summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-06-10 21:19:11 +0200
committerSergei Golubchik <serg@mariadb.org>2018-06-11 09:57:54 +0200
commitca733d03c82b02cd842ff2a226fee7b12eb86f8d (patch)
treeac878106b55360704058ca5d5772bd2bce7594b5 /mysql-test
parent6da8192174f033c2958ddafb2a15c14360bb1ecc (diff)
downloadmariadb-git-ca733d03c82b02cd842ff2a226fee7b12eb86f8d.tar.gz
MDEV-15729 Server crashes in Field::make_field upon HANDLER READ executed with PS protocol
update table->pos_in_table_list during prepare, just like it's done in normal execution. otherwise it'll be a dangling pointer
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/handler/ps.result9
-rw-r--r--mysql-test/suite/handler/ps.test11
2 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/suite/handler/ps.result b/mysql-test/suite/handler/ps.result
new file mode 100644
index 00000000000..54685f9156b
--- /dev/null
+++ b/mysql-test/suite/handler/ps.result
@@ -0,0 +1,9 @@
+create table t1 (i int);
+handler test.t1 open handler_a;
+flush status;
+handler handler_a read first;
+i
+show status like 'Com_stmt_prepare%';
+Variable_name Value
+Com_stmt_prepare OK
+drop table t1;
diff --git a/mysql-test/suite/handler/ps.test b/mysql-test/suite/handler/ps.test
new file mode 100644
index 00000000000..68091190c85
--- /dev/null
+++ b/mysql-test/suite/handler/ps.test
@@ -0,0 +1,11 @@
+#
+# MDEV-15729 Server crashes in Field::make_field upon HANDLER READ executed with PS protocol
+#
+create table t1 (i int);
+handler test.t1 open handler_a;
+flush status;
+handler handler_a read first;
+# handler...read must be prepared in --ps-protocol mode
+--replace_result $PS_PROTOCOL OK
+show status like 'Com_stmt_prepare%';
+drop table t1;