summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/search_pattern_in_file.inc3
-rwxr-xr-xmysql-test/mysql-test-run.pl10
-rw-r--r--mysql-test/r/sp.result28
-rw-r--r--mysql-test/r/view.result35
-rw-r--r--mysql-test/suite/innodb/r/innodb-enlarge-blob.result32
-rw-r--r--mysql-test/suite/innodb/r/table_flags.result1
-rw-r--r--mysql-test/suite/innodb/t/innodb-enlarge-blob.opt3
-rw-r--r--mysql-test/suite/innodb/t/innodb-enlarge-blob.test33
-rw-r--r--mysql-test/suite/innodb/t/table_flags.test5
-rw-r--r--mysql-test/t/sp.test31
-rw-r--r--mysql-test/t/view.test38
11 files changed, 157 insertions, 62 deletions
diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc
index 3c5529989bb..21192b55efb 100644
--- a/mysql-test/include/search_pattern_in_file.inc
+++ b/mysql-test/include/search_pattern_in_file.inc
@@ -76,5 +76,6 @@ perl;
my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND";
$ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1};
print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n";
- exit $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/;
+ die "$ENV{SEARCH_ABORT}\n"
+ if $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/;
EOF
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 70a2b049fc0..a931381d9cc 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -5052,6 +5052,11 @@ sub mysqld_start ($$) {
}
}
+ # "Dynamic" version of MYSQLD_CMD is reevaluated with each mysqld_start.
+ # Use it to restart the server at testing a failing server start (e.g
+ # due to incompatible options).
+ $ENV{'MYSQLD_LAST_CMD'}= "$exe @$args";
+
if ( $opt_gdb || $opt_manual_gdb )
{
gdb_arguments(\$args, \$exe, $mysqld->name());
@@ -5148,11 +5153,6 @@ sub mysqld_start ($$) {
# Remember options used when starting
$mysqld->{'started_opts'}= $extra_opts;
- # "Dynamic" version of MYSQLD_CMD is reevaluated with each mysqld_start.
- # Use it to restart the server at testing a failing server start (e.g
- # due to incompatible options).
- $ENV{'MYSQLD_LAST_CMD'}= "$exe @$args";
-
return;
}
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index f4e7a729367..a1af26cdda0 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -8088,6 +8088,34 @@ CALL sp1();
CALL sp1();
drop user 'foo'@'%';
drop procedure sp1;
+#
+# MDEV-10972: Insert from select / view / union --
+# repeatable crash in 10.1, 10.2 Linux/Mac/Windows
+#
+create table t (id int auto_increment primary key);
+insert into t values (9494),(9495),(9496),(9497),(9498),(9499),(9500),(9501),(9502),(9503);
+create VIEW v AS
+select id from t
+union
+select id from t
+;
+drop procedure if exists p;
+Warnings:
+Note 1305 PROCEDURE test.p does not exist
+create procedure p()
+insert into tmp_t select t.id from (
+select id from v
+union
+select id from v
+) sq
+inner join t on (sq.id = t.id);
+CALL p();
+ERROR 42S02: Table 'test.tmp_t' doesn't exist
+create table tmp_t (id int null);
+CALL p();
+drop procedure p;
+drop view v;
+drop table t, tmp_t;
#End of 10.1 tests
#
# MDEV-11081: CURSOR for query with GROUP BY
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index d0d57e1b1e9..8767b737ca7 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -6603,6 +6603,41 @@ use test;
drop database test_db;
drop user foo@localhost;
#
+# MDEV-13523: Group By in a View, called within a Stored Routine
+# causes Error Code 1356 when a non-root user runs the routine for
+# a second time
+#
+CREATE DATABASE bugTest;
+USE bugTest;
+CREATE TABLE `procViewTable` (`id` int(10), `someText` varchar(50) NOT NULL);
+insert into `procViewTable` values (1,'Test'), (2,'Test 2');
+CREATE USER 'procView'@'%';
+GRANT ALL PRIVILEGES ON `bugTest`.* TO 'procView'@'%';
+CREATE DEFINER=`procView`@`%` VIEW `procViewSimple` AS (
+select * from (
+select `id` from `bugTest`.`procViewTable`
+ ) `innerQuery`
+ group by `innerQuery`.`id`
+);
+connect con1,localhost,procView,,;
+use bugTest;
+prepare stmt from "SELECT * FROM procViewSimple";
+execute stmt;
+id
+1
+2
+execute stmt;
+id
+1
+2
+disconnect con1;
+connection default;
+drop user procView;
+drop view procViewSimple;
+drop table procViewTable;
+use test;
+drop database bugTest;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/suite/innodb/r/innodb-enlarge-blob.result b/mysql-test/suite/innodb/r/innodb-enlarge-blob.result
index e74e954e360..8c8e9cf5007 100644
--- a/mysql-test/suite/innodb/r/innodb-enlarge-blob.result
+++ b/mysql-test/suite/innodb/r/innodb-enlarge-blob.result
@@ -1,37 +1,17 @@
-CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB DEFAULT CHARSET=UTF8 ROW_FORMAT=DYNAMIC;
+CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
Level Code Message
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B');
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-UPDATE t1 SET a=CONCAT(a, RAND(), a);
+INSERT INTO t1 SET a=CONCAT('A', SPACE(8000), 'B');
+INSERT INTO t1 SELECT a FROM t1;
UPDATE t1 SET a=CONCAT(a, RAND(), a);
UPDATE t1 SET a=CONCAT(a, RAND(), a);
SELECT * from t1;
DROP TABLE t1;
-CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB DEFAULT CHARSET=UTF8 ROW_FORMAT=REDUNDANT;
+CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB ROW_FORMAT=DYNAMIC;
SHOW WARNINGS;
Level Code Message
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B');
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-UPDATE t1 SET a=CONCAT(a, RAND(), a);
+INSERT INTO t1 SET a=CONCAT('A', SPACE(8000), 'B');
+INSERT INTO t1 SELECT a FROM t1;
UPDATE t1 SET a=CONCAT(a, RAND(), a);
UPDATE t1 SET a=CONCAT(a, RAND(), a);
SELECT * from t1;
diff --git a/mysql-test/suite/innodb/r/table_flags.result b/mysql-test/suite/innodb/r/table_flags.result
index fdb2898dc81..0d636d84529 100644
--- a/mysql-test/suite/innodb/r/table_flags.result
+++ b/mysql-test/suite/innodb/r/table_flags.result
@@ -181,7 +181,6 @@ a
SELECT * FROM tp;
a
DROP TABLE tr,tc,td,tz,tp;
-ib_buffer_pool
ib_logfile0
ib_logfile1
ibdata1
diff --git a/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt b/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
index 083a93dfc07..2f9bf78f82e 100644
--- a/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
+++ b/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
@@ -1,5 +1,4 @@
--innodb-file-per-table
--innodb-buffer-pool-size=32M
---innodb-log-file-size=32M
+--innodb-page-size=64k
--innodb-strict-mode=OFF
-
diff --git a/mysql-test/suite/innodb/t/innodb-enlarge-blob.test b/mysql-test/suite/innodb/t/innodb-enlarge-blob.test
index 84c23465a5c..65a64d299be 100644
--- a/mysql-test/suite/innodb/t/innodb-enlarge-blob.test
+++ b/mysql-test/suite/innodb/t/innodb-enlarge-blob.test
@@ -1,24 +1,13 @@
--source include/have_innodb.inc
---source include/innodb_page_size.inc
#
# MDEV-13227: Assertion failure len < 16384 in file rem0rec.cc line 1285
# Crashes with innodb_page_size=64K. Does not crash at <= 32K.
#
-CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB DEFAULT CHARSET=UTF8 ROW_FORMAT=DYNAMIC;
+CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B');
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-UPDATE t1 SET a=CONCAT(a, RAND(), a);
+INSERT INTO t1 SET a=CONCAT('A', SPACE(8000), 'B');
+INSERT INTO t1 SELECT a FROM t1;
UPDATE t1 SET a=CONCAT(a, RAND(), a);
UPDATE t1 SET a=CONCAT(a, RAND(), a);
# random data no output we are only interested if fails
@@ -27,20 +16,10 @@ SELECT * from t1;
--enable_result_log
DROP TABLE t1;
-CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB DEFAULT CHARSET=UTF8 ROW_FORMAT=REDUNDANT;
+CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB ROW_FORMAT=DYNAMIC;
SHOW WARNINGS;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B');
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
-UPDATE t1 SET a=CONCAT(a, RAND(), a);
+INSERT INTO t1 SET a=CONCAT('A', SPACE(8000), 'B');
+INSERT INTO t1 SELECT a FROM t1;
UPDATE t1 SET a=CONCAT(a, RAND(), a);
UPDATE t1 SET a=CONCAT(a, RAND(), a);
# random data no output we are only interested if fails
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test
index c64ff5ace20..2c0b55bcaae 100644
--- a/mysql-test/suite/innodb/t/table_flags.test
+++ b/mysql-test/suite/innodb/t/table_flags.test
@@ -204,6 +204,11 @@ DROP TABLE tr,tc,td,tz,tp;
--let $restart_parameters=
--source include/restart_mysqld.inc
+--error 0,1
+--remove_file $bugdir/ibtmp1
+--error 0,1
+--remove_file $bugdir/ib_buffer_pool
+
--list_files $bugdir
--remove_files_wildcard $bugdir
--rmdir $bugdir
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 4b7ee3723db..94d779de203 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9549,6 +9549,37 @@ CALL sp1();
drop user 'foo'@'%';
drop procedure sp1;
+--echo #
+--echo # MDEV-10972: Insert from select / view / union --
+--echo # repeatable crash in 10.1, 10.2 Linux/Mac/Windows
+--echo #
+
+create table t (id int auto_increment primary key);
+insert into t values (9494),(9495),(9496),(9497),(9498),(9499),(9500),(9501),(9502),(9503);
+
+create VIEW v AS
+select id from t
+union
+select id from t
+;
+
+drop procedure if exists p;
+create procedure p()
+insert into tmp_t select t.id from (
+ select id from v
+ union
+ select id from v
+) sq
+inner join t on (sq.id = t.id);
+
+--error ER_NO_SUCH_TABLE
+CALL p();
+create table tmp_t (id int null);
+CALL p();
+
+drop procedure p;
+drop view v;
+drop table t, tmp_t;
--echo #End of 10.1 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index c24cb502d7b..fc6ee46c1ac 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -6313,6 +6313,44 @@ drop database test_db;
drop user foo@localhost;
--echo #
+--echo # MDEV-13523: Group By in a View, called within a Stored Routine
+--echo # causes Error Code 1356 when a non-root user runs the routine for
+--echo # a second time
+--echo #
+
+CREATE DATABASE bugTest;
+USE bugTest;
+
+CREATE TABLE `procViewTable` (`id` int(10), `someText` varchar(50) NOT NULL);
+insert into `procViewTable` values (1,'Test'), (2,'Test 2');
+
+CREATE USER 'procView'@'%';
+GRANT ALL PRIVILEGES ON `bugTest`.* TO 'procView'@'%';
+
+CREATE DEFINER=`procView`@`%` VIEW `procViewSimple` AS (
+ select * from (
+ select `id` from `bugTest`.`procViewTable`
+ ) `innerQuery`
+ group by `innerQuery`.`id`
+);
+
+--connect (con1,localhost,procView,,)
+use bugTest;
+
+prepare stmt from "SELECT * FROM procViewSimple";
+execute stmt;
+execute stmt;
+
+# Cleanup
+--disconnect con1
+--connection default
+drop user procView;
+drop view procViewSimple;
+drop table procViewTable;
+use test;
+drop database bugTest;
+
+--echo #
--echo # End of 10.2 tests
--echo #