100 Commits
Author SHA1 Message Date
Tamas Bunth f9fc420dce tdf#101181 Implement glow effect on shapes
Glow effect is a color-blurred outline outside of the shape. In ooxml
document it is specified with the <a:glow> element.

The commit contains the following:
- Add support for importing and exporting <a:glow> from ooxml documents.
- Assign new properties to XShape which stores glow-related attributes.
- A new 2D primitive is introduced in module 'drawinglayer' which is
  responsible for representing the glow primitive which is to be rendered.
  + A glow primitive is a clone of the original shape which has been
    scaled up slightly and a new color has been assigned to it. The
    radius of the glow effect and the color is defined in the <a:glow>
    element being imported.
- A blur algorithm is introduced in module 'vcl', which is called during
  rendering the primitive.
  + The blur algorithm works on a bitmap.
  + Since the algorithm is CPU-intensive, the result is cached in the
    processor and it is recalculated only if needed.
- Add support for importing and exporting glow effect to ODF format. For
  that, new attributes of element <style:graphic-properties> has been
  added:
  + loext:glow, which can have the values "visible" or "hidden"
  + loext:glow-radius: which holds the radius of the glow effect in cm.
  + loext:glow-color: holds the color of the glow effect
- Tests have been added to assert properties after pptx import and
export.

Change-Id: I836aeb5e0f24e2c8d5725834c8c0f98083bc82e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89125
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-03-03 15:52:47 +01:00
Tamas Bunth edfe1dbc67 Fix typo
Change-Id: I4308e9957368845059d837a3ace79b5c78b7db51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89124
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-02-22 11:33:53 +01:00
Tamas Bunth 0f2d4ce014 tdf#125444 Add pptx import test for percentage
Add test for imporing custom label field of type "PERCENTAGE" from a
pptx document.

Change-Id: Ide6baa95d07836cafb97efc9c00ec2ab224a1d1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86109
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-01-02 15:45:03 +01:00
Tamas Bunth 2c7ef73e99 tdf#123206 Add test: import custom-label-field
Add test for deprecated custom-label-field attribute of the data-point
element.

Change-Id: I9a7619898fa72900323e5b41728d2146c14203e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86103
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-01-02 14:38:12 +01:00
Tamas Bunth fa0df1035b tdf#125444 Percentage as custom chart label
Support importing ooxml charts with a field of type "PERCENTAGE" as
custom label.

Change-Id: Ie8931f77e3b6199d98635422d11d776e675f6e5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86067
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-01-01 17:36:04 +01:00
Tamas Bunth 7d2c7e7af0 tdf#123206 Store custom label as chart:data-label
Use the chart:data-label element instead of using the
loext:custom-label-field attribute.

chart:data-label stores can be a child of chart:data-point and it may
contain a text:o element for holding one or more paragraphs of custom
label text.

This commit aims to export and import chart:data-label with paragraphs
put into different text:span elements. These span elements may hold a
text:style-name attribute in order to achieve formatted text.

This structure is already in the ODF format.

Change-Id: I0bea7ce1a16af9c47b33555e18545bdaae7e95ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85659
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-01-01 17:35:50 +01:00
Tamas Bunth c2b36cd6f7 tdf#123206 Import/Export chart custom label text
OOX import supports custom label texts in chart diagrams (produced by
e.g. double clicking on a data label, and write custom text), but -
since embedded objects are exported and imported to odf right after migration -
it is not displayed in case of a Writer document.

In order to make it work, we have to support custom label text in the
odf structure. This commit only allows the import/export of pure text,
it should be improved to store and load formatted string.

A new XML token is added, which currently refers to an attribute of the
chart:data-point tag. If we want to store formatted string, something
more clever has to be done.

Change-Id: I80c4a3a0dbcf59f1dc732d795fb716da318411cb
Reviewed-on: https://gerrit.libreoffice.org/80156
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-11-29 16:44:12 +01:00
Tamas Bunth 89f0af144c tdf#113198 set default shape paragraph alignment..
to center when importing oox document.

Using MS Office, the default aligment of a (text) paragraph
inside a shape is centered.

Change-Id: Id9bcaaab109df65f4124f733b2cfee438e82b79b
Reviewed-on: https://gerrit.libreoffice.org/83193
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-11-28 01:47:13 +01:00
Tamas Bunth 742f59eaa3 tdf128684: Rotate text in not preset custom shape
The TextPreRotateAngle property should be set in case of a not preset
custom shape as well during ooxml import.

Also add unit test for testing the TextPreRotateAngle property.

