[Libreoffice-bugs] [Bug 121553] Editing: Firebird: Table editor erroneously prompts to change CLOB field to a BLOB field during alter table
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Fri Oct 30 12:18:38 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=121553
--- Comment #8 from Julien Nabet <serval2412 at yahoo.fr> ---
(In reply to Lionel Elie Mamane from comment #7)
> Try:
>
> // Clob (SQL_BLOB SUBTYPE TEXT)
> - aRow[1] = new ORowSetValueDecorator(OUString("BLOB")); // BLOB, with
> subtype 1
> + aRow[1] = new ORowSetValueDecorator(OUString("BLOB SUBTYPE TEXT"));
> // BLOB, with subtype 1
> aRow[2] = new ORowSetValueDecorator(DataType::CLOB);
> aRow[3] = new ORowSetValueDecorator(sal_Int32(2147483647)); //
> Precision = max length
> aRow[6] = new ORowSetValueDecorator(); // Create Params
> aRow[9] = new ORowSetValueDecorator(
> sal_Int16(ColumnSearch::FULL)); // Searchable
> aRow[12] = new ORowSetValueDecorator(false); // Autoincrement
> aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale
> aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale
> tmp.push_back(aRow);
>
> // Longvarbinary (SQL_BLOB SUBTYPE BINARY)
> // Distinguished from simple blob with a user-defined subtype.
> + aRow[1] = aRow[2] = new
> ORowSetValueDecorator(DataType::LONGVARBINARY);
> aRow[2] = new ORowSetValueDecorator(DataType::LONGVARBINARY);
> tmp.push_back(aRow);
>
> and
>
> In firebird::ColumnTypeInfo::getColumnTypeName()
> Replace:
> case DataType::CLOB:
> return "CLOB";
> by
> case DataType::CLOB:
> return "BLOB SUBTYPE TEXT";
> and replace
> case DataType::BLOB:
> return "BLOB";
> by
> case DataType::CLOB:
> return "BLOB SUBTYPE BINARY";
Remark I suppose the last one is:
> and replace
> case DataType::BLOB:
> return "BLOB";
> by
> case DataType::BLOB:
> return "BLOB SUBTYPE BINARY";
Anyway, it'll work for this case but it'll regress for "tdf#137801"
since I got:
sTypeName=SMALLINT pField->GetTypeName()=BLOB SUBTYPE BINARY
In connectivity/source/drivers/firebird/Util.cxx, I used:
case DataType::BLOB:
- return "BLOB";
+ return "BLOB SUBTYPE BINARY";
*Dynamic SQL Error
*SQL error code = -104
*Token unknown - line 1, column 36
*SUBTYPE
caused by
'isc_dsql_prepare'
It seems we can modify table containing a CLOB (and I suppose a BLOB) but we
can't create a brand new table when adding a BLOB or CLOB because of the
"SUBTYPE ..."
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20201030/5ce4df78/attachment-0001.htm>
More information about the Libreoffice-bugs
mailing list