Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-162

SQLNumResultCols returns zero for query with long data and CTE

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 3.0.5
    • 2.0.17, 3.0.6
    • General
    • None

    Description

      Driver somehow returns 0 colmns for this query. Same query works correctly with MySQL 8.0/MySQL ODBC Connector 8.0

      with x as (
          select 1 as `val`
          union all
          select 2 as `val`
          union all
          select 3 as `val`
      )
      select repeat(cast(x.val as nchar), x.val * 12000) as `string`
           , repeat(cast(x.val as char), x.val * 12000) as `c_string`
           , cast(repeat(char(x.val), x.val * 12000) as binary) as `binary`
           , x.val as `index`
      from x;
      

      Relevant part of the trace log:

      [ODBC][459][1531695923.138711][SQLExecDirectW.c][177]
      		Entry:
      			Statement = 0x7f4e0a6d9700
      			SQL = [
                          with x as (
                              select 1 as `val`
                              union all
                         ...][length = 594]
      [ODBC][459][1531695923.140973][SQLExecDirectW.c][445]
      		Exit:[SQL_SUCCESS]
      [ODBC][459][1531695923.140991][SQLNumResultCols.c][156]
      		Entry:
      			Statement = 0x7f4e0a6d9700
      			Column Count = 0x7f4e0a5fa5d4
      [ODBC][459][1531695923.140999][SQLNumResultCols.c][251]
      		Exit:[SQL_SUCCESS]
      			Count = 0x7f4e0a5fa5d4 -> 0
      

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            nazarmx Nazar Mishturak
            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.