Change-Id: Ib5b822286f8a78fe8398bf7e2014a36d7e0a24d5
Reviewed-on: https://gerrit.libreoffice.org/82643
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-11-16 13:41:20 +01:00
Tamas Bunth f9fb1e1abc Build mysql_jdbc library even when building without java
Change-Id: Iecf49ab466a77f8342e69bf245a30e1529fe0078
Reviewed-on: https://gerrit.libreoffice.org/79056
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/81917
Tested-by: Jenkins
2019-11-04 09:25:55 +01:00
Tamas Bunth 8349e919a8 mysqlc: replace initializer list with assignment
Because visual c++ compiler may not support it without creating a
constructor for the struct.

Change-Id: I6c8868c4e34cbe7b67e413b1db18aed01378c959
Reviewed-on: https://gerrit.libreoffice.org/65905
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/76727
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/81901
Tested-by: Jenkins
2019-11-03 23:08:50 +01:00
Tamas Bunth fddfbeff8a tdf#126324 pptx unit test for custom date import
Add unit test for importing custom date field (<c:fld> element of type
"datetime")

Change-Id: Ifcb5641c99eeb79afe54b801750e68792880c000
Reviewed-on: https://gerrit.libreoffice.org/81682
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-10-30 09:19:47 +01:00
Tamas Bunth df9672b1fa tdf#126324 Import custom date as custom XTextField
Change-Id: I89f96490a47210e7daa3b21b2399e0dfe0cf3abf
Reviewed-on: https://gerrit.libreoffice.org/81513
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-10-25 20:22:35 +02:00
Tamas Bunth 47a62ede24 tdf#126852 Bind TEXT mysql type to Clob
Change-Id: I5a71666f1fafa9507032deffafebf885813a0369
Reviewed-on: https://gerrit.libreoffice.org/78815
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-09-17 13:24:34 +02:00
Tamas Bunth cc876706b1 mysqlc: Support connection to utf8mb4 server
This charset is backward compatible with 'normal' utf-8.

Change-Id: I4407894bf9029b9c56eb0d2530796e85bd226591
Reviewed-on: https://gerrit.libreoffice.org/78650
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-09-06 16:05:01 +02:00
Tamas Bunth 91a97c5e0b tdf#127093 mysqlc: set NO_AUTO_VALUE_ON_ZERO
Without setting this sql_mode, NULL or 0 inserted to an auto-incremented column
of a prepared statement would cause that to be auto generated.

Setting NO_AUTO_VALUE_ON_ZERO allows us to copy/paste auto-incremented
columns which may contain zero values as well.

Change-Id: I9602746371c75c82c99ff63240025e8cfb03776a
Reviewed-on: https://gerrit.libreoffice.org/78560
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-09-03 19:59:17 +02:00
Tamas Bunth d783017c1c Revert "tdf#127093, tdf#127092 Fix pasting autoincremented"
This reverts commit fa177231cd.

Change-Id: Ia0c2d83c840c0ff8981b721766a6a1df810f971d
Reviewed-on: https://gerrit.libreoffice.org/78559
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-09-03 19:59:07 +02:00
Tamas Bunth 376cc3ea0f dbaccess: delete old paste autoincrement logic
Change-Id: I6a4392c9e93842838022370fe6c54908adcc627b
Reviewed-on: https://gerrit.libreoffice.org/78358
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-08-31 19:43:36 +02:00
Tamas Bunth fa177231cd tdf#127093, tdf#127092 Fix pasting autoincremented
Fix copy/paste functionality when trying to paste a table with auto
incremental column in it. In that case we should let the DBMS handle the
values in that column.

Change-Id: Ia40a0056402ec540f469b94694629dd6db7d4e71
Reviewed-on: https://gerrit.libreoffice.org/78298
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-08-31 19:43:25 +02:00
Tamas Bunth c635364120 Query MySQL schema name when pasting table
In case of a MySQL direct connection the current schema in use cannot be
queried with the getUserName() method of the DatabaseMetadata interface,
because the user name and the schema name can (and usually do) differ.

Instead, we can always query for the current schema with the DATABASE()
SQL function.

Change-Id: Ibb026519e1a63e29c5a7c9b04ab64901faec0f85
Reviewed-on: https://gerrit.libreoffice.org/78297
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-08-31 17:50:02 +02:00
Tamas Bunth f5c09ac048 mysqlc: Implement DatabaseMetadata::getUserName
Change-Id: Id3518a049a55d64e7272d265f22e930881a70161
Reviewed-on: https://gerrit.libreoffice.org/78296
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-08-31 17:49:51 +02:00
Tamas Bunth cbbda5b926 mysqlc: Add test for textual blob types
Test setting and querying the following data types:
TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT

