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

COERCIBILITY() returns different results in prepared vs direct execution

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.5.36, 10.0.10
    • 5.5(EOL)
    • None

    Description

      COERCIBILITY() returns different results in prepared vs direct
      execution in some tricky cases, e.g. conversion of a temporal
      hybrid function to a non-ASCII character set:

      mysql> SET NAMES utf8, collation_connection=utf16_general_ci;
      Query OK, 0 rows affected (0.00 sec)
       
      mysql> SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
      +-----------------------------------------------------------------------+
      | COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)) |
      +-----------------------------------------------------------------------+
      |                                                                     4 |
      +-----------------------------------------------------------------------+
      1 row in set (3.24 sec)
       
      mysql> PREPARE stmt FROM "SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))";
      Query OK, 0 rows affected (0.00 sec)
      Statement prepared
       
      mysql> EXECUTE stmt;
      +-----------------------------------------------------------------------+
      | COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)) |
      +-----------------------------------------------------------------------+
      |                                                                     2 |
      +-----------------------------------------------------------------------+
      1 row in set (0.00 sec)
       

      This, in particular, make some tests fail in --ps mode but pass in "normal" mode:
      http://buildbot.askmonty.org/buildbot/builders/bld-dan-debug/builds/985/steps/test_1/logs/stdio

      Prepared execution should be fixed to return the same results with direct execution.

      Attachments

        Activity

          bar Alexander Barkov created issue -
          bar Alexander Barkov made changes -
          Field Original Value New Value
          Description COERCIBILITY() returns different results in prepared vs direct
          execution in some tricky cases, e.g. conversion of a temporal
          hybrid function to a non-ASCII character set:

          {code}
          mysql> SET NAMES utf8, collation_connection=utf16_general_ci;
          Query OK, 0 rows affected (0.00 sec)

          mysql> SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
          +-----------------------------------------------------------------------+
          | COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)) |
          +-----------------------------------------------------------------------+
          | 4 |
          +-----------------------------------------------------------------------+
          1 row in set (3.24 sec)

          mysql> PREPARE stmt FROM "SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))";
          Query OK, 0 rows affected (0.00 sec)
          Statement prepared

          mysql> EXECUTE stmt;
          +-----------------------------------------------------------------------+
          | COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)) |
          +-----------------------------------------------------------------------+
          | 2 |
          +-----------------------------------------------------------------------+
          1 row in set (0.00 sec)

          {code}

          This, in particular, make some tests fail:
          http://buildbot.askmonty.org/buildbot/builders/bld-dan-debug/builds/985/steps/test_1/logs/stdio
          COERCIBILITY() returns different results in prepared vs direct
          execution in some tricky cases, e.g. conversion of a temporal
          hybrid function to a non-ASCII character set:

          {code}
          mysql> SET NAMES utf8, collation_connection=utf16_general_ci;
          Query OK, 0 rows affected (0.00 sec)

          mysql> SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
          +-----------------------------------------------------------------------+
          | COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)) |
          +-----------------------------------------------------------------------+
          | 4 |
          +-----------------------------------------------------------------------+
          1 row in set (3.24 sec)

          mysql> PREPARE stmt FROM "SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))";
          Query OK, 0 rows affected (0.00 sec)
          Statement prepared

          mysql> EXECUTE stmt;
          +-----------------------------------------------------------------------+
          | COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)) |
          +-----------------------------------------------------------------------+
          | 2 |
          +-----------------------------------------------------------------------+
          1 row in set (0.00 sec)

          {code}

          This, in particular, make some tests fail in --ps mode but pass in "normal" mode:
          http://buildbot.askmonty.org/buildbot/builders/bld-dan-debug/builds/985/steps/test_1/logs/stdio

          Prepared execution should be fixed to return the same results with direct execution.

          Make sure to remove "--disable_ps_protocol" in mysql-test/include/ctype_datetime.inc after fixing this bug

          bar Alexander Barkov added a comment - Make sure to remove "--disable_ps_protocol" in mysql-test/include/ctype_datetime.inc after fixing this bug

          Also reproducible on MySQL 5.6.

          elenst Elena Stepanova added a comment - Also reproducible on MySQL 5.6.
          elenst Elena Stepanova made changes -
          Fix Version/s 10.0.11 [ 15200 ]
          Fix Version/s 5.5.38 [ 15400 ]
          Affects Version/s 5.5.36 [ 14600 ]
          Affects Version/s 10.0.10 [ 14500 ]
          Labels upstream
          Priority Major [ 3 ] Minor [ 4 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.0.12 [ 15201 ]
          Fix Version/s 10.0.11 [ 15200 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 5.5.39 [ 15800 ]
          Fix Version/s 5.5.38 [ 15400 ]
          serg Sergei Golubchik made changes -
          Workflow defaullt [ 31520 ] MariaDB v2 [ 44625 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.0.13 [ 16000 ]
          Fix Version/s 10.0.12 [ 15201 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 44625 ] MariaDB v3 [ 61785 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 61785 ] MariaDB v4 [ 139566 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.0 [ 16000 ]

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.