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

Query using IN with 1000+ varbinary bound parameters ignores trailing whitespace

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 2.0.14, 3.0.2, 3.1.1
    • N/A
    • General
    • None
    • Centos 7, Mariadb Server 10.3.15 and 10.3.12. Perl 5.16.3, perl-DBD-ODBC 1.50-3

    Description

      When executing a query with 1000 or more bound parameters on a varbinary field such as:

      SELECT c1 FROM table WHERE c1 IN (?,?....
      

      Any record that happens to have a trailing space is not returned.
      If you execute the query 999 bound parameters, all records are returned.

      /etc/odbcinst.ini contains:

      [MariaDB]
      Description     = ODBC for MaridDB
      Driver          = /usr/lib/libmaodbc.so
      FileUsage       = 1
      

      Attached is a perl script to reproduce the bug.

      The perl test creates a table with a varbinary field, adds 999 records with every second one having a trailing space. Queries with 999 bound parameters, then repeats the query with 1000 bound parameters, of which the last one doesn't exist. It doesn't matter if I add another record and include it in the bound parameters, it's the fact that there are now 1000 that affects the results.

      Output from perl script:

      $ perl ./trim_in_test.pl -host=127.0.0.1 -driver={MariaDB} -user=test -passw
      ord=password
      Connecting to database
      Creating table test_trim_in
      Inserting 999 records
      .......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
      Reading records
      Records expected 999, Got 999
       
      Reading records
      Records expected 999, Got 499
      Didn't get all rows from server (499) at ./trim_in_test.pl line 83.
      

      The reason why I've logged this under ODBC is because the test script works with perl-DBD-MySQL

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            peter.botha Peter Botha
            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.