Test them using prepared statements.

Change-Id: I43387034ad8c32c3731cde70a22cc8b3dd652b78
Reviewed-on: https://gerrit.libreoffice.org/76747
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-08-01 11:38:46 +02:00
Tamas Bunth acafd1ac87 mysqlc: getTablePrivileges not implemented, so..
it should throw an exception.

Reviewed-on: https://gerrit.libreoffice.org/60460
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 19f8ea668833a4dc90244792cbf91881b0ca9a07)

Change-Id: I32b0b5dde0bcfd8cc59d0814a9f35d43c0f58ae1
Reviewed-on: https://gerrit.libreoffice.org/76750
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-31 19:58:09 +02:00
Tamas Bunth cc4c20d08f mysqlc: Support reading blob as string
Change-Id: I1ef0c3817bc255e7f0c38aca73c475b19d5d7d9b
Reviewed-on: https://gerrit.libreoffice.org/76600
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-07-31 10:53:18 +02:00
Tamas Bunth 41d3be4a48 mysqlc: Fix query of cursor position in result set
Fix queries like "IsAfterLast" in result sets of prepared statements in
the mysql driver.

Cursor position is stored in the driver, since the mysql C driver does
not support the query of the cursor position.

The cursor position works the following way:
- 0 means the cursor is on "BeforeFirst". In that state calling of
  getXXX() methods is user error.
- 1 means the first row is already fetched.
- n means the last fow is fetched, where n is the total number of rows
  in the result set.
- Everything bigger than n is "AfterLast"

Change-Id: I131f2042606897019cc0f868dbc4151faf4850ac
Reviewed-on: https://gerrit.libreoffice.org/76549
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-07-29 22:33:38 +02:00
Tamas Bunth b5890bf269 tdf#123020 dbahsql: Support string delimiter
Support multi-word table names while migrating HSQLDB data.

Change-Id: I5129f995ea90a3fdbcbcb844774cf074f3ffddb2
Reviewed-on: https://gerrit.libreoffice.org/75734
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-07-17 22:49:54 +02:00
Tamas Bunth c19c206cf4 tdf#123150: Firebird: set UTF-8 client connection
There are two options related to character sets when attaching or
creating a database with the C API:

- isc_dpb_lc_ctype: Sets the character set of the connection between the
Firebird server and the Client (which is the sdbc driver in that case).
That is required in order to pass UTF 8 literals correctly.

- isc_dpb_set_db_charset: Sets the default character set of the database
itself. It has the same effect as the following SQL statement:
 ALTER DATABASE SET DEFAULT CHARACTER SET <Charset>

We need to set both of them to UTF-8.

Change-Id: Ia9e5a4b87a3997c084be8abb68c2de813fbd631b
Reviewed-on: https://gerrit.libreoffice.org/75557
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Tested-by: Tamás Bunth <btomi96@gmail.com>
2019-07-13 21:21:18 +02:00
Tamas Bunth a0d85d526c tdf#123591: Firebird: Fix setting double values
Handle numerical and decimal values separately. In order to do that
we have to indentify the exact type first. That can be achieved using
sqltype and sqlsubtype in Firebird API.

Change-Id: Ie664dead51bae5522ee53009cda1cddbe0d64b16
Reviewed-on: https://gerrit.libreoffice.org/75525
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Tested-by: Tamás Bunth <btomi96@gmail.com>
2019-07-13 21:21:09 +02:00
Tamas Bunth 3a4c4482ec mysqlc: Add support for mysql type INT24
Which is mapped to sal_Int32.

Change-Id: Ibf12e92a20034440fa990ed0c6f1196f4ca3f40f
Reviewed-on: https://gerrit.libreoffice.org/73217
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-06-03 18:44:07 +02:00
Tamas Bunth 0efccbc58b Add unit test for pptx import, crop to shape
Change-Id: I2a987278320a5685780962de2d3dfc165f3ef3aa
Reviewed-on: https://gerrit.libreoffice.org/72309
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-05-15 09:10:40 +02:00
Tamas Bunth f4ba484183 ooxml import: supprt cropping to shape
Change-Id: I7bdc959921ecb0cbf19037a78b63eaeb8fc52814
Reviewed-on: https://gerrit.libreoffice.org/72206
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-05-13 18:14:26 +02:00
Tamas Bunth 406aef41d1 mysqlc: Allow conversions between different types
Change-Id: I54c1f438a755267db0896637c79f915de9113f83
Reviewed-on: https://gerrit.libreoffice.org/71074
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-04-25 15:47:38 +02:00
Tamas Bunth 7a9f6df7fb single source file for licensing info with conditional text
... for easier maintenance. This commit only introduces the
framework. Follow up commits will update the license file.
Advantages:
* single source, multiple outputs (html, txt)
* conditional text, i.e. output will not include license
  terms of components that are not configured in the build

