Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1056

JDBC connector reads incorrect data from unix socket when the text is too large

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.9, 3.0.10, 3.1.2
    • 3.1.3
    • Other
    • None
    • Linux, Mac OS, 10.10.3-MariaDB, penJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode)

    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 .

      Attachments

        Activity

          diego dupin Diego Dupin added a comment -

          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) ?

          diego dupin Diego Dupin added a comment - 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) ?
          diego dupin Diego Dupin added a comment -

          not reproduced using using 10.10.3 as well.

          diego dupin Diego Dupin added a comment - not reproduced using using 10.10.3 as well.
          HBensch Heiko Bensch added a comment -

          Which driver version are you using?

          HBensch Heiko Bensch added a comment - Which driver version are you using?
          diego dupin Diego Dupin added a comment -

          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.

          diego dupin Diego Dupin added a comment - 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.
          HBensch Heiko Bensch added a comment -

          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?

          HBensch Heiko Bensch added a comment - 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?
          diego dupin Diego Dupin added a comment -

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

          diego dupin Diego Dupin added a comment - finally reproduced using very big parameter. I'll investigate the results. thanks !
          diego dupin Diego Dupin added a comment -

          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

          diego dupin Diego Dupin added a comment - 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

          People

            diego dupin Diego Dupin
            HBensch Heiko Bensch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.