diff options
author | Dmitry Shulga <dmitry.shulga@mariadb.com> | 2021-04-22 14:52:19 +0700 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-06-17 19:30:24 +0200 |
commit | 9370c6e83c148b4a5d4f08de7778e6a02da6adcb (patch) | |
tree | 6ac6bc49f94378351383cd7bf3b3462f52de613e /mysql-test/main/sp-dynamic.result | |
parent | f778a5d5e2aaff7c58000f9e2423a809db14747c (diff) | |
download | mariadb-git-9370c6e83c148b4a5d4f08de7778e6a02da6adcb.tar.gz |
MDEV-16708: Unsupported commands for prepared statements
Withing this task the following changes were made:
- Added sending of metadata info in prepare phase for the admin related
command (check table, checksum table, repair, optimize, analyze).
- Refactored implmentation of HELP command to support its execution in
PS mode
- Added support for execution of LOAD INTO and XA- related statements
in PS mode
- Modified mysqltest.cc to run statements in PS mode unconditionally
in case the option --ps-protocol is set. Formerly, only those statements
were executed using PS protocol that matched the hard-coded regular expression
- Fixed the following issues:
The statement
explain select (select 2)
executed in regular and PS mode produces different results:
MariaDB [test]> prepare stmt from "explain select (select 2)";
Query OK, 0 rows affected (0,000 sec)
Statement prepared
MariaDB [test]> execute stmt;
+------+-------------+-------+------+---------------+------+---------+------+------+----------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------+------+---------------+------+---------+------+------+----------------+
| 1 | PRIMARY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | No tables used |
| 2 | SUBQUERY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | No tables used |
+------+-------------+-------+------+---------------+------+---------+------+------+----------------+
2 rows in set (0,000 sec)
MariaDB [test]> explain select (select 2);
+------+-------------+-------+------+---------------+------+---------+------+------+----------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------+------+---------------+------+---------+------+------+----------------+
| 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | No tables used |
+------+-------------+-------+------+---------------+------+---------+------+------+----------------+
1 row in set, 1 warning (0,000 sec)
In case the statement
CREATE TABLE t1 SELECT * FROM (SELECT 1 AS a, (SELECT a+0)) a
is run in PS mode it fails with the error
ERROR 1054 (42S22): Unknown column 'a' in 'field list'.
- Uniform handling of read-only variables both in case the SET var=val
statement is executed as regular or prepared statememt.
- Fixed assertion firing on handling LOAD DATA statement for temporary tables
- Relaxed assert condition in the function lex_end_stage1() by adding
the commands SQLCOM_ALTER_EVENT, SQLCOM_CREATE_PACKAGE,
SQLCOM_CREATE_PACKAGE_BODY to a list of supported command
- Removed raising of the error ER_UNSUPPORTED_PS in the function
check_prepared_statement() for the ALTER VIEW command
- Added initialization of the data memember st_select_lex_unit::last_procedure
(assign NULL value) in the constructor
Without this change the test case main.ctype_utf8 fails with the following
report in case it is run with the optoin --ps-protocol.
mysqltest: At line 2278: query 'VALUES (_latin1 0xDF) UNION VALUES(_utf8'a' COLLATE utf8_bin)' failed: 2013: Lost connection
- The following bug reports were fixed:
MDEV-24460: Multiple rows result set returned from stored
routine over prepared statement binary protocol is
handled incorrectly
CONC-519: mariadb client library doesn't handle server_status and
warnign_count fields received in the packet
COM_STMT_EXECUTE_RESPONSE.
Reasons for these bug reports have the same nature and caused by
missing loop iteration on results sent by server in response to
COM_STMT_EXECUTE packet.
Enclosing of statements for processing of COM_STMT_EXECUTE response
in the construct like
do
{
...
} while (!mysql_stmt_next_result());
fixes the above mentioned bug reports.
Diffstat (limited to 'mysql-test/main/sp-dynamic.result')
-rw-r--r-- | mysql-test/main/sp-dynamic.result | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/mysql-test/main/sp-dynamic.result b/mysql-test/main/sp-dynamic.result index 9fa3bea1108..ad11763b523 100644 --- a/mysql-test/main/sp-dynamic.result +++ b/mysql-test/main/sp-dynamic.result @@ -64,9 +64,8 @@ execute stmt; deallocate prepare stmt; end| call p1()| -ERROR HY000: This command is not supported in the prepared statement protocol yet call p1()| -ERROR HY000: This command is not supported in the prepared statement protocol yet +ERROR 42000: PROCEDURE p2 already exists drop procedure p1| create procedure p1() begin @@ -75,9 +74,8 @@ execute stmt; deallocate prepare stmt; end| call p1()| -ERROR HY000: This command is not supported in the prepared statement protocol yet call p1()| -ERROR HY000: This command is not supported in the prepared statement protocol yet +ERROR 42000: PROCEDURE test.p2 does not exist drop procedure p1| create procedure p1() begin @@ -295,15 +293,15 @@ select * from t1| id stmt_text status 1 select 1 supported 2 flush tables supported -3 handler t1 open as ha not supported +3 handler t1 open as ha supported 4 analyze table t1 supported -5 check table t1 not supported +5 check table t1 supported 6 checksum table t1 supported -7 check table t1 not supported +7 check table t1 supported 8 optimize table t1 supported 9 repair table t1 supported 10 describe extended select * from t1 supported -11 help help not supported +11 help help supported 12 show databases supported 13 show tables supported 14 show table status supported @@ -316,7 +314,7 @@ id stmt_text status 21 call p1() supported 22 foo bar syntax error 23 create view v1 as select 1 supported -24 alter view v1 as select 2 not supported +24 alter view v1 as select 2 supported 25 drop view v1 supported 26 create table t2 (a int) supported 27 alter table t2 add (b int) supported |