summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-03-05 17:43:30 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2018-03-05 17:43:30 +0100
commit96b3872bc5b8a80d17809ed691f04108f0358160 (patch)
tree656415830124eb61417165af3f0c9c637cb95fc0 /mysql-test/t
parent8f98835bb86550a68a6c412d8417cc169dfdc206 (diff)
downloadmariadb-git-bb-10.3-MDEV-15328.tar.gz
MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM LAST_INSERT_ID ()bb-10.3-MDEV-15328
There is not current SELECT during assigning SP parameters, do not use it if current_select is empty.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/query_cache.test15
-rw-r--r--mysql-test/t/sp.test10
2 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index c354032bc36..1b1e24bc6f4 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -1767,6 +1767,21 @@ show status like "Qcache_inserts";
show status like "Qcache_hits";
drop table t1;
+--echo #
+--echo # MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM
+--echo # LAST_INSERT_ID ()
+--echo # (part 2, part 1 is in sp.test)
+--echo #
+
+create table t1 (a int);
+insert into t1 values (1);
+CREATE FUNCTION foo (i INT UNSIGNED ) RETURNS int deterministic RETURN 1;
+show status like "Qcache_queries_in_cache";
+SELECT foo( LAST_INSERT_ID() ) from t1;
+show status like "Qcache_queries_in_cache";
+DROP FUNCTION foo;
+drop table t1;
+
--echo restore defaults
SET GLOBAL query_cache_type= default;
SET GLOBAL query_cache_size= default;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 68a0c060906..529ebd4736a 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9840,3 +9840,13 @@ call p3();
drop procedure p1;
drop procedure p2;
drop procedure p3;
+
+--echo #
+--echo # MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM
+--echo # LAST_INSERT_ID ()
+--echo # (part 1, part 2 is in query_cache.test)
+--echo #
+
+CREATE PROCEDURE foo ( IN i INT UNSIGNED ) BEGIN END;
+CALL foo( LAST_INSERT_ID() );
+DROP PROCEDURE foo;