[CONJ-1059] MySQL Connector Incompatible result from Statement.executeQuery when executing DDL Created: 2023-02-22  Updated: 2023-03-01  Resolved: 2023-03-01

Status: Closed
Project: MariaDB Connector/J
Component/s: MySQL compatibility
Affects Version/s: 3.1.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Wenqian Deng Assignee: Diego Dupin
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

Windows 11
MariaDB Connector 3.1.2
MySQL Connector 8.0.32
MariaDB 10.11



 Description   

Hey there,

I use different connectors(MySQL / MariaDB Connector) to connect to the same MariaDB. My connection URL is like "jdbc:mariadb://localhost:3366/test?useUnicode=true&characterEncoding=utf8&sessionVariables=storage_engine=InnoDB,sql_mode=''&connectionTimeZone=UTC" and "jdbc:mysql://localhost:3366/test?useUnicode=true&characterEncoding=utf8&sessionVariables=storage_engine=InnoDB,sql_mode=''&connectionTimeZone=UTC"

and the setup SQL file:

DROP DATABASE IF EXISTS database0;
CREATE DATABASE database0;

I execute this file using Statement.executeQuery() for both connectors.

But the MySQL Connector and MariaDB Connector seem to have different results when executing the SQL file.
That is, MySQL Connector returns 'java.sql.SQLException: Statement.executeQuery() cannot issue statements that do not produce result sets.' but MariaDB Connector can successfully execute these SQLs and returns an empty result.

I also classify this as a bug because MariaDB claims MySQL compatibility at the driver level.



 Comments   
Comment by Diego Dupin [ 2023-03-01 ]

MySQL has to parse queries in order to produce this error message that is not required by anyone.
Connector must never parse anything.

see javadoc : https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/Statement.html#executeQuery(java.lang.String) :
Connector will not slow down execution in order to throw an unneeded exception.
I would more create issue mysql side to do that kind of things.

sorry for the somewhat harsh answer, but i find all the recent mysql connector changes so much in the wrong direction, always going more in the direction of less performance for no reason

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