summaryrefslogtreecommitdiff
path: root/dbaccess/source/filter/hsqldb
AgeCommit message (Collapse)AuthorFilesLines
2018-05-28loplugin:passstuffbyrefNoel Grandin3-7/+7
Change-Id: I785e96599bbda029adf4698d11d7f981750dec07 Reviewed-on: https://gerrit.libreoffice.org/54802 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit ff3bdde2527123fc9e011ff0d93e958174632186) Reviewed-on: https://gerrit.libreoffice.org/54914 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-05-24tdf#117670: migration Firebird, deal with multiword columnJulien Nabet1-13/+33
by changing parsing process a bit Change-Id: I77c06ba218e9bc0d241dbff10f76860d0ca5ed44 Reviewed-on: https://gerrit.libreoffice.org/54542 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-05-24tdf117333 dbahsql: Chain SQLExceptionsTamas Bunth1-9/+13
Change-Id: Ic24d79f39d9cc36cf229c7410e1f96c4c3d316f9 Reviewed-on: https://gerrit.libreoffice.org/54671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-20tdf#117298: migration Firebird, fix time dataJulien Nabet1-1/+1
by just adjusting nColIndex like other datatypes Change-Id: Ia7947b3498818bac2f033eac81ac3835f98bbab3 Reviewed-on: https://gerrit.libreoffice.org/54581 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-05-16Fix typosAndrea Gelmini1-1/+1
Change-Id: I979323310cbb3473f7dc0f3d9ae1ea3f4c1642db Reviewed-on: https://gerrit.libreoffice.org/54420 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-05-16tdf#117333, tdf#117325 dbahsql: exception handlingTamas Bunth1-4/+50
Add proper exception handling for importing HSQL database. If there are errors during migration, the migration process should continue anyway. The first error should be shown to the user. All the others can be seen as a warning. Popping up several error messages would be just annoying for the user. Change-Id: Ia726ad777fd798f064a8fde1c0062c5b05fe59d0 Reviewed-on: https://gerrit.libreoffice.org/54396 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2018-05-16tdf#116987 dbahsql: check for table names..Tamas Bunth6-2/+37
..longer than 30 characters. In that case throw SQLException which indicates that the currently used Firebird version cannot handle table names longer than 30 characters. Change-Id: Ib2978feaeef22b70de9f2351042c25206a041105 Reviewed-on: https://gerrit.libreoffice.org/54398 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-14tdf#117092 dbahsql: handle multiple primary keysTamas Bunth5-9/+63
Set primary keys at the end of the sql statement instead of putting it right after the column definition. This way multiple primary keys can be defined. Change-Id: I7956a536b0516fd8a773d4aa64ccb930ae5c715d Reviewed-on: https://gerrit.libreoffice.org/54204 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-12tdf#117301 dbahsql: add FLOAT typeTamas Bunth2-0/+4
Change-Id: I2a7227c40d8df6347c014cf720369384b92e3970 Reviewed-on: https://gerrit.libreoffice.org/53898 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-07tdf#117299 dbahsql: add varchar_ignorecase typeTamas Bunth4-4/+12
Change-Id: I1dc904fe1b9146c978086861ef96f5141794bf09 Reviewed-on: https://gerrit.libreoffice.org/53901 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-02tdf#116980 tdf#116986 Fix data migration in..Tamas Bunth4-11/+17
.. databases with relations. There might be several nodes written in data file before the actual row, each representing an index. We have to skip these. Change-Id: I1556a8212b509c6cb63cb98fa0e9b7b8d3483004 Reviewed-on: https://gerrit.libreoffice.org/53507 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-02tdf#116980 Add constraints after data migrationTamas Bunth4-19/+44
So there won't be any violation problems while migrating data. If there is a constraint created in a "CREATE TABLE..." statement, then cut it off and move it to a separate "ALTER TABLE ... ADD CONSTRAINT" statement. Change-Id: I7245ba8b23a6239cd3b724815a6385b9e6c17a91 Reviewed-on: https://gerrit.libreoffice.org/53508 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-02tdf#117296 dbahsql: Fix migration of numericTamas Bunth1-7/+4
Change-Id: I9ca181c58cd73432c632147870d546d277893fdf Reviewed-on: https://gerrit.libreoffice.org/53587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-29tdf#117300 dbahsql: Add REAL typeTamas Bunth2-0/+3
Change-Id: I5a63633f8efa2307c75e8018a8fae13f154254ce Reviewed-on: https://gerrit.libreoffice.org/53585 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-17Fix typoAndrea Gelmini1-1/+1
Change-Id: I4e6ace300ffc19c5586d1d0371a06fca36b81080 Reviewed-on: https://gerrit.libreoffice.org/52954 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-17loplugin:constparamsNoel Grandin5-5/+5
Change-Id: I3d1b88dbd0ff73fddc08d52f50e0efb42daab89b Reviewed-on: https://gerrit.libreoffice.org/52756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-15tdf#116965 dbahsql: migrate relationgshipsTamas Bunth3-3/+15
from ALTER statements Change-Id: I399f2ea6f6181c609952d08beb85068cfb45b4df Reviewed-on: https://gerrit.libreoffice.org/52893 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-15tdf#116954 dbahsql: migrate views tooTamas Bunth1-0/+2
Change-Id: If6de6491b89cf2fb94586990f5c3e8483e74d464 Reviewed-on: https://gerrit.libreoffice.org/52892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-15tdf#116982 dbahsql: fix autoincrementationTamas Bunth8-23/+265
Fix autoincrementation issue by parsing and processing statements like "ALTER TABLE <name> ALTER COLUMN <col_name> RESTART WITH <num>" Change-Id: Ib175d64343d05d4b2cfc9a4cf944d0d0478adbcc Reviewed-on: https://gerrit.libreoffice.org/52879 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-08Fix typoAndrea Gelmini1-1/+1
Change-Id: I655328122905ff70b667187937f57d23145377b1 Reviewed-on: https://gerrit.libreoffice.org/52567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-04-07dbahsql: Add doxygen commentsTamas Bunth6-2/+99
Change-Id: Ie666d4d8660d29c36479c2e8a1289bd789d1433b Reviewed-on: https://gerrit.libreoffice.org/52549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-07dbahsql: add default for autoincremented columnsTamas Bunth2-2/+10
Change-Id: I8b4c99ed9e3701193228c58cc9e64dc87a03da71 Reviewed-on: https://gerrit.libreoffice.org/52550 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-07dbaccess: Enable hsql migration by defaultTamas Bunth9-50/+79
Also make Firebird driver not experimental anymore. With hsql migration enabled, the hsqldb related unit tests can be reused, because the underlying DBMS is transparent. To achieve that, I added firebird_sdbc component to hsqldb CppunitTest_* files. This commit also contains fixes for upcoming bugs while migrating from hsqldb to firebird, shown by hsqldb related unit tests: - null values: in case of null values, the setNull method should be used instead of nothing. (malformed string otherwise) Remove DBACCESS_HSQL_MIGRATION environment variable, since migration is default from now on. JunitTest_dbaccess_complex was based on HSQLDB. This commit replaces "if exists" hsql specific solution with firebird specific. Also disable test for queries with named parameters. Change-Id: Ieb68f5ad3a11389599c4f268ea4df82a83643b82 Reviewed-on: https://gerrit.libreoffice.org/52008 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-29dbahsql: Unit test for binary importTamas Bunth2-17/+48
Also fix bugs shown by the unit test Use boost date/time instead of std, because std::tm cannot handle dates before 1970. Change-Id: I7f5dbb3d828a591a4b51c7204dc3bd39fefc42ff Reviewed-on: https://gerrit.libreoffice.org/51804 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-28dbahsql: wrong variableTamas Bunth1-1/+1
Change-Id: Ib0027bc8a84c2cfd5622e83c420434b3bb130c7c Reviewed-on: https://gerrit.libreoffice.org/51974 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2018-03-22dbahsql: refactor move index parser to parseschemaTamas Bunth3-63/+73
Change-Id: I57820edc9ba8e9b8b11db78cf795fd5b1203db9b Reviewed-on: https://gerrit.libreoffice.org/51733 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-22dbahsql: add unit tests for schema importTamas Bunth2-2/+2
Change-Id: Ib666562f2d33824188ea3d643e6056f375a4339b Reviewed-on: https://gerrit.libreoffice.org/51537 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-12Fix typoAndrea Gelmini1-1/+1
Change-Id: If7667b9cda78b481de0048a459cef3de4642385a Reviewed-on: https://gerrit.libreoffice.org/51084 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-03-12dbahsql: use empty Any for "Other" columnTamas Bunth1-2/+1
Change-Id: Ie3e918956a25fba2831d3542e5f3d1b26c4fdc2a Reviewed-on: https://gerrit.libreoffice.org/51117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-12another fix for AndroidNoel Grandin1-1/+1
Change-Id: I21802c695e2ca4fbc7ff0dd08880dfa262ca9a33
2018-03-12blind fix for AndroidNoel Grandin1-1/+1
Change-Id: I014e23da43292b458ca046ebdc7fd6a472c6dffb
2018-03-11dbahsql: import DATE and DATETIME columnsTamas Bunth3-8/+53
Change-Id: Ibfd9340fad40efab891cba5b77ce3496424a3525 Reviewed-on: https://gerrit.libreoffice.org/51076 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-11dbahsql: import TIME columnsTamas Bunth2-3/+16
Change-Id: I8863127a4de1bfc06b13d008e037db2a4e60f1e7 Reviewed-on: https://gerrit.libreoffice.org/51059 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-10dbahsql: Add numeric/decimal importTamas Bunth2-3/+104
Change-Id: Icba170d586d35f890d5232463f89d547d526d885 Reviewed-on: https://gerrit.libreoffice.org/50937 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-10dbahsql: add booleanTamas Bunth1-2/+6
Change-Id: I1c18d40f6375d034e8de3c1bad6323b7cda052e6 Reviewed-on: https://gerrit.libreoffice.org/50975 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-10Modernize a bit more dbaccessJulien Nabet1-2/+2
mainly by using for-range loops but also by simplifying some simple algo Change-Id: If04cd78e62f80f9575e24f3d50ff1e427454da79 Reviewed-on: https://gerrit.libreoffice.org/51019 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-03-08loplugin:unusedmethodsNoel Grandin1-5/+0
Change-Id: Id6b4edd265cb6bef31c72e2a0a440211d51c7c33 Reviewed-on: https://gerrit.libreoffice.org/50900 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-07dbahsql: add BINARY and VARBINARY importTamas Bunth3-2/+41
Change-Id: Ibb4d5f8dda16dc7779b7a7b818a8bd2c49cbf283 Reviewed-on: https://gerrit.libreoffice.org/50844 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-03-05Removed duplicated includeAndrea Gelmini1-1/+0
Change-Id: I9baebc135d62fac29512ae5e8eb5e43d61ac227a Reviewed-on: https://gerrit.libreoffice.org/50773 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-05Fix typosAndrea Gelmini1-1/+1
Change-Id: I70e7db0926f8c5815637ae14c1193130d52c3224 Reviewed-on: https://gerrit.libreoffice.org/50774 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-05HSQLDB Binary importTamas Bunth11-61/+665
C++ implementation of reading HSQL's binary file format. This file contains the actual rows for the tables, represented in an AVL tree. Import starts from HsqlImporter, which calls to SchemaParser for some metadata (the positions of the trees in "data" file). After that it goes through the tree and read up the rows using HsqlRowInputStream. Finally, it uses sdbc's XPreparedStatement to insert the rows to the actual database. Change-Id: If4b17572e5989c218d45880bc3fd5a8820bb4101 Reviewed-on: https://gerrit.libreoffice.org/50536 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2018-01-27Add HSQLDB schema importTamas Bunth10-0/+804
It can be enabled by initializing the DBACCESS_HSQL_MIGRATION variable. Create new library "dbahsql" which is responsible for migrating the embedded hsql database to any database covered by sdbc. The hsqldb schema is stored in a file named "script" in form of SQL statements. The SQL statements used by DBMS's differ mostly by the defined types. Because of that, only the create statements need to be parsed, alter statements will work (with a little luck) without actually modifying it. User / security settings which can occur in the script file (e.g. GRANT statements) are dropped. Statements starting with SET are also dropped (they are hsql specific stuff) Change-Id: I6a22942e8a9a76765f80e50f0ad68f4d72e1ff9d Reviewed-on: https://gerrit.libreoffice.org/48260 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>