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

Inconsistency in handling empty comments in direct vs prepared execution

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.11, 11.0(EOL)
    • 10.6, 10.11
    • Parser

    Description

      There is an inconsistency in handling comments between direct execution and prepared execution.

      Direct execution in 10.3 and 10.11 works as follow:

      • a. Executable comment, condition=TRUE

        MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
        ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
        

      • b. Executable comment, condition=FALSE

        MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
        Query OK, 0 rows affected (0.000 sec)
        

      • c. Non-executable comment

        MariaDB [test]> /* */;
        ERROR: No query specified
        

      So far so good.

      Prepared execution (see below) works differently, which is not good.
      Moreover, there is an unintentional change in prepared execution (most likely happened in 10.6 by MDEV-16708) - prepared execution in 10.11 for a statement consisting only of a non-executable comment returns OK, which became not consistent with direct execution.

      Prepared execution in 10.3:

      • a. Executible comment, condition=TRUE

        MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
        ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
        

      • b. Executable comment, condition=FALSE

        MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
        ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
        

      • c. Non-executable comment

        MariaDB [test]> EXECUTE IMMEDIATE '/* */';
        ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
        

      Notice, (b) and (c) work differently comparing to direct execution.

      Prepared execution in 10.11:

      • a. Executible comment, condition=TRUE

        MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
        ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
        

      • b. Executable comment, condition=FALSE

        MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
        Query OK, 0 rows affected (0.001 sec)
        

      • c. Non-executable comment

        MariaDB [test]> EXECUTE IMMEDIATE '/* */';
        Query OK, 0 rows affected (0.001 sec)
        

      Notice:

      • (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
      • (b) prepared execution (in 10.11) has changed since 10.3. Now it works like direct execution, which should be good.
      • (c) prepared execution (in 10.11) has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE

            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE -> OK
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE -> OK
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE -> OK
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE -> OK
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE -> OK
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE -> OK
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.

            Additionally:
            - (a) in 10.11 has also changed: it used to return a syntax error, now it returns an unknown column error. Possibly, this is fine. But the reason for this change should be investigated.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE -> OK
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.

            Additionally:
            - (a) in 10.11 has also changed: it used to return a syntax error, now it returns an unknown column error. Possibly, this is fine. But the reason for this change should be investigated.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.

            Additionally:
            - (a) in 10.11 has also changed: it used to return a syntax error, now it returns an unknown column error. Possibly, this is fine. But the reason for this change should be investigated.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error 10.3. The best choice would be to return an empty query error, like direct execution does.

            Additionally:
            - (a) in 10.11 has also changed: it used to return a syntax error, now it returns an unknown column error. Possibly, this is fine. But the reason for this change should be investigated.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. The best choice would be to return an empty query error, like direct execution does.

            Additionally:
            - (a) in 10.11 has also changed: it used to return a syntax error, now it returns an unknown column error. Possibly, this is fine. But the reason for this change should be investigated.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. The best choice would be to return an empty query error, like direct execution does.

            Additionally:
            - (a) in 10.11 has also changed: it used to return a syntax error, now it returns an unknown column error. Possibly, this is fine. But the reason for this change should be investigated.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.

            Additionally:
            - (a) in 10.11 has also changed: it used to return a syntax error, now it returns an unknown column error. Possibly, this is fine. But the reason for this change should be investigated.
            bar Alexander Barkov made changes -
            Labels regression-10.6
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1054 (42S22): Unknown column 'MariaDB' in 'field list'
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.

            Additionally:
            - (a) in 10.11 has also changed: it used to return a syntax error, now it returns an unknown column error. Possibly, this is fine. But the reason for this change should be investigated.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB:10.x does not ignore this*/;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB:10.x does not ignore this*/;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in prepared execution in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in prepared execution in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in prepared execution in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in prepared execution in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executable comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in prepared execution in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in prepared execution in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executable comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6, which was likely caused by MDEV-16708.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in prepared execution in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in prepared execution in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executable comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6 by MDEV-16708 - prepared execution for a statement consisting only of a non-executable comment returns OK, which became not consistent with direct execution.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in prepared execution in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in prepared execution in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executable comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution, most likely happened in 10.6 by MDEV-16708 - prepared execution for a statement consisting only of a non-executable comment returns OK, which became not consistent with direct execution.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in prepared execution in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in prepared execution in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executable comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution (most likely happened in 10.6 by MDEV-16708) - prepared execution in 10.11 for a statement consisting only of a non-executable comment returns OK, which became not consistent with direct execution.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in prepared execution in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in prepared execution in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            bar Alexander Barkov made changes -
            Description There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executable comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution (most likely happened in 10.6 by MDEV-16708) - prepared execution in 10.11 for a statement consisting only of a non-executable comment returns OK, which became not consistent with direct execution.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) in prepared execution in 10.11 has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) in prepared execution in 10.11 has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.
            There is an inconsistency in handling comments between direct execution and prepared execution.


            h1. Direct execution in 10.3 and 10.11 works as follow:

            - a. Executable comment, condition=TRUE
            {noformat}
            MariaDB [test]> /*M!50701 MariaDB-10.x does not ignore this */;
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> /*M!200101 MariaDB-10.x ignores this */;
            Query OK, 0 rows affected (0.000 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> /* */;
            ERROR: No query specified
            {noformat}

            So far so good.

            Prepared execution (see below) works differently, which is not good.
            Moreover, there is an unintentional change in prepared execution (most likely happened in 10.6 by MDEV-16708) - prepared execution in 10.11 for a statement consisting only of a non-executable comment returns OK, which became not consistent with direct execution.



            h1. Prepared execution in 10.3:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB:10.x does not ignore this*/';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB:10.x does not ignore this*/' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet
            {noformat}

            Notice, (b) and (c) work differently comparing to direct execution.

            h1. Prepared execution in 10.11:

            - a. Executible comment, condition=TRUE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!50701 MariaDB-10.x does not ignore this */';
            ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MariaDB-10.x does not ignore this */' at line 1
            {noformat}

            - b. Executable comment, condition=FALSE
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/*M!200101 MariaDB-10.x ignores this */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            - c. Non-executable comment
            {noformat}
            MariaDB [test]> EXECUTE IMMEDIATE '/* */';
            Query OK, 0 rows affected (0.001 sec)
            {noformat}

            Notice:
            - (a) works in the same way in both 10.3 and 10.11, in both direct and prepared execution.
            - (b) prepared execution (in 10.11) has changed since 10.3. Now it works like direct execution, which should be good.
            - (c) prepared execution (in 10.11) has changed since 10.3. Now it returns OK. It used to return an error in 10.3. It should be fixed. The best choice would be to return an empty query error, like direct execution does.

            I am working on this bug fix

            Debjyoti Debjyoti Ghosh added a comment - I am working on this bug fix
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.7 [ 24805 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.8 [ 26121 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.9 [ 26905 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.0 [ 28320 ]

            People

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