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

Cannot read autoincremented IDs bigger than Short.MAX_VALUE

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 1.4.0, 1.4.1, 1.4.2
    • 1.4.3
    • Other
    • None
    • Fedora Core 23 x64, connecting to 10.1.13-MariaDB MariaDB Server

    Description

      When inserting a new row using a PreparedStatement into a table with an auto incremented ID, the connector returns a negative ID if the actual generated ID is greater than 32767.

      I've nailed this down to this method: org.mariadb.jdbc.internal.util.buffer.Buffer.getLengthEncodedBinary()

      In version 1.3.7, where this still works, the method contains this snippet:

      case (byte) 0xfc: //252
           return (long) 0xffff & readShort();
      

      In version 1.4.2, where it's broken, it looks like this:

      case 252:
          return readShort();
      

      I think this bug is insanely critical.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            cciach Christian Ciach
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.