Change-Id: I0ffad41119228a0a26fd1b6ce19930ca6085adb2
Reviewed-on: https://gerrit.libreoffice.org/69396
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-03-19 15:16:51 +01:00
Tamas Bunth aa974a1b37 tdf#119502: dbahsql: tables without primary key
No "PRIMARY KEY" keyword is needed, when composing a parsed sql which
did not contain any primary key definition.

Change-Id: Ife8b898806edba41a52d47dc04b1170606ea8aae
Reviewed-on: https://gerrit.libreoffice.org/67379
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-02-05 11:25:07 +01:00
Tamas Bunth 6affbd2b57 tdf#122129 Firebird: fix concurrency issue
Allow only one isc_dsql_prepare at a time.

Change-Id: I3d5974057272cd47697aeb7be54579d0c1a662a0
Reviewed-on: https://gerrit.libreoffice.org/67231
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-02-04 21:32:25 +01:00
Tamas Bunth 2ec13411b7 tdf#121069, tdf#121469 migrate special characters
dbahsql: Decode UTF8 characters stored as unicode code point values in
schema file.

Change-Id: I90db2345a6de9bee7aae8ae6a7c046a03eebc0a7
Reviewed-on: https://gerrit.libreoffice.org/67197
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-01-31 14:41:10 +01:00
Tamas Bunth 7649186011 mysqlc: fix timestamp query of result set
Also add test for inserting and reading timestamp values.

Change-Id: I2ba997c438f4e33965b0fe0602e58eddeff38b01
Reviewed-on: https://gerrit.libreoffice.org/67066
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-01-29 18:07:08 +01:00
Tamas Bunth 6e80862ee6 mysqlc: resultset's previous() on first position..
.. should move the cursor backwards to beforeFirst position and return
false.

Change-Id: Icbb4bed0ea39ea3a0bf375d5616e3ef768fc69d9
Reviewed-on: https://gerrit.libreoffice.org/66729
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-01-22 17:43:41 +01:00
Tamas Bunth 8d92dca462 mysqlc: fetch data exactly when it's needed
It fixes the issue that one could not call getXXX on a result set
on which next() method was never called before.

Change-Id: I972bb9d475d192a14ba1534dcbdac81c20f211d0
Reviewed-on: https://gerrit.libreoffice.org/66404
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-01-22 13:19:53 +01:00
Tamas Bunth 316f85fa1d tdf#122437 mysqlc: Fix foreign key references
Comparing mysqlc terminology (INFORMATION_SCHEMA) with the description
of the XDatabaseMetadata interface:
- columns with name "REFERENCED_*" (INF_SCHEMA) should be used for primary key
attributes (sdbc terminology).
- columns without any prefix (INF_SCHEMA) should be used for primary key
attributes (sdbc)

Change-Id: Id9780fd86834441485da927f85b9446c40951fcf
Reviewed-on: https://gerrit.libreoffice.org/66213
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-01-12 17:25:07 +01:00
Tamas Bunth ead0a04e41 tdf#122437 mysqlc: consider "types" parameter in..
..method XDatabaseMetadata::getTables() so it will return only those types
which are needed. This solves the problem that no tables appear in
"Relations.." window.

Change-Id: Ia02537c78917583f574ad788098c65a9acd43078
Reviewed-on: https://gerrit.libreoffice.org/66212
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-01-12 12:47:24 +01:00
Tamas Bunth 74de1d0051 tdf#122437 mysqlc: fix foreign key name query
Correct query of the foreign key constraint name is required for
dropping foreign keys.

Change-Id: Id98b0672ec5a8a06039667a06cb0afd97b3ee205
Reviewed-on: https://gerrit.libreoffice.org/65861
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-01-07 10:02:13 +01:00
Tamas Bunth ee33372f64 mysqlc: Fix result set metadata related issue
In order to allow fetching result of multiple result sets at time same
time, all the data is fetched and copied on demand from the mysql result
set. The mysql result set (MYSQL_RES) is freed afterwards.

