Bug 121069 - Firebird: Migration: "unsuccessful metadata update" create FK statement fails when it involves a column name with special characters
Summary: Firebird: Migration: "unsuccessful metadata update" create FK statement fails...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha1+
Hardware: All Linux (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-10-30 20:46 UTC by Terrence Enger
Modified: 2019-02-16 01:04 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Terrence Enger 2018-10-30 20:46:44 UTC
This arises from poking into bug 120126, which is reported for Mac
OS/X.  Perhaps this is the same bug showing up differently and earlier
in Linux.

My observations are on debian-buster and daily Linux dbgutil bibisect
repository version 2018-10-30, commit 2e184378:

    Version: 6.2.0.0.alpha1+
    Build ID: 2e184378da6058af14acf208d6469fadf44d04ed
    CPU threads: 4; OS: Linux 4.18; UI render: default; VCL: gtk3; 
    Locale: en-CA (en_CA.utf8); Calc: threaded

STR

(0) Download Iglesias_before.odb, "ddbb before migrating"
    <https://bugs.documentfoundation.org/attachment.cgi?id=145480"
    attached to bug 120126 "Base error after migrating to Firebird".

(1) Open the downloaded file. Observe in status bar of the database
    window "HSQLDB Embedded".

(2) In Database pane, click <Tables>.  Program presents dialog
    "Confirm Migration".

(3) At prompt "Confirm Migration" click <Yes>.

    Expected:
        An embedded Firebird database with some tables showing in the
        lower right pane.

    Observed:
        Terminal messages
            warn:connectivity.firebird:22678:22678:connectivity/source/drivers/firebird/Statement.cxx:122: isc_dsql_execute failed
            warn:connectivity.firebird:22678:22678:connectivity/source/drivers/firebird/Util.cxx:55: firebird_sdbc error:
            *unsuccessful metadata update
            *ALTER TABLE Iglesias failed
            *Unknown columns in index SYS_FK_78
            caused by
            'ALTER TABLE "Iglesias" ADD CONSTRAINT SYS_FK_78 FOREIGN KEY("Denominaci\u00f3n") REFERENCES "Denominaciones"("ID")'

            warn:dbaccess:22678:22678:dbaccess/source/filter/hsqldb/hsqlimport.cxx:372: Error during migration
        and 
            message box with the database error messages.

(4) In dialog click <OK>.  The status bar shows "Firebird Embedded"
    and the Tables pane shows 5 tables.
Comment 1 Drew Jensen 2018-11-11 20:34:11 UTC
Confirmed with Ubuntu 18.04, LO 6.2Alpha1

There was an earlier issue, now closed I believe, which dealt only with column names during the create table statements.

The create fk statement is malformed when a column name includes special characters. In this case the column name "Denominación" ends up as "Denominaci\u00f3n" which of course fails.

Changing summary

CC to Tamas.
Comment 2 Drew Jensen 2018-11-11 20:38:37 UTC
Note - after the migration is finished, opening the Relationship window and adding that FK reference again works and the resulting relationships are back to what was there. It appears to be an issue only in the migration assistant code.
Comment 3 Commit Notification 2019-01-31 13:42:06 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#121069, tdf#121469 migrate special characters

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 4 Commit Notification 2019-02-05 09:37:36 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

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

tdf#121069, tdf#121469 migrate special characters

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.
Comment 5 Terrence Enger 2019-02-16 01:04:21 UTC
I see the bug fixed in bibisect-linux-64-6.3 repository from
2019-02-15, commit 465939fe.

Thank you, Tamas.  I am setting status VERIFIED FIXED.