Bug 85013 - MySQL throws syntax errors for LibreOffice generated queries
Summary: MySQL throws syntax errors for LibreOffice generated queries
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.3.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: high critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-14 17:02 UTC by Erkin Alp Güney
Modified: 2014-10-16 18:47 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erkin Alp Güney 2014-10-14 17:02:51 UTC
I get this when I try to add a table into a previously created MySQL database:
SQL State: 42000
Error code: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' PRIMARY KEY  (`Instructor_ID`))' at line 1

Steps to reproduce
1st-Create a MySQL database using whatever way you like.
2nd-Connect this database in LibreOffice Base using JDBC.
3rd-Open table design window and create a table with a primary key having the type "INT UNSIGNED", add more columns as you like.
4th-Try saving this.
Comment 1 Robert Großkopf 2014-10-14 18:15:49 UTC
Have tested the steps as reported.
Could save the table and put values into the fields.
Could also set an Auto-Value to the ID-field.

My system: OpenSUSE 12.3 64bit rpm Linux,
LO 4.3.2.2 (as reported for, tested with other versions also)
mysql-connector-java-4.1.26-bin.jar
Have also tested the connector
mysql-connector-java-4.1.33-bin.jar
with the same result.
MariaDB instead of MySQL

The connector for my distribution throws an error while connecting - so I couldn't connect to MariaDB with this connector. Which connector do you use?
Comment 2 Erkin Alp Güney 2014-10-15 14:41:22 UTC
> 
> The connector for my distribution throws an error while connecting - so I
> couldn't connect to MariaDB with this connector. Which connector do you use?
JDBC MySQL connector.
Comment 3 Robert Großkopf 2014-10-15 17:26:15 UTC
(In reply to Erkin Alp Güney from comment #2)
> > 
> > The connector for my distribution throws an error while connecting - so I
> > couldn't connect to MariaDB with this connector. Which connector do you use?
> JDBC MySQL connector.

You have reported this for the JDBC-connection. Which version of the JDBC-connector do you use? I have tested 3 different JDBC-Connectors. The one, which is part of my distribution, doesn't connect. The other two work well.
Comment 4 Erkin Alp Güney 2014-10-16 05:37:47 UTC
It is version 5.1.31-1 (Ubuntu package).
Comment 5 Robert Großkopf 2014-10-16 06:24:51 UTC
Could you test it with the platform independent connector from MySQL?
http://dev.mysql.com/downloads/connector/j/

If you start the download you were asked for a login for Oracle Web - dont worry. At the bottom of the page is the (small) link: "No thanks, just start my download".
You have to unpack the file and search for mysql-connector-java-4.1.33-bin.jar in one of the folders.
Copy this file into your home-directory (could be it is already there in "Download").
Uninstall the JDBC-Connector from Ubuntu.
Open LO → Tools → Options → LibreOffice → Advanced → Java Options → Class Path → Add Archive
and add mysql-connector-java-4.1.33-bin.jar to your LO.

This connector works here all right with every version of LO.
Comment 6 Erkin Alp Güney 2014-10-16 18:47:04 UTC
Tested as you told. Bug is caused by Debian patch.