That means we need a copy of the meta information as well. Now all the
meta data is stored in the driver for each result set, so it does not
depend on the MYSQL_RES structure anymore.

Also add test case for invoking some meta data queries before and after
fetching the result set.

Change-Id: Ie8bf993926ebe89cd362ab0b311d1f3d164b84df
Reviewed-on: https://gerrit.libreoffice.org/65717
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-01-04 17:37:26 +01:00
Tamas Bunth c3eeb89154 mysqlc: ensure fetched result while invoking last
Change-Id: Ia1872973eefff1d8d677aa443b0c03d3ea569d60
Reviewed-on: https://gerrit.libreoffice.org/65716
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-12-31 16:07:12 +01:00
Tamas Bunth 44416a16f4 mysqlc: Fix obtaining field information in rs
Result set field information should be stored correctly. It is queried
from database on demand and stored locally.

Change-Id: Ia62c62e6db32b45640b9fcd5f48c6249aecc41a2
Reviewed-on: https://gerrit.libreoffice.org/64861
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-12-14 11:19:58 +01:00
Tamas Bunth adc10258c7 mysql_jdbc: test simultaneously opened result sets
Change-Id: I413fa17ee0fc264526133eca12ee747d40d6ac6a
Reviewed-on: https://gerrit.libreoffice.org/64412
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-12-09 01:06:25 +01:00
Tamas Bunth 3339c730f8 Put text label outside of the pie if..
performLabelBestFitInnerPlacement fails.

Change-Id: Ic84e8b42e02da2023b22a9406c44d462170c5305
Reviewed-on: https://gerrit.libreoffice.org/64015
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-11-26 09:47:43 +01:00
Tamas Bunth 878c36f829 mysqlc: next() should move cursor from Last
XResultSet::next() should move cursor when called while cursor is on the
last position. It is not documented, but older versions of the mysqlc
extension are implemented that way. The cursor goes to the so called
afterlast position.

Even so, the next() call on the last position should return false.

Change-Id: I0fd145c920077151364a6a8c12e05290496b99c8
Reviewed-on: https://gerrit.libreoffice.org/63895
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-11-24 23:15:51 +01:00
Tamas Bunth da16857fe3 Build mysql_jdbc library even when building..
.. without java

Change-Id: Id44ef2d94992423a12b32234822e8ed3f5a48299
Reviewed-on: https://gerrit.libreoffice.org/63889
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-11-24 23:15:34 +01:00
Tamas Bunth dbe401ba4b mysqlc: fix return value of XResultSet::next
Change-Id: I59e4803a5d9b01062eb0eaca0bf65d28298bd3e4
Reviewed-on: https://gerrit.libreoffice.org/63121
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-11-09 21:52:23 +01:00
Tamas Bunth 3c92c34788 mysql_jdbc should be enabled in Repository.mk..
..only if java is enabled:

Change-Id: Iaf210e7044e854545518336ed7a40ce615443356
Reviewed-on: https://gerrit.libreoffice.org/62882
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Tested-by: Tamás Bunth <btomi96@gmail.com>
2018-11-05 11:15:37 +01:00
Tamas Bunth 0c6da44c92 mysqlc: allow multiple open statements
Change-Id: I07e57ea7d9e6af1c7543483b1ab54a0b8c5be2d5
Reviewed-on: https://gerrit.libreoffice.org/62640
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-11-05 10:06:03 +01:00
Tamas Bunth 39e0bbfdf7 mysqlc: filter schema in getColumns
Filter schema in XDatabaseMetaData::getColumns so it would show correct
results in case there are more tables with the same name in different
schemas.

Change-Id: I8a986a43a8b049db3615d7ec2585ce68ebe3340e
Reviewed-on: https://gerrit.libreoffice.org/62696
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-11-01 14:23:20 +01:00
Tamas Bunth e33424dd88 mysqlc: Add support for mediumnint and char types
When reading column types from information schema, it can be mediumint
and char types as well. Mediumint should be 3 bytes long. We can use
sal_Int32 for that.

Change-Id: Id3507b1f38cabfb96800fc7743c911e36609a346
Reviewed-on: https://gerrit.libreoffice.org/62697
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-10-31 23:51:40 +01:00
Tamas Bunth 76279399f7 tdf#120691 Migrate tables which contain spaces
Change-Id: I115d765bc781a926189605990e91c8e47f24d474
Reviewed-on: https://gerrit.libreoffice.org/62403
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-10-29 10:02:56 +01:00
Tamas Bunth e04e7a7214 Add unit test for mysqlc connector
It can be used to test the mysqlc connector whenever there is an
external mysql or mariadb server running.

