Wisser / Jailer

Database Subsetting and Relational Data Browsing Tool.

Home Page:https://wisser.github.io/Jailer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] firebird database - No suitable Inline-View Style known

jcaillon opened this issue · comments

Hello,

Thank you again for your wonderful work.

Description of the Issue

I have an issue using firebird databases.

I can create the data model and extraction model just fine. But when I try to export data i get the following error:

 ERROR  - No suitable Inline-View Style known for jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE

Steps to Reproduce the Issue

I'm using a firebird database (https://hub.docker.com/r/jacobalberty/firebird/) and the example schema given in jailer (employee).

Debug Information

I'm using the latest release.

Full log below with my command line:

[00:00.033] Executing program:
"C:\Program Files\Java\jdk-11.0.6\bin\java.exe" net.sf.jailer.Jailer export C:\data\repo\_innersource\cnaf\yadaman\src\bin\example\db\extractionmodels\employe.jm org.firebirdsql.jdbc.FBDriver jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE myuser myuser -datamodel C:\data\repo\_innersource\cnaf\yadaman\src\bin\example\db\datamodel -e C:\Users\jcaillon\Desktop\2try.sql -threads 1 -entities 50 -format SQL -scope LOCAL_DATABASE -working-table-schema try -upsert-only -check-primary-keys -target-dbms FIREBIRD
[00:02.026] 2020-08-05 17:23:56,455 [main] ERROR  - No suitable Inline-View Style known for jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE
[00:02.028] Error: java.lang.RuntimeException: No suitable Inline-View Style known for jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE
[00:02.030]    MySQL: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 45; Union [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C Union all Select 4, '5', 6) Entity""
[00:02.031]    MySQL: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 45; Union [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C Union all Select 4, '5', 6) Entity""
[00:02.033]    Oracle: ""Dynamic SQL Error; SQL error code = -204; Table unknown; DUAL; At line 1, column 50 [SQLState:42S02, ISC error code:335544580]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from dual Union all Select 4, '5', 6 from dual) Entity""
[00:02.035]    Oracle: ""Dynamic SQL Error; SQL error code = -204; Table unknown; DUAL; At line 1, column 50 [SQLState:42S02, ISC error code:335544580]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from dual Union all Select 4, '5', 6 from dual) Entity""
[00:02.036]    DB2: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 22; values [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (values (1, '2', 3), (4, '5', 6)) Entity(A, B, C)""
[00:02.046]    DB2: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 22; values [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (values (1, '2', 3), (4, '5', 6)) Entity(A, B, C)""
[00:02.051]    INFORMIX1: ""Dynamic SQL Error; SQL error code = -204; Procedure unknown; SYSMASTER.SYSDUAL; At line 1, column 50 [SQLState:42000, ISC error code:335544581]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from sysmaster.sysdual Union all Select 4, '5', 6 from sysmaster.sysdual) Entity""
[00:02.057]    INFORMIX1: ""Dynamic SQL Error; SQL error code = -204; Procedure unknown; SYSMASTER.SYSDUAL; At line 1, column 50 [SQLState:42000, ISC error code:335544581]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from sysmaster.sysdual Union all Select 4, '5', 6 from sysmaster.sysdual) Entity""
[00:02.066]    INFORMIX2: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 50; table [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from table(set{1}) Union all Select 4, '5', 6 from table(set{1})) Entity""
[00:02.073]    INFORMIX2: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 50; table [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from table(set{1}) Union all Select 4, '5', 6 from table(set{1})) Entity""
[00:02.079]    DB2_ZOS: ""Dynamic SQL Error; SQL error code = -204; Procedure unknown; SYSIBM.SYSDUMMY1; At line 1, column 44 [SQLState:42000, ISC error code:335544581]" in statement "Select A, B, C from (Select 1, '2', 3 from sysibm.sysdummy1 Union all Select 4, '5', 6 from sysibm.sysdummy1) Entity(A, B, C)""
[00:02.084]    DB2_ZOS: ""Dynamic SQL Error; SQL error code = -204; Procedure unknown; SYSIBM.SYSDUMMY1; At line 1, column 44 [SQLState:42000, ISC error code:335544581]" in statement "Select A, B, C from (Select 1, '2', 3 from sysibm.sysdummy1 Union all Select 4, '5', 6 from sysibm.sysdummy1) Entity(A, B, C)""
[00:02.090]    INFORMIX3: ""Dynamic SQL Error; SQL error code = -104; Unexpected end of command - line 1, column 128 [SQLState:42000, ISC error code:335544851]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from systables WHERE tabid=1 Union all Select 4, '5', 6 from systables WHERE tabid=1""
[00:02.095]    INFORMIX3: ""Dynamic SQL Error; SQL error code = -104; Unexpected end of command - line 1, column 128 [SQLState:42000, ISC error code:335544851]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from systables WHERE tabid=1 Union all Select 4, '5', 6 from systables WHERE tabid=1""
[00:02.099]    INFORMIX4: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 59; : [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from sysmaster:"informix".sysdual Union all Select 4, '5', 6 from sysmaster:"informix".sysdual) Entity""
[00:02.104]    INFORMIX4: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 59; : [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from sysmaster:"informix".sysdual Union all Select 4, '5', 6 from sysmaster:"informix".sysdual) Entity""
[00:02.108] java.lang.RuntimeException: No suitable Inline-View Style known for jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE
[00:02.112] Arguments:  0: {export},  1: {C:\data\repo\_innersource\cnaf\yadaman\src\bin\example\db\extractionmodels\employe.jm},  2: {org.firebirdsql.jdbc.FBDriver},  3: {jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE},  4: {?},  5: {?},  6: {-datamodel},  7: {C:\data\repo\_innersource\cnaf\yadaman\src\bin\example\db\datamodel},  8: {-e},  9: {C:\Users\jcaillon\Desktop\2try.sql},  10: {-threads},  11: {1},  12: {-entities},  13: {50},  14: {-format},  15: {SQL},  16: {-scope},  17: {LOCAL_DATABASE},  18: {-working-table-schema},  19: {try},  20: {-upsert-only},  21: {-check-primary-keys},  22: {-target-dbms},  23: {FIREBIRD}
[00:02.116]    MySQL: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 45; Union [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C Union all Select 4, '5', 6) Entity""
[00:02.122]    Oracle: ""Dynamic SQL Error; SQL error code = -204; Table unknown; DUAL; At line 1, column 50 [SQLState:42S02, ISC error code:335544580]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from dual Union all Select 4, '5', 6 from dual) Entity""
[00:02.126]    DB2: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 22; values [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (values (1, '2', 3), (4, '5', 6)) Entity(A, B, C)""
[00:02.130]    INFORMIX1: ""Dynamic SQL Error; SQL error code = -204; Procedure unknown; SYSMASTER.SYSDUAL; At line 1, column 50 [SQLState:42000, ISC error code:335544581]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from sysmaster.sysdual Union all Select 4, '5', 6 from sysmaster.sysdual) Entity""
[00:02.137]    INFORMIX2: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 50; table [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from table(set{1}) Union all Select 4, '5', 6 from table(set{1})) Entity""
[00:02.141]    DB2_ZOS: ""Dynamic SQL Error; SQL error code = -204; Procedure unknown; SYSIBM.SYSDUMMY1; At line 1, column 44 [SQLState:42000, ISC error code:335544581]" in statement "Select A, B, C from (Select 1, '2', 3 from sysibm.sysdummy1 Union all Select 4, '5', 6 from sysibm.sysdummy1) Entity(A, B, C)""
[00:02.145]    INFORMIX3: ""Dynamic SQL Error; SQL error code = -104; Unexpected end of command - line 1, column 128 [SQLState:42000, ISC error code:335544851]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from systables WHERE tabid=1 Union all Select 4, '5', 6 from systables WHERE tabid=1""
[00:02.150]    INFORMIX4: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 59; : [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from sysmaster:"informix".sysdual Union all Select 4, '5', 6 from sysmaster:"informix".sysdual) Entity""
[00:02.155]     at net.sf.jailer.database.InlineViewStyle.forSession(InlineViewStyle.java:331)
[00:02.159]     at net.sf.jailer.entitygraph.local.LocalEntityGraph.<init>(LocalEntityGraph.java:258)
[00:02.163]     at net.sf.jailer.entitygraph.local.LocalEntityGraph.create(LocalEntityGraph.java:326)
[00:02.167]     at net.sf.jailer.subsetting.SubsettingEngine.export(SubsettingEngine.java:1403)
[00:02.172]     at net.sf.jailer.Jailer.jailerMain(Jailer.java:217)
[00:02.176]     at net.sf.jailer.Jailer.main(Jailer.java:120)

