Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5080

jdbc adapter "zeroDateTimeBehavior=convertToNull" Causes "enumerable" to get stuck

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core, jdbc-adapter, jdbc-driver
    • None

    Description

      We have a data set stored in Tidb (a distributed mysql database), a field in the database is Timestamp type, there will be data items such as 0000-00-00 00:00:00
      If the jdbc connection parameter does not add the zeroDateTimeBehavior=xx command, the query will report an error, but the zeroDateTimeBehavior=convertToNull command seems to cause the “Enumerable bind” process to freeze and the query does not respond.

      SQL:

      select * from `catalog_name`.`database_name`.`table_name` limit 1;

       

      zeroDateTimeBehavior=round will be ok

       

      {
          "version":"1.0",
          "defaultSchema":"icuser",
          "schemas":[
              {
                  "name":"tidb_test",
                  "type":"custom",
                  "factory":"com.xxxx.TidbCatalogSchema$Factory",
                  "operand":{
                      "jdbcDriver":"com.mysql.cj.jdbc.Driver",
                      "jdbcUrl":"jdbc:mysql://xxxxxx:4037/xx? zeroDateTimeBehavior=round ",
                      "jdbcUser":"mysql",
                      "jdbcPassword":"mysql"
                  }
              }
          ]
      }

       

       

       

      zeroDateTimeBehavior=convertToNull will cause stuck

       

      {
          "version": "1.0",
          "defaultSchema": "icuser",
          "schemas": [{
              "name": "tidb_test",
              "type": "custom",
              "factory": "com.xxxx.TidbCatalogSchema$Factory",
              "operand": {
                  "jdbcDriver": "com.mysql.cj.jdbc.Driver",
                  "jdbcUrl": "jdbc:mysql://xxxxxx:4037/xx? zeroDateTimeBehavior=convertToNull",
                  "jdbcUser": "mysql",
                  "jdbcPassword": "mysql"            
              }        
          }    ]
      }

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            itxiangkui itxiangkui
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: