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

jdbcCompliantTruncation Does Not Appear To Be Working

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.0, 3.3.3
    • 3.4.0
    • configuration
    • None

    Description

      We are trying to upgrade our java application from MariaDB connector J 2.7.12 to 3.3.2.

      As part of our testing, we found that the driver no longer rejects an insert when a column value is longer than the column.

      environment:
      MariaDB Server version: 10.4.29, sql_mode = "NO_KEY_OPTIONS"

      CREATE TABLE `test`
      (
          `ID`   int(11)       NOT NULL auto_increment,
          `TEST` varchar(1500) NOT NULL DEFAULT '',
          PRIMARY KEY (`ID`),
      )
      

      To reproduce:
      Disable strict mode on MariaDB Server, set jdbcCompliantTruncation=true or unconfigured in connector config

      Attempt to insert into the table, with TEST value more than 1,500 characters.

      Expected result:

      • error is returned by driver when we try to insert <-- works as expected with 2.7.12

      Actual result:

      • value is inserted (truncated) <-- 3.0 to 3.3.3

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              stephen.hames Stephen Hames
              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.