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

Driver (?mariadb server) returns wrong column nullability in ResultSet

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5, 11.7(EOL)
    • 10.5
    • None
    • None

    Description

      Table schema

      create table table1(idi1 int not null, idf1 int not null);
      create table table2(idi2 int not null, idf2 int not null);
      create table table3(idi3 int not null, idf3 int not null);
      insert into table1 values(1,2);
      insert into table1 values(2,3);
      insert into table1 values(3,4);
      

      Problem description

      Knowledge of ResultSet column nullability is crucial for convenient developer experience (application stability too).
      I looked at the driver code associated with nullability, and it seems like driver reach nullability throw network protocol.
      I found simple case, where driver fails with nullability:

      var pStmt = connection.prepareStatement("""
          select idi1, idi2, idi3
          from table1 t1
              left join table2 t2 on t1.idf1 = t2.idi2
              inner join table3 t3 on t2.idf2 = t3.idi3
          """);
       
      var metaData = pStmt.getMetaData();
      Assertions.assertEquals(0, metaData.isNullable(1)); // return 0
      Assertions.assertEquals(0, metaData.isNullable(2)); // return 1
      Assertions.assertEquals(0, metaData.isNullable(3)); // return 0
      

      So, Oracle give correct answer.

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            dgorodetskiy Gorodetskiy Dmitry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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