The test runs only when CONNECTIVITY_TEST_MYSQL_DRIVER environment variable
is set. This variable should contain the URL of the database, including
the port number and the host name.

The URL should also contain a user name password pair which can be used
to connect to the external database. The URL format is the following:

[user]/[passwd]@sdbc:mysql:mysqlc:[host]:[port]/[db_name]

README is updated and contains detailed information about the test.

Change-Id: I1bbc9369ff193a29c06de63a0f6cc975877c8da3
Reviewed-on: https://gerrit.libreoffice.org/62171
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-10-22 15:43:29 +02:00
Tamas Bunth b2cefc2e36 Revert removal of mysql jdbc connector
And also make some minor fixes so it cooperates with the new mysqlc
library.

Change-Id: I866add99a699150c6550ee7f7ff2ee947e07117c
Reviewed-on: https://gerrit.libreoffice.org/61648
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-10-14 22:16:05 +02:00
Tamas Bunth 37dba4f25f tdf#119850 show missing mysql connector options
For MYSQL connections there is an extra window which determines how to
connect to a mysql/mariadb database. This functionality is handled in
OGeneralPageWizard::approveDatasourceType.

Change-Id: Ia3c548103b694731cba47ff5390c34b072a938a0
Reviewed-on: https://gerrit.libreoffice.org/60893
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Tested-by: Tamás Bunth <btomi96@gmail.com>
2018-09-22 18:44:13 +02:00
Tamas Bunth f4393330b2 mysqlc: fix XPreparedStatement::setTimestamp
Change-Id: Ia0d0290517fdebd9a7700d52fa0e86de0e958b2d
Reviewed-on: https://gerrit.libreoffice.org/60406
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-09-13 20:36:31 +02:00
Tamas Bunth 25ca37889e mysqlc: prep stmt: check if cursor out of range
Change-Id: I81307c6e45220081c39ddd7d1672457202bbc517
Reviewed-on: https://gerrit.libreoffice.org/60404
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-09-13 20:36:08 +02:00
Tamas Bunth b3e8106873 mysqlc: Fix XResultSet::absolute and previous
We need to update the actual row position after using absolute or
previous.

Change-Id: Ie85f9679b7a06649a88ac8ee08436bf7f4a58a22
Reviewed-on: https://gerrit.libreoffice.org/60328
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-09-13 16:19:05 +02:00
Tamas Bunth ed01dc1a88 mysqlc: ensure cursor is not out of range
when calling getXXX() methods of a simple result set.

Change-Id: I9e018385bb73468ea520b03275232c0982cbcba0
Reviewed-on: https://gerrit.libreoffice.org/60095
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-09-07 15:06:51 +02:00
Tamas Bunth 897f9c0dbc mysqlc: implement beforeFirst and fix findColumn
Change-Id: I9a12ef6c61b83f588be89ed9aff301d570155d74
Reviewed-on: https://gerrit.libreoffice.org/59880
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-09-01 14:46:27 +02:00
Tamas Bunth 9b75c54aa5 tdf#119615 Ownership of m_aFields is..
.. on Mariadb side

Change-Id: Id65487191c29f7af1a171c06345034d1dc5b20ec
Reviewed-on: https://gerrit.libreoffice.org/59856
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-31 15:32:44 +02:00
Tamas Bunth d2a1ca79e5 mysqlc: implement getImpotedKeys
Change-Id: Ic819389000b5b31de69bece6b280cf89f93db948
Reviewed-on: https://gerrit.libreoffice.org/59851
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-31 15:32:29 +02:00
Tamas Bunth 98a03d8ff4 mysqlc: Add library to log areas and put some
warnings into databasemetadata

Change-Id: I4c2841e9174e738fff6b8627f8860588c7838c49
Reviewed-on: https://gerrit.libreoffice.org/59755
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-29 14:53:37 +02:00
Tamas Bunth a67acf8e61 mysqlc: registry xml: install driver
Change-Id: I864302cc7ba8f27300e4bf0dd3d8a6cc1896da4b
Reviewed-on: https://gerrit.libreoffice.org/59698
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-28 15:46:17 +02:00
Tamas Bunth 43f30952f3 mysqlc: fix registry configuration
Change-Id: Iefe1446e5f28471c6cafd256b29612c2457e42fc
Reviewed-on: https://gerrit.libreoffice.org/59640
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-27 12:59:58 +02:00
Tamas Bunth bce87186e5 Delete mysqlc module, mysql cpp connector remains
Change-Id: Ic3536c1dd1e2aa9dd19af66db1b9a50fd8ef90e6
Reviewed-on: https://gerrit.libreoffice.org/59639
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-27 12:57:54 +02:00
Tamas Bunth 5c5515fde5 mysqlc: Fix issue by freeing result sets
Change-Id: I8a5f886306e028f06243768376b2a6c55df6063c
Reviewed-on: https://gerrit.libreoffice.org/59210
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-27 11:15:02 +02:00
Tamas Bunth 26b40fcfc6 Moving mysqlc into connectivity as a library
Additionally I erased the remains of the old mysql C++ connector.

