Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19499

Prepared statements with 1000 binary parameters and utf8 collation returns no data

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3.3, 10.3(EOL), 10.4(EOL)
    • 10.4(EOL)
    • None
    • docker image, utf8 collation, prepared statement with > 999 binary parameters.

    Description

      Since MariaDB 10.3.3 executing prepared statement with more than 999 parameters (binary blobs) return empty data set and no errors if utf8 collation is used and binary blobs contain non ASCII characters (symbols with codes of 128 or higher).

      Same query with 999 parameters works fine, having 1000 parameters returns no data.
      Same query with ASCII data works fine, having at least one byte >= 128 returns no data.
      Same query on connection with collation latin1 works fine, using utf8 returns no data.

      Go proof of concept app

      We have stumbled on this bug after upgrade to MariaDB 10.3 on our service written in go. Simple go application to reproduce the problem is attached to the issue. Application will spin MariaDB server docker container and execute same query with 999 and 1000 parameters to show the issue. It will try multiple MariaDB versions. Same issue is not present in latest MySQL servers or MariaDB < 10.3.3.

      C proof of concept app

      Digging deeper into the issue I was able to reproduce it in C code. Demo code attached to the issue (builds with clang main.c -o main `mysql_config --cflags` `mysql_config --libs`).

      C app will not spawn any docker containers and expect MariaDB running on localhost:3306.

      Attachments

        1. main.go
          3 kB
        2. main.c
          3 kB

        Activity

          People

            bar Alexander Barkov
            fln Julius
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.