Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-572

random failure of mthd_my_read_query_result() with connector-c > 3.1.7 and server >= 10.5

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Incomplete
    • 3.2.5
    • N/A
    • Other
    • None
    • Windows 10 x64 latest

    Description

      In MDEV-17832 support was added for extended type info.

      Since this change I have random errors coming from mthd_my_read_query_result() and in it db_read_rows() when using connector-c 3.1.8 and higher. Using 3.1.7 no errors are present.

      From 3.1.8 onwards ma_result_set_rows() returns 9 when using server 10.5.2 or greater.

      So db_read_rows() wants to read 9 fields, always. The error comes from the server is sending sometimes less the 9 fields! When the client reads the field = 8 data it then reads past the packet size and reads random data. The function exits with:
      SET_CLIENT_ERROR(mysql, CR_UNKNOWN_ERROR, SQLSTATE_UNKNOWN, 0);

      I think the problem originates in the server function has_extended_metadata() in file sql/sql_type.h

      The function Protocol_text::store_field_metadata() uses has_extended_metadata() to decide to send 6 or more fields depending on m_attr[i].str being not null. I suppose there are cases when all three m_attr[i].str are null, which results in sending 6 fields in stead of the expected 9.

      Could mr. Alexander Barkov look at this issue?

      Attachments

        Issue Links

          Activity

            People

              georg Georg Richter
              ferdo Ferdinand Oeinck
              Votes:
              0 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.