[CONJ-351] getTables call fails w/ syntax error Created: 2016-09-20  Updated: 2016-09-27  Resolved: 2016-09-22

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.5.2
Fix Version/s: 1.5.3

Type: Bug Priority: Major
Reporter: Yekaterina Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux Kernel-3.0.101-glibc-2.11.3 zSeries 64bit;
Linux Kernel-2.6.32-glibc-2.12 pSeries 64bit;
Ubuntu 14 Little Endian;
AIX 6.1 pSeries 64bit;
AIX 7.1 pSeries 64bit.
These are the machines we got the problem on. The rest were fine.


Attachments: HTML File env_java     File repro.class     Java Source File repro.java     File repro.log.jdbcdriv146.java8     File repro.log.jdbcdriv152.java7     File repro.log.jdbcdriv152.java8    
Issue Links:
Problem/Incident
is caused by CONJ-353 IBM jdk compatibility issue Closed

 Description   

We installed the newest Connector/J 1.5.2 instead of 1.4.6. We discovered a bug in the new driver.
getTables() call fails w/ syntax error. Failure occurs when using MariaDB JDBC driver V1.5.2 , but works when using MariaDB JDBC driver V1.4.6.

call getTables()

      • SQLException caught ***

SQLState: 42000
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
Query is : SELECT TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, TABLE_NAME, IF(TABLE_TYPE='BASE TABLE', 'TABLE', TABLE_TYPE) as TABLE_TYPE, TABLE_COMMENT REMARKS, NULL TYPE_CAT, NULL TYPE_SCHEM, NULL TYPE_NAME, NULL SELF_REFERENCING_COL_NAME, NULL REF_GENERATION FROM INFORMATION_SCHEMA.TABLES WHERE (ISNULL(database()) OR (TABLE_SCHEMA = database())) AND (TABLE_NAME = 'junk') ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME
Vendor: 1064

When the above SQL statement is run in MariaDB natively, it returns a row with no problem.



 Comments   
Comment by Diego Dupin [ 2016-09-21 ]

Hi, this is strange because seems to be simular to CONJ-347, but i didn't succedd to reproduced the problem.
Using the "repro" files you send and 1.5.2, using oracle JDK on windows and unix.

So, in order to reproduced the problem, can you indicate the server : database version, environnement = unix/windows/z-os...
and the java runtime (oracle, openJDK, IBM) ?

i'll make some tests with IBM runtime

Comment by Diego Dupin [ 2016-09-21 ]

issue reproduced, it concern only IBM runtime.

Comment by Diego Dupin [ 2016-09-22 ]

fixed in 1.5.3 (will be released the oct. 3).

correction is available in snapshot release :

<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>
 
<dependencies>
    <dependency>
        <groupId>org.mariadb.jdbc</groupId>
        <artifactId>mariadb-java-client</artifactId>
        <version>1.5.3-SNAPSHOT</version>
    </dependency>
</dependencies>

Comment by Yekaterina [ 2016-09-22 ]

Hi Diego,
Thanks for your prompt fix. Could you help me to find the snapshot release of Connector/J 1.5.3?
I navigated to the url https://oss.sonatype.org/content/repositories/snapshots but do not know how to find it there.
Kate

Comment by Diego Dupin [ 2016-09-27 ]

it's a maven repository, so you just have to folow the maven groupId path.
So jar can be available directly here :
https://oss.sonatype.org/content/repositories/snapshots/org/mariadb/jdbc/mariadb-java-client/1.5.3-SNAPSHOT/mariadb-java-client-1.5.3-20160926.213538-2.jar

Generated at Thu Feb 08 03:15:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.