Bug 290354

Summary: Query SQL generated in the Query designer should be of KEXISQL type
Product: [Applications] KEXI Reporter: Jarosław Staniek <staniek>
Component: QueriesAssignee: Jarosław Staniek <staniek>
Status: CLOSED FIXED    
Severity: major    
Priority: NOR    
Version: 2.4 beta5 (Calligra 2.4 beta5)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.4 beta6 (Calligra 2.4 beta6)
Sentry Crash Report:

Description Jarosław Staniek 2012-01-01 23:22:31 UTC
Query SQL generated in the Query designer should be of KEXISQL type, i.e. independent of any driver.

Actually the current driver is used to perform data/identifier escaping, and internal collation (COLLATE '') is added. This makes incompatible SQL in the SQL view.

KexiSQL escaping without any KexiDB driver should be used for the statement generation. Only such statement should be stored.

So far unnoticed bug probably except text escaping for some drivers other than SQLite, _unless_ "COLLATE ''" specifier has been internally added for SQLite3 driver to get unicode collations.
Comment 1 Jarosław Staniek 2012-01-02 22:53:37 UTC
Git commit 1072a0f5d4d2d0bccc38ed801ec0a5914f0b1e1e by Jaroslaw Staniek.
Committed on 02/01/2012 at 23:50.
Pushed by staniek into branch 'master'.

Query SQL generated in the Query Designer should be of KEXISQL type

(KexiDB)

M  +23   -14   kexi/kexidb/connection.cpp
M  +19   -3    kexi/kexidb/connection.h
M  +73   -18   kexi/kexidb/driver.cpp
M  +56   -14   kexi/kexidb/driver.h
M  +7    -4    kexi/kexidb/fieldlist.cpp
M  +4    -3    kexi/kexidb/fieldlist.h
M  +17   -24   kexi/kexidb/queryschema.cpp
M  +5    -5    kexi/kexidb/queryschema.h
M  +8    -6    kexi/kexidb/queryschemaparameter.cpp
M  +2    -2    kexi/kexidb/queryschemaparameter.h
M  +2    -2    kexi/plugins/queries/kexiquerydesignerguieditor.cpp
M  +2    -2    kexi/plugins/queries/kexiquerydesignersql.cpp

http://commits.kde.org/calligra/1072a0f5d4d2d0bccc38ed801ec0a5914f0b1e1e
Comment 2 Jarosław Staniek 2012-06-25 22:35:20 UTC
Git commit acc09928c44a1c4c6cab0f95d7bbb01a7b4f9aa8 by Jaroslaw Staniek.
Committed on 20/06/2012 at 19:24.
Pushed by staniek into branch 'master'.

Query SQL generated in the Query Designer should be of PREDICATESQL type

*(2012-01-02 calligra master commit 1072a0f5d)

M  +2    -2    Drivers/mysql/MysqlDriver.cpp
M  +1    -1    Drivers/mysql/MysqlDriver.h
M  +2    -2    Drivers/postgresql/PostgresqlDriver.cpp
M  +1    -1    Drivers/postgresql/PostgresqlDriver.h
M  +2    -2    Drivers/sqlite/SqliteDriver.cpp
M  +1    -1    Drivers/sqlite/SqliteDriver.h
M  +100  -75   Predicate/Connection.cpp
M  +43   -7    Predicate/Connection.h
M  +41   -13   Predicate/Driver.cpp
M  +57   -20   Predicate/Driver.h
M  +3    -3    Predicate/DriverManager_p.h
M  +5    -5    Predicate/FieldList.cpp
M  +6    -0    Predicate/Global.h.cmake
M  +2    -2    Predicate/LookupFieldSchema.cpp
M  +12   -11   Predicate/QuerySchema.cpp
M  +3    -3    Predicate/QuerySchemaParameter.cpp
M  +1    -1    Predicate/QuerySchemaParameter.h
M  +33   -0    Predicate/Utils.cpp
M  +2    -0    Predicate/Utils.h
M  +49   -48   Predicate/parser/SqlScanner.cpp
M  +1    -1    Predicate/tests/CMakeLists.txt

http://commits.kde.org/predicate/acc09928c44a1c4c6cab0f95d7bbb01a7b4f9aa8