diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/alter_table.test | 32 | ||||
-rw-r--r-- | mysql-test/t/alter_table_online.test | 4 | ||||
-rw-r--r-- | mysql-test/t/binary_to_hex.test | 76 | ||||
-rw-r--r-- | mysql-test/t/check_constraint.test | 8 | ||||
-rw-r--r-- | mysql-test/t/count_distinct.test | 16 | ||||
-rw-r--r-- | mysql-test/t/create_drop_event.test | 3 | ||||
-rw-r--r-- | mysql-test/t/errors.test | 10 | ||||
-rw-r--r-- | mysql-test/t/func_regexp_pcre.test | 19 | ||||
-rw-r--r-- | mysql-test/t/gis.test | 10 | ||||
-rw-r--r-- | mysql-test/t/group_by.test | 38 | ||||
-rw-r--r-- | mysql-test/t/mysql_upgrade.test | 28 | ||||
-rw-r--r-- | mysql-test/t/mysqld--help.test | 2 | ||||
-rw-r--r-- | mysql-test/t/read_only.test | 3 | ||||
-rw-r--r-- | mysql-test/t/sp-destruct.test | 4 | ||||
-rw-r--r-- | mysql-test/t/sp.test | 21 | ||||
-rw-r--r-- | mysql-test/t/statistics.test | 2 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 17 | ||||
-rw-r--r-- | mysql-test/t/subselect_nulls.test | 6 | ||||
-rw-r--r-- | mysql-test/t/type_json.test | 7 | ||||
-rw-r--r-- | mysql-test/t/type_num.test | 26 | ||||
-rw-r--r-- | mysql-test/t/union.test | 14 | ||||
-rw-r--r-- | mysql-test/t/view.test | 13 |
22 files changed, 331 insertions, 28 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 143ba80c53b..93fd23b7fea 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1801,3 +1801,35 @@ DROP TABLE t1; --error ER_DUP_CONSTRAINT_NAME CREATE TABLE t1(a INT, b INT, CONSTRAINT min check (a>5), CONSTRAINT min check (b>5)); + +# +# MDEV-11114 Cannot drop column referenced by CHECK constraint +# +create table t1 (a int, b int, check(a>b)); +--error ER_BAD_FIELD_ERROR +alter table t1 drop column a; +--error ER_BAD_FIELD_ERROR +alter table t1 drop column b, add column b bigint first; +show create table t1; +drop table t1; + +create table t1 (a int, b int, check(a>0)); +alter table t1 drop column a; +show create table t1; +drop table t1; + +create table t1 (a int, b int, check(a>0)); +alter table t1 drop column a, add column a bigint first; +show create table t1; +drop table t1; + +create table t1 (a int, b int, c int, unique(a)); +alter table t1 drop column a; +show create table t1; +drop table t1; + +create table t1 (a int, b int, c int, unique(a,b)); +--error ER_KEY_COLUMN_DOES_NOT_EXITS +alter table t1 drop column a; +show create table t1; +drop table t1; diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test index 15df36e8009..f5a40734535 100644 --- a/mysql-test/t/alter_table_online.test +++ b/mysql-test/t/alter_table_online.test @@ -285,6 +285,8 @@ CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci); ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE; DROP TABLE t1; +# End of 10.0 tests + # # MDEV-11335 Changing delay_key_write option for MyISAM table should not copy rows # @@ -306,3 +308,5 @@ flush tables; insert t1 values (1,2),(2,3),(3,4); show status like 'Feature_delay_key_write'; drop table t1; + +# End of 10.1 tests diff --git a/mysql-test/t/binary_to_hex.test b/mysql-test/t/binary_to_hex.test new file mode 100644 index 00000000000..8312a246d0c --- /dev/null +++ b/mysql-test/t/binary_to_hex.test @@ -0,0 +1,76 @@ +# === Purpose === +# The purpose of this test case is to make +# sure that the binary data in tables is printed +# as hex when the option binary-as-hex is enabled. +# +# === Related bugs and/or worklogs === +# Bug #25340722 - PRINT BINARY DATA AS HEX IN THE MYSQL +# CLIENT (CONTRIBUTION) +# + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc +--source include/not_embedded.inc + +USE test; +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +CREATE TABLE t1 (c1 TINYBLOB, + c2 BLOB, + c3 MEDIUMBLOB, + c4 LONGBLOB, + c5 TEXT, + c6 BIT(1), + c7 CHAR, + c8 VARCHAR(10), + c9 GEOMETRY) CHARACTER SET = binary; + +SHOW CREATE TABLE t1; + +INSERT INTO t1 VALUES ('tinyblob-text readable', 'blob-text readable', + 'mediumblob-text readable', 'longblob-text readable', + 'text readable', b'1', 'c', 'variable', + POINT(1, 1)); + +CREATE TABLE t2(id int, `col1` binary(10),`col2` blob); + +SHOW CREATE TABLE t2; + +INSERT INTO t2 VALUES (1, X'AB1234', X'123ABC'), (2, X'DE1234', X'123DEF'); + +--echo #Print the table contents when binary-as-hex option is off. +--replace_column 6 # 9 # +SELECT * FROM t1; + +--replace_column 2 # 3 # +SELECT * FROM t2; + +--echo #Print the table contents after turning on the binary-as-hex option +--echo +--echo #Print the table contents in tab format +--echo +--exec $MYSQL test --binary-as-hex -e "SELECT * FROM t1; SELECT * FROM t2;" +--echo +--echo #Print the table contents in table format +--echo +--exec $MYSQL test --binary-as-hex --table -e "SELECT * FROM t1; SELECT * FROM t2 WHERE col2=0x123ABC;" +--echo +--echo #Print the table contents vertically +--echo +--exec $MYSQL test --binary-as-hex --vertical -e "SELECT * FROM t1;" +--echo +--echo #Print the table contents in xml format +--echo +--exec $MYSQL test --binary-as-hex --xml -e "SELECT * FROM t1; SELECT * FROM t2;" +--echo +--echo #Print the table contents in html format +--echo +--exec $MYSQL test --binary-as-hex --html -e "SELECT * FROM t1; SELECT * FROM t2;" + +#Cleanup +DROP TABLE t1, t2; + +# Wait till all disconnects are completed + --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/check_constraint.test b/mysql-test/t/check_constraint.test index c70a208f774..43b4417cfa3 100644 --- a/mysql-test/t/check_constraint.test +++ b/mysql-test/t/check_constraint.test @@ -80,14 +80,6 @@ insert into t1(c1) values(2); drop table t1; # -# MDEV-11114 Cannot drop column referenced by CHECK constraint: Unknown column 'a' in 'virtual column function' -# -create table t1 (a int, b int, check(a>0)); ---error ER_BAD_FIELD_ERROR -alter table t1 drop column a; -drop table t1; - -# # MDEV-11117 CHECK constraint fails on intermediate step of ALTER # -- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test index 10b4ac6f0e7..a00574b6cba 100644 --- a/mysql-test/t/count_distinct.test +++ b/mysql-test/t/count_distinct.test @@ -107,3 +107,19 @@ create view v1 as select * from t1; select count(distinct i) from v1; drop table t1; drop view v1; + +# +# MDEV-12136 SELECT COUNT(DISTINCT) returns the wrong value when tmp_table_size is limited +# +create table t1 (user_id char(64) character set utf8); +insert t1 values(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17); +set @@tmp_table_size = 1024; +select count(distinct user_id) from t1; +alter table t1 modify user_id char(128) character set utf8; +select count(distinct user_id) from t1; +drop table t1; +set @@tmp_table_size = default; + +# +# End of 5.5 tests +# diff --git a/mysql-test/t/create_drop_event.test b/mysql-test/t/create_drop_event.test index e136798ac29..d885a39e453 100644 --- a/mysql-test/t/create_drop_event.test +++ b/mysql-test/t/create_drop_event.test @@ -10,11 +10,13 @@ CREATE OR REPLACE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO DROP DAT CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10); SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; +--source include/count_sessions.inc SET GLOBAL event_scheduler=on; let $wait_condition= SELECT count(*)>0 FROM t1; --source include/wait_condition.inc SELECT DISTINCT a FROM t1; SET GLOBAL event_scheduler=off; +--source include/wait_until_count_sessions.inc DELETE FROM t1; --error ER_EVENT_ALREADY_EXISTS @@ -30,6 +32,7 @@ let $wait_condition= SELECT count(*)>0 FROM t1; --source include/wait_condition.inc SELECT DISTINCT a FROM t1; SET GLOBAL event_scheduler=off; +--source include/wait_until_count_sessions.inc DELETE FROM t1; DROP EVENT IF EXISTS ev1; diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index d1d83248df4..55461002fd4 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -203,7 +203,13 @@ drop table t1; # # errors caused by max_session_mem_used # +--disable_result_log +set max_session_mem_used = 50000; +--error 0,ER_OPTION_PREVENTS_STATEMENT +select * from seq_1_to_1000; set max_session_mem_used = 8192; ---error ER_SQL_DISCOVER_ERROR,ER_OPTION_PREVENTS_STATEMENT +--error 0,ER_OPTION_PREVENTS_STATEMENT select * from seq_1_to_1000; -set global max_session_mem_used = default; +--enable_result_log +# We may not be able to execute any more queries with this connection +# because of too little memory# diff --git a/mysql-test/t/func_regexp_pcre.test b/mysql-test/t/func_regexp_pcre.test index 4cbe893d9c4..d77467b559b 100644 --- a/mysql-test/t/func_regexp_pcre.test +++ b/mysql-test/t/func_regexp_pcre.test @@ -434,6 +434,25 @@ SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck; SELECT 1 FROM dual WHERE ('Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,StrataCentral,Golf,Hotel,India,Juliet,Kilo,Lima,Mike,StrataL3,November,Oscar,StrataL2,Sand,P3,P4SwitchTest,Arsys,Poppa,ExtensionMgr,Arp,Quebec,Romeo,StrataApiV2,PtReyes,Sierra,SandAcl,Arrow,Artools,BridgeTest,Tango,SandT,PAlaska,Namespace,Agent,Qos,PatchPanel,ProjectReport,Ark,Gimp,Agent,SliceAgent,Arnet,Bgp,Ale,Tommy,Central,AsicPktTestLib,Hsc,SandL3,Abuild,Pca9555,Standby,ControllerDut,CalSys,SandLib,Sb820,PointV2,BfnLib,Evpn,BfnSdk,Sflow,ManagementActive,AutoTest,GatedTest,Bgp,Sand,xinetd,BfnAgentLib,bf-utils,Hello,BfnState,Eos,Artest,Qos,Scd,ThermoMgr,Uniform,EosUtils,Eb,FanController,Central,BfnL3,BfnL2,tcp_wrappers,Victor,Environment,Route,Failover,Whiskey,Xray,Gimp,BfnFixed,Strata,SoCal,XApi,Msrp,XpProfile,tcpdump,PatchPanel,ArosTest,FhTest,Arbus,XpAcl,MacConc,XpApi,telnet,QosTest,Alpha2,BfnVlan,Stp,VxlanControllerTest,MplsAgent,Bravo2,Lanz,BfnMbb,Intf,XCtrl,Unicast,SandTunnel,L3Unicast,Ipsec,MplsTest,Rsvp,EthIntf,StageMgr,Sol,MplsUtils,Nat,Ira,P4NamespaceDut,Counters,Charlie2,Aqlc,Mlag,Power,OpenFlow,Lag,RestApi,BfdTest,strongs,Sfa,CEosUtils,Adt746,MaintenanceMode,MlagDut,EosImage,IpEth,MultiProtocol,Launcher,Max3179,Snmp,Acl,IpEthTest,PhyEee,bf-syslibs,tacc,XpL2,p4-ar-switch,p4-bf-switch,LdpTest,BfnPhy,Mirroring,Phy6,Ptp' REGEXP '^((?!\b(Strata|StrataApi|StrataApiV2)\b).)*$'); # +# MDEV-13173 An RLIKE that previously worked on 10.0 now returns "Got error 'pcre_exec: recursion limit of 100 exceeded' from regexp" +# +SELECT CONCAT(REPEAT('100,',133),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'; +--replace_regex /[0-9]+ exceeded/NUM exceeded/ +SELECT CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'; + +SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'); +--replace_regex /[0-9]+ exceeded/NUM exceeded/ +SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'); + +SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')); +--replace_regex /[0-9]+ exceeded/NUM exceeded/ +SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')); + +SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', '')); +--replace_regex /[0-9]+ exceeded/NUM exceeded/ +SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', '')); + +# # MDEV-12942 REGEXP_INSTR returns 1 when using brackets # SELECT REGEXP_INSTR('a_kollision', 'oll'); diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 538718f21ba..91e4b3d49f4 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -351,15 +351,15 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439 36.252666,-115.261439 36.247366,-115.247239 36.247066)))')); -# Expected result is 115.31877315203187, but IA64 returns 115.31877315203188 -# due to fused multiply-add instructions. ---replace_result 115.31877315203188 115.31877315203187 +# Expected results are 115.2970604672862 and 36.23335610879993, but IA64 returns +# slightly different values due to fused multiply-add instructions. +--replace_result 115.29706047613604 115.2970604672862 36.23335611157958 36.23335610879993 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85998; -# Expected result is 36.3310176346905, but IA64 returns 36.3310176346904 +# Expected result is 36.34725218253213, but IA64 returns 36.34725217627852 # due to fused multiply-add instructions. ---replace_result 36.3310176346904 36.3310176346905 -114.87787186923326 -114.87787186923313 36.33101763469053 36.33101763469059 36.33101763469043 36.33101763469059 +--replace_result 36.34725217627852 36.34725218253213 -114.86854470090232 -114.86854472054372 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85984; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index acb33c2c115..a2df97949d8 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1751,6 +1751,44 @@ select a as x from t1 group by x having x > 1; select a from t1 group by a having a > 1; drop table t1; set sql_mode= @save_sql_mode; + +# +# MDEV-7826 Server crashes in Item_subselect::enumerate_field_refs_processor +# +create table t1 (f1 int); +insert into t1 values (5),(9); +create table t2 (f2 int); +insert into t2 values (0),(6); +create table t3 (f3 int); +insert into t3 values (6),(3); +create table t4 (f4 int); +insert into t4 values (1),(0); +--error ER_ILLEGAL_REFERENCE +select +(select min(f1) from t1 where f1 in (select min(f4) from t2)) as field7, +(select count(*) from t3 where f3 in (select max(f4) from t2 group by field7)) +from t4; +drop table t1, t2, t3, t4; + +# +# MDEV-13180 Unused left join causes server crash +# +create table t1 (i1 int); +insert into t1 values (1); +create table t2 (i int); +insert into t2 values (2); +select 1 from t1 left join t2 b on b.i = (select max(b.i) from t2); +drop table t1, t2; + + +# +# MDEV-12489 The select stmt may fail due to "having clause is ambiguous" unexpected +# +create table t1 (c1 int, c2 int); +create table t2 (c1 int, c2 int); +select t1.c1 as c1, t2.c2 as c1 from t1, t2 where t1.c1 < 20 and t2.c2 > 5 group by t1.c1, t2.c2 having t1.c1 < 3; +drop table t1, t2; + # # End of MariaDB 5.5 tests # diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test index 9d33dd70e3a..a19be30e68f 100644 --- a/mysql-test/t/mysql_upgrade.test +++ b/mysql-test/t/mysql_upgrade.test @@ -1,6 +1,7 @@ -- source include/mysql_upgrade_preparation.inc -- source include/have_working_dns.inc -- source include/have_innodb.inc +-- source include/have_partition.inc set sql_mode=""; @@ -168,6 +169,31 @@ SELECT grantor FROM mysql.tables_priv WHERE db = 'mysql' AND table_name = 'user' DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost; DROP PROCEDURE test.pr; +# +# MDEV-13274 mysql_upgrade fails if dbname+tablename+partioname > 64 chars +# +use test; +call mtr.add_suppression('Column last_update in table `mysql`.`innodb_table_stats` is INT NOT NULL but should be'); +alter table mysql.innodb_table_stats modify last_update int not null; + +create table extralongname_extralongname_extralongname_extralongname_ext ( + id int(10) unsigned not null, + created_date date not null, + created timestamp not null, + primary key (created,id,created_date) +) engine=innodb stats_persistent=1 default charset=latin1 + partition by range (year(created_date)) + subpartition by hash (month(created_date)) + subpartitions 2 ( + partition p2007 values less than (2008), + partition p2008 values less than (2009) + ); +--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 +select length(table_name) from mysql.innodb_table_stats; +drop table extralongname_extralongname_extralongname_extralongname_ext; + +--echo End of 10.0 tests + set sql_mode=default; # @@ -192,4 +218,4 @@ DROP TABLE test.t1; --remove_file $MYSQLD_DATADIR/mysql_upgrade_info SET GLOBAL enforce_storage_engine=NULL; ---echo End of tests +--echo End of 10.1 tests diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test index f6ac0042e9d..1613f8e7a4f 100644 --- a/mysql-test/t/mysqld--help.test +++ b/mysql-test/t/mysqld--help.test @@ -42,7 +42,7 @@ perl; $re2=join('|', @plugins); $skip=0; open(F, '<', "$ENV{MYSQL_TMP_DIR}/mysqld--help.txt") or die; - print "Windows bug: happens when a new line is exactly at the right offset\n"; + print "Windows bug: happens when a new line is exactly at the right offset.\n"; while (<F>) { next if 1../The following groups are read/; # formatting, skip line consisting entirely of dashes and blanks diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test index 3e970fc6da7..152770c1731 100644 --- a/mysql-test/t/read_only.test +++ b/mysql-test/t/read_only.test @@ -79,6 +79,9 @@ insert into t3 values(1); insert into t4 select * from t3; +--error ER_OPTION_PREVENTS_STATEMENT +create table t3 (a int); + # a non-temp table updated: --error ER_OPTION_PREVENTS_STATEMENT update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a; diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index 6e19fd885e3..31da235d906 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -39,7 +39,7 @@ create table t1 (id int); create trigger t1_ai after insert on t1 for each row call bug14233(); # Unsupported tampering with the mysql.proc definition -alter table mysql.proc drop type; +alter table mysql.proc drop security_type; --error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 call bug14233(); --error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 @@ -238,7 +238,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; create database mysqltest; --echo # Corrupt mysql.proc to make it unusable by current version of server. -alter table mysql.proc drop column type; +alter table mysql.proc drop column security_type; --echo # The below statement should not cause assertion failure. drop database mysqltest; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 7eedc67acd9..7b7e3a741f2 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9590,6 +9590,27 @@ DROP PROCEDURE p1; DROP TABLE t1; --echo # +--echo # MDEV-13346: CURSOR a query with GROUP BY using derived table +--echo # + +DELIMITER |; +CREATE PROCEDURE p1() +BEGIN + DECLARE c CURSOR FOR + SELECT + IFNULL(NULL,1) AS col + FROM + ( select 1 as id ) AS t + GROUP BY t.id + ; + OPEN c; +END +| +DELIMITER ;| +CALL p1(); +DROP PROCEDURE p1; + +--echo # --echo # Start of 10.3 tests --echo # diff --git a/mysql-test/t/statistics.test b/mysql-test/t/statistics.test index 61ef20605af..e9ecb56a1cb 100644 --- a/mysql-test/t/statistics.test +++ b/mysql-test/t/statistics.test @@ -500,7 +500,7 @@ SELECT * FROM mysql.index_stats ORDER BY index_name, prefix_arity, table_name; ANALYZE TABLE t2 PERSISTENT FOR COLUMNS ALL INDEXES ALL; SELECT * FROM mysql.index_stats ORDER BY index_name, prefix_arity, table_name; -ALTER TABLE t2 DROP COLUMN b; +ALTER TABLE t2 DROP COLUMN b, DROP PRIMARY KEY, ADD PRIMARY KEY(a); SELECT * FROM mysql.index_stats ORDER BY index_name, prefix_arity, table_name; ANALYZE TABLE t2 PERSISTENT FOR COLUMNS() INDEXES ALL; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 4d4a3f2d933..7412eae8ecf 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -6063,6 +6063,23 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; drop view v1; drop table t1,t2; +# +# MDEV-7828 Assertion `key_read == 0' failed in TABLE::enable_keyread with SELECT SQ and WHERE SQ +# +CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM; +INSERT t1 VALUES (4),(8); +CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM; +INSERT t2 VALUES (6); +SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; +--echo # +--echo # Disable this query till MDEV-13399 is resolved +--echo # +--echo # INSERT t2 VALUES (9); +--echo # --error ER_SUBQUERY_NO_1_ROW +--echo # SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; +--echo # +drop table t1, t2; + --echo # End of 10.0 tests --echo # diff --git a/mysql-test/t/subselect_nulls.test b/mysql-test/t/subselect_nulls.test index 4b08e773b17..3e7b2189ed5 100644 --- a/mysql-test/t/subselect_nulls.test +++ b/mysql-test/t/subselect_nulls.test @@ -97,3 +97,9 @@ set optimizer_switch= @tmp_subselect_nulls; drop table x1; drop table x2; + +# +# MDEV-7339 Server crashes in Item_func_trig_cond::val_int +# +select (select 1, 2) in (select 3, 4); +select (select NULL, NULL) in (select 3, 4); diff --git a/mysql-test/t/type_json.test b/mysql-test/t/type_json.test index 0f6d091d6e3..0cff9366145 100644 --- a/mysql-test/t/type_json.test +++ b/mysql-test/t/type_json.test @@ -5,10 +5,13 @@ create or replace table t1(a json); show create table t1; -create or replace table t1(a json character set utf8 default '{a:1}'); +--error ER_PARSE_ERROR +create or replace table t1(a json character set utf8); + +create or replace table t1(a json default '{a:1}'); show create table t1; -create or replace table t1(a json binary not null check (json_valid(a))); +create or replace table t1(a json not null check (json_valid(a))); show create table t1; insert t1 values ('[]'); --error ER_CONSTRAINT_FAILED diff --git a/mysql-test/t/type_num.test b/mysql-test/t/type_num.test index 87f5cc609d9..cc715d6cda2 100644 --- a/mysql-test/t/type_num.test +++ b/mysql-test/t/type_num.test @@ -679,10 +679,6 @@ SELECT --echo # ---echo # End of 10.0 tests ---echo # - ---echo # --echo # Start of 10.1 tests --echo # @@ -701,7 +697,25 @@ SELECT NULL+1 AS c0, --disable_metadata --enable_ps_protocol - --echo # ---echo # Start of 10.1 tests +--echo # Start of 10.2 tests --echo # + +# +# MDEV-8659 Conflicting declaration is accepted: INT SIGNED ZEROFILL +# +--error ER_PARSE_ERROR +CREATE TABLE t1 (a INT SIGNED ZEROFILL); +--error ER_PARSE_ERROR +CREATE TABLE t1 (a INT SIGNED UNSIGNED); +--error ER_PARSE_ERROR +CREATE TABLE t1 (a INT ZEROFILL UNSIGNED ZEROFILL); + +# documented syntax: +CREATE OR REPLACE TABLE t1 (a INT SIGNED); +CREATE OR REPLACE TABLE t1 (a INT UNSIGNED); +CREATE OR REPLACE TABLE t1 (a INT ZEROFILL); +# not documented, supported for backward compatibility +CREATE OR REPLACE TABLE t1 (a INT UNSIGNED ZEROFILL); +CREATE OR REPLACE TABLE t1 (a INT ZEROFILL UNSIGNED); +DROP TABLE t1; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index abea52fe584..a2e1fd09ade 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -1421,6 +1421,20 @@ drop table t1; --echo End of 5.0 tests +# +# Bug #24595639: INCORRECT BEHAVIOR IN QUERY WITH UNION AND GROUP BY +# +create table t1 (a int, b int); +insert into t1 values (1,1),(2,2),(3,3); +create table t2 (c varchar(30), d varchar(30)); +insert into t1 values ('1','1'),('2','2'),('4','4'); +create table t3 (e int, f int); +insert into t3 values (1,1),(2,2),(31,31),(32,32); +select e,f, (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3; +select avg(f), (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3 group by sub; +drop table t1,t2,t3; + +--echo End of 5.5 tests --echo # --echo # WL#1763 Avoid creating temporary table in UNION ALL diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index a9d6d9cec9c..c24cb502d7b 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -5575,6 +5575,19 @@ select * drop view v1; drop table t1,t2,t3; +--echo # +--echo # MDEV-11240: Server crashes in check_view_single_update or +--echo # Assertion `derived->table' failed in mysql_derived_merge_for_insert +--echo # + +CREATE TABLE t3 (a INT); +CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2; +CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1; +--error ER_VIEW_NO_INSERT_FIELD_LIST +PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3'; +drop view v1,v2; +drop table t3; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.5 tests. --echo # ----------------------------------------------------------------- |