diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-05-04 17:04:55 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-05-04 17:04:55 +0200 |
commit | 8cbb14ef5d180687f131bc44a4e8fc84083d033c (patch) | |
tree | 091f11e2d20f95656a7b12294782eb0488fd4fcc /mysql-test/t | |
parent | 4345868382ca3525de5eb432302b6b9b957b47c1 (diff) | |
parent | b85aa20065504bdda4bc03c2bd7eb7de38865c5d (diff) | |
download | mariadb-git-8cbb14ef5d180687f131bc44a4e8fc84083d033c.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'mysql-test/t')
25 files changed, 395 insertions, 51 deletions
diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index add9e0286db..44b8d5eb08a 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -65,6 +65,15 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' --error 1 --exec $MYSQLD_BOOTSTRAP_CMD --myisam_recover_options=NONE +# +# MDEV-19349 mysql_install_db: segfault at tmp_file_prefix check +# +--write_file $MYSQLTEST_VARDIR/tmp/1 +use test; +EOF +--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/1 >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +--remove_file $MYSQLTEST_VARDIR/tmp/1 + --echo End of 5.5 tests --source include/not_windows_embedded.inc diff --git a/mysql-test/t/events_stress.test b/mysql-test/t/events_stress.test index 8ea7633877b..080707f029f 100644 --- a/mysql-test/t/events_stress.test +++ b/mysql-test/t/events_stress.test @@ -21,6 +21,7 @@ GRANT ALL ON *.* TO event_user3@localhost; connect (conn2,localhost,event_user2,,events_conn2_db); --echo "In the second connection we create some events which won't be dropped till the end" --disable_query_log +--disable_warnings let $1= 50; while ($1) { diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index abc86476a6b..e752d9fcd50 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -1,9 +1,7 @@ # # simple test of group_concat function # ---disable_warnings -drop table if exists t1, t2; ---enable_warnings +source include/have_sequence.inc; create table t1 (grp int, a bigint unsigned, c char(10) not null, d char(10) not null); insert into t1 values (1,1,"a","a"); @@ -874,6 +872,35 @@ SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2; DROP TABLE t1; SET group_concat_max_len= DEFAULT; +# +# MDEV-9531 GROUP_CONCAT with ORDER BY inside takes a lot of memory while it's executed +# +set session group_concat_max_len=1024; +set max_session_mem_used=16*1024*1024; # 8M..32M +SELECT GROUP_CONCAT(concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1) ORDER BY 2,1,3,4,6,5,8,7) AS c +FROM seq_1_to_200000; +set max_session_mem_used=default; +set session group_concat_max_len=default; + +# +# MDEV-19350 Server crashes in delete_tree_element / ... / Item_func_group_concat::repack_tree +# +SET group_concat_max_len= 8; +CREATE TABLE t1 (a INT); +INSERT t1 VALUES (1),(2); +CREATE TABLE t2 (b DATE, c INT); +INSERT t2 VALUES ('2019-12-04',1),('2020-03-28',2); +CREATE TABLE t3 (d INT); +INSERT t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14); +CREATE TABLE t4 (e INT); +INSERT t4 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15); +SELECT (SELECT MAX(a) FROM t1 WHERE t2_sq.c > 0) AS f, + GROUP_CONCAT(t2_sq.b ORDER BY 1) AS gc +FROM (SELECT t2_a.* FROM t2 AS t2_a, t2 AS t2_b) AS t2_sq, t3, t4 +GROUP BY f; +DROP TABLE t1, t2, t3, t4; +SET group_concat_max_len= default; + --echo # --echo # Start of 10.2 tests diff --git a/mysql-test/t/func_hybrid_type.test b/mysql-test/t/func_hybrid_type.test index dd8a399025b..c07303f7450 100644 --- a/mysql-test/t/func_hybrid_type.test +++ b/mysql-test/t/func_hybrid_type.test @@ -456,6 +456,26 @@ EXECUTE stmt USING @a,@a; SHOW CREATE TABLE t1; DROP TABLE t1; + +--echo # +--echo # MDEV-11015 Assertion failed: precision > 0 in decimal_bin_size upon SELECT with DISTINCT, CAST and other functions +--echo # + +CREATE TABLE t1 (b LONGBLOB); +INSERT IGNORE INTO t1 VALUES ('foo'),('bar'); +SELECT DISTINCT - GREATEST( b, CAST( NULL AS DATETIME ) ) AS f FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (b LONGBLOB); +INSERT IGNORE INTO t1 VALUES ('foo'),('bar'); +SELECT DISTINCT - GREATEST( b, CAST( NULL AS TIME) ) AS f FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (b LONGBLOB); +INSERT IGNORE INTO t1 VALUES ('foo'),('bar'); +SELECT DISTINCT - GREATEST( b, CAST( NULL AS DATE) ) AS f FROM t1; +DROP TABLE t1; + --echo # --echo # End of 10.1 tests --echo # diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 6a69c71ff0b..80390536343 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1892,6 +1892,42 @@ SELECT f1,HEX(f2) FROM t1 WHERE f1='YQ==' AND (f2= from_base64( SELECT f1,HEX(f2) FROM t1 WHERE f1='YQ==' AND (f2= from_base64("Yq==") OR f2= from_base64("YQ==")); DROP TABLE t1; + +--echo # +--echo # MDEV-18738 ASAN heap-use-after-free in copy_if_not_alloced / copy_fields +--echo # + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +SELECT REPLACE( CAST( CURDATE() AS BINARY ), CURDATE(), REPEAT('a',32) ) AS f FROM t1 GROUP BY f; +DROP TABLE t1; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +SELECT REPLACE( LEFT( CURDATE(), 4), LEFT(CURDATE(),4), REPEAT('a',32) ) AS f FROM t1 GROUP BY f; +DROP TABLE t1; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +SELECT REPLACE(RIGHT(CURDATE(), 4), RIGHT(CURDATE(),4), REPEAT('a',32)) AS f FROM t1 GROUP BY f; +DROP TABLE t1; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +SELECT REPLACE(SUBSTR(CURDATE(),2,3), SUBSTR(CURDATE(),2,3), REPEAT('a',32)) AS f FROM t1 GROUP BY f; +DROP TABLE t1; + + +--echo # +--echo # MDEV-19359 ASAN heap-use-after-free in copy_if_not_alloced / make_sortkey +--echo # + +CREATE TABLE t1 (a INT, b TIME, c TIME); +INSERT INTO t1 VALUES (NULL,'22:56:45','22:56:45'),(4,'12:51:42','12:51:42'); +SELECT REPLACE( BINARY c, a, b ) f FROM t1 GROUP BY f WITH ROLLUP; +DROP TABLE t1; + + --echo # --echo # End of 10.1 tests --echo # diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index ebcea63b083..f630a6dc8bf 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -1568,6 +1568,25 @@ CREATE TABLE t2 AS SELECT WITHIN(g1,g1) as w1,WITHIN(g2,g2) AS w2 FROM t1; SHOW CREATE TABLE t2; DROP TABLE t1,t2; + +# +# MDEV-3934 Assertion `((keypart_map+1) & keypart_map) == 0' failed in _mi_pack_key with an index on a POINT column +# + +CREATE TABLE t1 ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT, + point_data POINT NOT NULL, + PRIMARY KEY (id), + KEY idx_point_data(point_data) +) ENGINE=MyISAM; +INSERT t1 (point_data) VALUES + (GeomFromText('Point(37.0248492 23.8512726)')), + (GeomFromText('Point(38.0248492 23.8512726)')); +SELECT id FROM t1 +WHERE ST_Contains(point_data, GeomFromText('Point(38.0248492 23.8512726)')); +DROP TABLE t1; + + --echo # --echo # Start of 10.2 tests --echo # @@ -1758,6 +1777,34 @@ INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); SELECT c FROM t1; DROP TABLE t1; +# +# MDEV-13923 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon altering table with geometry field +# +--error ER_CANT_CREATE_GEOMETRY_OBJECT +create table t1 (p point default "qwer"); +--error ER_CANT_CREATE_GEOMETRY_OBJECT +create table t1 (p point default 0); +--error ER_INVALID_DEFAULT +create table t1 (p point not null default st_geometryfromtext('point 0)')); +create table t1 (p point not null default st_geometryfromtext('point(0 0)')); +insert into t1 values(default); +select st_astext(p) from t1; +drop table t1; + +create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)); +set timestamp=10; +--error ER_CANT_CREATE_GEOMETRY_OBJECT +insert into t1 values(default); +drop table t1; +SET timestamp=default; + +create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)); +set timestamp=10; +--error ER_CANT_CREATE_GEOMETRY_OBJECT +alter table t1 add column i int; +drop table t1; +SET timestamp=default; + --echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/t/gis2.test b/mysql-test/t/gis2.test deleted file mode 100644 index 8ec11d1dcfa..00000000000 --- a/mysql-test/t/gis2.test +++ /dev/null @@ -1,45 +0,0 @@ -# -# MDEV-3934 Assertion `((keypart_map+1) & keypart_map) == 0' failed in _mi_pack_key with an index on a POINT column -# - -CREATE TABLE t1 ( - id INT UNSIGNED NOT NULL AUTO_INCREMENT, - point_data POINT NOT NULL, - PRIMARY KEY (id), - KEY idx_point_data(point_data) -) ENGINE=MyISAM; -INSERT t1 (point_data) VALUES - (GeomFromText('Point(37.0248492 23.8512726)')), - (GeomFromText('Point(38.0248492 23.8512726)')); -SELECT id FROM t1 -WHERE ST_Contains(point_data, GeomFromText('Point(38.0248492 23.8512726)')); -DROP TABLE t1; - -# -# MDEV-13923 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon altering table with geometry field -# ---error ER_CANT_CREATE_GEOMETRY_OBJECT -create table t1 (p point default "qwer"); ---error ER_CANT_CREATE_GEOMETRY_OBJECT -create table t1 (p point default 0); ---error ER_INVALID_DEFAULT -create table t1 (p point not null default st_geometryfromtext('point 0)')); -create table t1 (p point not null default st_geometryfromtext('point(0 0)')); -insert into t1 values(default); -select st_astext(p) from t1; -drop table t1; - -create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)); -set timestamp=10; ---error ER_CANT_CREATE_GEOMETRY_OBJECT -insert into t1 values(default); -drop table t1; -SET timestamp=default; - -create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)); -set timestamp=10; ---error ER_CANT_CREATE_GEOMETRY_OBJECT -alter table t1 add column i int; -drop table t1; -SET timestamp=default; - diff --git a/mysql-test/t/gis_notembedded.test b/mysql-test/t/gis_notembedded.test new file mode 100644 index 00000000000..d25d6a7097e --- /dev/null +++ b/mysql-test/t/gis_notembedded.test @@ -0,0 +1,24 @@ +source include/not_embedded.inc; +# +# MDEV-60 Support for Spatial Reference systems for the GIS data. +# +show create procedure mysql.AddGeometryColumn; +show create procedure mysql.DropGeometryColumn; +create table t1 (a int, b int); +call mysql.AddGeometryColumn('', 'test', 't1', 'c', 10); +show create table t1; +call mysql.DropGeometryColumn('', 'test', 't1', 'c'); +show create table t1; +call mysql.DropGeometryColumn('', 'test', 't1', 'b'); +show create table t1; +drop table t1; + +create user foo@localhost; +grant execute on mysql.* to foo@localhost; +connect (foo, localhost, foo); +--error ER_TABLEACCESS_DENIED_ERROR +call mysql.AddGeometryColumn('', 'mysql', 'proc', 'c', 10); +disconnect foo; +connection default; +drop user foo@localhost; + diff --git a/mysql-test/t/grant4.test b/mysql-test/t/grant4.test index 2715b7c7145..0d974af02fe 100644 --- a/mysql-test/t/grant4.test +++ b/mysql-test/t/grant4.test @@ -145,6 +145,34 @@ disconnect con1; drop database mysqltest_db1; drop user mysqltest_u1@localhost; +# +# MDEV-18241 Downgrade from 10.4 to 10.3 crashes +# +call mtr.add_suppression("Table 'mysql.user' doesn't exist"); +call mtr.add_suppression("'mysql.user' is not TABLE"); +rename table mysql.user to mysql.user1; +create view mysql.user as select * from mysql.user1; +--error ER_WRONG_OBJECT +flush privileges; +drop view mysql.user; +create temporary table mysql.user select * from mysql.user1 limit 0; +--error ER_NO_SUCH_TABLE +flush privileges; +drop temporary table mysql.user; +rename table mysql.user1 to mysql.user; + +# +# Bug#28986737: RENAMING AND REPLACING MYSQL.USER TABLE CAN LEAD TO A SERVER CRASH +# +call mtr.add_suppression('mysql.user table is damaged'); +rename table mysql.user to mysql.user1; +create table mysql.user (Host char(100), User char(100)); +--error ER_UNKNOWN_ERROR +flush privileges; +drop table mysql.user; +rename table mysql.user1 to mysql.user; + +--echo End of 5.5 tests --echo # --echo # Additional coverage for refactoring which is made as part @@ -233,5 +261,6 @@ create user foo3 identified via mysql_old_password using '00'; --error ER_PASSWD_LENGTH create user foo4 identified via mysql_old_password using '11111111111111111111111111111111111111111'; - set GLOBAL sql_mode=default; + +--echo End of 10.1 tests diff --git a/mysql-test/t/information_schema_prepare.test b/mysql-test/t/information_schema_prepare.test new file mode 100644 index 00000000000..c5f3f89ff29 --- /dev/null +++ b/mysql-test/t/information_schema_prepare.test @@ -0,0 +1,7 @@ +# +# MDEV-15907 ASAN heap-use-after-free in strnmov / .. / fill_effective_table_privileges on concurrent GRANT and CREATE VIEW +# +PREPARE stmt2 FROM "CREATE VIEW v AS SELECT * FROM INFORMATION_SCHEMA.TABLES"; +FLUSH PRIVILEGES; +EXECUTE stmt2; +DROP VIEW v; diff --git a/mysql-test/t/mdev_19276.test b/mysql-test/t/mdev_19276.test new file mode 100644 index 00000000000..3e6b72a3f55 --- /dev/null +++ b/mysql-test/t/mdev_19276.test @@ -0,0 +1,17 @@ +source include/not_embedded.inc; + +CREATE DATABASE db1; +CREATE USER u@localhost IDENTIFIED BY 'pw'; +set global log_warnings=2; + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error ER_DBACCESS_DENIED_ERROR +--connect(con1,localhost,u,pw,db1) +--connection default +let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err; +let SEARCH_RANGE= -50; +let SEARCH_PATTERN=Access denied for user 'u'@'localhost' to database 'db1'; +source include/search_pattern_in_file.inc; +set global log_warnings=@@log_warnings; +DROP DATABASE db1; +DROP USER u@localhost; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 64e61f7c0b5..900d0bd4283 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -983,4 +983,35 @@ deallocate prepare stmt1; drop view v3,v2,v1; drop table t1,t2,t3; + +# +# MDEV-18507 can't update temporary table when joined with table with triggers on read-only +# +create table t1 (id int not null, v1 varchar(10) not null); +insert into t1 values (1,1),(2,2); +create table t2 (log varchar(10) not null); +create trigger t1_after_update after update on t1 + for each row insert into t2 values ('triggered'); + +create user foo; +grant select, insert, update, delete, create, drop, reload, index, alter, show databases, create temporary tables, lock tables, execute, create view, show view, create routine, alter routine, trigger on *.* to 'foo'@'%'; + +set global read_only=1; +connect a, localhost, foo; + +create temporary table temp_t1 (id int not null, update_me varchar(10)); +insert into temp_t1 values (1,1),(2,2),(3,3); +update temp_t1 left join t1 on temp_t1.id = t1.id set temp_t1.update_me = 'hello'; + +connection default; +set global read_only = 0; + +create table t3 (id int not null); +insert t3 values (2); +update t1 left join t3 on t1.id = t3.id set t1.v1 = 'hello'; +select * from t2; + +drop table t1,t2, t3; +drop user foo; + --echo end of 5.5 tests diff --git a/mysql-test/t/multi_update2-master.opt b/mysql-test/t/multi_update_big.opt index da78f987af3..da78f987af3 100644 --- a/mysql-test/t/multi_update2-master.opt +++ b/mysql-test/t/multi_update_big.opt diff --git a/mysql-test/t/multi_update2.test b/mysql-test/t/multi_update_big.test index a0f17fabec4..a0f17fabec4 100644 --- a/mysql-test/t/multi_update2.test +++ b/mysql-test/t/multi_update_big.test diff --git a/mysql-test/t/mysqldump-compat.test b/mysql-test/t/mysqldump-compat.test index 9a830b16f26..ae74a760953 100644 --- a/mysql-test/t/mysqldump-compat.test +++ b/mysql-test/t/mysqldump-compat.test @@ -15,3 +15,16 @@ CREATE TABLE t1 (c1 int); DROP DATABASE mysqldump_30126; --remove_file $file +use test; + +# +# MDEV-19182 mysqldump not always handling SHOW CREATE TRIGGER failures correctly +# +create table t1 (a int); +create trigger tr after insert on t1 for each row set @a=1; +let $datadir=`select @@datadir`; +move_file $datadir/test/tr.TRN $datadir/test/tr-1.TRN; +error 2; +exec $MYSQL_DUMP test t1 >/dev/null; +move_file $datadir/test/tr-1.TRN $datadir/test/tr.TRN; +drop table t1; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 590e2fc7f07..8c644103046 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -1025,6 +1025,31 @@ DROP TABLE t; set sql_mode= @save_sql_mode; --echo # +--echo # Bug#28573894 ALTER PARTITIONED TABLE ADD AUTO_INCREMENT DIFF RESULT +--echo # +CREATE TABLE t (a VARCHAR(10) NOT NULL,b INT,PRIMARY KEY (b)) ENGINE=INNODB +PARTITION BY RANGE (b) +(PARTITION pa VALUES LESS THAN (2), + PARTITION pb VALUES LESS THAN (20), + PARTITION pc VALUES LESS THAN (30), + PARTITION pd VALUES LESS THAN (40)); + +INSERT INTO t +VALUES('A',0),('B',1),('C',2),('D',3),('E',4),('F',5),('G',25),('H',35); +CREATE TABLE t_copy LIKE t; +INSERT INTO t_copy SELECT * FROM t; + +--enable_info +ALTER TABLE t ADD COLUMN r INT UNSIGNED NOT NULL AUTO_INCREMENT, +ADD UNIQUE KEY (r,b); +ALTER TABLE t_copy ADD COLUMN r INT UNSIGNED NOT NULL AUTO_INCREMENT, +ADD UNIQUE KEY (r,b), ALGORITHM=COPY; +--disable_info +SELECT * FROM t; +SELECT * FROM t_copy; +DROP TABLE t,t_copy; + +--echo # --echo # Bug#26390658 RENAMING A PARTITIONED TABLE DOES NOT UPDATE --echo # MYSQL.INNODB_TABLE_STATS --echo # diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 9acae1078dd..00cb4974418 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3924,6 +3924,22 @@ END; / DELIMITER ;/ +--echo # +--echo # MDEV-14572: Assertion `! is_set()' failed in +--echo # Diagnostics_area::set_eof_status upon EXPLAIN UPDATE in PS +--echo # + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); + +#EXPLAIN UPDATE t1, t2 SET a = 1; +PREPARE stmt FROM 'EXPLAIN UPDATE t1, t2 SET a = 1'; +EXECUTE stmt; +EXECUTE stmt; +deallocate prepare stmt; + +# Cleanup +DROP TABLE t1, t2; --echo # --echo # End of 10.1 tests diff --git a/mysql-test/t/ssl_verify_ip.opt b/mysql-test/t/ssl_verify_ip.opt new file mode 100644 index 00000000000..7b1c308e46b --- /dev/null +++ b/mysql-test/t/ssl_verify_ip.opt @@ -0,0 +1,3 @@ +--loose-enable-ssl +--loose-ssl-cert=$MYSQL_TEST_DIR/std_data/serversan-cert.pem +--loose-ssl-key=$MYSQL_TEST_DIR/std_data/serversan-key.pem diff --git a/mysql-test/t/ssl_verify_ip.test b/mysql-test/t/ssl_verify_ip.test new file mode 100644 index 00000000000..2a2e780ecfc --- /dev/null +++ b/mysql-test/t/ssl_verify_ip.test @@ -0,0 +1,3 @@ +source include/have_ssl_crypto_functs.inc; +--exec $MYSQL --protocol=tcp --host=127.0.0.1 --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl --ssl-verify-server-cert -e "select 1" +--exec $MYSQL --protocol=tcp --host=localhost --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl --ssl-verify-server-cert -e "select 1" diff --git a/mysql-test/t/stat_tables.test b/mysql-test/t/stat_tables.test index 93caa47ce79..ddf881c69ae 100644 --- a/mysql-test/t/stat_tables.test +++ b/mysql-test/t/stat_tables.test @@ -453,6 +453,27 @@ delete from mysql.table_stats; delete from mysql.column_stats; delete from mysql.index_stats; +--echo # +--echo # MDEV-19352: Server crash in alloc_histograms_for_table_share upon query from information schema +--echo # + +use test; +set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; +set @@optimizer_use_condition_selectivity= 4; +set use_stat_tables='preferably'; + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); +CREATE VIEW v AS SELECT * FROM t1 JOIN t2; +--error ER_NO_SUCH_TABLE +INSERT INTO t2 SELECT * FROM x; + +select * from information_schema.tables where table_name='v'; + +drop table t1,t2; +drop view v; +set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; + set @save_optimizer_switch=@@optimizer_switch; set use_stat_tables=@save_use_stat_tables; diff --git a/mysql-test/t/statistics.test b/mysql-test/t/statistics.test index b2e544064b0..4c45b4f38b8 100644 --- a/mysql-test/t/statistics.test +++ b/mysql-test/t/statistics.test @@ -879,6 +879,21 @@ rename table t1 to t2, t3 to t4; drop table t1, mysql.table_stats; rename table test.table_stats to mysql.table_stats; +--echo # +--echo # MDEV-19334: bool is_eits_usable(Field*): Assertion `field->table->stats_is_read' failed. +--echo # + +create temporary table t1(a int); +insert into t1 values (1),(2),(3); + +set use_stat_tables=preferably; +set @optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; +set optimizer_use_condition_selectivity=4; + +select * from t1 where a >= 2; +drop table t1; +set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; + set use_stat_tables=@save_use_stat_tables; --echo # diff --git a/mysql-test/t/status2.test b/mysql-test/t/status2.test index 2d1541c54f2..fa3b718efaa 100644 --- a/mysql-test/t/status2.test +++ b/mysql-test/t/status2.test @@ -20,11 +20,11 @@ END $$ DELIMITER ;$$ --disable_warnings DROP TABLE IF EXISTS t1,t2; +CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND + DO INSERT INTO t1 VALUES(1); --enable_warnings CREATE TABLE t1 (c1 INT); CREATE TABLE t2 (c1 INT); -CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND - DO INSERT INTO t1 VALUES(1); --echo Assert Questions == 7 SHOW STATUS LIKE 'Questions'; diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index 7a38610ad95..1e5615502da 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -308,3 +308,34 @@ SELECT CONVERT_TZ('2001-10-08 00:00:00', MAKE_SET(0,'+01:00'), '+00:00' ); --echo # --echo # End of 5.3 tests --echo # + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-11895 NO_ZERO_DATE affects timestamp values without any warnings +--echo # + +SET sql_mode = ''; +CREATE TABLE t1 (a TIMESTAMP NULL) ENGINE = MyISAM; +CREATE TABLE t2 (a TIMESTAMP NULL) ENGINE = MyISAM; +CREATE TABLE t3 (a TIMESTAMP NULL) ENGINE = MyISAM; + +SET @@session.time_zone = 'UTC'; +INSERT INTO t1 VALUES ('2011-10-29 23:00:00'); +INSERT INTO t1 VALUES ('2011-10-29 23:00:01'); +INSERT INTO t1 VALUES ('2011-10-29 23:59:59'); + +SET @@session.time_zone = 'Europe/Moscow'; +SET sql_mode='NO_ZERO_DATE'; +INSERT INTO t2 SELECT * FROM t1; +SET sql_mode=''; +INSERT INTO t3 SELECT * FROM t1; +SELECT UNIX_TIMESTAMP(a), a FROM t2; +SELECT UNIX_TIMESTAMP(a), a FROM t3; +DROP TABLE t1, t2, t3; + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 04db1511833..012fa2236d7 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -460,6 +460,15 @@ SELECT COALESCE(val, 1) FROM t1; DROP TABLE t1; --echo # +--echo # MDEV-18452 ASAN unknown-crash in Field::set_default upon SET bit_column = DEFAULT +--echo # + +CREATE TABLE t1 (b BIT(20)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (0); +UPDATE t1 SET b = DEFAULT; +DROP TABLE t1; + +--echo # --echo # End of 10.1 tests --echo # diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test index a70241138aa..df4ca502dff 100644 --- a/mysql-test/t/view_grant.test +++ b/mysql-test/t/view_grant.test @@ -244,6 +244,8 @@ create table mysqltest.t1 (a int, b int, primary key(a)); insert into mysqltest.t1 values (10,2), (20,3), (30,4), (40,5), (50,10); create table mysqltest.t2 (x int); insert into mysqltest.t2 values (3), (4), (5), (6); +create table mysqltest.t3 (x int); +insert into mysqltest.t3 values (3), (4), (5), (6); create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1; create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1; create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1; @@ -251,6 +253,7 @@ create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1; create user mysqltest_1@localhost; grant update (a) on mysqltest.v2 to mysqltest_1@localhost; grant update on mysqltest.v1 to mysqltest_1@localhost; +grant update on mysqltest.t3 to mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; connection user1; @@ -265,6 +268,8 @@ update t2,v2 set v2.a=v2.a+v2.c where t2.x=v2.c; select * from t1; update v2 set a=a+c; select * from t1; +# update a table, select only on view +update t3,v3 set t3.x=t3.x+v3.c where t3.x=v3.c; # no rights on column --error ER_COLUMNACCESS_DENIED_ERROR update t2,v2 set v2.c=v2.a+v2.c where t2.x=v2.c; |