Also update the code where the clang plugins were unhappy after moving
the mysqlc module.

Remove mysql-cpp-connector external.

Change-Id: I771cc7afacf5012fc349afb6b36828fb0fee5a66
Reviewed-on: https://gerrit.libreoffice.org/59200
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-24 17:19:51 +02:00
Tamas Bunth aa6859f090 mysqlc: Fix float, double and numeric types
Change-Id: I9d0b989735e736c9c35d8acf4ea1b072eddf7437
Reviewed-on: https://gerrit.libreoffice.org/58744
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-08-12 23:16:59 +02:00
Tamas Bunth 3478d7453a Switch from mysql to MariaDB C API
In order to get rid of the MySQL C++ Connector, the sdbc driver should
be implemented using the MariaDB C connector instead. MariaDB
Connector/C is LGPL licensed, so later it can be used in the
connectivity module. This way mysqlc won't be an extension, so it could
be maintained easier.

Change-Id: I99c13ccf154b33b145d34b1e06eec85946dc82a0
Reviewed-on: https://gerrit.libreoffice.org/55960
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Tested-by: Tamás Bunth <btomi96@gmail.com>
2018-08-12 23:15:21 +02:00
Tamas Bunth 9ceeb4619b HSQLDB Migration: overwrite backup xml
Change-Id: I080568f2d278e8a7153188497e3987217d9d188f
Reviewed-on: https://gerrit.libreoffice.org/56464
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-07-06 13:56:58 +02:00
Tamas Bunth a91fe8558b dbahsql: Look for properties only after name
Additional properties in SQL string like "DEFAULT" or "NOT NULL" should
be searched only after column name, because what if a column name is
"myEvilNOT NULLColumn"

Change-Id: I21f0755ba14c7267243d9999f044db4d16963387
Reviewed-on: https://gerrit.libreoffice.org/56462
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-07-06 10:37:36 +02:00
Tamas Bunth 815b2130c8 dbahsql: refactor, around parseColumnpart
Change-Id: I663da1474d3f1c3bde8a3d3c041e8fd0fe4c7d43
Reviewed-on: https://gerrit.libreoffice.org/56459
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-07-06 10:34:06 +02:00
Tamas Bunth 8f3d6e67b0 tdf#117867 dbahsql: Migrate default values
Default Value "NOW" is a special case, because Firebird likes it with
single quotes. In contrast, HSQLDB uses the keyword without quotes.

Add unit test for parsing default value "NOW"

Change-Id: I34886f8ae53e98addb52bf5e85030a03721d6a45
Reviewed-on: https://gerrit.libreoffice.org/56454
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-07-06 10:33:48 +02:00
Tamas Bunth b68805a896 Back up content.xml when migrating database
Change-Id: I4eacbf689989d20142c04dc8fe586d0054c46350
Reviewed-on: https://gerrit.libreoffice.org/55962
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-06-18 10:36:45 +02:00
Tamas Bunth 1f91ebb586 tdf#118043 dbahsql: Fix putDot funciton
Change-Id: Ia49b7e852446b05a4e20a7ff0c32d8acc6da52b2
Reviewed-on: https://gerrit.libreoffice.org/55594
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-06-14 13:15:04 +02:00
Tamas Bunth 647a9fec40 tdf#117115 dbahsql: respect escaped '\'
Change-Id: Id408f7a98011d806f01b6c63ae67008c4dba4b0d
Reviewed-on: https://gerrit.libreoffice.org/55595
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-06-11 10:42:22 +02:00
Tamas Bunth ded4dcbbce tdf#117115 dbahsql: respect unicode in columns
Change-Id: I6a1dcba0afda88eaf083f0d4c73c1e74b0c78f56
Reviewed-on: https://gerrit.libreoffice.org/54297
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-25 15:27:20 +02:00
Tamas Bunth 434ba18afd tdf117333 dbahsql: Chain SQLExceptions
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-24 11:37:29 +02:00
Tamas Bunth ea19b96b6b tdf#117333, tdf#117325 dbahsql: exception handling
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-16 11:10:04 +02:00
Tamas Bunth a1825b219a tdf#116987 dbahsql: check for table names..
..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-16 11:09:39 +02:00
Tamas Bunth 4f043c0a26 tdf#117092 dbahsql: handle multiple primary keys
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-14 09:21:44 +02:00
Tamas Bunth 1932f4b04a tdf#117301 dbahsql: add FLOAT type
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-12 10:28:50 +02:00
Tamas Bunth 210638cc16 tdf#117299 dbahsql: add varchar_ignorecase type
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-07 11:03:47 +02:00
Tamas Bunth 1c5c9b84df Refactor: migration warn dlg without modifying API
Use Migration warn dialog directly in library dba instead of popping up
window in dbu and passing down the information through XDataSource.