I have defined an InlineViewStyle for Firebird. Based on release 9.5 you can find a patch attached. Please replace the file "jailer.jar" with the one in the attachment and test it in advance. Thanks a lot.
(I had to put the file into a zip archive because github does not allow jar files as attachments)

As Firebird is only used by few users of this tool, it's quite possible that there are other problems here and there. So if you notice any other problems, please let me know.

jailer.zip

Hello @Wisser thanks for the fast answer!

I replaced the file but still have the same error:

"C:\Program Files\Java\jdk-11.0.6\bin\java.exe" net.sf.jailer.Jailer export C:\data\repo\_innersource\cnaf\yadaman\src\bin\example\db\extractionmodels\employe.jm org.firebirdsql.jdbc.FBDriver jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE sysdba sysdba -datamodel C:\data\repo\_innersource\cnaf\yadaman\src\bin\example\db\datamodel -e C:\Users\jcaillon\Desktop\2try.sql -threads 1 -entities 50 -format SQL -scope LOCAL_DATABASE -working-table-schema try -check-primary-keys -target-dbms FIREBIRD
[00:01.893] 2020-08-06 11:12:40,885 [main] ERROR  - No suitable Inline-View Style known for jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE
[00:01.895] Error: java.lang.RuntimeException: No suitable Inline-View Style known for jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE

