[CONJ-1056] JDBC connector reads incorrect data from unix socket when the text is too large Created: 2023-02-21  Updated: 2023-03-02  Resolved: 2023-03-02

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 3.0.9, 3.0.10, 3.1.2
Fix Version/s: 3.1.3

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

Linux, Mac OS, 10.10.3-MariaDB, penJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode)


Attachments: Java Source File TestMariaDBSQLError.java     File trace.log.gz    

 Description   

I created the following table:

create table test_table
(
    int_column int        null,
    mediumtext_column     mediumtext null
)
    collate = utf8mb3_bin;

I stored 100 in the int_column and a large text (30000 chars) in the mediumtext_colum.
Then I read the data via Unix socket (jdbc:mariadb:///test-int?user=<user>>&password=<password>&localSocket=/tmp/mysql.sock).

Instead of reading the 100 for the int value I get -624824290 and the text length is 98 characters instead of 30000.

The error does not occur when using a TCP/IP database connection.

I attached my test case .



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

that's strange, like wrong packet.
I've not been able to reproduced that with you example, but using ubuntu and MariaDB 10.9.5 for now

Could you reproduced that using trace logging level in order to understand where the issue is (connector or server side) ?

Comment by Diego Dupin [ 2023-03-01 ]

not reproduced using using 10.10.3 as well.

Comment by Heiko Bensch [ 2023-03-01 ]

Which driver version are you using?

Comment by Diego Dupin [ 2023-03-01 ]

I've tryed with 3.1.2 on ubuntu with MariaDB 10.9.5 and 10.10.3
But even if not reproducing it, logs would greatly help to identify the problem.

Comment by Heiko Bensch [ 2023-03-01 ]

I created a trace file trace.log.gz.

Server version: 10.11.2-MariaDB
MariaDB java client: 3.1.2
OS: macOS Ventura 13.2.1

Could you increase the stringLength to 100000 or 500000?

Comment by Diego Dupin [ 2023-03-02 ]

finally reproduced using very big parameter. I'll investigate the results. thanks !

Comment by Diego Dupin [ 2023-03-02 ]

correction available through snapshot, using :

<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>3.1.3-SNAPSHOT</version>
    </dependency>
</dependencies>

Will be in 3.1.3 version

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