Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11267

connect jdbc null value problem remains

Details

    Description

      I just upgraded to 10.1.19 and recompiled the Java code for the JdbcInterface and ApacheInterface. The null behavior is different than 10.1.18 but still not correct.

      In 10.1.19 when you INSERT a row with NULL values specified for numeric or date/time column datatypes (all of their various forms) and then SELECT the result back, you will see that 0 was INSERTed.

      Note however that now in 10.1.19 if you issue an UPDATE statement with null values the behavior is now correct (when you select back you get NULLs for numbers and dates).

      Attachments

        Activity

          bertrandop Olivier Bertrand added a comment - - edited

          The difference is that UPDATE commands are just sent to the driver while INSERT are prepared statements. And the set parameter function did not test for null values.

          Waiting for the fix, a turnaround is to replace:

          insert into t1(col1,col2) values('hello',NULL);
          

          by:

          insert into t1(col1) values('hello');
          

          bertrandop Olivier Bertrand added a comment - - edited The difference is that UPDATE commands are just sent to the driver while INSERT are prepared statements. And the set parameter function did not test for null values. Waiting for the fix, a turnaround is to replace: insert into t1(col1,col2) values('hello',NULL); by: insert into t1(col1) values('hello');
          rdyas Robert Dyas added a comment -

          Great. Thank you!

          rdyas Robert Dyas added a comment - Great. Thank you!
          rdyas Robert Dyas added a comment -

          I just installed 10.1.20 and the problem with inserting null values remains.

          INSERT INTO atable (mynumericcol) VALUES (null);
          SELECT mynumericcol FROM atable

          the SELECT returns zero not null.

          rdyas Robert Dyas added a comment - I just installed 10.1.20 and the problem with inserting null values remains. INSERT INTO atable (mynumericcol) VALUES (null); SELECT mynumericcol FROM atable the SELECT returns zero not null.

          People

            bertrandop Olivier Bertrand
            rdyas Robert Dyas
            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.