I tried with the version 9.5.1 initially but even when downgrading to 9.5 I have the same message.

Hi @jcaillon
That's odd. It works for me with the current Firebird DBMS.
Does Jailer have version 9.5.1.3 after the patch? You can see that in the GUI or in the sql.log/jailer.log.
In the sql.log you should find a statement of the type

Select A, B, C from (Select 1 A, '2' B, 3 C from RDB$DATABASE Union all Select 4, '5', 6 from RDB$DATABASE) Entity

Is that there and did it work? What happens if you execute this statement or

Select * from RDB$DATABASE

directly in Firebird?

This is indeed the right version:

image

Here are the log files:

sql.log
export.log

I don't see the statement you are mentioning in the log file.

The statement Select * from RDB$DATABASE works, it produces :

RDB$DESCRIPTION RDB$RELATION_ID RDB$SECURITY_CLASS  RDB$CHARACTER_SET_NAME  RDB$LINGER
                136             SQL$363             UTF8        

I think it is just never executed.

I'm using firebird 3.0.6 and the driver jaybird 4.0.0 if this helps.

Thanks for the log files.
In the first line of the files the version 9.5.1 is shown.

2020-08-06 13:04:02,711 [main] INFO - Jailer 9.5.1

Do you execute the export via CLI? Obviously you still have access to the jailer.jar from 9.5.1 somewhere.

Oh ok! :s

I do execute it with the CLI, however i am positive that I use the same jailer.jar in the CLI and in the UI but in the UI it shows 9.5.1.3.

