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

ResultSet.getString() of PreparedStatement return NULL When TIME column value=00:00:00

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.4.6
    • 1.5.2
    • Other
    • None

    Description

      This bug is similar to CONJ-226, but this bug effects getString(), rather than getTime().

      I've attached a test program similar to the JUnit test case in CONJ-226 to demonstrate the behavior. To make it work, first, you would need to perform some setup steps:

      create table db1.time_test (
      ID int unsigned NOT NULL,
      time_test time NOT NULL,
      PRIMARY KEY (ID)
      ) engine=InnoDB;
       
      insert into db1.time_test(id, time_test) values(1, '00:00:00'), (2, '08:00:00');
      

      Then build and execute the program:

      $ javac -cp .:/home/ec2-user/mariadb-jdbc-1.4.6/jar/mariadb-java-client-1.4.6.jar MariaDbJdbcDriverTest.java
      $ java -cp .:/home/ec2-user/mariadb-jdbc-1.4.6/jar/mariadb-java-client-1.4.6.jar MariaDbJdbcDriverTest
      

      Example output:

      ID: 1, Time: 00:00:00
      Testing PreparedStatement with getTime()
      ID: 1, Time: 00:00:00
      Testing Statement with getString()
      ID: 1, Time: 00:00:00
      Testing PreparedStatement with getString()
      ID: 1, Time: null
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            GeoffMontee Geoff Montee (Inactive)
            Votes:
            1 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.