Bug 119502 - Firebird: Migration: Incorrect calculation of the length of the table name (Russian)
Summary: Firebird: Migration: Incorrect calculation of the length of the table name (R...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0 target:6.2.1
Keywords:
Depends on:
Blocks: Database-Firebird-Migration
  Show dependency treegraph
 
Reported: 2018-08-26 03:25 UTC by avsharapov
Modified: 2019-02-05 19:25 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The table name contains 5 characters (3.29 KB, application/vnd.sun.xml.base)
2018-08-26 03:25 UTC, avsharapov
Details
The table name contains 19 characters (3.32 KB, application/vnd.sun.xml.base)
2018-08-26 03:26 UTC, avsharapov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description avsharapov 2018-08-26 03:25:30 UTC
Created attachment 144442 [details]
The table name contains 5 characters

The table name contains 5 characters, and the column name is also 5. Migration does not occur.

SET DATABASE COLLATION "Russian"
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE CACHED TABLE "\u0420\u0443\u0441\u0441\u043a"("\u0420\u0443\u0441\u0441\u043a" VARCHAR(100))
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 0 MILLIS
Comment 1 avsharapov 2018-08-26 03:26:57 UTC
Created attachment 144443 [details]
The table name contains 19 characters
Comment 2 Drew Jensen 2018-08-26 21:53:20 UTC
Confirmed with Ubuntu 18.04
LibreOffice 6.0.3 and 6.1.1

Unable to check 6.2Alpha as these two ODB files are added to the list of files which fail to run the migration assistant when responding yes to the prompt.

Adding Tamas to the CC
Comment 3 Drew Jensen 2018-08-26 21:57:42 UTC
sorry of course I meant 6.1.0.3 (not 6.0.3) in the last comment.
Comment 5 Commit Notification 2019-02-05 10:25:33 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/aa974a1b3798e04424623ad331e9f5a0ae01a34b%5E%21

tdf#119502: dbahsql: tables without primary key

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Xisco Faulí 2019-02-05 16:05:18 UTC
I do confirm the issue is fixed in if I open the first file attached. 

Version: 6.3.0.0.alpha0+
Build ID: f8c4459bbda62cb905d0c007cac044f3410ab76b
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

However, the second one still fails to be migrated.
@Tamas Bunth, should I create a follow-up bug ?
Comment 7 Drew Jensen 2019-02-05 18:25:01 UTC
For what it's worth.

If you create an sql script file form each of the test files and attempt to apply the table create statement in a Firebird emb ODB via the SQL Window:

The 5 character (multi-byte) string

CREATE TABLE "\u0420\u0443\u0441\u0441\u043a"("\u0420\u0443\u0441\u0441\u043a" VARCHAR(100))

is accepted.

The 19 character (multi-byte) string

CREATE TABLE "\u0420\u0443\u0441\u0441\u043a\u043e\u0435\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435"("\u0420\u0443\u0441\u0441\u043a" VARCHAR(100))

is rejected with exactly the same error as during the migration assistant:

2: firebird_sdbc error:
*Dynamic SQL Error
*SQL error code = -104
*Name longer than database column size
caused by
'isc_dsql_prepare'


So I would think this is best as a new issue against the SDBC driver and not just the Migration Assistant.
Comment 8 Drew Jensen 2019-02-05 18:28:27 UTC
(In reply to Drew Jensen from comment #7)
> 
> So I would think this is best as a new issue against the SDBC driver and not
> just the Migration Assistant.

OH - this is embarrassing: forget the last comment. It didn't do what I thought it did at all and was meaningless noise.
Comment 9 Commit Notification 2019-02-05 19:25:40 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/8d070171116eb9c57aae10d3dfbd913a097d2451%5E%21

tdf#119502: dbahsql: tables without primary key

It will be available in 6.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.