Still using jailer-engine-9.5.1.jar though, maybe that's why I shows the wrong version in the CLI?

I tried using the UI instead, I got the same error:

image

The version is correctly shown.

export "tmp\em-14-01-51-030.jm" org.firebirdsql.jdbc.FBDriver 
"jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE" myuser - "<password>" -e 
"C:\Users\jcaillon\Desktop\2try.sql" -isolation-level 1 -threads 4 -entities 50 
-format SQL -schemamapping = -source-schemamapping = -scope LOCAL_DATABASE 
-datamodel "C:\data\repo\_innersource\cnaf\yadaman\src\bin\example\db\datamodel"

Help Desk: https://sourceforge.net/p/jailer/discussion/
Mail: rwisser@users.sourceforge.net

Jailer 9.5.1.3

java.lang.RuntimeException: No suitable Inline-View Style known for jdbc:firebirdsql://localhost:3050/mydb?encoding=NONE

   MySQL: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 45; Union [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C Union all Select 4, '5', 6) Entity""

   Oracle: ""Dynamic SQL Error; SQL error code = -204; Table unknown; DUAL; At line 1, column 50 [SQLState:42S02, ISC error code:335544580]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from dual Union all Select 4, '5', 6 from dual) Entity""

   DB2: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 22; values [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (values (1, '2', 3), (4, '5', 6)) Entity(A, B, C)""

   INFORMIX1: ""Dynamic SQL Error; SQL error code = -204; Procedure unknown; SYSMASTER.SYSDUAL; At line 1, column 50 [SQLState:42000, ISC error code:335544581]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from sysmaster.sysdual Union all Select 4, '5', 6 from sysmaster.sysdual) Entity""

   INFORMIX2: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 50; table [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from table(set{1}) Union all Select 4, '5', 6 from table(set{1})) Entity""

   DB2_ZOS: ""Dynamic SQL Error; SQL error code = -204; Procedure unknown; SYSIBM.SYSDUMMY1; At line 1, column 44 [SQLState:42000, ISC error code:335544581]" in statement "Select A, B, C from (Select 1, '2', 3 from sysibm.sysdummy1 Union all Select 4, '5', 6 from sysibm.sysdummy1) Entity(A, B, C)""

   INFORMIX3: ""Dynamic SQL Error; SQL error code = -104; Unexpected end of command - line 1, column 128 [SQLState:42000, ISC error code:335544851]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from systables WHERE tabid=1 Union all Select 4, '5', 6 from systables WHERE tabid=1""

   INFORMIX4: ""Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 59; : [SQLState:42000, ISC error code:335544634]" in statement "Select A, B, C from (Select 1 A, '2' B, 3 C from sysmaster:"informix".sysdual Union all Select 4, '5', 6 from sysmaster:"informix".sysdual) Entity""


	at net.sf.jailer.database.InlineViewStyle.forSession(InlineViewStyle.java:331)
	at net.sf.jailer.entitygraph.local.LocalEntityGraph.<init>(LocalEntityGraph.java:258)
	at net.sf.jailer.entitygraph.local.LocalEntityGraph.create(LocalEntityGraph.java:326)
	at net.sf.jailer.subsetting.SubsettingEngine.export(SubsettingEngine.java:1403)
	at net.sf.jailer.Jailer.jailerMain(Jailer.java:217)
	at net.sf.jailer.ui.UIUtil$6.run(UIUtil.java:589)
	at java.base/java.lang.Thread.run(Thread.java:834)

There must be something wrong with the patch or how it was installed.
I rebuilt the current version and put it here. This is version 9.5.1.4

jailer.zip

If this does not work either, you can download a regular installation file here:
https://sourceforge.net/projects/jailer/files/v9.5.1.4/

(I will delete this directory when I release the 9.5.2. Probably early next week)

Good news: it is working now! 🎉

I used the jailer.zip patch :)

Thank you for the help, have a nice day 😁

Fixed in release 9.5.2.