summaryrefslogtreecommitdiff
path: root/mysql-test/main/sp.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-06 09:00:52 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-06 09:00:52 +0200
commit2a791c53ad93c8bc1441dd227000234bd49c4990 (patch)
tree4c52ad715c99bd3c6681771d7cb77d451a34e216 /mysql-test/main/sp.test
parentb5c72a843abee033e9ea6028e1a109f03afc4455 (diff)
parent723ffdb32ee785cbc511abc457eb70d41c2fcce3 (diff)
downloadmariadb-git-2a791c53ad93c8bc1441dd227000234bd49c4990.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/main/sp.test')
-rw-r--r--mysql-test/main/sp.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index 230e9c8bb18..1000f172931 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -9352,6 +9352,47 @@ CALL sp;
DROP PROCEDURE sp;
DROP TABLE t1;
+--echo #
+--echo # MDEV-17055: Server crashes in find_order_in_list upon
+--echo # 2nd (3rd) execution of SP with UPDATE
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (c INT);
+
+CREATE PROCEDURE sp() UPDATE v1 SET a = 1 ORDER BY a, b LIMIT 1;
+LOCK TABLE t2 READ;
+--error ER_TABLE_NOT_LOCKED
+CALL sp;
+UNLOCK TABLES;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+
+# Cleanup
+DROP PROCEDURE sp;
+
+CREATE PROCEDURE sp() UPDATE v1 SET a = 1 WHERE a=1 and b=2;
+LOCK TABLE t2 READ;
+--error ER_TABLE_NOT_LOCKED
+CALL sp;
+UNLOCK TABLES;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+
+# Cleanup
+DROP PROCEDURE sp;
+
+DROP VIEW v1;
+DROP TABLE t1, t2;
--echo # End of 5.5 test