Bug 123368 - Firebird Migration of Existing Database Error on Importing Table Name with space
Summary: Firebird Migration of Existing Database Error on Importing Table Name with space
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Firebird-Migration
  Show dependency treegraph
 
Reported: 2019-02-11 17:44 UTC by sdritchey
Modified: 2019-02-12 12:38 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
error message screenshot (26.67 KB, image/png)
2019-02-11 17:45 UTC, sdritchey
Details
hsqldb test file (303.88 KB, application/vnd.oasis.opendocument.database)
2019-02-11 19:13 UTC, sdritchey
Details
hsqldb test file, without space in table name (303.66 KB, application/vnd.oasis.opendocument.database)
2019-02-11 19:14 UTC, sdritchey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdritchey 2019-02-11 17:44:36 UTC
Description:
I am attempting to migrate an existing ODB database with a space in a table name to Firebird with the new migration assistant in LO 6.2.0.3.  After selecting "Yes" to convert the database to Firebird I get an error message that states: "SQL Status: map::at:  key not found"

If I remove the space from the table name in HSQLDB before conversion, the conversion completes without the error message.




Steps to Reproduce:
1.Open HSQLDB in Base and click Yes to convert to Firebird
2.Error message appears, conversion fails.
3.Open HSQLDB without conversion, remove space from table name, then attempt to convert to Firebird.
4.Conversion completes without error.

Actual Results:
conversion does not complete

Expected Results:
conversion should complete


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 sdritchey 2019-02-11 17:45:07 UTC
Created attachment 149165 [details]
error message screenshot
Comment 2 Julien Nabet 2019-02-11 18:55:56 UTC
On pc Debian x86-64 with master sources updated yesterday, I don't reproduce this.
Could you attach an example file?
Comment 3 sdritchey 2019-02-11 19:13:54 UTC
Created attachment 149166 [details]
hsqldb test file
Comment 4 sdritchey 2019-02-11 19:14:35 UTC
Created attachment 149167 [details]
hsqldb test file, without space in table name
Comment 5 sdritchey 2019-02-11 19:16:31 UTC
I've attached two test databases, one with a space in the table name and one without.  The one without the space converts as expected.  The one with the space shows the error message in the screenshot above.
Comment 6 Julien Nabet 2019-02-11 20:04:08 UTC
Thank you for your feedback, I could reproduce this.

Tamas: debugging a bit on gdb shows the pb is in utils::getTableNameFromStmt
See https://opengrok.libreoffice.org/xref/core/dbaccess/source/filter/hsqldb/utils.cxx?r=6a736800#92

This method is called from CREATE TABLE and ALTER TABLE statements.

We can't do like in https://cgit.freedesktop.org/libreoffice/core/commit/?id=2a08db9a0473e2f87715aacfc7b481beaa490dcf since we got:
ALTER TABLE \"Plant Database\" ALTER COLUMN \"ID\" RESTART WITH 1497

With no space in table, perhaps we would have had this:
ALTER TABLE Plant_Database ALTER COLUMN \"ID\" RESTART WITH 1497
So can't test the presence of ".

In brief, it shows we need to use a real sql parser here because for the moment we're using only bandaid fixes. Of course, it's more easy to tell than to do I suppose, if not, it should have already be implemented.