Change-Id: I6b8d2b55408a741662052d4af316b0c662d799f0
Reviewed-on: https://gerrit.libreoffice.org/53363
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-05-05 11:10:07 +02:00
Tamas Bunth 04e564b817 tdf#116980 tdf#116986 Fix data migration in..
.. 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-02 19:02:55 +02:00
Tamas Bunth b18953565b tdf#116980 Add constraints after data migration
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-02 14:09:37 +02:00
Tamas Bunth 9123711dd0 tdf#117296 dbahsql: Fix migration of numeric
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-05-02 11:12:18 +02:00
Tamas Bunth cd65f09838 tdf#117300 dbahsql: Add REAL type
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-29 18:19:42 +02:00
Tamas Bunth 60db3d2cc3 dbu: Set Firebird to default in wizard..
..in case experimental feature is checked in.

Change-Id: I8a774d4e532ea2afc0e1fe528e98a5743c662888
Reviewed-on: https://gerrit.libreoffice.org/53366
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-26 13:13:51 +02:00
Tamas Bunth 05b0381377 tdf#116965 dbahsql: migrate relationgships
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-15 21:29:13 +02:00
Tamas Bunth 098b84ff26 tdf#116954 dbahsql: migrate views too
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-15 21:29:02 +02:00
Tamas Bunth 22cfac8ede tdf#116982 dbahsql: fix autoincrementation
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-15 21:28:52 +02:00
Tamas Bunth 5b0ceb86c3 tdf#116944 Warn user before database migration
Warn user with a pop-up dialog before migration.

To do that we have to know the database URL at UI level. In order to get
that I updated XDataSource interface with getConnectionURL().

The dialog offers two options: proceed with or without migration. If the
user choose "yes", we store that information in XDataSource. The
migration itself will be made in buildLowConnection().

Change-Id: I1f0d03da6352f7a0a8d989da79c4b2fe60a03ca1
Reviewed-on: https://gerrit.libreoffice.org/52876
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-14 21:14:50 +02:00
Tamas Bunth 3bb1f0b3a8 Revert HSQLDB related unit tests
Revert changes making HSQLDB related unit tests test Firebird migration.
They should still test the HSQLDB driver.

It reverts part of 159dd28651

Change-Id: If2b9207e95055418bd1dc1dc6e472335de311d1e
Reviewed-on: https://gerrit.libreoffice.org/52873
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-14 17:44:48 +02:00
Tamas Bunth f5a2fedaeb tdf#105075 Firebird: Support Limit of query_GUI
Firebird uses "SELECT FIRST <num> ..." format to limit the number of
result row numbers instead of "SELECT ... LIMIT <num>"

My first approach was to improve OSQLParser and make it understand the
Firebird dialect. But it is hard because the parser has hard-coded
getChild(int) calls all over the code and all the indexes should be
updated.

Instead of this, we recognise the LIMIT keyword with the parser, remove
it and push the FIRST <num> part manually right after SELECT.

All of this should happen in case of Firebird and only when using the
query-GUI.

Change-Id: I53f3f977f77cf98b91b25a7eaa6ebb2ee8ac0951
Reviewed-on: https://gerrit.libreoffice.org/52591
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Jenkins <ci@libreoffice.org>
2018-04-14 14:15:26 +02:00
Tamas Bunth 8d381ae8d6 Remove dead HSQLDB driver
Change-Id: Id4cfb69079f0150c9cca2626c16df7fab441d916
Reviewed-on: https://gerrit.libreoffice.org/52611
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-10 11:34:35 +02:00