diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-10-19 20:38:59 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-10-19 20:38:59 +0200 |
commit | e1f681c99b3e5462c033aaafa94ac295e626cde2 (patch) | |
tree | 2da5eff1a0d03831c2d85b32a7bc3df6ec37b522 /mysql-test | |
parent | 52c84d144d3b07966d9b3bab8694eb012eef69ce (diff) | |
parent | 807fef40fffbbb8e92564a52b902b504ba8cfcdc (diff) | |
download | mariadb-git-e1f681c99b3e5462c033aaafa94ac295e626cde2.tar.gz |
10.0-base -> 10.0-monty
Diffstat (limited to 'mysql-test')
698 files changed, 43478 insertions, 1372 deletions
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 3bbc693ceda..5b57eab1005 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -205,16 +205,55 @@ DROP PROCEDURE p4; --echo End of 5.0 tests -# Test of a too big SET INSERT_ID: see if the truncated value goes -# into binlog (right), or the too big value (wrong); we look at the -# binlog further down with SHOW BINLOG EVENTS. +# Test of a too big SET INSERT_ID. +# This should generate an error and should not be put in binlog +# We look at the binlog further down with SHOW BINLOG EVENTS. + reset master; create table t1 (id tinyint auto_increment primary key); +insert into t1 values(5); +set insert_id=128; +--error 167 +insert into t1 values(null) /* Not binlogged */; + +# The followin insert ignore will be put in binlog set insert_id=128; -insert into t1 values(null); +insert ignore into t1 values(null) /* Insert 128 */; + +# Insert with duplicate key error should not go into binglo +set insert_id=5; +--error ER_DUP_ENTRY +insert into t1 values(null) /* Not binlogged */; + +# Insert with autogenerated key + duplicate key error should go into binlog +set insert_id=5; +insert ignore into t1 values(null) /* Insert 5 */; select * from t1; drop table t1; +# Same tests but with 2 rows inserted at a time + +create table t1 (id tinyint auto_increment primary key) engine=myisam; +set insert_id=128; +--error 167 +insert into t1 values(5),(null) /* Insert_id 128 */; + +# The followin insert ignore will be put in binlog +set insert_id=128; +insert ignore into t1 values (4),(null) /* Insert_id 128 */; + +# Insert with duplicate key error should not go into binglo +set insert_id=5; +--error ER_DUP_ENTRY +insert into t1 values(3),(null) /* Insert_id 5 */; + +# Insert with autogenerated key + duplicate key error should go into binlog +set insert_id=5; +insert ignore into t1 values(2),(null) /* Insert_id 5 */; +select * from t1 order by id; +drop table t1; + + # bug#22027 create table t1 (a int); create table if not exists t2 select * from t1; diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test index 7b31a3ebf17..8f669fc1152 100644 --- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test +++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test @@ -28,6 +28,7 @@ # BUG#20627: INSERT DELAYED does not honour auto_increment_* variables # Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild +reset master; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index b41bfeaba74..4ce001cfdd7 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -318,8 +318,8 @@ connection con4; select get_lock("a",10); # wait for rollback to finish if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) { - --let $binlog_rollback= query_get_value(SHOW BINLOG EVENTS, Pos, 7) - --let $binlog_query= query_get_value(SHOW BINLOG EVENTS, Info, 7) + --let $binlog_rollback= query_get_value(SHOW BINLOG EVENTS, Pos, 8) + --let $binlog_query= query_get_value(SHOW BINLOG EVENTS, Info, 8) if ($binlog_query != ROLLBACK) { --echo Wrong query from SHOW BINLOG EVENTS. Expected ROLLBACK, got '$binlog_query' --source include/show_rpl_debug_info.inc diff --git a/mysql-test/extra/rpl_tests/create_recursive_construct.inc b/mysql-test/extra/rpl_tests/create_recursive_construct.inc index 6e130a8154f..e790a1db41f 100644 --- a/mysql-test/extra/rpl_tests/create_recursive_construct.inc +++ b/mysql-test/extra/rpl_tests/create_recursive_construct.inc @@ -325,7 +325,8 @@ if ($CRC_RET_stmt_sidef) { SHOW BINLOG EVENTS; --die Wrong number of warnings. } - --let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 2) + # There should be no events after format description and binlog checkpoint. + --let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 3) if ($binlog_event != No such row) { --enable_query_log --echo ******** Failure! Something was written to the binlog despite SQL_LOG_BIN=0 ******** @@ -345,23 +346,23 @@ if ($CRC_RET_stmt_sidef) { SHOW BINLOG EVENTS; --die Warnings printed } - --let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 3) - # The first event is format_description, the second is - # Query_event('BEGIN'), and the third should be our Query + --let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 4) + # The first event is format_description, the second is Binlog_checkpoint, + # the third Query_event('BEGIN'), and the fourth should be our Query # for 'INSERT DELAYED' unsafe_type 3, which is safe after # the fix of bug#54579. if (`SELECT $unsafe_type = 3 AND '$event_type' != 'Query'`) { --enable_query_log - --echo ******** Failure! Event number 3 was a '$event_type', not a 'Query'. ******** + --echo ******** Failure! Event number 4 was a '$event_type', not a 'Query'. ******** SHOW BINLOG EVENTS; --die Wrong events in binlog. } - # The first event is format_description, the second is - # Query_event('BEGIN'), and the third should be our Table_map + # The first event is format_description, the second is Binlog_checkpoint, + # the third is Query_event('BEGIN'), and the fourth should be our Table_map # for unsafe statement. if (`SELECT $unsafe_type != 3 AND '$event_type' != 'Table_map'`) { --enable_query_log - --echo ******** Failure! Event number 3 was a '$event_type', not a 'Table_map'. ******** + --echo ******** Failure! Event number 4 was a '$event_type', not a 'Table_map'. ******** SHOW BINLOG EVENTS; --die Wrong events in binlog. } diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test index bd5943d46ea..8cd86de8040 100644 --- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test +++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test @@ -111,7 +111,7 @@ set auto_increment_increment=11; set auto_increment_offset=4; insert into t1 values(null); insert into t1 values(null); ---error ER_DUP_ENTRY +--error 167 insert into t1 values(null); select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a; @@ -120,6 +120,8 @@ create table t2 (a tinyint unsigned not null auto_increment primary key) engine= set auto_increment_increment=10; set auto_increment_offset=1; set insert_id=1000; +insert into t2 values(10); +--error 167 insert into t2 values(null); select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a; @@ -127,6 +129,7 @@ select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 orde create table t3 like t1; set auto_increment_increment=1000; set auto_increment_offset=700; +--error 167 insert into t3 values(null); select * from t3 order by a; sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test index 0e862e041e6..56ff4683df8 100644 --- a/mysql-test/extra/rpl_tests/rpl_deadlock.test +++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test @@ -34,7 +34,7 @@ INSERT INTO t3 VALUES (3); COMMIT; save_master_pos; # Save BEGIN event into variable -let $master_pos_begin= query_get_value(SHOW BINLOG EVENTS, Pos, 5); +let $master_pos_begin= query_get_value(SHOW BINLOG EVENTS, Pos, 6); --echo # 1) Test deadlock diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index df08622b0bd..2dbba38166b 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -102,7 +102,9 @@ CREATE TABLE t1(a int, UNIQUE(a)); --let $_start= query_get_value(SHOW MASTER STATUS, Position, 1) INSERT DELAYED IGNORE INTO t1 VALUES(1); +--disable_warnings INSERT DELAYED IGNORE INTO t1 VALUES(1); +--enable_warnings flush table t1; # to wait for INSERT DELAYED to be done if (`SELECT @@global.binlog_format = 'STATEMENT'`) { @@ -133,7 +135,7 @@ if (`SELECT @@global.binlog_format = 'STATEMENT'`) { #must show two INSERT DELAYED --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) - --let $binlog_limit= 1,6 + --let $binlog_limit= 2,6 --source include/show_binlog_events.inc } select * from t1; diff --git a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test index d8cd4f2d284..0fcff5ebe6c 100644 --- a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test +++ b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test @@ -34,7 +34,7 @@ reset slave; --echo # Test 1 --echo # -set @my_max_binlog_size= @@global.max_binlog_size; +set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; # mapped to 4096 select @@global.max_relay_log_size; @@ -110,6 +110,7 @@ source include/show_master_status.inc; # Restore max_binlog_size connection slave; set global max_binlog_size= @my_max_binlog_size; +set global max_relay_log_size= @my_max_relay_log_size; --echo # --echo # End of 4.1 tests diff --git a/mysql-test/include/binlog_start_pos.inc b/mysql-test/include/binlog_start_pos.inc index add5a42a426..5237e357b28 100644 --- a/mysql-test/include/binlog_start_pos.inc +++ b/mysql-test/include/binlog_start_pos.inc @@ -15,14 +15,14 @@ # 1 /* Checksum algorithm */ + # 4 /* CRC32 length */ # -# With current number of events = 160, +# With current number of events = 161, # -# binlog_start_pos = 4 + 19 + 57 + 160 + 1 + 4 = 245. +# binlog_start_pos = 4 + 19 + 57 + 161 + 1 + 4 = 246. # ############################################################################## -let $binlog_start_pos=245; +let $binlog_start_pos=246; --disable_query_log -SET @binlog_start_pos=245; +SET @binlog_start_pos=246; --enable_query_log diff --git a/mysql-test/include/index_merge2.inc b/mysql-test/include/index_merge2.inc index 1d6b82e1787..c50a45a9923 100644 --- a/mysql-test/include/index_merge2.inc +++ b/mysql-test/include/index_merge2.inc @@ -343,6 +343,7 @@ alter table t1 add index i3(key3); update t1 set key2=key1,key3=key1; # to test the bug, the following must use "sort_union": +--replace_column 9 REF explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); drop table t1; diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index a690ca4b334..c30cb7d1ff4 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -225,6 +225,8 @@ INSERT INTO global_suppressions VALUES ("Slave I/O: The slave I/O thread stops because a fatal error is encountered when it tried to SET @master_binlog_checksum on master.*"), ("Slave I/O: Get master BINLOG_CHECKSUM failed with error.*"), ("Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error.*"), + ("Slave I/O: Setting master-side filtering of @@skip_replication failed with error:.*"), + ("Slave I/O: Setting @mariadb_slave_capability failed with error:.*"), ("THE_LAST_SUPPRESSION")|| diff --git a/mysql-test/include/mysqlbinlog_have_debug.inc b/mysql-test/include/mysqlbinlog_have_debug.inc new file mode 100644 index 00000000000..14da1379ecd --- /dev/null +++ b/mysql-test/include/mysqlbinlog_have_debug.inc @@ -0,0 +1,34 @@ +############################################# +# checks if mysqlbinlog is debug compiled +# this "cannot" be done simply by using +# have_debug.inc +############################################# + +--disable_query_log +--let $temp_out_help_file=$MYSQL_TMP_DIR/mysqlbinlog_help.tmp +--exec $MYSQL_BINLOG --help>$temp_out_help_file +let log_tmp=$temp_out_help_file; +--let $temp_inc=$MYSQL_TMP_DIR/temp.inc +let inc_tmp=$temp_inc; + +--perl +use strict; +my $tmp_file= $ENV{'log_tmp'} or die "log_tmp not set"; +open(FILE, "$tmp_file") or die("Unable to open $tmp_file: $!\n"); +my $count = () = grep(/Output debug log/g,<FILE>); +close FILE; + +my $temp_inc= $ENV{'inc_tmp'} or die "temp_inc not set"; +open(FILE_INC,">", "$temp_inc") or die("can't open file \"$temp_inc\": $!"); +print FILE_INC '--let $is_debug= '.$count; +close FILE_INC; +EOF +--source $temp_inc + +if (!$is_debug) +{ + --skip mysqlbinlog needs to be debug compiled +} +--remove_file $temp_out_help_file +--remove_file $temp_inc +--enable_query_log diff --git a/mysql-test/include/query_cache_partitions.inc b/mysql-test/include/query_cache_partitions.inc new file mode 100644 index 00000000000..e5bb7406c10 --- /dev/null +++ b/mysql-test/include/query_cache_partitions.inc @@ -0,0 +1,126 @@ +# include/query_cache_partitions.inc +# +# The variables +# $engine_type -- storage engine to be tested +# have to be set before sourcing this script. + +eval SET SESSION STORAGE_ENGINE = $engine_type; + +# Initialise +--disable_warnings +drop table if exists t1; +--enable_warnings + +set @save_query_cache_size = @@global.query_cache_size; + +--echo # Test that partitions works with query cache + +flush query cache; + +SET GLOBAL query_cache_size=1024*1024*512; + CREATE TABLE `t1` ( + `id` int(11) NOT NULL , + `created_at` datetime NOT NULL, + `cool` tinyint default 0 + ); + + ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( + PARTITION month_2010_4 VALUES LESS THAN (734258), + PARTITION month_2010_5 VALUES LESS THAN (734289), + PARTITION month_max VALUES LESS THAN MAXVALUE + ); + +show create table t1; + +INSERT INTO t1 VALUES (1, now(), 0); + +flush status; +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + + +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +drop table t1; + +--echo # Test that sub-partitions works with query cache + +flush query cache; + +SET GLOBAL query_cache_size=1024*1024*512; + CREATE TABLE `t1` ( + `id` int(11) NOT NULL , + `created_at` datetime NOT NULL, + `cool` tinyint default 0 + ) + PARTITION BY RANGE (TO_DAYS(created_at)) + subpartition by hash(cool) subpartitions 3 ( + PARTITION month_2010_4 VALUES LESS THAN (734258), + PARTITION month_2010_5 VALUES LESS THAN (734289), + PARTITION month_max VALUES LESS THAN MAXVALUE + ); + +show create table t1; + +INSERT INTO t1 VALUES (1, now(), 0); + +flush status; +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +drop table t1; + +--echo # +--echo # MySQL bug#53775 Query on partitioned table returns cached result +--echo # from previous transaction +--echo # + +flush query cache; +flush status; + +SET GLOBAL query_cache_size=1024*1024*512; + CREATE TABLE `t1` ( + `id` int(11) NOT NULL , + `created_at` datetime NOT NULL, + `cool` tinyint default 0 + ); + + ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( + PARTITION month_2010_4 VALUES LESS THAN (734258), + PARTITION month_2010_5 VALUES LESS THAN (734289), + PARTITION month_max VALUES LESS THAN MAXVALUE + ); + +INSERT INTO t1 VALUES (1, now(), 0); + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +BEGIN; +UPDATE `t1` SET `cool` = 1 WHERE `id` = 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +BEGIN; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +drop table t1; + +set @@global.query_cache_size = @save_query_cache_size; diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc index 4f1d4f6f162..a1964572427 100644 --- a/mysql-test/include/setup_fake_relay_log.inc +++ b/mysql-test/include/setup_fake_relay_log.inc @@ -74,7 +74,6 @@ let $_fake_relay_index= $_fake_datadir/$_fake_filename.index; let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`; RESET SLAVE; -let $_orphan_relay_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); # Create relay log file. --copy_file $fake_relay_log $_fake_relay_log @@ -103,8 +102,5 @@ let $_orphan_relay_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); # Setup replication from existing relay log. eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4; -# remove the orphan log file (became spurious) --- remove_file $_fake_datadir/$_orphan_relay_file - --let $include_filename= setup_fake_relay_log.inc --source include/end_include_file.inc diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc index dd458096071..b2462e0d1b1 100644 --- a/mysql-test/include/show_binlog_events.inc +++ b/mysql-test/include/show_binlog_events.inc @@ -20,7 +20,7 @@ # # $binlog_start # Position for the 'FROM' clause of SHOW BINLOG EVENTS. If none -# given, starts right after the Format_description_log_event. +# given, starts right after the Binlog_checkpoint_log_even. # # $binlog_limit # Limit for the 'LIMIT' clause of SHOW BINLOG EVENTS, i.e.: diff --git a/mysql-test/include/show_binlog_events2.inc b/mysql-test/include/show_binlog_events2.inc index c32d12537fd..65a357c59f4 100644 --- a/mysql-test/include/show_binlog_events2.inc +++ b/mysql-test/include/show_binlog_events2.inc @@ -1,5 +1,16 @@ ---let $binlog_start=245 ---replace_result $binlog_start <binlog_start> +if ($binlog_start) +{ + --let $_binlog_start=$binlog_start +} +if (!$binlog_start) +{ + --let $_binlog_start=246 +} +if ($binlog_file) +{ + --let $_in_binlog_file=in '$binlog_file' +} +--replace_result $_binlog_start <binlog_start> --replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ ---eval show binlog events from $binlog_start +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ +--eval show binlog events $_in_binlog_file from $_binlog_start diff --git a/mysql-test/include/show_events.inc b/mysql-test/include/show_events.inc index ae2f08f65a6..2de24951846 100644 --- a/mysql-test/include/show_events.inc +++ b/mysql-test/include/show_events.inc @@ -10,13 +10,28 @@ --let $include_filename= show_events.inc --source include/begin_include_file.inc +# Do not modify $binlog_start - if we did, it could wrongly persist until a +# later call of show_events.inc. +if ($binlog_start) +{ + --let $_binlog_start= $binlog_start +} if (!$binlog_start) { - # If $binlog_start is not set, we will set it as the second event's - # position. The first event(Description Event) is always ignored. For - # description event's length might be changed because of adding new events, - # 'SHOW BINLOG EVENTS LIMIT 1' is used to get the right value. - --let $binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1) + # If $binlog_start is not set, we will set it as the third event's + # position (second in relay log which has not Binlog Checkpoing event). + # The first two events (Description Event and Binlog Checkpoint + # event) are always ignored. For description event's length might be changed + # because of adding new events, 'SHOW BINLOG EVENTS LIMIT 2' is used to get + # the right value. + if ($is_relay_log) + { + --let $_binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1) + } + if (!$is_relay_log) + { + --let $_binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 2, End_log_pos, 2) + } } --let $_se_old_statement= $statement @@ -44,7 +59,7 @@ if ($binlog_file) --let $statement= $statement in '$_binlog_file' } ---let $statement= $statement from $binlog_start +--let $statement= $statement from $_binlog_start if ($binlog_limit != '') { diff --git a/mysql-test/include/strict_autoinc.inc b/mysql-test/include/strict_autoinc.inc index 823efcc2040..3298008b66f 100644 --- a/mysql-test/include/strict_autoinc.inc +++ b/mysql-test/include/strict_autoinc.inc @@ -19,11 +19,12 @@ select count(*) from t1; set auto_increment_increment=1000; set auto_increment_offset=700; ---error ER_WARN_DATA_OUT_OF_RANGE +--error 167 insert into t1 values(null); select count(*) from t1; set @@sql_mode=@org_mode; +--error 167 insert into t1 values(null); select * from t1; diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 160fdcd935b..a8db67f1e67 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -472,11 +472,13 @@ sub process_suite { else { my @combs; - @combs = combinations_from_file($parent, "$suitedir/combinations") - unless $suite->{skip}; + my $from = "$suitedir/combinations"; + @combs = combinations_from_file($parent, $from) unless $suite->{skip}; $suite->{combinations} = [ @combs ]; # in overlays it's a union of parent's and overlay's files. - unshift @{$suite->{combinations}}, @{$parent->{combinations}} if $parent; + unshift @{$suite->{combinations}}, + grep { not $skip_combinations{"$from => $_->{name}"} } + @{$parent->{combinations}} if $parent; } # suite.opt @@ -1039,8 +1041,11 @@ sub get_tags_from_file($$) { $suite = load_suite_for_file($comb_file) if $prefix[0] eq ''; my @comb; unless ($suite->{skip}) { - @comb = combinations_from_file($over, "$prefix[0]$comb_file"); - push @comb, combinations_from_file(undef, "$prefix[1]$comb_file") if $over; + my $from = "$prefix[0]$comb_file"; + @comb = combinations_from_file($over, $from); + push @comb, + grep { not $skip_combinations{"$from => $_->{name}"} } + combinations_from_file(undef, "$prefix[1]$comb_file") if $over; } push @combinations, [ @comb ]; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c7c10f16816..ce964d6856d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -174,6 +174,7 @@ my $DEFAULT_SUITES= join(',', map { "$_-" } qw( heap innodb maria + multi_source optimizer_unfixed_bugs oqgraph parts @@ -1147,7 +1148,6 @@ sub command_line_setup { 'start-from=s' => \&collect_option, 'big-test+' => \$opt_big_test, 'combination=s' => \@opt_combinations, - 'skip-combinations' => \&collect_option, 'experimental=s' => \@opt_experimentals, # skip-im is deprecated and silently ignored 'skip-im' => \&ignore_option, @@ -6265,7 +6265,6 @@ Options to control what engine/variation to run all generated configs combination=<opt> Use at least twice to run tests with specified options to mysqld - skip-combinations Ignore combination file (or options) Options to control directories to use tmpdir=DIR The directory where temporary files are stored diff --git a/mysql-test/r/adddate_454.result b/mysql-test/r/adddate_454.result new file mode 100644 index 00000000000..0993cdce32c --- /dev/null +++ b/mysql-test/r/adddate_454.result @@ -0,0 +1,10 @@ +create table t1 (d date); +insert into t1 values ('2012-00-00'); +select * from t1; +d +2012-00-00 +update t1 set d = adddate(d, interval 1 day); +select * from t1; +d +NULL +drop table t1; diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 30b4ff11227..12cbf294b69 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -150,7 +150,7 @@ select last_insert_id(); last_insert_id() 255 insert into t1 set i = null; -ERROR 23000: Duplicate entry '255' for key 'PRIMARY' +ERROR 22003: Out of range value for column 'i' at row 1 select last_insert_id(); last_insert_id() 255 @@ -162,8 +162,7 @@ select last_insert_id(); last_insert_id() 255 insert into t1 set i = null; -Warnings: -Warning 1264 Out of range value for column 'i' at row 1 +ERROR 22003: Out of range value for column 'i' at row 1 select last_insert_id(); last_insert_id() 255 @@ -487,7 +486,7 @@ SELECT @@SESSION.AUTO_INCREMENT_OFFSET; @@SESSION.AUTO_INCREMENT_OFFSET 1 INSERT INTO t1 VALUES (NULL), (NULL), (NULL); -ERROR 22003: Out of range value for column 't1' at row 167 +ERROR 22003: Out of range value for column 'c1' at row 2 SELECT * FROM t1; c1 1 diff --git a/mysql-test/r/auto_increment_ranges_innodb.result b/mysql-test/r/auto_increment_ranges_innodb.result new file mode 100644 index 00000000000..fb936ddfd2b --- /dev/null +++ b/mysql-test/r/auto_increment_ranges_innodb.result @@ -0,0 +1,266 @@ +set default_storage_engine=innodb; +drop table if exists t1; +# +# Testing ranges with smallint +# +create table t1 (a smallint primary key auto_increment); +insert into t1 values(32767); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(32767-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +32766 +32767 +truncate table t1; +insert into t1 values(32767),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +truncate table t1; +insert into t1 values(32767-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(32767+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +32767 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with unsigned smallint +# +create table t1 (a smallint unsigned primary key auto_increment); +insert into t1 values(65535); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(65535-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +65534 +65535 +truncate table t1; +insert into t1 values(65535),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +truncate table t1; +insert into t1 values(65535-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(65535+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +65535 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with integer +# +create table t1 (a int primary key auto_increment); +insert into t1 values(2147483647); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(2147483647-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +2147483646 +2147483647 +truncate table t1; +insert into t1 values(2147483647),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +truncate table t1; +insert into t1 values(2147483647-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(2147483647+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +2147483647 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with unsigned integer +# +create table t1 (a int unsigned primary key auto_increment); +insert into t1 values(4294967295); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(4294967295-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +4294967294 +4294967295 +truncate table t1; +insert into t1 values(4294967295),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +truncate table t1; +insert into t1 values(4294967295-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(4294967295+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +4294967295 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with bigint +# +create table t1 (a bigint primary key auto_increment); +insert into t1 values(cast(9223372036854775807 as unsigned)); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(cast(9223372036854775807 as unsigned)-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +9223372036854775806 +9223372036854775807 +truncate table t1; +insert into t1 values(cast(9223372036854775807 as unsigned)),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +truncate table t1; +insert into t1 values(cast(9223372036854775807 as unsigned)-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(cast(9223372036854775807 as unsigned)+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +9223372036854775807 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with unsigned bigint +# +create table t1 (a bigint unsigned primary key auto_increment); +insert into t1 values(18446744073709551615-1); +insert into t1 values(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +insert into t1 values(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +truncate table t1; +insert into t1 values(18446744073709551615-1); +insert into t1 values(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +insert into t1 values(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +select * from t1; +a +18446744073709551614 +truncate table t1; +insert into t1 values(18446744073709551615),(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +select * from t1; +a +truncate table t1; +insert into t1 values(18446744073709551615-1),(NULL),(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +drop table t1; +# +# Test IGNORE and strict mode +# +create table t1 (a smallint primary key auto_increment); +insert ignore into t1 values(32766),(NULL),(NULL),(1); +Warnings: +Warning 167 Out of range value for column 'a' at row 3 +select * from t1; +a +1 +32766 +32767 +truncate table t1; +set @org_mode=@@sql_mode; +set @@sql_mode='ansi,traditional'; +insert ignore into t1 values(32766),(NULL),(NULL); +Warnings: +Warning 167 Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(32766),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +set @@sql_mode=@org_mode; +drop table t1; +# +# Test auto increment with negative numbers +# +CREATE TABLE t1 (a INTEGER AUTO_INCREMENT, PRIMARY KEY (a)); +INSERT INTO t1 VALUES (NULL), (2), (-5), (NULL); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +a +-5 +1 +2 +3 +5 +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES (-5), (NULL); +SELECT * FROM t1; +a +-5 +1 +DROP TABLE t1; +# +# Test inserting a value out-of-range into an auto increment column +# +CREATE TABLE t1 (a smallint AUTO_INCREMENT, PRIMARY KEY (a)); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (32768); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +INSERT INTO t1 VALUES (NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a +2 +32767 +DROP TABLE t1; +# +# Test old behaviour +# +create table t1 (a smallint primary key auto_increment); +insert into t1 values(32766),(NULL); +delete from t1 where a=32767; +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; diff --git a/mysql-test/r/auto_increment_ranges_myisam.result b/mysql-test/r/auto_increment_ranges_myisam.result new file mode 100644 index 00000000000..5101321c864 --- /dev/null +++ b/mysql-test/r/auto_increment_ranges_myisam.result @@ -0,0 +1,272 @@ +set default_storage_engine=MYISAM; +drop table if exists t1; +# +# Testing ranges with smallint +# +create table t1 (a smallint primary key auto_increment); +insert into t1 values(32767); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(32767-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +32766 +32767 +truncate table t1; +insert into t1 values(32767),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +32767 +truncate table t1; +insert into t1 values(32767-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(32767+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +32767 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with unsigned smallint +# +create table t1 (a smallint unsigned primary key auto_increment); +insert into t1 values(65535); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(65535-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +65534 +65535 +truncate table t1; +insert into t1 values(65535),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +65535 +truncate table t1; +insert into t1 values(65535-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(65535+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +65535 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with integer +# +create table t1 (a int primary key auto_increment); +insert into t1 values(2147483647); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(2147483647-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +2147483646 +2147483647 +truncate table t1; +insert into t1 values(2147483647),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +2147483647 +truncate table t1; +insert into t1 values(2147483647-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(2147483647+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +2147483647 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with unsigned integer +# +create table t1 (a int unsigned primary key auto_increment); +insert into t1 values(4294967295); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(4294967295-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +4294967294 +4294967295 +truncate table t1; +insert into t1 values(4294967295),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +4294967295 +truncate table t1; +insert into t1 values(4294967295-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(4294967295+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +4294967295 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with bigint +# +create table t1 (a bigint primary key auto_increment); +insert into t1 values(cast(9223372036854775807 as unsigned)); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +truncate table t1; +insert into t1 values(cast(9223372036854775807 as unsigned)-1); +insert into t1 values(NULL); +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +select * from t1; +a +9223372036854775806 +9223372036854775807 +truncate table t1; +insert into t1 values(cast(9223372036854775807 as unsigned)),(NULL); +ERROR 22003: Out of range value for column 'a' at row 2 +select * from t1; +a +9223372036854775807 +truncate table t1; +insert into t1 values(cast(9223372036854775807 as unsigned)-1),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(cast(9223372036854775807 as unsigned)+1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +select * from t1; +a +9223372036854775807 +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; +# +# Testing ranges with unsigned bigint +# +create table t1 (a bigint unsigned primary key auto_increment); +insert into t1 values(18446744073709551615-1); +insert into t1 values(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +insert into t1 values(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +truncate table t1; +insert into t1 values(18446744073709551615-1); +insert into t1 values(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +insert into t1 values(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +select * from t1; +a +18446744073709551614 +truncate table t1; +insert into t1 values(18446744073709551615),(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +select * from t1; +a +18446744073709551615 +truncate table t1; +insert into t1 values(18446744073709551615-1),(NULL),(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +drop table t1; +# +# Test IGNORE and strict mode +# +create table t1 (a smallint primary key auto_increment); +insert ignore into t1 values(32766),(NULL),(NULL),(1); +Warnings: +Warning 167 Out of range value for column 'a' at row 3 +select * from t1; +a +1 +32766 +32767 +truncate table t1; +set @org_mode=@@sql_mode; +set @@sql_mode='ansi,traditional'; +insert ignore into t1 values(32766),(NULL),(NULL); +Warnings: +Warning 167 Out of range value for column 'a' at row 3 +truncate table t1; +insert into t1 values(32766),(NULL),(NULL); +ERROR 22003: Out of range value for column 'a' at row 3 +set @@sql_mode=@org_mode; +drop table t1; +# +# Test auto increment with negative numbers +# +CREATE TABLE t1 (a INTEGER AUTO_INCREMENT, PRIMARY KEY (a)); +INSERT INTO t1 VALUES (NULL), (2), (-5), (NULL); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +a +-5 +1 +2 +3 +4 +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES (-5), (NULL); +SELECT * FROM t1; +a +-5 +1 +DROP TABLE t1; +# +# Test inserting a value out-of-range into an auto increment column +# +CREATE TABLE t1 (a smallint AUTO_INCREMENT, PRIMARY KEY (a)); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (32768); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +INSERT INTO t1 VALUES (NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a +2 +32767 +DROP TABLE t1; +# +# Test old behaviour +# +create table t1 (a smallint primary key auto_increment); +insert into t1 values(32766),(NULL); +delete from t1 where a=32767; +insert into t1 values(NULL); +ERROR 22003: Out of range value for column 'a' at row 1 +drop table t1; diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index a95975f1097..3852da5d4b0 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -220,6 +220,10 @@ a d 3 11120436154190595086 drop table t1, t2; End of 5.0 tests +CREATE TABLE t1(a YEAR); +SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END; +1 +DROP TABLE t1; create table t1 (f1 time); insert t1 values ('00:00:00'),('00:01:00'); select case t1.f1 when '00:00:00' then 1 end from t1; diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result index 3e3d75f66e4..af198edc4ca 100644 --- a/mysql-test/r/commit_1innodb.result +++ b/mysql-test/r/commit_1innodb.result @@ -529,6 +529,8 @@ SUCCESS # 13. Read-write statement: INSERT IGNORE, change 0 rows. # insert ignore t1 set a=2; +Warnings: +Warning 1062 Duplicate entry '2' for key 'a' call p_verify_status_increment(2, 2, 1, 0); SUCCESS diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index 6ee01349022..cdd234f1478 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -96,3 +96,7 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00'; a DROP TABLE t1; End of 5.0 tests +CREATE TABLE t1(a INT ZEROFILL); +SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; +1 +DROP TABLE t1; diff --git a/mysql-test/r/create-big.result b/mysql-test/r/create-big.result index 34293d7e5cd..4cce5d8618c 100644 --- a/mysql-test/r/create-big.result +++ b/mysql-test/r/create-big.result @@ -53,8 +53,8 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; set debug_sync='now WAIT_FOR parked'; alter table t3 rename to t1; -ERROR 42S01: Table 't1' already exists set debug_sync='now SIGNAL go'; +ERROR 42S01: Table 't1' already exists show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -65,8 +65,8 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; set debug_sync='now WAIT_FOR parked'; alter table t3 rename to t1, add k int; -ERROR 42S01: Table 't1' already exists set debug_sync='now SIGNAL go'; +ERROR 42S01: Table 't1' already exists show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 0a6dff6d9a3..ba52959be84 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -2396,6 +2396,8 @@ a b drop table t1; create table if not exists t1 (a int unique, b int) ignore select 1 as a, 1 as b union select 1 as a, 2 as b; +Warnings: +Warning 1062 Duplicate entry '1' for key 'a' select * from t1; a b 1 1 diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 1cb4b48ed69..c897108f793 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2039,6 +2039,8 @@ hex(concat(a)) a 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -2352,6 +2354,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 3d695a87701..5323469dff3 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -2431,6 +2431,8 @@ hex(concat(a)) a 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -2744,6 +2746,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index e2169e4e4e2..ae459fce8eb 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -2458,6 +2458,8 @@ hex(concat(a)) a 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -2771,6 +2773,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 501b9cb611b..d463ce87c92 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -3341,6 +3341,8 @@ hex(concat(a)) a 00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -3654,6 +3656,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index 03f60261450..6cf24d768f7 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -1182,5 +1182,11 @@ a 256 Warnings: Warning 1260 Row 1 was cut by GROUP_CONCAT() # +# incorrect charset for val_str_ascii +# +SELECT '2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second; +'2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second +2010-10-10 10:10:10 +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 4dd9d787528..69e32977103 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -4197,6 +4197,8 @@ hex(concat(a)) a 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -4510,6 +4512,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/datetime_456.result b/mysql-test/r/datetime_456.result new file mode 100644 index 00000000000..ba020a250b7 --- /dev/null +++ b/mysql-test/r/datetime_456.result @@ -0,0 +1,8 @@ +create table t1 (d datetime); +insert t1 values (addtime('9999-12-31 23:59:59', '00:00:01')), +(from_days(3652499)); +select * from t1; +d +NULL +NULL +drop table t1; diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index ba01db4a66f..5446406924f 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -1687,7 +1687,6 @@ SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t WHERE t.b AND t.c = t1.a; b c a -8 c c EXPLAIN EXTENDED SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t @@ -1702,7 +1701,6 @@ SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t WHERE t.b <> 0 AND t.c = t1.a; b c a -8 c c INSERT INTO t3 VALUES (100), (200); EXPLAIN EXTENDED SELECT t.b, t.c, t1.a @@ -1718,7 +1716,7 @@ SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t WHERE t.b AND t.c = t1.a; b c a -8 c c +NULL NULL c EXPLAIN EXTENDED SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t @@ -1733,7 +1731,7 @@ SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t WHERE t.b <> 0 AND t.c = t1.a; b c a -8 c c +NULL NULL c SET optimizer_switch=@save_optimizer_switch; DROP TABLE t1,t2,t3; # diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 8560e6176c4..23c77d3978c 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -160,3 +160,11 @@ ERROR 42S22: Unknown column '' in 'VALUES() function' INSERT INTO t2(a,b) VALUES (1,0) ON DUPLICATE KEY UPDATE b=(SELECT VALUES(a)+2 FROM t1); DROP TABLE t1, t2; +# +# MDEV-492: incorrect error check before sending OK in mysql_update +# +CREATE TABLE t1 (a CHAR(3), b BLOB); +UPDATE t1 SET a = 'new' +WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL; +ERROR 22007: Illegal value used as argument of dynamic column function +drop table t1; diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index e081b56e6ce..919e29f185e 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -287,7 +287,7 @@ WHERE t1.f1 GROUP BY t1.f1)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE 1 > ALL((SELECT t1.f1 FROM t1 RIGHT OUTER JOIN t1 a @@ -297,12 +297,12 @@ EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where DEALLOCATE PREPARE stmt; PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 @@ -313,12 +313,12 @@ EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 5.1 tests. diff --git a/mysql-test/r/features.result b/mysql-test/r/features.result new file mode 100644 index 00000000000..7b6a352ab0c --- /dev/null +++ b/mysql-test/r/features.result @@ -0,0 +1,140 @@ +drop table if exists t1; +show status like "feature%"; +Variable_name Value +Feature_dynamic_columns 0 +Feature_fulltext 0 +Feature_gis 0 +Feature_locale 0 +Feature_subquery 0 +Feature_timezone 0 +Feature_trigger 0 +Feature_xml 0 +# +# Feature GIS +# +CREATE TABLE t1 (g POINT); +SHOW FIELDS FROM t1; +Field Type Null Key Default Extra +g point YES NULL +INSERT INTO t1 VALUES +(PointFromText('POINT(10 10)')), +(PointFromText('POINT(20 10)')), +(PointFromText('POINT(20 20)')), +(PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +drop table t1; +show status like "feature_gis"; +Variable_name Value +Feature_gis 3 +# +# Feature dynamic columns +# +set @a= COLUMN_CREATE(1, 1212 AS int); +set @b= column_add(@a, 2, 1212 as integer); +select column_get(@b, 2 as integer); +column_get(@b, 2 as integer) +1212 +show status like "feature_dynamic_columns"; +Variable_name Value +Feature_dynamic_columns 2 +# +# Feature fulltext +# +CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)) engine=myisam; +INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), +('Full-text indexes', 'are called collections'), +('Only MyISAM tables','support collections'), +('Function MATCH ... AGAINST()','is used to do a search'), +('Full-text search in MySQL', 'implements vector space model'); +select * from t1 where MATCH(a,b) AGAINST ("collections"); +a b +Only MyISAM tables support collections +Full-text indexes are called collections +select * from t1 where MATCH(a,b) AGAINST ("indexes"); +a b +Full-text indexes are called collections +drop table t1; +show status like "feature_fulltext"; +Variable_name Value +Feature_fulltext 2 +# +# Feature locale +# +SET lc_messages=sr_RS; +SET lc_messages=en_US; +show status like "feature_locale"; +Variable_name Value +Feature_locale 2 +# +# Feature subquery +# +select (select 2); +(select 2) +2 +SELECT (SELECT 1) UNION SELECT (SELECT 2); +(SELECT 1) +1 +2 +create table t1 (a int); +insert into t1 values (2); +select (select a from t1 where t1.a=t2.a), a from t1 as t2; +(select a from t1 where t1.a=t2.a) a +2 2 +drop table t1; +show status like "feature_subquery"; +Variable_name Value +Feature_subquery 4 +# +# Feature timezone +# +SELECT FROM_UNIXTIME(unix_timestamp()) > "1970-01-01"; +FROM_UNIXTIME(unix_timestamp()) > "1970-01-01" +1 +set time_zone="+03:00"; +SELECT FROM_UNIXTIME(unix_timestamp()) > "1970-01-01"; +FROM_UNIXTIME(unix_timestamp()) > "1970-01-01" +1 +set time_zone= @@global.time_zone; +show status like "feature_timezone"; +Variable_name Value +Feature_timezone 1 +# +# Feature triggers +# +create table t1 (i int); +# let us test some very simple trigger +create trigger trg before insert on t1 for each row set @a:=1; +set @a:=0; +select @a; +@a +0 +insert into t1 values (1),(2); +select @a; +@a +1 +SHOW TRIGGERS IN test like 't1'; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg INSERT t1 set @a:=1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +drop trigger trg; +drop table t1; +show status like "%trigger%"; +Variable_name Value +Com_create_trigger 1 +Com_drop_trigger 1 +Com_show_create_trigger 0 +Com_show_triggers 1 +Executed_triggers 2 +Feature_trigger 2 +# +# Feature xml +# +SET @xml='<a aa1="aa1" aa2="aa2">a1<b ba1="ba1">b1<c>c1</c>b2</b>a2</a>'; +SELECT extractValue(@xml,'/a'); +extractValue(@xml,'/a') +a1 a2 +select updatexml('<div><div><span>1</span><span>2</span></div></div>', +'/','<tr><td>1</td><td>2</td></tr>') as upd1; +upd1 +<tr><td>1</td><td>2</td></tr> +show status like "feature_xml"; +Variable_name Value +Feature_xml 2 diff --git a/mysql-test/r/filesort_debug.result b/mysql-test/r/filesort_debug.result index 6d6eb817259..13912ac8756 100644 --- a/mysql-test/r/filesort_debug.result +++ b/mysql-test/r/filesort_debug.result @@ -4,7 +4,7 @@ SET @old_debug= @@session.debug; # CREATE TABLE t1(f0 int auto_increment primary key, f1 int); INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5); -SET session debug_dbug= '+d,make_sort_keys_alloc_fail'; +SET session debug_dbug= '+d,alloc_sort_buffer_fail'; CALL mtr.add_suppression("Out of sort memory"); SELECT * FROM t1 ORDER BY f1 ASC, f0; ERROR HY001: Out of sort memory, consider increasing server sort buffer size diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index d3b3cd16210..b64351045bf 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -489,3 +489,10 @@ UNLOCK TABLES; # Switching to connection 'default'. COMMIT; DROP TABLE t1; +# +# Test flushing slave or relay logs twice +# +flush relay logs,relay logs; +ERROR HY000: Incorrect usage of FLUSH and RELAY LOGS +flush slave,slave; +ERROR HY000: Incorrect usage of FLUSH and SLAVE diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index c38201f6d9f..65323257300 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1527,6 +1527,8 @@ DROP TABLE t1; # Bug#43668: Wrong comparison and MIN/MAX for YEAR(2) # create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (98,1998,19980101,"1998-01-01 00:00:00"), (00,2000,20000101,"2000-01-01 00:00:01"), @@ -1838,7 +1840,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 range a a 4 NULL 4 100.00 Using where; Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where (<expr_cache><<cache>(1),<cache>(2)>(<in_optimizer>(<cache>((1,2)),<exists>(select 3,4 having (((1 = 3) or isnull(3)) and ((2 = 4) or isnull(4)) and <is_not_null_test>(3) and <is_not_null_test>(4))))) and (`test`.`t1`.`a` < 10)) +Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where (<cache>(<in_optimizer>((1,2),<exists>(select 3,4 having (((1 = 3) or isnull(3)) and ((2 = 4) or isnull(4)) and <is_not_null_test>(3) and <is_not_null_test>(4))))) and (`test`.`t1`.`a` < 10)) SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT 3,4) AND a<10; MAX(a) NULL diff --git a/mysql-test/r/func_group_innodb.result b/mysql-test/r/func_group_innodb.result index 6485793d0e1..67ea44f187a 100644 --- a/mysql-test/r/func_group_innodb.result +++ b/mysql-test/r/func_group_innodb.result @@ -146,19 +146,6 @@ count(*) min(7) max(7) 0 NULL NULL drop table t1m, t1i, t2m, t2i; # -# Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN -# -CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, -KEY(b, c, a(765))) ENGINE=INNODB; -INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0); -SELECT MIN(c) FROM t1 GROUP BY b; -MIN(c) -0 -EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL b 263 NULL 4 Using index for group-by -DROP TABLE t1; -# # Bug #57954: BIT_AND function returns incorrect results when # semijoin=on CREATE TABLE c ( @@ -230,4 +217,18 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date = member_id_to COUNT(*) 518491 2 DROP TABLE t1; +# End of test BUG#12713907 +# +# Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN +# +CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, +KEY(b, c, a(765))) ENGINE=INNODB; +INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0); +SELECT MIN(c) FROM t1 GROUP BY b; +MIN(c) +0 +EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL b 263 NULL 4 Using index for group-by +DROP TABLE t1; End of 5.5 tests diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index bfc6b72caa1..98854db4812 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1023,11 +1023,11 @@ MAKETIME(CAST(-1 AS UNSIGNED), 0, 0) Warnings: Note 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect time value: '18446744073709551615:00:00' -SELECT EXTRACT(HOUR FROM '100000:02:03'); -EXTRACT(HOUR FROM '100000:02:03') +SELECT EXTRACT(HOUR FROM '10000:02:03'); +EXTRACT(HOUR FROM '10000:02:03') 838 Warnings: -Warning 1292 Truncated incorrect time value: '100000:02:03' +Warning 1292 Truncated incorrect time value: '10000:02:03' CREATE TABLE t1(f1 TIME); INSERT INTO t1 VALUES('916:00:00 a'); Warnings: @@ -1922,3 +1922,5 @@ cast(greatest(cast("0-0-0" as date), cast("10:20:05" as time)) as datetime(6)) select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010'); microsecond('12:00:00.123456') microsecond('2009-12-31 23:59:59.000010') 123456 10 +select now(258); +ERROR 42000: Too big precision 258 specified for 'now'. Maximum is 6. diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index ca48177b1b5..30385323502 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1428,6 +1428,29 @@ WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; count(*) 1 DROP DATABASE gis_ogs; +# +# BUG #1043845 st_distance() results are incorrect depending on variable order +# +select st_distance(geomfromtext('LINESTRING(-95.9673005697771 36.13509598461, + -95.9673057475387 36.1344478941074, + -95.9673063519371 36.134484524621, + -95.9673049102515 36.1343976584193)'), +geomfromtext('point(-95.96269500000000000000 36.14181833333330000000)')) ; +st_distance(geomfromtext('LINESTRING(-95.9673005697771 36.13509598461, + -95.9673057475387 36.1344478941074, + -95.9673063519371 36.134484524621, + +0.008148695928146028 +select st_distance(geomfromtext('point(-95.96269500000000000000 36.14181833333330000000)'), +geomfromtext('LINESTRING(-95.9673005697771 36.13509598461, + -95.9673057475387 36.1344478941074, + -95.9673063519371 36.134484524621, + -95.9673049102515 36.1343976584193) ')) ; +st_distance(geomfromtext('point(-95.96269500000000000000 36.14181833333330000000)'), +geomfromtext('LINESTRING(-95.9673005697771 36.13509598461, + -95.9673057475387 36.1344478941074, + -95.9673063519371 36. +0.008148695928146028 USE test; # # BUG#12414917 - ISCLOSED() CRASHES ON 64-BIT BUILDS diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 85ec79d94a1..72c53697e61 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2149,3 +2149,48 @@ f1 MIN(f2) MAX(f2) 4 00:25:00 00:25:00 DROP TABLE t1; #End of test#49771 +# +# Bug #58782 +# Missing rows with SELECT .. WHERE .. IN subquery +# with full GROUP BY and no aggr +# +CREATE TABLE t1 ( +pk INT NOT NULL, +col_int_nokey INT, +PRIMARY KEY (pk) +); +INSERT INTO t1 VALUES (10,7); +INSERT INTO t1 VALUES (11,1); +INSERT INTO t1 VALUES (12,5); +INSERT INTO t1 VALUES (13,3); +SELECT pk AS field1, col_int_nokey AS field2 +FROM t1 +WHERE col_int_nokey > 0 +GROUP BY field1, field2; +field1 field2 +10 7 +11 1 +12 5 +13 3 +CREATE TABLE where_subselect +SELECT pk AS field1, col_int_nokey AS field2 +FROM t1 +WHERE col_int_nokey > 0 +GROUP BY field1, field2 +; +SELECT * +FROM where_subselect +WHERE (field1, field2) IN ( +SELECT pk AS field1, col_int_nokey AS field2 +FROM t1 +WHERE col_int_nokey > 0 +GROUP BY field1, field2 +); +field1 field2 +10 7 +11 1 +12 5 +13 3 +DROP TABLE t1; +DROP TABLE where_subselect; +# End of Bug #58782 diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index 95caa6853b8..ce0793b70a6 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -2403,7 +2403,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 index NULL a 10 NULL 15 Using index +2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra @@ -2421,7 +2421,7 @@ AND t1_outer1.b = t1_outer2.b; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index 1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 index NULL a 10 NULL 15 Using index +2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2; id select_type table type possible_keys key key_len ref rows Extra @@ -2757,7 +2757,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); id select_type table type possible_keys key key_len ref rows Extra x x x x x x x x x Impossible WHERE noticed after reading const tables -x x x x x x x x x Using index +x x x x x x x x x Using where; Using index SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); MIN( a ) NULL @@ -2829,7 +2829,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); id select_type table type possible_keys key key_len ref rows Extra x x x x x x x x x Impossible WHERE noticed after reading const tables -x x x x x x x x x Using index +x x x x x x x x x Using where; Using index SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); MIN( a ) NULL @@ -2908,7 +2908,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); id select_type table type possible_keys key key_len ref rows Extra x x x x x x x x x Impossible WHERE noticed after reading const tables -x x x x x x x x x Using index +x x x x x x x x x Using where; Using index SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); MIN( a ) NULL diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result index b8eda092291..b93d15f7bef 100644 --- a/mysql-test/r/index_merge_innodb.result +++ b/mysql-test/r/index_merge_innodb.result @@ -313,7 +313,7 @@ alter table t1 add index i3(key3); update t1 set key2=key1,key3=key1; explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL 9 Using sort_union(i3,i2); Using where +1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL REF Using sort_union(i3,i2); Using where select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); key1 key2 key3 31 31 31 @@ -777,4 +777,19 @@ commit; select * from t1 where t1.zone_id=830 AND modified=9; pk zone_id modified drop table t0, t1; +# +# MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join +# +CREATE TABLE t1 ( +a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d'); +SELECT ta.* FROM t1 AS ta, t1 AS tb +WHERE ( tb.b != ta.b OR tb.a = ta.a ) +AND ( tb.b = ta.c OR tb.b = ta.b ); +a b c +8 v v +8 m m +9 d d +DROP TABLE t1; set optimizer_switch= @optimizer_switch_save; diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result index bf151a872cf..0b6959d15a9 100644 --- a/mysql-test/r/index_merge_myisam.result +++ b/mysql-test/r/index_merge_myisam.result @@ -1146,7 +1146,7 @@ alter table t1 add index i3(key3); update t1 set key2=key1,key3=key1; explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL 11 Using sort_union(i3,i2); Using where +1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL REF Using sort_union(i3,i2); Using where select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); key1 key2 key3 31 31 31 diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 655303be7f4..7110f541fb7 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -327,9 +327,11 @@ select row_count(); row_count() 3 insert ignore into t1 values (1, 1); +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' select row_count(); row_count() -0 +-1 replace into t1 values (1, 11); select row_count(); row_count() @@ -371,7 +373,15 @@ drop table t1,t2; create table t1 (id int primary key auto_increment, data int, unique(data)); insert ignore into t1 values(NULL,100),(NULL,110),(NULL,120); insert ignore into t1 values(NULL,10),(NULL,20),(NULL,110),(NULL,120),(NULL,100),(NULL,90); +Warnings: +Warning 1062 Duplicate entry '110' for key 'data' +Warning 1062 Duplicate entry '120' for key 'data' +Warning 1062 Duplicate entry '100' for key 'data' insert ignore into t1 values(NULL,130),(NULL,140),(500,110),(550,120),(450,100),(NULL,150); +Warnings: +Warning 1062 Duplicate entry '110' for key 'data' +Warning 1062 Duplicate entry '120' for key 'data' +Warning 1062 Duplicate entry '100' for key 'data' select * from t1 order by id; id data 1 100 diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index c952b914167..8bfc4e9215e 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -6,6 +6,10 @@ insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1; insert into t2 (payoutID) SELECT payoutID+10 FROM t1; ERROR 23000: Duplicate entry '16' for key 'PRIMARY' insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1; +Warnings: +Warning 1062 Duplicate entry '16' for key 'PRIMARY' +Warning 1062 Duplicate entry '16' for key 'PRIMARY' +Warning 1062 Duplicate entry '22' for key 'PRIMARY' select * from t2; payoutID 1 diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index c3acea5d11f..1987c5c0559 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -172,11 +172,15 @@ DROP TABLE t2; create table t1 (a int not null unique) engine=myisam; insert into t1 values (1),(2); insert ignore into t1 select 1 on duplicate key update a=2; +Warnings: +Warning 1062 Duplicate entry '2' for key 'a' select * from t1; a 1 2 insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ; +Warnings: +Warning 1062 Duplicate entry '2' for key 'a' select * from t1; a 1 diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index e215caadb1c..e63afeab126 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -599,7 +599,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 index NULL a 10 NULL 15 Using index +2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by SELECT 1 as RES FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; RES diff --git a/mysql-test/r/last_value.result b/mysql-test/r/last_value.result new file mode 100644 index 00000000000..6222eacd4f0 --- /dev/null +++ b/mysql-test/r/last_value.result @@ -0,0 +1,73 @@ +drop table if exists t1; +drop database if exists mysqltest; +CREATE TABLE t1 (a INT, b INT, c INT, d INT); +INSERT INTO t1 VALUES (1,3,0,NULL),(2,2,0,NULL),(3,4,0,NULL),(4,2,0,NULL); +SELECT * FROM t1; +a b c d +1 3 0 NULL +2 2 0 NULL +3 4 0 NULL +4 2 0 NULL +UPDATE t1 SET c=LAST_VALUE(@last_a:=a,@last_b:=b,@last_c:=c,1), d=4211 WHERE c=0 ORDER BY b DESC LIMIT 1; +SELECT @last_a, @last_b, @last_c; +@last_a @last_b @last_c +3 4 0 +SELECT * FROM t1; +a b c d +1 3 0 NULL +2 2 0 NULL +3 4 1 4211 +4 2 0 NULL +DROP TABLE t1; +SELECT LAST_VALUE(@last_a:=1,@last_b:=1); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LAST_VALUE(@last_a:=1,@last_b:=1) 8 1 1 N 32897 0 63 +LAST_VALUE(@last_a:=1,@last_b:=1) +1 +select @last_b; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def @last_b 8 20 1 Y 32896 0 63 +@last_b +1 +SELECT LAST_VALUE(@last_a:=1,@last_b:=1.0); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LAST_VALUE(@last_a:=1,@last_b:=1.0) 246 4 3 N 32897 1 63 +LAST_VALUE(@last_a:=1,@last_b:=1.0) +1.0 +select @last_b; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def @last_b 246 83 3 Y 32896 30 63 +@last_b +1.0 +SELECT LAST_VALUE(@last_a:=1,@last_b:="hello"); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LAST_VALUE(@last_a:=1,@last_b:="hello") 253 5 5 N 1 31 8 +LAST_VALUE(@last_a:=1,@last_b:="hello") +hello +select @last_b; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def @last_b 250 16777215 5 Y 0 31 8 +@last_b +hello +SELECT date(LAST_VALUE(@last_a:=1,@last_b:="2001-02-03")); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def date(LAST_VALUE(@last_a:=1,@last_b:="2001-02-03")) 10 10 10 Y 128 0 63 +date(LAST_VALUE(@last_a:=1,@last_b:="2001-02-03")) +2001-02-03 +select @last_b; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def @last_b 250 16777215 10 Y 0 31 8 +@last_b +2001-02-03 +SELECT LAST_VALUE(@last_a:=1,@last_b:="2001-02-03",NULL); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LAST_VALUE(@last_a:=1,@last_b:="2001-02-03",NULL) 6 0 0 Y 32896 0 63 +LAST_VALUE(@last_a:=1,@last_b:="2001-02-03",NULL) +NULL +select @last_b; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def @last_b 250 16777215 10 Y 0 31 8 +@last_b +2001-02-03 +SELECT LAST_VALUE(); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1 diff --git a/mysql-test/r/limit_rows_examined.result b/mysql-test/r/limit_rows_examined.result index 3a5212818ef..f4242f17a14 100644 --- a/mysql-test/r/limit_rows_examined.result +++ b/mysql-test/r/limit_rows_examined.result @@ -679,7 +679,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 Using temporary 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Distinct 2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) SELECT DISTINCT a AS field1 FROM t1, t2 WHERE EXISTS (SELECT c FROM t3 LEFT JOIN t2 ON b = d) HAVING field1 > 'aaa' LIMIT ROWS EXAMINED 20; diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index ee0e63706a1..c4c8216c14a 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -5,8 +5,8 @@ Warnings: Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'd' at row 1 -Warning 1264 Out of range value for column 'a' at row 2 -Warning 1264 Out of range value for column 'b' at row 2 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'b' at row 2 Warning 1265 Data truncated for column 'd' at row 2 load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; SELECT * from t1; @@ -20,7 +20,7 @@ load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated Warnings: Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'd' at row 1 -Warning 1264 Out of range value for column 'b' at row 2 +Warning 1265 Data truncated for column 'b' at row 2 Warning 1265 Data truncated for column 'd' at row 2 SELECT * from t1; a b c d diff --git a/mysql-test/r/mdev375.result b/mysql-test/r/mdev375.result new file mode 100644 index 00000000000..32580804686 --- /dev/null +++ b/mysql-test/r/mdev375.result @@ -0,0 +1,14 @@ +SET GLOBAL log_warnings=4; +SET GLOBAL max_connections=2; +SELECT 1; +1 +1 +SELECT 2; +2 +2 +ERROR HY000: Too many connections +SELECT 0; +0 +0 +SET GLOBAL log_warnings=default; +SET GLOBAL max_connections=default; diff --git a/mysql-test/r/mix2_myisam.result b/mysql-test/r/mix2_myisam.result index e5f5857d2c9..6f90555325b 100644 --- a/mysql-test/r/mix2_myisam.result +++ b/mysql-test/r/mix2_myisam.result @@ -702,6 +702,8 @@ id 2 99 insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); +Warnings: +Warning 1062 Duplicate entry '1-1' for key 'PRIMARY' commit; select id,id3 from t1; id id3 diff --git a/mysql-test/r/myisam_mrr.result b/mysql-test/r/myisam_mrr.result index 03d212dbc04..bd50df7c40e 100644 --- a/mysql-test/r/myisam_mrr.result +++ b/mysql-test/r/myisam_mrr.result @@ -278,6 +278,8 @@ bb-1 NULL cc-2 NULL-1 drop table t1, t2, t3, t4; create table t1 (a int, b int not null,unique key (a,b),index(b)); insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6); +Warnings: +Warning 1062 Duplicate entry '6-6' for key 'a' create table t2 like t1; insert into t2 select * from t1; alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10)); diff --git a/mysql-test/r/mysqlbinlog-innodb.result b/mysql-test/r/mysqlbinlog-innodb.result index fed2c8a8651..41d15bc32d3 100644 --- a/mysql-test/r/mysqlbinlog-innodb.result +++ b/mysql-test/r/mysqlbinlog-innodb.result @@ -34,7 +34,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; INSERT INTO t1 VALUES (1) /*!*/; @@ -65,7 +65,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use foo/*!*/; +use `foo`/*!*/; SET TIMESTAMP=1000000000/*!*/; INSERT INTO t1 VALUES (1) /*!*/; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 43226436b6d..63b0ea2a71a 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -18,7 +18,7 @@ flush logs; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -111,7 +111,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`) /*!*/; @@ -202,7 +202,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("Alas") /*!*/; @@ -219,7 +219,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -312,7 +312,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`) /*!*/; @@ -403,7 +403,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("Alas") /*!*/; @@ -427,7 +427,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1108844555/*!*/; insert t1 values (1) /*!*/; @@ -445,7 +445,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1108844555/*!*/; insert t1 values (1) /*!*/; @@ -498,7 +498,7 @@ ERROR 42000: PROCEDURE test.p1 does not exist /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -548,7 +548,7 @@ flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -725,7 +725,7 @@ FLUSH LOGS; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1253783037/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -825,7 +825,7 @@ BEGIN SET TIMESTAMP=1266652094/*!*/; SavePoint mixed_cases /*!*/; -use db1/*!*/; +use `db1`/*!*/; SET TIMESTAMP=1266652094/*!*/; INSERT INTO db1.t2 VALUES("in savepoint mixed_cases") /*!*/; @@ -892,6 +892,7 @@ DROP DATABASE test1; FLUSH LOGS; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # CREATE DATABASE test1 master-bin.000002 # Query # # use `test1`; CREATE TABLE t1(id int) master-bin.000002 # Query # # DROP DATABASE test1 diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index 52a589ca7c1..bf65bab602d 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -19,7 +19,7 @@ insert into t1 values(null, "f"); /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -103,7 +103,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; @@ -172,7 +172,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -209,7 +209,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -263,7 +263,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -289,7 +289,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -326,7 +326,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -369,7 +369,7 @@ flush logs; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -445,7 +445,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -474,7 +474,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; @@ -535,7 +535,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -564,7 +564,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -605,7 +605,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -622,7 +622,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -697,7 +697,6 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -SET INSERT_ID=6/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -720,7 +719,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -761,7 +760,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -778,7 +777,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -820,7 +819,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -904,7 +903,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; @@ -972,7 +971,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1009,7 +1008,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1062,7 +1061,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1088,7 +1087,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1125,7 +1124,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1167,7 +1166,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1243,7 +1242,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -1272,7 +1271,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; @@ -1333,7 +1332,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -1361,7 +1360,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1402,7 +1401,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -1419,7 +1418,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1483,17 +1482,6 @@ COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; -SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; -/*!\C latin1 *//*!*/; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; -SET @@session.lc_time_names=0/*!*/; -SET @@session.collation_database=DEFAULT/*!*/; -BEGIN -/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1516,7 +1504,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1557,7 +1545,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -1574,7 +1562,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1616,7 +1604,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqlbinlog_row.result b/mysql-test/r/mysqlbinlog_row.result index 7ae1ea36899..6361cdadb32 100644 --- a/mysql-test/r/mysqlbinlog_row.result +++ b/mysql-test/r/mysqlbinlog_row.result @@ -335,8 +335,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_innodb.result b/mysql-test/r/mysqlbinlog_row_innodb.result index 00a3eb79b64..4be266d586c 100644 --- a/mysql-test/r/mysqlbinlog_row_innodb.result +++ b/mysql-test/r/mysqlbinlog_row_innodb.result @@ -2252,8 +2252,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -3875,8 +3877,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -4242,8 +4246,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -4803,8 +4809,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_myisam.result b/mysql-test/r/mysqlbinlog_row_myisam.result index 7b0112d0a91..d4062565320 100644 --- a/mysql-test/r/mysqlbinlog_row_myisam.result +++ b/mysql-test/r/mysqlbinlog_row_myisam.result @@ -2252,8 +2252,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -3897,8 +3899,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -4270,8 +4274,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -4841,8 +4847,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_trans.result b/mysql-test/r/mysqlbinlog_row_trans.result index 5c96db7d19b..85106ab9684 100644 --- a/mysql-test/r/mysqlbinlog_row_trans.result +++ b/mysql-test/r/mysqlbinlog_row_trans.result @@ -131,8 +131,10 @@ DELIMITER /*!*/; #010909 4:46:40 server id 1 end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 2b34c4da8af..5b8e6ea3348 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -355,8 +355,7 @@ The following options may be given as the first argument: --max-binlog-cache-size=# Sets the total size of the transactional cache --max-binlog-size=# Binary log will be rotated automatically when the size - exceeds this value. Will also apply to relay logs if - max_relay_log_size is 0 + exceeds this value. --max-binlog-stmt-cache-size=# Sets the total size of the statement cache --max-connect-errors=# @@ -382,9 +381,9 @@ The following options may be given as the first argument: --max-prepared-stmt-count=# Maximum number of prepared statements in the server --max-relay-log-size=# - If non-zero: relay log will be rotated automatically when - the size exceeds this value; if zero: when the size - exceeds max_binlog_size + relay log will be rotated automatically when the size + exceeds this value. If 0 are startup, it's set to + max_binlog_size --max-seeks-for-key=# Limit assumed max number of seeks when looking up rows based on a key @@ -765,7 +764,7 @@ The following options may be given as the first argument: partial matching --rpl-recovery-rank=# Unused, will be removed - --safe-mode Skip some optimize stages (for testing). + --safe-mode Skip some optimize stages (for testing). Deprecated. --safe-user-create Don't allow new user creation by the user who has no write privileges to the mysql.user table. --secure-auth Disallow authentication for accounts that have old @@ -805,8 +804,11 @@ The following options may be given as the first argument: --slave-load-tmpdir=name The location where the slave should put its temporary files when replicating a LOAD DATA INFILE command + --slave-max-allowed-packet=# + The maximum packet length to sent successfully from the + master to slave. --slave-net-timeout=# - Number of seconds to wait for more data from a + Number of seconds to wait for more data from any master/slave connection before aborting the read --slave-skip-errors=name Tells the slave thread to continue replication when a @@ -991,7 +993,6 @@ key-cache-age-threshold 300 key-cache-block-size 1024 key-cache-division-limit 100 key-cache-segments 0 -language MYSQL_SHAREDIR/ large-pages FALSE lc-messages en_US lc-messages-dir MYSQL_SHAREDIR/ @@ -1034,7 +1035,7 @@ max-join-size 18446744073709551615 max-length-for-sort-data 1024 max-long-data-size 1048576 max-prepared-stmt-count 16382 -max-relay-log-size 0 +max-relay-log-size 1073741824 max-seeks-for-key 18446744073709551615 max-sort-length 1024 max-sp-recursion-depth 0 @@ -1101,7 +1102,7 @@ performance-schema-max-rwlock-instances 1000000 performance-schema-max-socket-classes 10 performance-schema-max-socket-instances 1000 performance-schema-max-stage-classes 150 -performance-schema-max-statement-classes 170 +performance-schema-max-statement-classes 173 performance-schema-max-table-handles 10000 performance-schema-max-table-instances 1000 performance-schema-max-thread-classes 50 @@ -1155,6 +1156,7 @@ skip-show-database FALSE skip-slave-start FALSE slave-compressed-protocol FALSE slave-exec-mode STRICT +slave-max-allowed-packet 1073741824 slave-net-timeout 3600 slave-skip-errors (No default value) slave-sql-verify-checksum TRUE diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result index 6722f308358..fb0be20c119 100644 --- a/mysql-test/r/mysqldump-max.result +++ b/mysql-test/r/mysqldump-max.result @@ -332,12 +332,12 @@ a b 2 1 DROP TABLE t1; DROP TABLE t2; -SHOW BINLOG EVENTS LIMIT 6,3; +SHOW BINLOG EVENTS LIMIT 7,3; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 663 Query 1 731 BEGIN -master-bin.000001 731 Query 1 828 use `test`; INSERT INTO t2 VALUES (1,0), (2,0) -master-bin.000001 828 Xid 1 855 COMMIT /* XID */ --- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=855; +master-bin.000001 704 Query 1 772 BEGIN +master-bin.000001 772 Query 1 869 use `test`; INSERT INTO t2 VALUES (1,0), (2,0) +master-bin.000001 869 Xid 1 896 COMMIT /* XID */ +-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=896; SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 6f1b43b7b2b..b58a904bc1f 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2073,7 +2073,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` varchar(30) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -2167,7 +2167,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v1`*/; @@ -2241,7 +2241,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` varchar(30) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -2355,9 +2355,9 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11), - `b` int(11), - `c` varchar(30) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; @@ -2365,7 +2365,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` int(11) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v3`; @@ -2373,9 +2373,9 @@ DROP TABLE IF EXISTS `v3`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v3` ( - `a` int(11), - `b` int(11), - `c` varchar(30) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v1`*/; @@ -3112,9 +3112,9 @@ DROP TABLE IF EXISTS `v0`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v0` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v1`; @@ -3122,9 +3122,9 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; @@ -3132,9 +3132,9 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3514,7 +3514,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `id` int(11) + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3574,7 +3574,7 @@ USE `mysqldump_views`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `nasishnasifu` ( - `id` bigint(20) unsigned + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3967,7 +3967,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `c` int(11) + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -4384,7 +4384,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `id` int(11) + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 25345227d59..d08ffd96a04 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -232,7 +232,7 @@ mysqltest: At line 2: Spurious text after `query` expression mysqltest: At line 1: Missing argument(s) to 'error' mysqltest: At line 1: Missing argument(s) to 'error' mysqltest: At line 1: The sqlstate definition must start with an uppercase S -mysqltest: At line 1: The error name definition must start with an uppercase E +mysqltest: At line 1: The error name definition must start with an uppercase E or W mysqltest: At line 1: Invalid argument to error: '9eeeee' - the errno may only consist of digits[0-9] mysqltest: At line 1: Invalid argument to error: '1sssss' - the errno may only consist of digits[0-9] mysqltest: At line 1: The sqlstate must be exactly 5 chars long @@ -690,6 +690,7 @@ Got one of the listed errors insert into t1 values ("Abcd"); Got one of the listed errors garbage; +SELECT * FROM non_existing_table; drop table t2; create table t1 ( f1 char(10)); insert into t1 values ("Abcd"); diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 35c6ebe1442..ba79011f53e 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -1,6 +1,8 @@ drop table if exists t1,t2; create table t1 (a int, b int not null,unique key (a,b),index(b)) engine=myisam; insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6); +Warnings: +Warning 1062 Duplicate entry '6-6' for key 'a' explain select * from t1 where a is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a a 5 const 3 Using where; Using index diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index d320b5b669f..1ded1e90314 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -1439,6 +1439,7 @@ CALL mtr.add_suppression("Out of sort memory"); select * from t1 order by b; ERROR HY001: Out of sort memory, consider increasing server sort buffer size drop table t1; +set session sort_buffer_size= 30000; # # Bug #39844: Query Crash Mysql Server 5.0.67 # @@ -1533,6 +1534,890 @@ ppfcz1 DE ppfcz1 14 8 57.5 ppfcz1 DE ppfcz1 14 9 59.5 ppfcz1 DE ppfcz1 14 10 61.5 DROP TABLE t1,t2,t3; +# +# WL#1393 - Optimizing filesort with small limit +# +CREATE TABLE t1(f0 int auto_increment primary key, f1 int, f2 varchar(200)); +INSERT INTO t1(f1, f2) VALUES +(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"), +(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"), +(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"), +(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"), +(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"), +(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"), +(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"), +(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"), +(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"), +(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"), +(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"), +(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"), +(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"), +(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"), +(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"), +(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"), +(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"), +(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"), +(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"), +(96,"96"),(97,"97"),(98,"98"),(99,"99"); +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 100; +f0 f1 f2 +1 0 0 +2 1 1 +3 2 2 +4 3 3 +5 4 4 +6 5 5 +7 6 6 +8 7 7 +9 8 8 +10 9 9 +11 10 10 +12 11 11 +13 12 12 +14 13 13 +15 14 14 +16 15 15 +17 16 16 +18 17 17 +19 18 18 +20 19 19 +21 20 20 +22 21 21 +23 22 22 +24 23 23 +25 24 24 +26 25 25 +27 26 26 +28 27 27 +29 28 28 +30 29 29 +31 30 30 +32 31 31 +33 32 32 +34 33 33 +35 34 34 +36 35 35 +37 36 36 +38 37 37 +39 38 38 +40 39 39 +41 40 40 +42 41 41 +43 42 42 +44 43 43 +45 44 44 +46 45 45 +47 46 46 +48 47 47 +49 48 48 +50 49 49 +51 50 50 +52 51 51 +53 52 52 +54 53 53 +55 54 54 +56 55 55 +57 56 56 +58 57 57 +59 58 58 +60 59 59 +61 60 60 +62 61 61 +63 62 62 +64 63 63 +65 64 64 +66 65 65 +67 66 66 +68 67 67 +69 68 68 +70 69 69 +71 70 70 +72 71 71 +73 72 72 +74 73 73 +75 74 74 +76 75 75 +77 76 76 +78 77 77 +79 78 78 +80 79 79 +81 80 80 +82 81 81 +83 82 82 +84 83 83 +85 84 84 +86 85 85 +87 86 86 +88 87 87 +89 88 88 +90 89 89 +91 90 90 +92 91 91 +93 92 92 +94 93 93 +95 94 94 +96 95 95 +97 96 96 +98 97 97 +99 98 98 +100 99 99 +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 30; +f0 f1 f2 +1 0 0 +2 1 1 +3 2 2 +4 3 3 +5 4 4 +6 5 5 +7 6 6 +8 7 7 +9 8 8 +10 9 9 +11 10 10 +12 11 11 +13 12 12 +14 13 13 +15 14 14 +16 15 15 +17 16 16 +18 17 17 +19 18 18 +20 19 19 +21 20 20 +22 21 21 +23 22 22 +24 23 23 +25 24 24 +26 25 25 +27 26 26 +28 27 27 +29 28 28 +30 29 29 +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 0; +f0 f1 f2 +SELECT * FROM t1 ORDER BY f2 DESC, f0 LIMIT 30; +f0 f1 f2 +100 99 99 +99 98 98 +98 97 97 +97 96 96 +96 95 95 +95 94 94 +94 93 93 +93 92 92 +92 91 91 +91 90 90 +10 9 9 +90 89 89 +89 88 88 +88 87 87 +87 86 86 +86 85 85 +85 84 84 +84 83 83 +83 82 82 +82 81 81 +81 80 80 +9 8 8 +80 79 79 +79 78 78 +78 77 77 +77 76 76 +76 75 75 +75 74 74 +74 73 73 +73 72 72 +SELECT * FROM t1 ORDER BY f2 DESC, f0 LIMIT 0; +f0 f1 f2 +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 20; +f0 f1 f2 +12 11 11 +13 12 12 +14 13 13 +15 14 14 +16 15 15 +17 16 16 +18 17 17 +19 18 18 +20 19 19 +21 20 20 +22 21 21 +23 22 22 +24 23 23 +25 24 24 +26 25 25 +27 26 26 +28 27 27 +29 28 28 +30 29 29 +31 30 30 +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0; +f0 f1 f2 +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 10 OFFSET 10; +f0 f1 f2 +22 21 21 +23 22 22 +24 23 23 +25 24 24 +26 25 25 +27 26 26 +28 27 27 +29 28 28 +30 29 29 +31 30 30 +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0 OFFSET 10; +f0 f1 f2 +set sort_buffer_size= 32768; +CREATE TEMPORARY TABLE tmp (f1 int, f2 varchar(20)); +INSERT INTO tmp SELECT f1, f2 FROM t1; +INSERT INTO t1(f1, f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1, f2 FROM t1; +INSERT INTO t1(f1, f2) SELECT * FROM tmp; +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 30; +f0 f1 f2 +1 0 0 +101 0 0 +201 0 0 +301 0 0 +401 0 0 +2 1 1 +102 1 1 +202 1 1 +302 1 1 +402 1 1 +3 2 2 +103 2 2 +203 2 2 +303 2 2 +403 2 2 +4 3 3 +104 3 3 +204 3 3 +304 3 3 +404 3 3 +5 4 4 +105 4 4 +205 4 4 +305 4 4 +405 4 4 +6 5 5 +106 5 5 +206 5 5 +306 5 5 +406 5 5 +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 0; +f0 f1 f2 +SELECT * FROM t1 ORDER BY f2 DESC, f0 LIMIT 30; +f0 f1 f2 +100 99 99 +200 99 99 +300 99 99 +400 99 99 +500 99 99 +99 98 98 +199 98 98 +299 98 98 +399 98 98 +499 98 98 +98 97 97 +198 97 97 +298 97 97 +398 97 97 +498 97 97 +97 96 96 +197 96 96 +297 96 96 +397 96 96 +497 96 96 +96 95 95 +196 95 95 +296 95 95 +396 95 95 +496 95 95 +95 94 94 +195 94 94 +295 94 94 +395 94 94 +495 94 94 +SELECT * FROM t1 ORDER BY f2 DESC, f0 LIMIT 0; +f0 f1 f2 +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 20; +f0 f1 f2 +12 11 11 +112 11 11 +212 11 11 +312 11 11 +412 11 11 +13 12 12 +113 12 12 +213 12 12 +313 12 12 +413 12 12 +14 13 13 +114 13 13 +214 13 13 +314 13 13 +414 13 13 +15 14 14 +115 14 14 +215 14 14 +315 14 14 +415 14 14 +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0; +f0 f1 f2 +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 10 OFFSET 10; +f0 f1 f2 +14 13 13 +114 13 13 +214 13 13 +314 13 13 +414 13 13 +15 14 14 +115 14 14 +215 14 14 +315 14 14 +415 14 14 +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0 OFFSET 10; +f0 f1 f2 +set sort_buffer_size= 32768; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 +ORDER BY f1, f0 LIMIT 30; +f0 f1 f2 +1 0 0 +101 0 0 +201 0 0 +301 0 0 +401 0 0 +2 1 1 +102 1 1 +202 1 1 +302 1 1 +402 1 1 +3 2 2 +103 2 2 +203 2 2 +303 2 2 +403 2 2 +4 3 3 +104 3 3 +204 3 3 +304 3 3 +404 3 3 +5 4 4 +105 4 4 +205 4 4 +305 4 4 +405 4 4 +6 5 5 +106 5 5 +206 5 5 +306 5 5 +406 5 5 +SELECT FOUND_ROWS(); +FOUND_ROWS() +500 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 +ORDER BY f1, f0 LIMIT 0; +f0 f1 f2 +SELECT FOUND_ROWS(); +FOUND_ROWS() +500 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 20; +f0 f1 f2 +12 11 11 +112 11 11 +212 11 11 +312 11 11 +412 11 11 +13 12 12 +113 12 12 +213 12 12 +313 12 12 +413 12 12 +14 13 13 +114 13 13 +214 13 13 +314 13 13 +414 13 13 +15 14 14 +115 14 14 +215 14 14 +315 14 14 +415 14 14 +SELECT FOUND_ROWS(); +FOUND_ROWS() +445 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 0; +f0 f1 f2 +SELECT FOUND_ROWS(); +FOUND_ROWS() +445 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 10 OFFSET 10; +f0 f1 f2 +14 13 13 +114 13 13 +214 13 13 +314 13 13 +414 13 13 +15 14 14 +115 14 14 +215 14 14 +315 14 14 +415 14 14 +SELECT FOUND_ROWS(); +FOUND_ROWS() +445 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 0 OFFSET 10; +f0 f1 f2 +SELECT FOUND_ROWS(); +FOUND_ROWS() +445 +set sort_buffer_size= 327680; +SELECT * FROM t1 JOIN tmp on t1.f2=tmp.f2 +ORDER BY tmp.f1, f0 LIMIT 30; +f0 f1 f2 f1 f2 +1 0 0 0 0 +1 0 0 0 0 +1 0 0 0 0 +101 0 0 0 0 +101 0 0 0 0 +101 0 0 0 0 +201 0 0 0 0 +201 0 0 0 0 +201 0 0 0 0 +301 0 0 0 0 +301 0 0 0 0 +301 0 0 0 0 +401 0 0 0 0 +401 0 0 0 0 +401 0 0 0 0 +2 1 1 1 1 +2 1 1 1 1 +2 1 1 1 1 +102 1 1 1 1 +102 1 1 1 1 +102 1 1 1 1 +202 1 1 1 1 +202 1 1 1 1 +202 1 1 1 1 +302 1 1 1 1 +302 1 1 1 1 +302 1 1 1 1 +402 1 1 1 1 +402 1 1 1 1 +402 1 1 1 1 +SELECT * FROM t1 JOIN tmp on t1.f2=tmp.f2 +ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30; +f0 f1 f2 f1 f2 +3 2 2 2 2 +3 2 2 2 2 +3 2 2 2 2 +103 2 2 2 2 +103 2 2 2 2 +103 2 2 2 2 +203 2 2 2 2 +203 2 2 2 2 +203 2 2 2 2 +303 2 2 2 2 +303 2 2 2 2 +303 2 2 2 2 +403 2 2 2 2 +403 2 2 2 2 +403 2 2 2 2 +4 3 3 3 3 +4 3 3 3 3 +4 3 3 3 3 +104 3 3 3 3 +104 3 3 3 3 +104 3 3 3 3 +204 3 3 3 3 +204 3 3 3 3 +204 3 3 3 3 +304 3 3 3 3 +304 3 3 3 3 +304 3 3 3 3 +404 3 3 3 3 +404 3 3 3 3 +404 3 3 3 3 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 JOIN tmp on t1.f2=tmp.f2 +ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30; +f0 f1 f2 f1 f2 +3 2 2 2 2 +3 2 2 2 2 +3 2 2 2 2 +103 2 2 2 2 +103 2 2 2 2 +103 2 2 2 2 +203 2 2 2 2 +203 2 2 2 2 +203 2 2 2 2 +303 2 2 2 2 +303 2 2 2 2 +303 2 2 2 2 +403 2 2 2 2 +403 2 2 2 2 +403 2 2 2 2 +4 3 3 3 3 +4 3 3 3 3 +4 3 3 3 3 +104 3 3 3 3 +104 3 3 3 3 +104 3 3 3 3 +204 3 3 3 3 +204 3 3 3 3 +204 3 3 3 3 +304 3 3 3 3 +304 3 3 3 3 +304 3 3 3 3 +404 3 3 3 3 +404 3 3 3 3 +404 3 3 3 3 +SELECT FOUND_ROWS(); +FOUND_ROWS() +1500 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 JOIN tmp on t1.f2=tmp.f2 +WHERE t1.f2>20 +ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30; +f0 f1 f2 f1 f2 +24 23 23 23 23 +24 23 23 23 23 +24 23 23 23 23 +124 23 23 23 23 +124 23 23 23 23 +124 23 23 23 23 +224 23 23 23 23 +224 23 23 23 23 +224 23 23 23 23 +324 23 23 23 23 +324 23 23 23 23 +324 23 23 23 23 +424 23 23 23 23 +424 23 23 23 23 +424 23 23 23 23 +25 24 24 24 24 +25 24 24 24 24 +25 24 24 24 24 +125 24 24 24 24 +125 24 24 24 24 +125 24 24 24 24 +225 24 24 24 24 +225 24 24 24 24 +225 24 24 24 24 +325 24 24 24 24 +325 24 24 24 24 +325 24 24 24 24 +425 24 24 24 24 +425 24 24 24 24 +425 24 24 24 24 +SELECT FOUND_ROWS(); +FOUND_ROWS() +1185 +CREATE VIEW v1 as SELECT * FROM t1 ORDER BY f1, f0 LIMIT 30; +SELECT * FROM v1; +f0 f1 f2 +1 0 0 +101 0 0 +201 0 0 +301 0 0 +401 0 0 +2 1 1 +102 1 1 +202 1 1 +302 1 1 +402 1 1 +3 2 2 +103 2 2 +203 2 2 +303 2 2 +403 2 2 +4 3 3 +104 3 3 +204 3 3 +304 3 3 +404 3 3 +5 4 4 +105 4 4 +205 4 4 +305 4 4 +405 4 4 +6 5 5 +106 5 5 +206 5 5 +306 5 5 +406 5 5 +drop view v1; +CREATE VIEW v1 as SELECT * FROM t1 ORDER BY f1, f0 LIMIT 100; +SELECT * FROM v1 ORDER BY f2, f0 LIMIT 30; +f0 f1 f2 +1 0 0 +101 0 0 +201 0 0 +301 0 0 +401 0 0 +2 1 1 +102 1 1 +202 1 1 +302 1 1 +402 1 1 +11 10 10 +111 10 10 +211 10 10 +311 10 10 +411 10 10 +12 11 11 +112 11 11 +212 11 11 +312 11 11 +412 11 11 +13 12 12 +113 12 12 +213 12 12 +313 12 12 +413 12 12 +14 13 13 +114 13 13 +214 13 13 +314 13 13 +414 13 13 +CREATE VIEW v2 as SELECT * FROM t1 ORDER BY f2, f0 LIMIT 100; +SELECT * FROM v1 JOIN v2 on v1.f1=v2.f1 ORDER BY v1.f2,v1.f0,v2.f0 +LIMIT 30; +f0 f1 f2 f0 f1 f2 +1 0 0 1 0 0 +1 0 0 101 0 0 +1 0 0 201 0 0 +1 0 0 301 0 0 +1 0 0 401 0 0 +101 0 0 1 0 0 +101 0 0 101 0 0 +101 0 0 201 0 0 +101 0 0 301 0 0 +101 0 0 401 0 0 +201 0 0 1 0 0 +201 0 0 101 0 0 +201 0 0 201 0 0 +201 0 0 301 0 0 +201 0 0 401 0 0 +301 0 0 1 0 0 +301 0 0 101 0 0 +301 0 0 201 0 0 +301 0 0 301 0 0 +301 0 0 401 0 0 +401 0 0 1 0 0 +401 0 0 101 0 0 +401 0 0 201 0 0 +401 0 0 301 0 0 +401 0 0 401 0 0 +2 1 1 2 1 1 +2 1 1 102 1 1 +2 1 1 202 1 1 +2 1 1 302 1 1 +2 1 1 402 1 1 +SELECT floor(f1/10) f3, count(f2) FROM t1 +GROUP BY 1 ORDER BY 2,1 LIMIT 5; +f3 count(f2) +0 50 +1 50 +2 50 +3 50 +4 50 +SELECT floor(f1/10) f3, count(f2) FROM t1 +GROUP BY 1 ORDER BY 2,1 LIMIT 0; +f3 count(f2) +CREATE PROCEDURE wl1393_sp_test() +BEGIN +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 30; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 15 OFFSET 15; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 15 OFFSET 15; +SELECT FOUND_ROWS(); +SELECT * FROM v1 ORDER BY f2, f0 LIMIT 30; +END| +CALL wl1393_sp_test()| +f0 f1 f2 +12 11 11 +112 11 11 +212 11 11 +312 11 11 +412 11 11 +13 12 12 +113 12 12 +213 12 12 +313 12 12 +413 12 12 +14 13 13 +114 13 13 +214 13 13 +314 13 13 +414 13 13 +15 14 14 +115 14 14 +215 14 14 +315 14 14 +415 14 14 +16 15 15 +116 15 15 +216 15 15 +316 15 15 +416 15 15 +17 16 16 +117 16 16 +217 16 16 +317 16 16 +417 16 16 +f0 f1 f2 +15 14 14 +115 14 14 +215 14 14 +315 14 14 +415 14 14 +16 15 15 +116 15 15 +216 15 15 +316 15 15 +416 15 15 +17 16 16 +117 16 16 +217 16 16 +317 16 16 +417 16 16 +f0 f1 f2 +15 14 14 +115 14 14 +215 14 14 +315 14 14 +415 14 14 +16 15 15 +116 15 15 +216 15 15 +316 15 15 +416 15 15 +17 16 16 +117 16 16 +217 16 16 +317 16 16 +417 16 16 +FOUND_ROWS() +445 +f0 f1 f2 +1 0 0 +101 0 0 +201 0 0 +301 0 0 +401 0 0 +2 1 1 +102 1 1 +202 1 1 +302 1 1 +402 1 1 +11 10 10 +111 10 10 +211 10 10 +311 10 10 +411 10 10 +12 11 11 +112 11 11 +212 11 11 +312 11 11 +412 11 11 +13 12 12 +113 12 12 +213 12 12 +313 12 12 +413 12 12 +14 13 13 +114 13 13 +214 13 13 +314 13 13 +414 13 13 +DROP PROCEDURE wl1393_sp_test| +SELECT d1.f1, d1.f2 FROM t1 +LEFT JOIN (SELECT * FROM t1 ORDER BY f1 LIMIT 30) d1 on t1.f1=d1.f1 +ORDER BY d1.f2 DESC LIMIT 30; +f1 f2 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +4 4 +4 4 +4 4 +4 4 +4 4 +SELECT * FROM t1 WHERE f1 = (SELECT f1 FROM t1 ORDER BY 1 LIMIT 1); +f0 f1 f2 +1 0 0 +101 0 0 +201 0 0 +301 0 0 +401 0 0 +SELECT * FROM t1 WHERE f1 = (SELECT f1 FROM t1 ORDER BY 1 LIMIT 2); +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1, tmp; +DROP VIEW v1, v2; +# end of WL#1393 - Optimizing filesort with small limit +# +# Bug #58761 +# Crash in Field::is_null in field.h on subquery in WHERE clause +# +CREATE TABLE t1 ( +pk INT NOT NULL AUTO_INCREMENT, +col_int_key INT DEFAULT NULL, +col_varchar_key VARCHAR(1) DEFAULT NULL, +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +INSERT INTO t1 VALUES (27,7,'x'); +INSERT INTO t1 VALUES (28,6,'m'); +INSERT INTO t1 VALUES (29,4,'c'); +CREATE TABLE where_subselect +SELECT DISTINCT `pk` AS field1 , `pk` AS field2 +FROM t1 AS alias1 +WHERE alias1 . `col_int_key` > 229 +OR alias1 . `col_varchar_key` IS NOT NULL +GROUP BY field1, field2 +; +SELECT * +FROM where_subselect +WHERE (field1, field2) IN ( +SELECT DISTINCT `pk` AS field1 , `pk` AS field2 +FROM t1 AS alias1 +WHERE alias1 . `col_int_key` > 229 +OR alias1 . `col_varchar_key` IS NOT NULL +GROUP BY field1, field2 +); +field1 field2 +27 27 +28 28 +29 29 +DROP TABLE t1; +DROP TABLE where_subselect; +# End of Bug #58761 CREATE TABLE t1 ( id1 INT NULL, id2 INT NOT NULL, @@ -1813,3 +2698,135 @@ Warnings: Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`) group by `test`.`t2`.`b` order by `test`.`t1`.`b` drop table t1,t2; End of 5.2 tests +# +# Bug mdev-449: ORDER BY with small sort_buffer_size +# +CREATE TABLE t1(f0 int auto_increment primary key, f1 int, f2 varchar(200)); +INSERT INTO t1(f1, f2) VALUES +(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"), +(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"), +(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"), +(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"), +(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"), +(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"), +(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"), +(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"), +(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"), +(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"), +(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"), +(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"), +(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"), +(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"), +(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"), +(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"), +(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"), +(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"), +(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"), +(96,"96"),(97,"97"),(98,"98"),(99,"99"); +set @save_sort_buffer_size= @@sort_buffer_size; +set sort_buffer_size= 2000; +SELECT * FROM t1 ORDER BY f1 DESC, f0; +f0 f1 f2 +100 99 99 +99 98 98 +98 97 97 +97 96 96 +96 95 95 +95 94 94 +94 93 93 +93 92 92 +92 91 91 +91 90 90 +90 89 89 +89 88 88 +88 87 87 +87 86 86 +86 85 85 +85 84 84 +84 83 83 +83 82 82 +82 81 81 +81 80 80 +80 79 79 +79 78 78 +78 77 77 +77 76 76 +76 75 75 +75 74 74 +74 73 73 +73 72 72 +72 71 71 +71 70 70 +70 69 69 +69 68 68 +68 67 67 +67 66 66 +66 65 65 +65 64 64 +64 63 63 +63 62 62 +62 61 61 +61 60 60 +60 59 59 +59 58 58 +58 57 57 +57 56 56 +56 55 55 +55 54 54 +54 53 53 +53 52 52 +52 51 51 +51 50 50 +50 49 49 +49 48 48 +48 47 47 +47 46 46 +46 45 45 +45 44 44 +44 43 43 +43 42 42 +42 41 41 +41 40 40 +40 39 39 +39 38 38 +38 37 37 +37 36 36 +36 35 35 +35 34 34 +34 33 33 +33 32 32 +32 31 31 +31 30 30 +30 29 29 +29 28 28 +28 27 27 +27 26 26 +26 25 25 +25 24 24 +24 23 23 +23 22 22 +22 21 21 +21 20 20 +20 19 19 +19 18 18 +18 17 17 +17 16 16 +16 15 15 +15 14 14 +14 13 13 +13 12 12 +12 11 11 +11 10 10 +10 9 9 +9 8 8 +8 7 7 +7 6 6 +6 5 5 +5 4 4 +4 3 3 +3 2 2 +2 1 1 +1 0 0 +set sort_buffer_size= @save_sort_buffer_size; +DROP TABLE t1; +End of 5.3 tests diff --git a/mysql-test/r/order_by_sortkey.result b/mysql-test/r/order_by_sortkey.result new file mode 100644 index 00000000000..717780f0af2 --- /dev/null +++ b/mysql-test/r/order_by_sortkey.result @@ -0,0 +1,159 @@ +CREATE TABLE t1( +f0 int auto_increment PRIMARY KEY, +f1 int, +f2 varchar(200) +); +INSERT INTO t1(f1, f2) VALUES +(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"), +(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"), +(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"), +(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"), +(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"), +(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"), +(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"), +(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"), +(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"), +(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"), +(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"), +(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"), +(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"), +(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"), +(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"), +(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"), +(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"), +(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"), +(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"), +(96,"96"),(97,"97"),(98,"98"),(99,"99"); +CREATE TEMPORARY TABLE tmp (f1 int, f2 varchar(20)); +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +set sort_buffer_size= 32768; +FLUSH STATUS; +SHOW SESSION STATUS LIKE 'Sort%'; +Variable_name Value +Sort_merge_passes 0 +Sort_range 0 +Sort_rows 0 +Sort_scan 0 +SELECT * FROM t1 ORDER BY f2 LIMIT 100; +f0 f1 f2 +1 0 0 +101 0 0 +201 0 0 +301 0 0 +401 0 0 +501 0 0 +601 0 0 +701 0 0 +801 0 0 +901 0 0 +1001 0 0 +1101 0 0 +1201 0 0 +1301 0 0 +1401 0 0 +1501 0 0 +1601 0 0 +1701 0 0 +1801 0 0 +1901 0 0 +2001 0 0 +2101 0 0 +2201 0 0 +2301 0 0 +2401 0 0 +2501 0 0 +2601 0 0 +2701 0 0 +2801 0 0 +2901 0 0 +3001 0 0 +3101 0 0 +3201 0 0 +3301 0 0 +3401 0 0 +3501 0 0 +3601 0 0 +3701 0 0 +3801 0 0 +3901 0 0 +4001 0 0 +4101 0 0 +4201 0 0 +4301 0 0 +4401 0 0 +4501 0 0 +4601 0 0 +4701 0 0 +4801 0 0 +4901 0 0 +5001 0 0 +5101 0 0 +5201 0 0 +5301 0 0 +5401 0 0 +5501 0 0 +5601 0 0 +5701 0 0 +5801 0 0 +5901 0 0 +6001 0 0 +6101 0 0 +6201 0 0 +6301 0 0 +6401 0 0 +6501 0 0 +6601 0 0 +6701 0 0 +6801 0 0 +6901 0 0 +7001 0 0 +7101 0 0 +7201 0 0 +7301 0 0 +7401 0 0 +7501 0 0 +7601 0 0 +7701 0 0 +7801 0 0 +7901 0 0 +8001 0 0 +8101 0 0 +8201 0 0 +8301 0 0 +8401 0 0 +8501 0 0 +8601 0 0 +8701 0 0 +8801 0 0 +8901 0 0 +9001 0 0 +9101 0 0 +9201 0 0 +9301 0 0 +9401 0 0 +9501 0 0 +9601 0 0 +9701 0 0 +9801 0 0 +9901 0 0 +SHOW SESSION STATUS LIKE 'Sort%'; +Variable_name Value +Sort_merge_passes 0 +Sort_range 0 +Sort_rows 100 +Sort_scan 1 +DROP TABLE t1, tmp; diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index 10700d0ba73..54378f16d49 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -441,7 +441,7 @@ select master_pos_wait(); ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' select master_pos_wait(1); ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' -select master_pos_wait(1, 2, 3, 4); +select master_pos_wait(1, 2, 3, 4, 5); ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' select rand(1, 2, 3); ERROR 42000: Incorrect parameter count in the call to native function 'rand' diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 431c5dda116..40586b8d54b 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2473,3 +2473,17 @@ SELECT * FROM vtmp; 1 DROP VIEW vtmp; DROP TABLE t1; +# +# MDEV-365 "Got assertion when doing alter table on a partition" +# +CREATE TABLE t1 ( i INT ) ENGINE=Aria PARTITION BY HASH(i) PARTITIONS 2; +INSERT INTO t1 VALUES (1),(2),(2),(3),(4); +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +SELECT * from t1 order by i; +i +1 +2 +2 +3 +4 +DROP TABLE t1; diff --git a/mysql-test/r/partition_cache.result b/mysql-test/r/partition_cache.result index ac2da9bb78a..cd579d00952 100644 --- a/mysql-test/r/partition_cache.result +++ b/mysql-test/r/partition_cache.result @@ -27,7 +27,7 @@ a 3 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 1 drop table t1; commit; create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3; @@ -50,7 +50,7 @@ a 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 3 show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 @@ -69,7 +69,7 @@ a 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 6 show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 @@ -93,14 +93,14 @@ a 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 2 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 0 +Qcache_hits 1 commit; show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 2 drop table t3,t2,t1; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) PARTITION BY HASH (id) PARTITIONS 3; select count(*) from t1; @@ -164,7 +164,7 @@ count(*) 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 1 connection connection1 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w'; count(*) @@ -197,9 +197,9 @@ count(*) 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 1 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 0 +Qcache_hits 1 set @@global.query_cache_size = @save_query_cache_size; drop table t2; diff --git a/mysql-test/r/partition_cache_innodb.result b/mysql-test/r/partition_cache_innodb.result new file mode 100644 index 00000000000..0d0abbb096c --- /dev/null +++ b/mysql-test/r/partition_cache_innodb.result @@ -0,0 +1,151 @@ +SET SESSION STORAGE_ENGINE = innodb; +drop table if exists t1; +set @save_query_cache_size = @@global.query_cache_size; +# Test that partitions works with query cache +flush query cache; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +); +ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `cool` tinyint(4) DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) +(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = InnoDB, + PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = InnoDB, + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +INSERT INTO t1 VALUES (1, now(), 0); +flush status; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +# Test that sub-partitions works with query cache +flush query cache; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +) +PARTITION BY RANGE (TO_DAYS(created_at)) +subpartition by hash(cool) subpartitions 3 ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `cool` tinyint(4) DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) +SUBPARTITION BY HASH (cool) +SUBPARTITIONS 3 +(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = InnoDB, + PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = InnoDB, + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +INSERT INTO t1 VALUES (1, now(), 0); +flush status; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +# +# MySQL bug#53775 Query on partitioned table returns cached result +# from previous transaction +# +flush query cache; +flush status; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +); +ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +INSERT INTO t1 VALUES (1, now(), 0); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +BEGIN; +UPDATE `t1` SET `cool` = 1 WHERE `id` = 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +BEGIN; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +drop table t1; +set @@global.query_cache_size = @save_query_cache_size; diff --git a/mysql-test/r/partition_cache_myisam.result b/mysql-test/r/partition_cache_myisam.result new file mode 100644 index 00000000000..0b617c03590 --- /dev/null +++ b/mysql-test/r/partition_cache_myisam.result @@ -0,0 +1,153 @@ +SET SESSION STORAGE_ENGINE = myisam; +drop table if exists t1; +set @save_query_cache_size = @@global.query_cache_size; +# Test that partitions works with query cache +flush query cache; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +); +ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `cool` tinyint(4) DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) +(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = MyISAM, + PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = MyISAM, + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +INSERT INTO t1 VALUES (1, now(), 0); +flush status; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +# Test that sub-partitions works with query cache +flush query cache; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +) +PARTITION BY RANGE (TO_DAYS(created_at)) +subpartition by hash(cool) subpartitions 3 ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `cool` tinyint(4) DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) +SUBPARTITION BY HASH (cool) +SUBPARTITIONS 3 +(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = MyISAM, + PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = MyISAM, + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +INSERT INTO t1 VALUES (1, now(), 0); +flush status; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +# +# MySQL bug#53775 Query on partitioned table returns cached result +# from previous transaction +# +flush query cache; +flush status; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +); +ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +INSERT INTO t1 VALUES (1, now(), 0); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +BEGIN; +UPDATE `t1` SET `cool` = 1 WHERE `id` = 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +BEGIN; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +set @@global.query_cache_size = @save_query_cache_size; diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 4d48b70d26a..ec7fd798d4c 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -787,7 +787,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 4 Using where; Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index +1 SIMPLE t1 pNULL ref a a 4 const 1 Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 range a a 4 NULL 4 Using where; Using index @@ -1116,7 +1116,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 4 Using where; Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index +1 SIMPLE t1 pNULL ref a a 4 const 1 Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index @@ -1445,7 +1445,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 4 Using where; Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index +1 SIMPLE t1 pNULL ref a a 4 const 1 Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 7629775b892..95217d9716a 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3056,7 +3056,7 @@ DROP TABLE t1; End of 5.1 tests. # -# LP bug#1001500 Crash on the second execution of the PS for +# lp:1001500 Crash on the second execution of the PS for # a query with degenerated conjunctive condition # (see also mysql bug#12582849) # @@ -3996,108 +3996,4 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 0 deallocate prepare st; drop table t1; -# -# LP bug#993459 Execution of PS for a query with GROUP BY -# returns wrong result (see also mysql bug#13805127) -# -PREPARE s1 FROM -" -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2 -"; - -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 3 1 -2012-03-01 01:99345900:00 2 1 -2012-03-01 02:00:00 3 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 - -SET @x = 2; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:00:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 - -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:00:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 -DEALLOCATE PREPARE s1; # End of 5.3 tests diff --git a/mysql-test/r/replace.result b/mysql-test/r/replace.result index 842302c89ac..59b8565f671 100644 --- a/mysql-test/r/replace.result +++ b/mysql-test/r/replace.result @@ -13,9 +13,9 @@ drop table t1; create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value"); insert into t1 values (126,"first"),(63, "middle"),(0,"last"); insert into t1 values (0,"error"); -ERROR 23000: Duplicate entry '127' for key 'PRIMARY' +ERROR 22003: Out of range value for column 'a' at row 1 replace into t1 values (0,"error"); -ERROR 23000: Duplicate entry '127' for key 'PRIMARY' +ERROR 22003: Out of range value for column 'a' at row 1 replace into t1 values (126,"first updated"); replace into t1 values (63,default); select * from t1; diff --git a/mysql-test/r/show_explain.result b/mysql-test/r/show_explain.result new file mode 100644 index 00000000000..bf96ad88f23 --- /dev/null +++ b/mysql-test/r/show_explain.result @@ -0,0 +1,1078 @@ +drop table if exists t0, t1, t2, t3, t4; +drop view if exists v1; +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a int); +insert into t1 select A.a + 10*B.a + 100*C.a from t0 A, t0 B, t0 C; +alter table t1 add b int, add c int, add filler char(32); +update t1 set b=a, c=a, filler='fooo'; +alter table t1 add key(a), add key(b); +show explain for 2000000000; +ERROR HY000: Unknown thread id: 2000000000 +show explain for (select max(a) from t0); +ERROR HY000: You may only use constant expressions in this statement +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +show explain for $thr1; +ERROR HY000: Target is not running an EXPLAINable command +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select count(*) from t1 where a < 100000; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index a a 5 NULL 1000 Using where; Using index +Warnings: +Note 1003 select count(*) from t1 where a < 100000 +count(*) +1000 +select max(c) from t1 where a < 10; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 10 Using index condition +Warnings: +Note 1003 select max(c) from t1 where a < 10 +max(c) +9 +# We can catch EXPLAIN, too. +set @show_expl_tmp= @@optimizer_switch; +set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_sort_keys=on'; +explain select max(c) from t1 where a < 10; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan +Warnings: +Note 1003 explain select max(c) from t1 where a < 10 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan +set optimizer_switch= @show_expl_tmp; +# UNION, first branch +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +explain select a from t0 A union select a+1 from t0 B; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY A ALL NULL NULL NULL NULL 10 +2 UNION B ALL NULL NULL NULL NULL 10 +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 explain select a from t0 A union select a+1 from t0 B +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY A ALL NULL NULL NULL NULL 10 +2 UNION B ALL NULL NULL NULL NULL 10 +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL +# UNION, second branch +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +explain select a from t0 A union select a+1 from t0 B; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY A ALL NULL NULL NULL NULL 10 +2 UNION B ALL NULL NULL NULL NULL 10 +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 explain select a from t0 A union select a+1 from t0 B +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY A ALL NULL NULL NULL NULL 10 +2 UNION B ALL NULL NULL NULL NULL 10 +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL +# Uncorrelated subquery, select +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select a, (select max(a) from t0 B) from t0 A where a<1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where +2 SUBQUERY B ALL NULL NULL NULL NULL 10 +Warnings: +Note 1003 select a, (select max(a) from t0 B) from t0 A where a<1 +a (select max(a) from t0 B) +0 9 +# Uncorrelated subquery, explain +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +explain select a, (select max(a) from t0 B) from t0 A where a<1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where +2 SUBQUERY B ALL NULL NULL NULL NULL 10 +Warnings: +Note 1003 explain select a, (select max(a) from t0 B) from t0 A where a<1 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where +2 SUBQUERY B ALL NULL NULL NULL NULL 10 +# correlated subquery, select +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where +2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1 +a (select max(a) from t0 b where b.a+a.a<10) +0 9 +# correlated subquery, explain +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where +2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1 +a (select max(a) from t0 b where b.a+a.a<10) +0 9 +# correlated subquery, select, while inside the subquery +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where +2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1 +a (select max(a) from t0 b where b.a+a.a<10) +0 9 +# correlated subquery, explain, while inside the subquery +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where +2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1 +a (select max(a) from t0 b where b.a+a.a<10) +0 9 +# correlated subquery, explain, while inside the subquery +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +a (select max(a) from t0 b where b.a+a.a<10) +0 9 +# Try to do SHOW EXPLAIN for a query that runs a SET command: +# I've found experimentally that select_id==2 here... +# +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +set @foo= (select max(a) from t0 where sin(a) >0); +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +# +# Attempt SHOW EXPLAIN for an UPDATE +# +create table t2 as select a as a, a as dummy from t0 limit 2; +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +drop table t2; +# +# Attempt SHOW EXPLAIN for a DELETE +# +create table t2 as select a as a, a as dummy from t0 limit 2; +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +drop table t2; +# +# Multiple SHOW EXPLAIN calls for one select +# +create table t2 as select a as a, a as dummy from t0 limit 3; +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 +2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Query plan already deleted +Warnings: +Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Query plan already deleted +Warnings: +Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 +a SUBQ +0 0 +1 0 +2 0 +drop table t2; +# +# SHOW EXPLAIN for SELECT ... ORDER BY with "Using filesort" +# +explain select * from t0 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using filesort +set debug_dbug='d,show_explain_probe_join_exec_start'; +set @show_explain_probe_select_id=1; +select * from t0 order by a; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using filesort +Warnings: +Note 1003 select * from t0 order by a +a +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +# +# SHOW EXPLAIN for SELECT ... with "Using temporary" +# +explain select distinct a from t0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary +set debug_dbug='d,show_explain_probe_join_exec_start'; +set @show_explain_probe_select_id=1; +select distinct a from t0; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary +Warnings: +Note 1003 select distinct a from t0 +a +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +# +# SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort" +# +explain select distinct a from t0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary +set debug_dbug='d,show_explain_probe_join_exec_start'; +set @show_explain_probe_select_id=1; +select distinct a from t0; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary +Warnings: +Note 1003 select distinct a from t0 +a +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +set debug_dbug=''; +# +# MDEV-238: SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY +# +CREATE TABLE t2 ( a INT ); +INSERT INTO t2 VALUES (1),(2),(1),(4),(2); +explain SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort +1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +set debug_dbug='d,show_explain_in_find_all_keys'; +SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a; +# FIXED by "conservative assumptions about when QEP is available" fix: +# NOTE: current code will not show "Using join buffer": +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +a +1 +2 +4 +set debug_dbug=''; +DROP TABLE t2; +# +# MDEV-239: Assertion `field_types == 0 ... ' failed in Protocol_text::store(double, uint32, String*) with +# SHOW EXPLAIN over EXPLAIN EXTENDED +# +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (1),(2),(1),(4),(2); +EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort +1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a` +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort +1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +Warnings: +Note 1003 EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort +1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a` +set debug_dbug=''; +DROP TABLE t2; +# +# MDEV-240: SHOW EXPLAIN: Assertion `this->optimized == 2' failed in +# JOIN::print_explain on query with a JOIN, TEMPTABLE view, +# +CREATE TABLE t3 (a INT); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (8); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (4),(5),(6),(7),(8),(9); +explain SELECT * FROM v1, t2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL NULL NULL NULL NULL 6 +2 DERIVED t3 system NULL NULL NULL NULL 1 +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_end'; +SELECT * FROM v1, t2; +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +a b +8 4 +8 5 +8 6 +8 7 +8 8 +8 9 +set debug_dbug=''; +DROP VIEW v1; +DROP TABLE t2, t3; +# +# MDEV-267: SHOW EXPLAIN: Server crashes in JOIN::print_explain on most of queries +# +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +select sleep(1); +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sleep(1) +sleep(1) +0 +set debug_dbug=''; +# +# Same as above, but try another reason for JOIN to be degenerate +# +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +select * from t0 where 1>10; +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +a +set debug_dbug=''; +# +# Same as above, but try another reason for JOIN to be degenerate (2) +# +create table t3(a int primary key); +insert into t3 select a from t0; +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +select * from t0,t3 where t3.a=112233; +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +a a +set debug_dbug=''; +drop table t3; +# +# MDEV-270: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with +# select tables optimized away +# +CREATE TABLE t2 (pk INT PRIMARY KEY, a INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES +(1,4),(2,62),(3,7),(4,1),(5,0),(6,7),(7,7),(8,1),(9,7),(10,1), +(11,5),(12,2),(13,0),(14,1),(15,8),(16,1),(17,1),(18,9),(19,1),(20,5) ; +explain SELECT * FROM t2 WHERE a = +(SELECT MAX(a) FROM t2 +WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using where +2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 Using where +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_do_select'; +SELECT * FROM t2 WHERE a = +(SELECT MAX(a) FROM t2 +WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) +); +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using where +2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 Using where +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 SELECT * FROM t2 WHERE a = +(SELECT MAX(a) FROM t2 +WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) +) +pk a +3 7 +6 7 +7 7 +9 7 +set debug_dbug=''; +drop table t2; +# +# MDEV-273: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with impossible WHERE +# +CREATE TABLE t2 (a1 INT, KEY(a1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES +(4),(6),(7),(1),(0),(7),(7),(1),(7),(1), +(5),(2),(0),(1),(8),(1),(1),(9),(1),(5); +CREATE TABLE t3 (b1 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES +(4),(5),(8),(4),(8),(2),(9),(6),(4),(8), +(3),(5),(9),(6),(8),(3),(2),(6),(3),(1), +(4),(3),(1),(7),(0),(0),(9),(5),(9),(0), +(2),(2),(5),(9),(1),(4),(8),(6),(5),(5), +(1),(7),(2),(8),(9),(3),(2),(6),(6),(5), +(4),(3),(2),(7),(4),(6),(0),(8),(5),(8), +(2),(9),(7),(5),(7),(0),(4),(3),(1),(0), +(6),(2),(8),(3),(7),(3),(5),(5),(1),(2), +(1),(7),(1),(9),(9),(8),(3); +CREATE TABLE t4 (c1 INT) ENGINE=MyISAM; +EXPLAIN +SELECT count(*) FROM t2, t3 +WHERE a1 < ALL ( +SELECT a1 FROM t2 +WHERE a1 IN ( SELECT a1 FROM t2, t4 ) +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL a1 5 NULL 20 Using where; Using index +1 PRIMARY t3 ALL NULL NULL NULL NULL 87 Using join buffer (flat, BNL join) +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_do_select'; +SELECT count(*) FROM t2, t3 +WHERE a1 < ALL ( +SELECT a1 FROM t2 +WHERE a1 IN ( SELECT a1 FROM t2, t4 ) +); +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL a1 5 NULL 20 Using where; Using index +1 PRIMARY t3 ALL NULL NULL NULL NULL 87 Using join buffer (flat, BNL join) +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +Warnings: +Note 1003 SELECT count(*) FROM t2, t3 +WHERE a1 < ALL ( +SELECT a1 FROM t2 +WHERE a1 IN ( SELECT a1 FROM t2, t4 ) +) +count(*) +1740 +set debug_dbug=''; +drop table t2, t3, t4; +# +# MDEV-275: SHOW EXPLAIN: server crashes in JOIN::print_explain with IN subquery and aggregate function +# +CREATE TABLE t2 ( `pk` INT NOT NULL PRIMARY KEY, `a1` INT NOT NULL, KEY(`a1`)) ENGINE=MyISAM; +INSERT INTO t2 VALUES +(1,5),(2,4),(3,6),(4,9),(5,2),(6,8),(7,4),(8,8),(9,0),(10,43), +(11,23),(12,3),(13,45),(14,16),(15,2),(16,33),(17,2),(18,5),(19,9),(20,2); +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`); +show explain for $thr2; +ERROR HY000: Target is not running an EXPLAINable command +pk a1 +set debug_dbug=''; +DROP TABLE t2; +DROP TABLE t1; +# +# MDEV-305: SHOW EXPLAIN: ref returned by SHOW EXPLAIN is different from the normal EXPLAIN ('const' vs empty string) +# +CREATE TABLE t1(a INT, KEY(a)); +INSERT INTO t1 VALUES (3),(1),(5),(1); +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +SELECT 'test' FROM t1 WHERE a=1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using index +Warnings: +Note 1003 SELECT 'test' FROM t1 WHERE a=1 +test +test +test +set debug_dbug=''; +DROP TABLE t1; +# +# MDEV-299: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN changes back and forth during query execution +# +create table t1 (key1 int, col1 int, col2 int, filler char(100), key(key1)); +insert into t1 select A.a+ 10 * B.a, 10, 10, 'filler-data' from t0 A, t0 B; +update t1 set col1=3, col2=10 where key1=1; +update t1 set col1=3, col2=1000 where key1=2; +update t1 set col1=3, col2=10 where key1=3; +update t1 set col1=3, col2=1000 where key1=4; +set @tmp_mdev299_jcl= @@join_cache_level; +set join_cache_level=0; +explain select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1) +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_test_if_quick_select'; +select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100 +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100 +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100 +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100 +count(*) +212 +set debug_dbug=''; +drop table t1; +# +# MDEV-297: SHOW EXPLAIN: Server gets stuck until timeout occurs while +# executing SHOW INDEX and SHOW EXPLAIN in parallel +# +CREATE TABLE t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)); +INSERT INTO t1 (a) VALUES (3),(1),(5),(1); +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +SHOW INDEX FROM t1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE STATISTICS ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases +Warnings: +Note 1003 SHOW INDEX FROM t1 +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a A NULL NULL NULL YES BTREE +t1 1 b 1 b A NULL NULL NULL YES BTREE +t1 1 c 1 c A NULL NULL NULL YES BTREE +set debug_dbug=''; +DROP TABLE t1; +# +# MDEV-324: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN for a query with TEMPTABLE view +# loses 'DERIVED' line on the way without saying that the plan was already deleted +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; +EXPLAIN SELECT a + 1 FROM v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 +2 DERIVED t1 ALL NULL NULL NULL NULL 2 +set debug_dbug='d,show_explain_probe_join_tab_preread'; +set @show_explain_probe_select_id=1; +SELECT a + 1 FROM v1; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL Query plan already deleted +Warnings: +Note 1003 SELECT a + 1 FROM v1 +a + 1 +2 +3 +set debug_dbug=''; +DROP VIEW v1; +DROP TABLE t1; +# +# MDEV-323: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN loses +# 'UNION RESULT' line on the way without saying that the plan was already deleted +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (4),(6); +EXPLAIN +SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +set debug_dbug='d,show_explain_probe_union_read'; +SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 ); +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 ) +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 ) +a +set debug_dbug=''; +DROP TABLE t1; +# +# MDEV-327: SHOW EXPLAIN: Different select_type in plans produced by SHOW EXPLAIN +# and standard EXPLAIN: 'SUBQUERY' vs 'DEPENDENT SUBQUERY' +# +CREATE TABLE t1 (a INT) ENGINE=Aria; +INSERT INTO t1 VALUES +(4),(6),(3),(5),(3),(246),(2),(9),(3),(8), +(1),(8),(8),(5),(7),(5),(1),(6),(2),(9); +CREATE TABLE t2 (b INT) ENGINE=Aria; +INSERT INTO t2 VALUES +(1),(7),(4),(7),(0),(2),(9),(4),(0),(9), +(1),(3),(8),(8),(18),(84),(6),(3),(6),(6); +EXPLAIN +SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias +WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 20 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 20 +3 SUBQUERY t1 ALL NULL NULL NULL NULL 20 +3 SUBQUERY t2 ALL NULL NULL NULL NULL 20 Using where +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias +WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b ); +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 20 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 20 +3 SUBQUERY t1 ALL NULL NULL NULL NULL 20 +3 SUBQUERY t2 ALL NULL NULL NULL NULL 20 Using where +Warnings: +Note 1003 SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias +WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b ) +a b +set debug_dbug=''; +DROP TABLE t1, t2; +# +# Test that SHOW EXPLAIN will print 'Distinct'. +# +CREATE TABLE t1 (a int(10) unsigned not null primary key,b int(10) unsigned); +INSERT INTO t1 VALUES (1,1),(2,1),(3,1),(4,1); +CREATE TABLE t3 (a int(10) unsigned, key(A), b text); +INSERT INTO t3 VALUES (1,'1'),(2,'2'); +create temporary table t4 select * from t3; +insert into t3 select * from t4; +insert into t4 select * from t3; +insert into t3 select * from t4; +insert into t4 select * from t3; +insert into t3 select * from t4; +insert into t4 select * from t3; +insert into t3 select * from t4; +explain select distinct t1.a from t1,t3 where t1.a=t3.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary +1 SIMPLE t3 ref a a 5 test.t1.a 7 Using index; Distinct +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select distinct t1.a from t1,t3 where t1.a=t3.a; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary +1 SIMPLE t3 ref a a 5 test.t1.a 7 Using index; Distinct +Warnings: +Note 1003 select distinct t1.a from t1,t3 where t1.a=t3.a +a +1 +2 +set debug_dbug=''; +drop table t1,t3,t4; +# +# ---------- SHOW EXPLAIN and permissions ----------------- +# +grant ALL on test.* to test2@localhost; +grant super on *.* to test2@localhost; +# +# First, make sure that user 'test2' cannot do SHOW EXPLAIN on us +# +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select * from t0 where a < 3; +show explain for $thr2; +ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select * from t0 where a < 3 +a +0 +1 +2 +set debug_dbug=''; +# +# Check that user test2 can do SHOW EXPLAIN on its own queries +# +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select * from t0 where a < 3; +show explain for $thr_con2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select * from t0 where a < 3 +a +0 +1 +2 +# +# Now, grant test2 a PROCESSLIST permission, and see that he's able to observe us +# +grant process on *.* to test2@localhost; +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select * from t0 where a < 3; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select * from t0 where a < 3 +a +0 +1 +2 +set debug_dbug=''; +revoke all privileges on test.* from test2@localhost; +drop user test2@localhost; +# +# Test that it is possible to KILL a SHOW EXPLAIN command that's waiting +# on its target thread +# +create table t1 (pk int primary key, data char(64)) engine=innodb; +insert into t1 select A.a + 10 * B.a + 100 * C.a, 'data1' from t0 A, t0 B, t0 C; +# Lock two threads +set autocommit=0; +select * from t1 where pk between 10 and 20 for update; +pk data +10 data1 +11 data1 +12 data1 +13 data1 +14 data1 +15 data1 +16 data1 +17 data1 +18 data1 +19 data1 +20 data1 +set autocommit=0; +select * from t1 where pk between 10 and 20 for update; +# do: send_eval show explain for thr2; +kill query $thr_default; +ERROR 70100: Query execution was interrupted +rollback; +pk data +10 data1 +11 data1 +12 data1 +13 data1 +14 data1 +15 data1 +16 data1 +17 data1 +18 data1 +19 data1 +20 data1 +drop table t1; +# +# Check that the I_S table is invisible +# +select table_name from information_schema.tables where table_schema='information_schema' and table_name like '%explain%'; +table_name +# +# MDEV-325: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN is different from standard EXPLAIN: type ALL vs 'index_merge'.. +# +CREATE TABLE t1 (a INT, b INT, KEY(a), KEY(b)) ENGINE=MyISAM; +INSERT INTO t1 VALUES +(8,0),(128,5050),(5372,8),(234,7596),(2,0),(2907,8930),(1,0), +(0,5224),(8,7638),(960,5),(9872,1534),(0,2295),(3408,9809), +(7,0),(1168,0),(2089,5570),(0,205),(88,1018),(0,26528), +(0,0),(4,5567),(1444,145),(6,0),(1,7535),(7793,534),(70,9), +(178,1),(44,5),(189,0),(3,0); +EXPLAIN +SELECT a+SLEEP(0.01) FROM t1 +WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129 +ORDER BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +SELECT a+SLEEP(0.01) FROM t1 +WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129 +ORDER BY b; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort +Warnings: +Note 1003 SELECT a+SLEEP(0.01) FROM t1 +WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129 +ORDER BY b +a+SLEEP(0.01) +0 +5372 +70 +0 +0 +0 +0 +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_do_select'; +SELECT a+SLEEP(0.01) FROM t1 +WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129 +ORDER BY b; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort +Warnings: +Note 1003 SELECT a+SLEEP(0.01) FROM t1 +WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129 +ORDER BY b +a+SLEEP(0.01) +0 +5372 +70 +0 +0 +0 +0 +set debug_dbug=''; +drop table t1; +# +# MDEV-298: SHOW EXPLAIN: Plan returned by SHOW EXPLAIN only contains +# 'Using temporary' while the standard EXPLAIN says 'Using temporary; Using filesort' +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9), +(10),(11),(12),(13),(14),(15),(16); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12, t1 t13; +EXPLAIN SELECT a FROM t1 GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4112 Using temporary; Using filesort +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +SELECT a FROM t1 GROUP BY a; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4112 Using temporary; Using filesort +Warnings: +Note 1003 SELECT a FROM t1 GROUP BY a +a +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +set debug_dbug=''; +drop table t1; +# +# MDEV-408: SHOW EXPLAIN: Some values are chopped off in SHOW EXPLAIN output +# +CREATE TABLE t1 (a INT, b VARCHAR(35)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (3989,'Abilene'),(3873,'Akron'); +CREATE TABLE t2 (c INT, d VARCHAR(52) PRIMARY KEY, KEY(c)) ENGINE=InnoDB; +INSERT INTO t2 VALUES (86,'English'),(87,'Russian'); +explain SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's'; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 index_subquery PRIMARY,c c 5 func 1 Using index; Using where +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's'; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 index_subquery PRIMARY,c c 5 func 1 Using index; Using where +Warnings: +Note 1003 SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's' +SUM(a + SLEEP(0.1)) +7862 +set debug_dbug=''; +drop table t1, t2; +# +# MDEV-412: SHOW EXPLAIN: Server crashes in JOIN::print_explain on a query with inner join and ORDER BY the same column twice +# +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(3), KEY(b)) ENGINE=MyISAM; +INSERT INTO t1 VALUES +(3795,'USA'),(3913,'USA'),(3846,'ITA'),(4021,'USA'),(4005,'RUS'),(4038,'USA'), +(3825,'USA'),(3840,'USA'),(3987,'USA'),(3807,'USA'),(3896,'USA'),(4052,'USA'), +(3973,'USA'),(3982,'ITA'),(3965,'USA'),(3852,'RUS'),(4006,'USA'),(3800,'USA'), +(4020,'USA'),(4040,'USA'),(3916,'USA'),(3817,'USA'),(3885,'USA'),(3802,'USA'), +(4009,'ITA'),(3895,'USA'),(3963,'RUS'),(4045,'USA'),(3988,'USA'),(3815,'USA'), +(4063,'USA'),(3978,'USA'),(4019,'USA'),(3954,'USA'),(3950,'USA'),(3974,'ITA'), +(4054,'USA'),(4061,'RUS'),(3976,'USA'),(3966,'USA'),(3957,'USA'),(3981,'USA'), +(3923,'USA'),(3876,'USA'),(3819,'USA'),(3877,'USA'),(3829,'ITA'),(3964,'USA'), +(4053,'RUS'),(3917,'USA'),(3874,'USA'),(4023,'USA'),(4001,'USA'),(3872,'USA'), +(3890,'USA'),(3962,'USA'),(3886,'USA'),(4026,'ITA'),(3869,'USA'),(3937,'RUS'), +(3975,'USA'),(3944,'USA'),(3908,'USA'),(3867,'USA'),(3947,'USA'),(3838,'USA'), +(3796,'USA'),(3893,'USA'),(3920,'ITA'),(3994,'USA'),(3875,'RUS'),(4011,'USA'), +(4013,'USA'),(3810,'USA'),(3834,'USA'),(3968,'USA'),(3931,'USA'),(3839,'USA'), +(4042,'USA'),(4039,'ITA'),(3811,'USA'),(3837,'RUS'),(4041,'USA'),(3884,'USA'), +(3894,'USA'),(3879,'USA'),(3942,'USA'),(3959,'USA'),(3814,'USA'),(4044,'USA'), +(3971,'ITA'),(3823,'USA'),(3793,'RUS'),(3855,'USA'),(3905,'USA'),(3865,'USA'), +(4046,'USA'),(3990,'USA'),(4022,'USA'),(3833,'USA'),(3918,'USA'),(4064,'ITA'), +(3821,'USA'),(3836,'RUS'),(3921,'USA'),(3914,'USA'),(3888,'USA'); +CREATE TABLE t2 (c VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('USA'); +CREATE TABLE t3 (d VARCHAR(3), e VARCHAR(52), PRIMARY KEY (d,e)) ENGINE=MyISAM; +INSERT INTO t3 VALUES +('JPN','Japanese'),('KOR','Korean'),('POL','Polish'),('PRT','Portuguese'), +('ESP','Spanish'),('FRA','French'),('VNM','Vietnamese'); +explain +SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 system NULL NULL NULL NULL 1 Using filesort +1 SIMPLE t1 index b b 6 NULL 107 Using where; Using index +1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_do_select'; +SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 system NULL NULL NULL NULL 1 Using filesort +1 SIMPLE t1 index b b 6 NULL 107 Using where; Using index +1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index +Warnings: +Note 1003 SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2 +field1 field2 +set debug_dbug=''; +DROP TABLE t1,t2,t3; +# +# MDEV-423: SHOW EXPLAIN: 'Using where' for a subquery is shown in EXPLAIN, but not in SHOW EXPLAIN output +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (7),(0),(9),(3),(4),(2),(5),(7),(0),(9),(3),(4),(2),(5); +CREATE TABLE t2 (b INT, c INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES +(0,4),(8,6),(1,3),(8,5),(9,3),(24,246),(6,2),(1,9),(6,3),(2,8), +(4,1),(8,8),(4,8),(4,5),(7,7),(4,5),(1,1),(9,6),(4,2),(8,9); +create table t3 like t2; +insert into t3 select * from t2; +explain +SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias +WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 +1 PRIMARY t2 ALL NULL NULL NULL NULL 20 +3 SUBQUERY t3 ALL NULL NULL NULL NULL 20 Using where +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias +WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 +1 PRIMARY t2 ALL NULL NULL NULL NULL 20 +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Query plan already deleted +Warnings: +Note 1003 SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias +WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10 +max(a+b+c) +279 +set debug_dbug=''; +DROP TABLE t1,t2,t3; +# +# MDEV-416: Server crashes in SQL_SELECT::cleanup on EXPLAIN with SUM ( DISTINCT ) in a non-correlated subquery (5.5-show-explain tree) +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (8),(9); +EXPLAIN SELECT * FROM t1 +WHERE ( 8, 89 ) IN ( SELECT b, SUM( DISTINCT b ) FROM t2 GROUP BY b ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using filesort +DROP TABLE t1,t2; +# +# Check if queries in non-default charsets work. +# +set names cp1251; +select charset('ãû'); +charset('ãû') +cp1251 +select hex('ãû'); +hex('ãû') +E3FB +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select * from t0 where length('ãû') = a; +set names utf8; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select * from t0 where length('гы') = a +set names default; +a +2 +set debug_dbug=''; +set names default; +# +# MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref if FOR contains a non-numeric value +# +show explain for foo; +ERROR HY000: You may only use constant expressions in this statement +# End +drop table t0; diff --git a/mysql-test/r/show_explain_ps.result b/mysql-test/r/show_explain_ps.result new file mode 100644 index 00000000000..f9b82c85f01 --- /dev/null +++ b/mysql-test/r/show_explain_ps.result @@ -0,0 +1,29 @@ +drop table if exists t0, t1; +select * from performance_schema.setup_instruments where name like '%show_explain%'; +NAME ENABLED TIMED +wait/synch/cond/sql/show_explain YES YES +stage/sql/show explain YES YES +statement/sql/show_explain YES YES +# We've got no instances +select * from performance_schema.cond_instances where name like '%show_explain%'; +NAME OBJECT_INSTANCE_BEGIN +# Check out if our cond is hit. +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +select count(*) from t0 where a < 100000; +show explain for $thr2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where +Warnings: +Note 1003 select count(*) from t0 where a < 100000 +count(*) +10 +set debug_dbug=''; +select event_name +from performance_schema.events_waits_history_long +where event_name='wait/synch/cond/sql/show_explain'; +event_name +wait/synch/cond/sql/show_explain +drop table t0; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index d49c67a35fd..293400ece2f 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7811,9 +7811,12 @@ DROP FUNCTION f1; # -- End of 5.1 tests # ------------------------------------------------------------------ # -# LP bug#993459 Execution of PS for a query with GROUP BY +# lp:993459 Execution of PS for a query with GROUP BY # returns wrong result (see also mysql bug#13805127) # + +# Bug#13805127: Stored program cache produces wrong result in same THD + CREATE PROCEDURE p1(x INT UNSIGNED) BEGIN SELECT c1, t2.c2, count(c3) @@ -7850,7 +7853,7 @@ c1 c2 count(c3) 2012-03-01 02:00:00 3 1 DROP PROCEDURE p1; # -# LP bug#1002157 : testing stored function +# lp:1002157 : testing stored function # bug#62125 result for null incorrectly yields 1292 warning. # DROP FUNCTION IF EXISTS f1; diff --git a/mysql-test/r/str_to_datetime_457.result b/mysql-test/r/str_to_datetime_457.result new file mode 100644 index 00000000000..4fd0d00691c --- /dev/null +++ b/mysql-test/r/str_to_datetime_457.result @@ -0,0 +1,51 @@ +select cast('01:02:03 ' as time), cast('01:02:03 ' as time); +cast('01:02:03 ' as time) cast('01:02:03 ' as time) +01:02:03 00:00:00 +select cast('2002-011-012' as date), cast('2002.11.12' as date), cast('2002.011.012' as date); +cast('2002-011-012' as date) cast('2002.11.12' as date) cast('2002.011.012' as date) +2002-11-12 2002-11-12 2002-11-12 +select cast('2012103123595912' as datetime(6)), cast('20121031235959123' as datetime(6)); +cast('2012103123595912' as datetime(6)) cast('20121031235959123' as datetime(6)) +2012-10-31 23:59:59.000000 2012-10-31 23:59:59.000000 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2012103123595912' +Warning 1292 Truncated incorrect datetime value: '20121031235959123' +select cast(0 as date), cast('0000-00-00' as date), cast('0' as date); +cast(0 as date) cast('0000-00-00' as date) cast('0' as date) +0000-00-00 0000-00-00 NULL +Warnings: +Warning 1292 Incorrect datetime value: '0' +select extract(hour from '100000:02:03'), extract(hour from '100000:02:03 '); +extract(hour from '100000:02:03') extract(hour from '100000:02:03 ') +NULL NULL +Warnings: +Warning 1292 Truncated incorrect time value: '100000:02:03' +Warning 1292 Truncated incorrect time value: '100000:02:03 ' +# +# backward compatibility craziness +# +select cast('12:00:00.12.34.56' as time); +cast('12:00:00.12.34.56' as time) +12:00:00 +Warnings: +Warning 1292 Truncated incorrect time value: '12:00:00.12.34.56' +select cast('12:00:00 12.34.56' as time); +cast('12:00:00 12.34.56' as time) +12:34:56 +select cast('12:00:00-12.34.56' as time); +cast('12:00:00-12.34.56' as time) +12:00:00 +Warnings: +Warning 1292 Truncated incorrect time value: '12:00:00-12.34.56' +select cast('12:00:00.12.34.56' as datetime); +cast('12:00:00.12.34.56' as datetime) +2012-00-00 12:34:56 +select cast('12:00:00-12.34.56' as datetime); +cast('12:00:00-12.34.56' as datetime) +2012-00-00 12:34:56 +select cast('12:00:00 12.34.56' as datetime); +cast('12:00:00 12.34.56' as datetime) +2012-00-00 12:34:56 +select cast('12:00:00.123456' as time); +cast('12:00:00.123456' as time) +12:00:00 diff --git a/mysql-test/r/strict_autoinc_1myisam.result b/mysql-test/r/strict_autoinc_1myisam.result index afcccb1c40f..b22540f295b 100644 --- a/mysql-test/r/strict_autoinc_1myisam.result +++ b/mysql-test/r/strict_autoinc_1myisam.result @@ -20,9 +20,7 @@ count(*) 0 set @@sql_mode=@org_mode; insert into t1 values(null); -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +ERROR 22003: Out of range value for column 'a' at row 1 select * from t1; a -127 drop table t1; diff --git a/mysql-test/r/strict_autoinc_2innodb.result b/mysql-test/r/strict_autoinc_2innodb.result index e534286e2a2..1cf720da12a 100644 --- a/mysql-test/r/strict_autoinc_2innodb.result +++ b/mysql-test/r/strict_autoinc_2innodb.result @@ -20,9 +20,7 @@ count(*) 0 set @@sql_mode=@org_mode; insert into t1 values(null); -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +ERROR 22003: Out of range value for column 'a' at row 1 select * from t1; a -127 drop table t1; diff --git a/mysql-test/r/strict_autoinc_3heap.result b/mysql-test/r/strict_autoinc_3heap.result index 0a31da04460..21eea537af5 100644 --- a/mysql-test/r/strict_autoinc_3heap.result +++ b/mysql-test/r/strict_autoinc_3heap.result @@ -20,9 +20,7 @@ count(*) 0 set @@sql_mode=@org_mode; insert into t1 values(null); -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +ERROR 22003: Out of range value for column 'a' at row 1 select * from t1; a -127 drop table t1; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 1863cd09c38..f775336299b 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5966,7 +5966,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6127,7 +6127,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6612,7 +6612,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6768,5 +6794,68 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result index 41c445329cb..ed00e4ef684 100644 --- a/mysql-test/r/subselect2.result +++ b/mysql-test/r/subselect2.result @@ -161,18 +161,18 @@ SET optimizer_switch='materialization=on,in_to_exists=on'; EXPLAIN SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 2 Using index -1 PRIMARY t3 index b b 5 NULL 4 Using where; Using index; Using join buffer (flat, BNL join) -2 MATERIALIZED t1 index PRIMARY,a a 5 NULL 2 Using index +1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index +1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index +2 SUBQUERY t1 index_subquery PRIMARY,a a 5 const 0 Using index; Using where SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b; pk a b 0 4 4 EXPLAIN SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 2 Using index -1 PRIMARY t3 index b b 5 NULL 4 Using where; Using index; Using join buffer (flat, BNL join) -2 MATERIALIZED t1 index PRIMARY,a a 5 NULL 2 Using index +1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index +1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index +2 SUBQUERY t1 index_subquery PRIMARY,a a 5 const 0 Using index; Using where SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b; pk a b 0 4 4 diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 72b4f34d9de..7f290fb5b03 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -206,6 +206,165 @@ default(a) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DROP TABLE t; # +# LP BUG#1009187, MDEV-373, MYSQL bug#58628 +# Wrong result for a query with [NOT] IN subquery predicate if +# the left part of the predicate is explicit NULL +# +CREATE TABLE t1 (pk INT NOT NULL, i INT NOT NULL); +INSERT INTO t1 VALUES (0,10), (1,20), (2,30), (3,40); +CREATE TABLE t2a (pk INT NOT NULL, i INT NOT NULL, PRIMARY KEY(i,pk)); +INSERT INTO t2a VALUES (0,0), (1,1), (2,2), (3,3); +CREATE TABLE t2b (pk INT, i INT); +INSERT INTO t2b VALUES (0,0), (1,1), (2,2), (3,3); +CREATE TABLE t2c (pk INT NOT NULL, i INT NOT NULL); +INSERT INTO t2c VALUES (0,0), (1,1), (2,2), (3,3); +create index it2c on t2c (i,pk); +CREATE TABLE t2d (pk INT NOT NULL, i INT NOT NULL, PRIMARY KEY(i)); +INSERT INTO t2d VALUES (0,0), (1,1), (2,2), (3,3); +EXPLAIN +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2a unique_subquery PRIMARY PRIMARY 8 const,test.t1.pk 1 Using index; Using where; Full scan on NULL key +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk); +pk i +SELECT * FROM t1 WHERE 1+NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk); +pk i +SELECT * FROM t1 WHERE NULL IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk) IS UNKNOWN; +pk i +0 10 +1 20 +2 30 +3 40 +SELECT t1.pk, NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk) FROM t1; +pk NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk) +0 NULL +1 NULL +2 NULL +3 NULL +EXPLAIN +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2b ALL NULL NULL NULL NULL 4 Using where +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk); +pk i +SELECT * FROM t1 WHERE NULL IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk) IS UNKNOWN; +pk i +0 10 +1 20 +2 30 +3 40 +SELECT t1.pk, NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk) FROM t1; +pk NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk) +0 NULL +1 NULL +2 NULL +3 NULL +EXPLAIN +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2c index_subquery it2c it2c 8 const,test.t1.pk 2 Using index; Using where; Full scan on NULL key +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk); +pk i +SELECT * FROM t1 WHERE NULL IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk) IS UNKNOWN; +pk i +0 10 +1 20 +2 30 +3 40 +SELECT t1.pk, NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk) FROM t1; +pk NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk) +0 NULL +1 NULL +2 NULL +3 NULL +EXPLAIN +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2d const PRIMARY PRIMARY 4 const 1 Using where; Full scan on NULL key +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk); +pk i +SELECT * FROM t1 WHERE NULL IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk) IS UNKNOWN; +pk i +0 10 +1 20 +2 30 +3 40 +SELECT t1.pk, NULL NOT IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk) FROM t1; +pk NULL NOT IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk) +0 NULL +1 NULL +2 NULL +3 NULL +EXPLAIN +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2a.i, t2a.pk FROM t2a WHERE t2a.pk = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2a eq_ref PRIMARY PRIMARY 8 const,test.t1.pk 1 Using where; Using index; Full scan on NULL key +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2a.i, t2a.pk FROM t2a WHERE t2a.pk = t1.pk); +pk i +0 10 +2 30 +3 40 +SELECT (NULL, 1) NOT IN (SELECT t2a.i, t2a.pk FROM t2a WHERE t2a.pk = t1.pk) from t1; +(NULL, 1) NOT IN (SELECT t2a.i, t2a.pk FROM t2a WHERE t2a.pk = t1.pk) +1 +NULL +1 +1 +EXPLAIN +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2b.i, t2b.pk FROM t2b WHERE t2b.pk = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2b ALL NULL NULL NULL NULL 4 Using where +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2b.i, t2b.pk FROM t2b WHERE t2b.pk = t1.pk); +pk i +0 10 +2 30 +3 40 +SELECT (NULL, 1) NOT IN (SELECT t2b.i, t2b.pk FROM t2b WHERE t2b.pk = t1.pk) from t1; +(NULL, 1) NOT IN (SELECT t2b.i, t2b.pk FROM t2b WHERE t2b.pk = t1.pk) +1 +NULL +1 +1 +EXPLAIN +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2c ref it2c it2c 8 const,test.t1.pk 2 Using where; Using index; Full scan on NULL key +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk); +pk i +0 10 +2 30 +3 40 +SELECT (NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk) from t1; +(NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk) +1 +NULL +1 +1 +EXPLAIN +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2d.i, t2d.pk FROM t2d WHERE t2d.pk = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2d const PRIMARY PRIMARY 4 const 1 Using where; Full scan on NULL key +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2d.i, t2d.pk FROM t2d WHERE t2d.pk = t1.pk); +pk i +0 10 +2 30 +3 40 +SELECT (NULL, 1) NOT IN (SELECT t2d.i, t2d.pk FROM t2d WHERE t2d.pk = t1.pk) from t1; +(NULL, 1) NOT IN (SELECT t2d.i, t2d.pk FROM t2d WHERE t2d.pk = t1.pk) +1 +NULL +1 +1 +drop table t1, t2a, t2b, t2c, t2d; +# # End of 5.1 tests. # # @@ -627,51 +786,51 @@ SET @@optimizer_switch = 'materialization=on,in_to_exists=off,semijoin=off'; EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); f1 f2 EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in; not_in NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); f1 f2 EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in; not_in NULL @@ -679,7 +838,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in; not_in 1 @@ -687,7 +846,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in; not_in NULL @@ -695,7 +854,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in; not_in NULL @@ -703,7 +862,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in; not_in NULL @@ -718,51 +877,51 @@ SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off'; EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); f1 f2 EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in; not_in NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); f1 f2 EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in; not_in NULL @@ -770,7 +929,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in; not_in 1 @@ -778,7 +937,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in; not_in NULL @@ -786,7 +945,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in; not_in NULL @@ -794,7 +953,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in; not_in NULL @@ -813,21 +972,21 @@ SET @@optimizer_switch = 'materialization=on,in_to_exists=off,semijoin=off'; EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10); f1 f2 @@ -842,14 +1001,14 @@ NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10); f1 f2 @@ -904,21 +1063,21 @@ SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off'; EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10); f1 f2 @@ -933,14 +1092,14 @@ NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10); f1 f2 diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index a0f05a26a46..6c1e52a112e 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -248,6 +248,47 @@ NULL drop procedure p1; drop tables t1,t2,t3; # +# Bug #58756 +# Crash in heap_rrnd on query with HAVING ... IN (subquery) + LIMIT +# +CREATE TABLE t1 ( +col_time_key time DEFAULT NULL, +col_datetime_key datetime DEFAULT NULL, +col_varchar_nokey varchar(1) DEFAULT NULL, +KEY col_time_key (col_time_key), +KEY col_datetime_key (col_datetime_key) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('17:53:30','2005-11-10 12:40:29','h'); +INSERT INTO t1 VALUES ('11:35:49','2009-04-25 00:00:00','b'); +INSERT INTO t1 VALUES (NULL,'2002-11-27 00:00:00','s'); +INSERT INTO t1 VALUES ('06:01:40','2004-01-26 20:32:32','e'); +INSERT INTO t1 VALUES ('05:45:11','2007-10-26 11:41:40','j'); +INSERT INTO t1 VALUES ('00:00:00','2005-10-07 00:00:00','e'); +INSERT INTO t1 VALUES ('00:00:00','2000-07-15 05:00:34','f'); +INSERT INTO t1 VALUES ('06:11:01','2000-04-03 16:33:32','v'); +INSERT INTO t1 VALUES ('13:02:46',NULL,'x'); +INSERT INTO t1 VALUES ('21:44:25','2001-04-25 01:26:12','m'); +INSERT INTO t1 VALUES ('22:43:58','2000-12-27 00:00:00','c'); +CREATE TABLE t2 ( +col_time_key time DEFAULT NULL, +col_datetime_key datetime DEFAULT NULL, +col_varchar_nokey varchar(1) DEFAULT NULL, +KEY col_time_key (col_time_key), +KEY col_datetime_key (col_datetime_key) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2 VALUES ('11:28:45','2004-10-11 18:13:16','w'); +SELECT col_time_key, col_datetime_key +FROM +( SELECT * FROM t1 ) AS table1 +HAVING ( 'r' , 'e' ) IN +( SELECT col_varchar_nokey , col_varchar_nokey FROM t2 ) +ORDER BY col_datetime_key +LIMIT 10; +col_time_key col_datetime_key +DROP TABLE t1; +DROP TABLE t2; +# End of Bug #58756 +# # Bug#60085 crash in Item::save_in_field() with time data type # CREATE TABLE t1(a date, b int, unique(b), unique(a), key(b)) engine=innodb; @@ -333,7 +374,7 @@ WHERE (SELECT DISTINCT b FROM t3) > 0); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using where; Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 0 Using temporary +3 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using temporary SELECT * FROM t1 WHERE t1.a = ( @@ -386,7 +427,7 @@ select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 gr id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1 2 SUBQUERY t1 ALL NULL NULL NULL NULL 1 -3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +3 SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using temporary; Using filesort select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 group by a1)); 1 1 diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result index 45d0b9ee519..9bb26e8a6e0 100644 --- a/mysql-test/r/subselect_mat.result +++ b/mysql-test/r/subselect_mat.result @@ -2183,7 +2183,7 @@ NULL EXPLAIN SELECT * FROM t2 WHERE (SELECT f3a, f3b FROM t3) NOT IN (SELECT f1a, f1b FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t2 WHERE (SELECT f3a, f3b FROM t3) NOT IN (SELECT f1a, f1b FROM t1); diff --git a/mysql-test/r/subselect_mat_cost_bugs.result b/mysql-test/r/subselect_mat_cost_bugs.result index 5a38fe7ca72..8c95c8637aa 100644 --- a/mysql-test/r/subselect_mat_cost_bugs.result +++ b/mysql-test/r/subselect_mat_cost_bugs.result @@ -148,7 +148,7 @@ FROM t2 GROUP BY f1 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t1 system NULL NULL NULL NULL 1 -3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +3 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort drop table t1, t2, t3; # # LP BUG#715034 Item_sum_distinct::clear(): Assertion `tree != 0' failed @@ -162,7 +162,7 @@ EXPLAIN SELECT * FROM (SELECT * FROM t2) AS a2 WHERE (SELECT distinct SUM(distinct f3 ) FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found 3 SUBQUERY t1 index NULL f3 5 NULL 2 Using index 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table insert into t2 values (1),(2); diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 78ab87dbfd6..e72d25fdafa 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -4200,7 +4200,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5967,7 +5967,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6126,7 +6126,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6611,7 +6611,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6766,8 +6792,71 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index f822a4500f4..9030265356b 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5963,7 +5963,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6122,7 +6122,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6607,7 +6607,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6763,6 +6789,69 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index cdad363313d..e68f5990c08 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -4202,7 +4202,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5972,7 +5972,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6133,7 +6133,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6618,7 +6618,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6774,8 +6800,71 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 8e6d4bfccc2..f0ce541294a 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5963,7 +5963,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6122,7 +6122,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6607,7 +6607,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6763,7 +6789,70 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 63193bdedbc..3310209df58 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -165,6 +165,8 @@ select @log; (BEFORE_INSERT: new=(id=1, data=1))(AFTER_INSERT: new=(id=1, data=1)) set @log:= ""; insert ignore t1 values (1, 2); +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' select @log; @log (BEFORE_INSERT: new=(id=1, data=2)) diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 40325376fc0..ff4ebd6b15c 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -878,6 +878,8 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT CREATE TABLE b15776 (a char(4294967296)); ERROR 42000: Display width out of range for 'a' (max = 4294967295) CREATE TABLE b15776 (a year(4294967295)); +Warnings: +Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO b15776 VALUES (42); SELECT * FROM b15776; a @@ -886,6 +888,8 @@ DROP TABLE b15776; CREATE TABLE b15776 (a year(4294967296)); ERROR 42000: Display width out of range for 'a' (max = 4294967295) CREATE TABLE b15776 (a year(0)); +Warnings: +Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead DROP TABLE b15776; CREATE TABLE b15776 (a year(-2)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2))' at line 1 diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 41f590400ea..8a85cd53b2a 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -209,15 +209,11 @@ a SET SQL_MODE=TRADITIONAL; EXPLAIN SELECT * FROM t1 WHERE a = '0000-00-00'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i i 4 const 1 Using where; Using index -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +1 SIMPLE t1 ref i i 4 const 1 Using index SELECT * FROM t1 WHERE a = '0000-00-00'; a 0000-00-00 0000-00-00 -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 SELECT * FROM t2 WHERE a = '0000-00-00'; a 0000-00-00 @@ -242,15 +238,11 @@ a SET SQL_MODE=TRADITIONAL; EXPLAIN SELECT * FROM t1 WHERE a = '1000-00-00'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i i 4 const 1 Using where; Using index -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 +1 SIMPLE t1 ref i i 4 const 1 Using index SELECT * FROM t1 WHERE a = '1000-00-00'; a 1000-00-00 1000-00-00 -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 SELECT * FROM t2 WHERE a = '1000-00-00'; a 1000-00-00 diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 5d89a1ee407..4b9bf6f433f 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -1,5 +1,7 @@ drop table if exists t1; create table t1 (y year,y2 year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); select * from t1; y y2 @@ -50,6 +52,8 @@ End of 5.0 tests # Bug #49480: WHERE using YEAR columns returns unexpected results # CREATE TABLE t2(yy YEAR(2), c2 CHAR(4)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4)); INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069); INSERT INTO t4 (c4) SELECT c2 FROM t2; @@ -358,9 +362,22 @@ total_rows min_value MAX(c1+0) 3 0 2155 DROP TABLE t1; # +# WL#6219: Deprecate and remove YEAR(2) type +# +CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +DROP TABLE t1; +# End of 5.1 tests create function y2k() returns int deterministic return 2000; create table t1 (a year(2), b int); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert t1 values (0,2000); select a from t1 where a=2000; a diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 86f4ba25ab1..27a0d7f0a1b 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -34,7 +34,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=10000/*!*/; INSERT INTO t1 VALUES(@`a b`) /*!*/; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 008f8f41ada..5af20fd0c3c 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4674,6 +4674,62 @@ INSERT INTO t2 VALUES (1); DROP TRIGGER tr; DROP VIEW v1; DROP TABLE t1,t2,t3; +# +# LP bug#1007622 Server crashes in handler::increment_statistics on +# inserting into a view over a view +# +flush status; +CREATE TABLE t1 (a INT); +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a1.* FROM t1 AS a1, t1 AS a2; +CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM v1; +INSERT INTO v2 (a) VALUES (1) ; +select * from t1; +a +1 +drop view v2,v1; +drop table t1; +show status like '%view%'; +Variable_name Value +Com_create_view 2 +Com_drop_view 1 +Opened_views 3 +show status like 'Opened_table%'; +Variable_name Value +Opened_table_definitions 2 +Opened_tables 3 +# +# MDEV-486 LP BUG#1010116 Incorrect query results in +# view and derived tables +# +SELECT +`Derived1`.`id`, +`Derived2`.`Val1` +FROM (select 30631 as `id`) AS `Derived1` LEFT OUTER JOIN (SELECT +2 as `id`, +1 AS `Val1` +FROM (select 30631 as `id`) AS `Derived3`) AS `Derived2` ON `Derived1`.`id` = `Derived2`.`id`; +id Val1 +30631 NULL +create table t1 ( id int ); +insert into t1 values (30631); +create table t2 ( id int ); +insert into t2 values (30631); +create algorithm=MERGE view v2 as select 2 as id, 1 as val1 from t2; +select t1.*, v2.* from t1 left join v2 on t1.id = v2.id; +id id val1 +30631 NULL NULL +drop view v2; +drop table t1,t2; +create table t1 ( id int ); +insert into t1 values (30631); +create table t2 ( id int ); +insert into t2 values (30631); +create algorithm=MERGE view v2 as select 2 as id, id is null as bbb, id as iddqd, 1 as val1 from t2; +select t1.*, v2.* from t1 left join v2 on t1.id = v2.id; +id id bbb iddqd val1 +30631 NULL NULL NULL NULL +drop view v2; +drop table t1,t2; # ----------------------------------------------------------------- # -- End of 5.3 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/r/xa_binlog.result b/mysql-test/r/xa_binlog.result index 3ce64953902..395f0dc62a4 100644 --- a/mysql-test/r/xa_binlog.result +++ b/mysql-test/r/xa_binlog.result @@ -18,7 +18,7 @@ a 1 2 3 -SHOW BINLOG EVENTS LIMIT 1,9; +SHOW BINLOG EVENTS LIMIT 2,9; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1) diff --git a/mysql-test/r/xtradb_mrr.result b/mysql-test/r/xtradb_mrr.result index 069d3c25826..15b750d2fd3 100644 --- a/mysql-test/r/xtradb_mrr.result +++ b/mysql-test/r/xtradb_mrr.result @@ -276,6 +276,8 @@ bb-1 NULL cc-2 NULL-1 drop table t1, t2, t3, t4; create table t1 (a int, b int not null,unique key (a,b),index(b)); insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6); +Warnings: +Warning 1062 Duplicate entry '6-6' for key 'a' create table t2 like t1; insert into t2 select * from t1; alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10)); diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index 33feb5c7591..f84995cac3b 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -35,7 +35,7 @@ DELIMITER /*!*/; # at 4 <#>ROLLBACK/*!*/; # at 102 -<#>use test/*!*/; +<#>use `test`/*!*/; SET TIMESTAMP=1196959712/*!*/; <#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_checkpoint.result b/mysql-test/suite/binlog/r/binlog_checkpoint.result new file mode 100644 index 00000000000..8a4a3af115d --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_checkpoint.result @@ -0,0 +1,88 @@ +SET @old_max_binlog_size= @@global.max_binlog_size; +SET GLOBAL max_binlog_size= 4096; +SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +CREATE TABLE t2 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Myisam; +*** Test that RESET MASTER waits for pending commit checkpoints to complete. +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go"; +INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +INSERT INTO t2 VALUES (1, REPEAT("x", 4100)); +INSERT INTO t2 VALUES (2, REPEAT("x", 4100)); +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000001 +SET DEBUG_SYNC= "execute_command_after_close_tables SIGNAL reset_master_done"; +RESET MASTER; +This will timeout, as RESET MASTER is blocked +SET DEBUG_SYNC= "now WAIT_FOR reset_master_done TIMEOUT 1"; +Warnings: +Warning 1639 debug sync point wait timed out +SET DEBUG_SYNC= "now SIGNAL con1_go"; +show binary logs; +Log_name File_size +master-bin.000001 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000001 # Binlog_checkpoint # # master-bin.000001 +*** Test that binlog N is active, and commit checkpoint for (N-1) is +*** done while there is still a pending commit checkpoint for (N-2). +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR con1_continue"; +INSERT INTO t1 VALUES (20, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR con2_continue"; +INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000001 # Binlog_checkpoint # # master-bin.000001 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000002 # Binlog_checkpoint # # master-bin.000001 +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Table_map # # table_id: # (test.t1) +master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000002 # Xid # # COMMIT /* XID */ +master-bin.000002 # Rotate # # master-bin.000003;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000003 # Binlog_checkpoint # # master-bin.000001 +SET DEBUG_SYNC= "now SIGNAL con2_continue"; +con1 is still pending, no new binlog checkpoint should have been logged. +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000003 # Binlog_checkpoint # # master-bin.000001 +SET DEBUG_SYNC= "now SIGNAL con1_continue"; +No commit checkpoints are pending, a new binlog checkpoint should have been logged. +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000003 # Binlog_checkpoint # # master-bin.000001 +master-bin.000003 # Binlog_checkpoint # # master-bin.000003 +DROP TABLE t1, t2; +SET GLOBAL max_binlog_size= @old_max_binlog_size; +SET GLOBAL innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/binlog/r/binlog_drop_if_exists.result b/mysql-test/suite/binlog/r/binlog_drop_if_exists.result index e461a37c58b..0acd39388cd 100644 --- a/mysql-test/suite/binlog/r/binlog_drop_if_exists.result +++ b/mysql-test/suite/binlog/r/binlog_drop_if_exists.result @@ -96,3 +96,21 @@ master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684 +CREATE TABLE t1(id int); +DROP TABLE /* comment */ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* comment */ t1; +CREATE TABLE t1(id int); +DROP TABLE /**/ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* */ t1; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE /* comment */ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* comment */ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE /**/ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* */ `t1` /* generated by server */ diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result index 4f1ee073b6d..468a3dd5bd9 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb_row.result +++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result @@ -69,6 +69,8 @@ INSERT INTO t1 VALUES (1); START TRANSACTION; INSERT INTO t2 VALUES (1); INSERT IGNORE INTO t1 VALUES (1); +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' COMMIT; INSERT INTO t1 VALUES (2); START TRANSACTION; diff --git a/mysql-test/suite/binlog/r/binlog_ioerr.result b/mysql-test/suite/binlog/r/binlog_ioerr.result index f8e2d189f57..68ff5264aa3 100644 --- a/mysql-test/suite/binlog/r/binlog_ioerr.result +++ b/mysql-test/suite/binlog/r/binlog_ioerr.result @@ -16,6 +16,7 @@ a SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info BINLOG POS Format_desc 1 ENDPOS Server ver: #, Binlog ver: # +BINLOG POS Binlog_checkpoint 1 ENDPOS master-bin.000001 BINLOG POS Query 1 ENDPOS use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb BINLOG POS Query 1 ENDPOS BEGIN BINLOG POS Query 1 ENDPOS use `test`; INSERT INTO t1 VALUES(0) diff --git a/mysql-test/suite/binlog/r/binlog_mdev342.result b/mysql-test/suite/binlog/r/binlog_mdev342.result index 9cb2b94f59d..0d45cbace91 100644 --- a/mysql-test/suite/binlog/r/binlog_mdev342.result +++ b/mysql-test/suite/binlog/r/binlog_mdev342.result @@ -21,6 +21,7 @@ master-bin.000002 # include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000001 # Binlog_checkpoint # # master-bin.000001 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result index 0c008661784..58cac276c95 100644 --- a/mysql-test/suite/binlog/r/binlog_row_annotate.result +++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result @@ -8,6 +8,7 @@ ##################################################################################### show binlog events in 'master-bin.000001' from <start_pos>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1 master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test2 master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test3 @@ -67,6 +68,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -293,6 +296,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -437,6 +442,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -653,6 +660,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -879,6 +888,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -1023,6 +1034,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index b162e66137b..58ec82cbb3a 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -234,6 +234,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Rotate # # master-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ set @ac = @@autocommit; set autocommit= 0; @@ -578,13 +579,46 @@ DROP PROCEDURE p4; End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); +insert into t1 values(5); set insert_id=128; -insert into t1 values(null); +insert into t1 values(null) /* Not binlogged */; +ERROR 22003: Out of range value for column 'id' at row 1 +set insert_id=128; +insert ignore into t1 values(null) /* Insert 128 */; +Warnings: +Warning 167 Out of range value for column 'id' at row 1 +set insert_id=5; +insert into t1 values(null) /* Not binlogged */; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +set insert_id=5; +insert ignore into t1 values(null) /* Insert 5 */; Warnings: -Warning 1264 Out of range value for column 'id' at row 1 +Warning 1062 Duplicate entry '5' for key 'PRIMARY' select * from t1; id -127 +5 +drop table t1; +create table t1 (id tinyint auto_increment primary key) engine=myisam; +set insert_id=128; +insert into t1 values(5),(null) /* Insert_id 128 */; +ERROR 22003: Out of range value for column 'id' at row 2 +set insert_id=128; +insert ignore into t1 values (4),(null) /* Insert_id 128 */; +Warnings: +Warning 167 Out of range value for column 'id' at row 2 +set insert_id=5; +insert into t1 values(3),(null) /* Insert_id 5 */; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +set insert_id=5; +insert ignore into t1 values(2),(null) /* Insert_id 5 */; +Warnings: +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +select * from t1 order by id; +id +2 +3 +4 +5 drop table t1; create table t1 (a int); create table if not exists t2 select * from t1; @@ -603,36 +637,19 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) engine=myisam master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( - `a` int(11) DEFAULT NULL -) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( - `a` int(11) DEFAULT NULL -) -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (mysql.user) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (mysql.user) -master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -drop table t1,t2,t3,tt1; -create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -insert /* before delayed */ delayed /* after delayed */ into t1 values (207); -insert /*! delayed */ into t1 values (null); -insert delayed into t1 values (300); -FLUSH TABLES; -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -659,8 +676,15 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ +drop table t1,t2,t3,tt1; +reset master; +create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; +insert /* before delayed */ delayed /* after delayed */ into t1 values (207); +insert /*! delayed */ into t1 values (null); +insert delayed into t1 values (300); +FLUSH TABLES; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) @@ -728,6 +752,7 @@ BINLOG ' SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info # # Format_desc 1 # Server ver: #, Binlog ver: # +# # Binlog_checkpoint 1 # master-bin.000001 # # Query 1 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) # # Query 1 # BEGIN # # Table_map 1 # table_id: # (test.t1) diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result index d4a3503b1f2..55f4154574b 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result +++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result @@ -35,7 +35,9 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # -use new_test1/*!*/; +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # +use `new_test1`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -72,7 +74,7 @@ COMMIT /*!*/; # at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test2/*!*/; +use `test2`/*!*/; SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t2 (a INT) /*!*/; @@ -115,7 +117,7 @@ SET TIMESTAMP=1000000000/*!*/; COMMIT /*!*/; # at # -use new_test3/*!*/; +use `new_test3`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t3 (a INT) @@ -229,7 +231,9 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # -use new_test1/*!*/; +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # +use `new_test1`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -266,7 +270,7 @@ COMMIT /*!*/; # at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test2/*!*/; +use `test2`/*!*/; SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t2 (a INT) /*!*/; @@ -309,7 +313,7 @@ SET TIMESTAMP=1000000000/*!*/; COMMIT /*!*/; # at # -use new_test3/*!*/; +use `new_test3`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t3 (a INT) diff --git a/mysql-test/suite/binlog/r/binlog_server_id.result b/mysql-test/suite/binlog/r/binlog_server_id.result index f7d778a288b..34e32c8a29f 100644 --- a/mysql-test/suite/binlog/r/binlog_server_id.result +++ b/mysql-test/suite/binlog/r/binlog_server_id.result @@ -5,8 +5,9 @@ create table t1 (a int); select @@server_id; @@server_id 1 -show binlog events from <binlog_start>; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) set global server_id=2; @@ -14,8 +15,9 @@ create table t2 (b int); select @@server_id; @@server_id 2 -show binlog events from <binlog_start>; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) master-bin.000001 # Query 2 # use `test`; create table t2 (b int) @@ -24,8 +26,9 @@ create table t3 (c int); select @@server_id; @@server_id 3 -show binlog events from <binlog_start>; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) master-bin.000001 # Query 2 # use `test`; create table t2 (b int) diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index 1f4c138eb4e..344dddf78cf 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -1,3 +1,4 @@ +reset master; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; insert /* before delayed */ delayed /* after delayed */ into t1 values (207); insert /*! delayed */ into t1 values (null); @@ -5,9 +6,6 @@ insert delayed into t1 values (300); FLUSH TABLES; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci')) -master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert /* before delayed */ /* after delayed */ into t1 values (207) diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index fd6a98cabc4..06442245d3b 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -145,6 +145,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Rotate # # master-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ set @ac = @@autocommit; set autocommit= 0; @@ -387,13 +388,46 @@ DROP PROCEDURE p4; End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); +insert into t1 values(5); set insert_id=128; -insert into t1 values(null); +insert into t1 values(null) /* Not binlogged */; +ERROR 22003: Out of range value for column 'id' at row 1 +set insert_id=128; +insert ignore into t1 values(null) /* Insert 128 */; +Warnings: +Warning 167 Out of range value for column 'id' at row 1 +set insert_id=5; +insert into t1 values(null) /* Not binlogged */; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +set insert_id=5; +insert ignore into t1 values(null) /* Insert 5 */; Warnings: -Warning 1264 Out of range value for column 'id' at row 1 +Warning 1062 Duplicate entry '5' for key 'PRIMARY' select * from t1; id -127 +5 +drop table t1; +create table t1 (id tinyint auto_increment primary key) engine=myisam; +set insert_id=128; +insert into t1 values(5),(null) /* Insert_id 128 */; +ERROR 22003: Out of range value for column 'id' at row 2 +set insert_id=128; +insert ignore into t1 values (4),(null) /* Insert_id 128 */; +Warnings: +Warning 167 Out of range value for column 'id' at row 2 +set insert_id=5; +insert into t1 values(3),(null) /* Insert_id 5 */; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +set insert_id=5; +insert ignore into t1 values(2),(null) /* Insert_id 5 */; +Warnings: +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +select * from t1 order by id; +id +2 +3 +4 +5 drop table t1; create table t1 (a int); create table if not exists t2 select * from t1; @@ -408,35 +442,33 @@ include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=127 -master-bin.000001 # Query # # use `test`; insert into t1 values(null) +master-bin.000001 # Query # # use `test`; insert into t1 values(5) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Intvar # # INSERT_ID=128 +master-bin.000001 # Query # # use `test`; insert ignore into t1 values(null) /* Insert 128 */ +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert ignore into t1 values(null) /* Insert 5 */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -master-bin.000001 # Query # # use `test`; create table t1 (a int) -master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 -master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) -master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1 +master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) engine=myisam master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') +master-bin.000001 # Intvar # # INSERT_ID=128 +master-bin.000001 # Query # # use `test`; insert into t1 values(5),(null) /* Insert_id 128 */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' +master-bin.000001 # Intvar # # INSERT_ID=128 +master-bin.000001 # Query # # use `test`; insert ignore into t1 values (4),(null) /* Insert_id 128 */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert into t1 values(3),(null) /* Insert_id 5 */ master-bin.000001 # Query # # COMMIT -drop table t1,t2,t3,tt1; -create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -insert /* before delayed */ delayed /* after delayed */ into t1 values (207); -insert /*! delayed */ into t1 values (null); -insert delayed into t1 values (300); -FLUSH TABLES; -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=127 -master-bin.000001 # Query # # use `test`; insert into t1 values(null) +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert ignore into t1 values(2),(null) /* Insert_id 5 */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int) @@ -452,8 +484,15 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ +drop table t1,t2,t3,tt1; +reset master; +create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; +insert /* before delayed */ delayed /* after delayed */ into t1 values (207); +insert /*! delayed */ into t1 values (null); +insert delayed into t1 values (300); +FLUSH TABLES; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) @@ -521,6 +560,7 @@ BINLOG ' SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info # # Format_desc 1 # Server ver: #, Binlog ver: # +# # Binlog_checkpoint 1 # master-bin.000001 # # Query 1 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) # # Query 1 # BEGIN # # Query 1 # use `test`; INSERT INTO t1 VALUES (1) diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result index 755fd3e3761..2144a8bf649 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result +++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result @@ -173,8 +173,9 @@ set insert_id= 3; insert into t1 values (NULL), (33), (NULL); set insert_id= 5; insert into t1 values (55), (NULL); -show binlog events from <binlog_start>; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; create table t1 (a int auto_increment, primary key (a)) engine=blackhole master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Intvar 1 # INSERT_ID=1 diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result index 796e6d0588f..cfeca4811cb 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -26,7 +26,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=10000/*!*/; insert into t2 values (@v) /*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index d7148ea0293..b162323194b 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -700,7 +700,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # ROLLBACK /* the output must denote there is the query */; drop trigger trg_del_t2; @@ -952,7 +952,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # ROLLBACK drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index b69dcb642b8..f192bae7ac0 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -2682,6 +2682,7 @@ CREATE TABLE insert_2_keys (a INT UNIQUE KEY, b INT UNIQUE KEY); INSERT INTO insert_2_keys values (1, 1); INSERT IGNORE INTO insert_table SELECT * FROM filler_table; Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave. TRUNCATE TABLE insert_table; INSERT INTO insert_table SELECT * FROM filler_table ON DUPLICATE KEY UPDATE a = 1; diff --git a/mysql-test/suite/binlog/r/binlog_xa_recover.result b/mysql-test/suite/binlog/r/binlog_xa_recover.result new file mode 100644 index 00000000000..1231a034ec6 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_xa_recover.result @@ -0,0 +1,198 @@ +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +INSERT INTO t1 VALUES (100, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (101, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (102, REPEAT("x", 4100)); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever"; +INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con1_wait"; +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever"; +INSERT INTO t1 VALUES (2, NULL); +SET DEBUG_SYNC= "now WAIT_FOR con2_wait"; +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever"; +INSERT INTO t1 VALUES (3, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con3_wait"; +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont"; +SET SESSION debug_dbug="+d,crash_commit_after_log"; +INSERT INTO t1 VALUES (4, NULL); +SET DEBUG_SYNC= "now WAIT_FOR con4_wait"; +SET DEBUG_SYNC= "now SIGNAL con1_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "now SIGNAL con2_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; +SET DEBUG_SYNC= "now SIGNAL con3_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +master-bin.000005 # +master-bin.000006 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000003 # Binlog_checkpoint # # master-bin.000002 +master-bin.000003 # Binlog_checkpoint # # master-bin.000003 +master-bin.000003 # Query # # BEGIN +master-bin.000003 # Table_map # # table_id: # (test.t1) +master-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000003 # Xid # # COMMIT /* XID */ +master-bin.000003 # Rotate # # master-bin.000004;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000003 +master-bin.000004 # Binlog_checkpoint # # master-bin.000004 +master-bin.000004 # Query # # BEGIN +master-bin.000004 # Table_map # # table_id: # (test.t1) +master-bin.000004 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000004 # Xid # # COMMIT /* XID */ +master-bin.000004 # Rotate # # master-bin.000005;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000005 # Binlog_checkpoint # # master-bin.000004 +master-bin.000005 # Query # # BEGIN +master-bin.000005 # Table_map # # table_id: # (test.t1) +master-bin.000005 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000005 # Xid # # COMMIT /* XID */ +master-bin.000005 # Query # # BEGIN +master-bin.000005 # Table_map # # table_id: # (test.t1) +master-bin.000005 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000005 # Xid # # COMMIT /* XID */ +master-bin.000005 # Rotate # # master-bin.000006;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000006 # Binlog_checkpoint # # master-bin.000004 +PURGE BINARY LOGS TO "master-bin.000006"; +show binary logs; +Log_name File_size +master-bin.000004 # +master-bin.000005 # +master-bin.000006 # +SET DEBUG_SYNC= "now SIGNAL con4_cont"; +Got one of the listed errors +SELECT a FROM t1 ORDER BY a; +a +1 +2 +3 +4 +100 +101 +102 +Test that with multiple binlog checkpoints, recovery starts from the last one. +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont"; +INSERT INTO t1 VALUES (10, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con10_ready"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont"; +INSERT INTO t1 VALUES (11, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con11_ready"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont"; +INSERT INTO t1 VALUES (12, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con12_ready"; +INSERT INTO t1 VALUES (13, NULL); +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000001 +master-bin.000004 # Query # # BEGIN +master-bin.000004 # Table_map # # table_id: # (test.t1) +master-bin.000004 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000004 # Xid # # COMMIT /* XID */ +SET DEBUG_SYNC= "now SIGNAL con10_cont"; +SET DEBUG_SYNC= "now SIGNAL con12_cont"; +SET DEBUG_SYNC= "now SIGNAL con11_cont"; +Checking that master-bin.000004 is the last binlog checkpoint +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000001 +master-bin.000004 # Query # # BEGIN +master-bin.000004 # Table_map # # table_id: # (test.t1) +master-bin.000004 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000004 # Xid # # COMMIT /* XID */ +master-bin.000004 # Binlog_checkpoint # # master-bin.000002 +master-bin.000004 # Binlog_checkpoint # # master-bin.000004 +Now crash the server +SET SESSION debug_dbug="+d,crash_commit_after_log"; +INSERT INTO t1 VALUES (14, NULL); +Got one of the listed errors +SELECT a FROM t1 ORDER BY a; +a +1 +2 +3 +4 +10 +11 +12 +13 +14 +100 +101 +102 +*** Check that recovery works if we crashed early during rotate, before +*** binlog checkpoint event could be written. +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (22, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (23, REPEAT("x", 4100)); +SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event"; +INSERT INTO t1 VALUES (24, REPEAT("x", 4100)); +Got one of the listed errors +SELECT a FROM t1 ORDER BY a; +a +1 +2 +3 +4 +10 +11 +12 +13 +14 +21 +22 +23 +24 +100 +101 +102 +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +master-bin.000005 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000003 +master-bin.000004 # Binlog_checkpoint # # master-bin.000004 +master-bin.000004 # Query # # BEGIN +master-bin.000004 # Table_map # # table_id: # (test.t1) +master-bin.000004 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000004 # Xid # # COMMIT /* XID */ +master-bin.000004 # Rotate # # master-bin.000005;pos=POS +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_checkpoint.test b/mysql-test/suite/binlog/t/binlog_checkpoint.test new file mode 100644 index 00000000000..557791c77e5 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_checkpoint.test @@ -0,0 +1,108 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/have_binlog_format_row.inc + +SET @old_max_binlog_size= @@global.max_binlog_size; +SET GLOBAL max_binlog_size= 4096; +SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +CREATE TABLE t2 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Myisam; + +--echo *** Test that RESET MASTER waits for pending commit checkpoints to complete. + +# con1 will hang before doing commit checkpoint, blocking RESET MASTER. +connect(con1,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go"; +send INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +# Let's add a few binlog rotations just for good measure. +INSERT INTO t2 VALUES (1, REPEAT("x", 4100)); +INSERT INTO t2 VALUES (2, REPEAT("x", 4100)); +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000004 +--let $binlog_start= 4 +--source include/show_binlog_events.inc +SET DEBUG_SYNC= "execute_command_after_close_tables SIGNAL reset_master_done"; +send RESET MASTER; + +connect(con2,localhost,root,,); +--echo This will timeout, as RESET MASTER is blocked +SET DEBUG_SYNC= "now WAIT_FOR reset_master_done TIMEOUT 1"; +# Wake up transaction to allow RESET MASTER to complete. +SET DEBUG_SYNC= "now SIGNAL con1_go"; + +connection con1; +reap; + +connection default; +reap; +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000001 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + +--echo *** Test that binlog N is active, and commit checkpoint for (N-1) is +--echo *** done while there is still a pending commit checkpoint for (N-2). + +connection con1; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR con1_continue"; +send INSERT INTO t1 VALUES (20, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; + +connection con2; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR con2_continue"; +send INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000001 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000002 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000003 +--source include/show_binlog_events.inc + +SET DEBUG_SYNC= "now SIGNAL con2_continue"; + +connection con2; +reap; + +connection default; +--echo con1 is still pending, no new binlog checkpoint should have been logged. +--let $binlog_file= master-bin.000003 +--source include/show_binlog_events.inc + +SET DEBUG_SYNC= "now SIGNAL con1_continue"; + +connection con1; +reap; + +connection default; + +--echo No commit checkpoints are pending, a new binlog checkpoint should have been logged. +--let $binlog_file= master-bin.000003 + +# Wait for the master-bin.000003 binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "$binlog_file" +--let $field= Info +--let $condition= = "master-bin.000003" +--source include/wait_show_condition.inc + +--source include/show_binlog_events.inc + + +# Cleanup +connection default; +DROP TABLE t1, t2; +SET GLOBAL max_binlog_size= @old_max_binlog_size; +SET GLOBAL innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/binlog/t/binlog_drop_if_exists.test b/mysql-test/suite/binlog/t/binlog_drop_if_exists.test index 6b2b37ae791..26910432428 100644 --- a/mysql-test/suite/binlog/t/binlog_drop_if_exists.test +++ b/mysql-test/suite/binlog/t/binlog_drop_if_exists.test @@ -113,3 +113,18 @@ if($fixed_bug_25705) --source include/show_binlog_events.inc enable_warnings; + +# Drop comments in binlog +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +CREATE TABLE t1(id int); +DROP TABLE /* comment */ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* comment */ t1; + +CREATE TABLE t1(id int); +DROP TABLE /**/ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* */ t1; + +--source include/show_binlog_events.inc + diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test index 9b6420df4b4..ff558ee2948 100644 --- a/mysql-test/suite/binlog/t/binlog_killed.test +++ b/mysql-test/suite/binlog/t/binlog_killed.test @@ -59,8 +59,8 @@ reap; let $rows= `select count(*) from t2 /* must be 2 or 0 */`; let $MYSQLD_DATADIR= `select @@datadir`; ---let $binlog_killed_pos=query_get_value(SHOW BINLOG EVENTS, Pos, 4) ---let $binlog_killed_end_log_pos=query_get_value(SHOW BINLOG EVENTS, End_log_pos, 4) +--let $binlog_killed_pos=query_get_value(SHOW BINLOG EVENTS, Pos, 5) +--let $binlog_killed_end_log_pos=query_get_value(SHOW BINLOG EVENTS, End_log_pos, 5) --exec $MYSQL_BINLOG --force-if-open --start-position=$binlog_killed_pos --stop-position=$binlog_killed_end_log_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --disable_result_log @@ -270,8 +270,8 @@ select * from t4 order by b /* must be (1,1), (1,2) */; select @b /* must be 1 at the end of a stmt calling bug27563() */; --echo must have the update query event on the 4th line source include/show_binlog_events.inc; ---let $binlog_killed_pos= query_get_value(SHOW BINLOG EVENTS, Pos, 4) ---let $binlog_killed_end_log_pos= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 4) +--let $binlog_killed_pos= query_get_value(SHOW BINLOG EVENTS, Pos, 5) +--let $binlog_killed_end_log_pos= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 5) --echo *** a proof the query is binlogged with an error *** @@ -318,8 +318,8 @@ select count(*) from t4 /* must be 1 */; select @b /* must be 1 at the end of a stmt calling bug27563() */; --echo must have the delete query event on the 4th line source include/show_binlog_events.inc; ---let $binlog_killed_pos= query_get_value(SHOW BINLOG EVENTS, Pos, 4) ---let $binlog_killed_end_log_pos= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 4) +--let $binlog_killed_pos= query_get_value(SHOW BINLOG EVENTS, Pos, 5) +--let $binlog_killed_end_log_pos= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 5) # a proof the query is binlogged with an error diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test index ba111fd0145..33037710379 100644 --- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test +++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test @@ -50,8 +50,8 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "kil # a proof the query is binlogged with an error ---let $binlog_load_data= query_get_value(SHOW BINLOG EVENTS, Pos, 3) ---let $binlog_end= query_get_value(SHOW BINLOG EVENTS, Pos, 4) +--let $binlog_load_data= query_get_value(SHOW BINLOG EVENTS, Pos, 4) +--let $binlog_end= query_get_value(SHOW BINLOG EVENTS, Pos, 5) source include/show_binlog_events.inc; --exec $MYSQL_BINLOG --force-if-open --start-position=$binlog_load_data --stop-position=$binlog_end $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover-master.opt b/mysql-test/suite/binlog/t/binlog_xa_recover-master.opt new file mode 100644 index 00000000000..3c44f9fad10 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_xa_recover-master.opt @@ -0,0 +1 @@ +--skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004 diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.test b/mysql-test/suite/binlog/t/binlog_xa_recover.test new file mode 100644 index 00000000000..36b2ddecb4f --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_xa_recover.test @@ -0,0 +1,239 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/have_binlog_format_row.inc +# Valgrind does not work well with test that crashes the server +--source include/not_valgrind.inc + +# (We do not need to restore these settings, as we crash the server). +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +# Insert some data to force a couple binlog rotations (3), so we get some +# normal binlog checkpoints before starting the test. +INSERT INTO t1 VALUES (100, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (101, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (102, REPEAT("x", 4100)); + +# Now start a bunch of transactions that span multiple binlog +# files. Leave then in the state prepared-but-not-committed in the engine +# and crash the server. Check that crash recovery is able to recover all +# of them. +# +# We use debug_sync to get all the transactions into the prepared state before +# we commit any of them. This is because the prepare step flushes the InnoDB +# redo log - including any commits made before, so recovery would become +# unnecessary, decreasing the value of this test. +# +# We arrange to have con1 with a prepared transaction in master-bin.000004, +# con2 and con3 with a prepared transaction in master-bin.000005, and a new +# empty master-bin.000006. So the latest binlog checkpoint should be +# master-bin.000006. + +connect(con1,localhost,root,,); +# First wait after prepare and before write to binlog. +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont"; +# Then complete InnoDB commit in memory (but not commit checkpoint / write to +# disk), and hang until crash, leaving a transaction to be XA recovered. +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con1_wait"; + +connect(con2,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (2, NULL); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con2_wait"; + +connect(con3,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (3, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con3_wait"; + +connect(con4,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont"; +SET SESSION debug_dbug="+d,crash_commit_after_log"; +send INSERT INTO t1 VALUES (4, NULL); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con4_wait"; + +SET DEBUG_SYNC= "now SIGNAL con1_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "now SIGNAL con2_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; +SET DEBUG_SYNC= "now SIGNAL con3_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; + +# Check that everything is committed in binary log. +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000003 +--let $binlog_start= 4 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000004 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000005 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000006 +--source include/show_binlog_events.inc + + +# Check that server will not purge too much. +PURGE BINARY LOGS TO "master-bin.000006"; +--source include/show_binary_logs.inc + +# Now crash the server with one more transaction in prepared state. +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +SET DEBUG_SYNC= "now SIGNAL con4_cont"; +connection con4; +--error 2006,2013 +reap; + +--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +connection default; +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + +--echo Test that with multiple binlog checkpoints, recovery starts from the last one. +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +# Rotate to binlog master-bin.000003 while delaying binlog checkpoints. +# So we get multiple binlog checkpoints in master-bin.000003. +# Then complete the checkpoints, crash, and check that we only scan +# the necessary binlog file (ie. that we use the _last_ checkpoint). + +connect(con10,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont"; +send INSERT INTO t1 VALUES (10, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con10_ready"; + +connect(con11,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont"; +send INSERT INTO t1 VALUES (11, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con11_ready"; + +connect(con12,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont"; +send INSERT INTO t1 VALUES (12, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con12_ready"; +INSERT INTO t1 VALUES (13, NULL); + +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000004 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + +SET DEBUG_SYNC= "now SIGNAL con10_cont"; +connection con10; +reap; +connection default; +SET DEBUG_SYNC= "now SIGNAL con12_cont"; +connection con12; +reap; +connection default; +SET DEBUG_SYNC= "now SIGNAL con11_cont"; +connection con11; +reap; + +connection default; +# Wait for the last (master-bin.000004) binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" +--let $field= Info +--let $condition= = "master-bin.000004" +--source include/wait_show_condition.inc + +--echo Checking that master-bin.000004 is the last binlog checkpoint +--source include/show_binlog_events.inc + +--echo Now crash the server +# It is not too easy to test XA recovery, as it runs early during server +# startup, before any connections can be made. +# What we do is set a DBUG error insert which will crash if XA recovery +# starts from any other binlog than master-bin.000004 (check the file +# binlog_xa_recover-master.opt). Then we will fail here if XA recovery +# would start from the wrong place. +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +SET SESSION debug_dbug="+d,crash_commit_after_log"; +--error 2006,2013 +INSERT INTO t1 VALUES (14, NULL); + +--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +connection default; +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + + +--echo *** Check that recovery works if we crashed early during rotate, before +--echo *** binlog checkpoint event could be written. + +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +# We need some initial data to reach binlog master-bin.000004. Otherwise +# crash recovery fails due to the error insert used for previous test. +INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (22, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (23, REPEAT("x", 4100)); +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event"; +--error 2006,2013 +INSERT INTO t1 VALUES (24, REPEAT("x", 4100)); + +--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000004 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + +# Cleanup +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/an_calendar.result b/mysql-test/suite/engines/funcs/r/an_calendar.result index e974a67444e..f057c3b618f 100644 --- a/mysql-test/suite/engines/funcs/r/an_calendar.result +++ b/mysql-test/suite/engines/funcs/r/an_calendar.result @@ -16,7 +16,13 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL); SET TIMESTAMP=1171346973; INSERT INTO t1 VALUES(NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t1 VALUES(NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK diff --git a/mysql-test/suite/engines/funcs/r/datetime_function.result b/mysql-test/suite/engines/funcs/r/datetime_function.result index 182f61f67f0..583552edc7d 100644 --- a/mysql-test/suite/engines/funcs/r/datetime_function.result +++ b/mysql-test/suite/engines/funcs/r/datetime_function.result @@ -25,7 +25,15 @@ INSERT INTO t3 VALUES('2008-02-29 13:13:13'); DROP TABLE t3; CREATE TABLE t3(c1 TIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01 00:00:00'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t3 VALUES('1999-12-31 23:59:59'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t3 VALUES('2000-01-01 00:00:00'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t3 VALUES('2008-02-29 13:13:13'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 DROP TABLE t3; diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result index 6a9bfae27db..9792236af0a 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result @@ -77,6 +77,7 @@ utf8_persian_ci utf8 208 # # utf8_esperanto_ci utf8 209 # # utf8_hungarian_ci utf8 210 # # utf8_sinhala_ci utf8 211 # # +utf8_croatian_ci utf8 213 # # utf8_general_mysql500_ci utf8 223 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # @@ -100,6 +101,7 @@ ucs2_persian_ci ucs2 144 # # ucs2_esperanto_ci ucs2 145 # # ucs2_hungarian_ci ucs2 146 # # ucs2_sinhala_ci ucs2 147 # # +ucs2_croatian_ci ucs2 149 # # ucs2_general_mysql500_ci ucs2 159 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # @@ -137,6 +139,7 @@ utf8mb4_persian_ci utf8mb4 240 # # utf8mb4_esperanto_ci utf8mb4 241 # # utf8mb4_hungarian_ci utf8mb4 242 # # utf8mb4_sinhala_ci utf8mb4 243 # # +utf8mb4_croatian_ci utf8mb4 245 # # cp1251_bulgarian_ci cp1251 14 # # cp1251_ukrainian_ci cp1251 23 # # cp1251_bin cp1251 50 # # @@ -164,6 +167,7 @@ utf16_persian_ci utf16 117 # # utf16_esperanto_ci utf16 118 # # utf16_hungarian_ci utf16 119 # # utf16_sinhala_ci utf16 120 # # +utf16_croatian_ci utf16 215 # # cp1256_general_ci cp1256 57 Yes # # cp1256_bin cp1256 67 # # cp1257_lithuanian_ci cp1257 29 # # @@ -191,6 +195,7 @@ utf32_persian_ci utf32 176 # # utf32_esperanto_ci utf32 177 # # utf32_hungarian_ci utf32 178 # # utf32_sinhala_ci utf32 179 # # +utf32_croatian_ci utf32 214 # # binary binary 63 Yes # # geostd8_general_ci geostd8 92 Yes # # geostd8_bin geostd8 93 # # diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result index 79d1d4cbac2..9490446e83d 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result @@ -77,6 +77,7 @@ utf8_persian_ci utf8 208 # # utf8_esperanto_ci utf8 209 # # utf8_hungarian_ci utf8 210 # # utf8_sinhala_ci utf8 211 # # +utf8_croatian_ci utf8 213 # # utf8_general_mysql500_ci utf8 223 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # @@ -100,6 +101,7 @@ ucs2_persian_ci ucs2 144 # # ucs2_esperanto_ci ucs2 145 # # ucs2_hungarian_ci ucs2 146 # # ucs2_sinhala_ci ucs2 147 # # +ucs2_croatian_ci ucs2 149 # # ucs2_general_mysql500_ci ucs2 159 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # @@ -137,6 +139,7 @@ utf8mb4_persian_ci utf8mb4 240 # # utf8mb4_esperanto_ci utf8mb4 241 # # utf8mb4_hungarian_ci utf8mb4 242 # # utf8mb4_sinhala_ci utf8mb4 243 # # +utf8mb4_croatian_ci utf8mb4 245 # # cp1251_bulgarian_ci cp1251 14 # # cp1251_ukrainian_ci cp1251 23 # # cp1251_bin cp1251 50 # # @@ -164,6 +167,7 @@ utf16_persian_ci utf16 117 # # utf16_esperanto_ci utf16 118 # # utf16_hungarian_ci utf16 119 # # utf16_sinhala_ci utf16 120 # # +utf16_croatian_ci utf16 215 # # cp1256_general_ci cp1256 57 Yes # # cp1256_bin cp1256 67 # # cp1257_lithuanian_ci cp1257 29 # # @@ -191,6 +195,7 @@ utf32_persian_ci utf32 176 # # utf32_esperanto_ci utf32 177 # # utf32_hungarian_ci utf32 178 # # utf32_sinhala_ci utf32 179 # # +utf32_croatian_ci utf32 214 # # binary binary 63 Yes # # geostd8_general_ci geostd8 92 Yes # # geostd8_bin geostd8 93 # # diff --git a/mysql-test/suite/engines/funcs/r/db_use_error.result b/mysql-test/suite/engines/funcs/r/db_use_error.result index 03c41e927ac..2051b56b19e 100644 --- a/mysql-test/suite/engines/funcs/r/db_use_error.result +++ b/mysql-test/suite/engines/funcs/r/db_use_error.result @@ -9,7 +9,7 @@ mysql performance_schema test USE DATABASE nond6; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE nond6' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE nond6' at line 1 DROP DATABASE d6; SHOW DATABASES; Database diff --git a/mysql-test/suite/engines/funcs/r/de_calendar_range.result b/mysql-test/suite/engines/funcs/r/de_calendar_range.result index 07543e0c8c4..ab39556e6ce 100644 --- a/mysql-test/suite/engines/funcs/r/de_calendar_range.result +++ b/mysql-test/suite/engines/funcs/r/de_calendar_range.result @@ -33,10 +33,20 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1 ORDER BY c1; c1 09:09:33 @@ -47,8 +57,6 @@ c1 DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01'); SELECT * FROM t1 ORDER BY c1; c1 -12:10:34 -13:10:34 DROP TABLE t1; CREATE TABLE t1(c1 DATETIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_2_unique_constraints_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_calendar_2_unique_constraints_duplicate_update.result index 9c56e23574d..c68baf685e2 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_2_unique_constraints_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_2_unique_constraints_duplicate_update.result @@ -66,12 +66,42 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NULL, c3 TIME NULL, PRIMARY KEY(c1), UNIQUE(c2)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'4 04:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),ADDTIME(NOW(),'3 03:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'2 02:01:01'),ADDTIME(NOW(),'2 02:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'3 03:01:01'),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'4 04:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'2 02:01:01'),ADDTIME(NOW(),'2 02:01:01'),NOW()) ON DUPLICATE KEY UPDATE c3=ADDTIME(NOW(),'6 06:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c3=ADDTIME(NOW(),'6 06:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 13:10:34 15:10:34 diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_duplicate_update.result index 47355681eae..6e3f717e93d 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_duplicate_update.result @@ -29,8 +29,15 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1; c1 10:10:34 diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_error.result index f8bff355901..4644894beec 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_error.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_error.result @@ -28,7 +28,11 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()); ERROR 23000: Duplicate entry '09:09:33' for key 'PRIMARY' SELECT * FROM t1; diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_ignore.result index f8bff355901..4644894beec 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_ignore.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_ignore.result @@ -28,7 +28,11 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()); ERROR 23000: Duplicate entry '09:09:33' for key 'PRIMARY' SELECT * FROM t1; diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_duplicate_update.result index 5c4307158fa..8af6ff6af13 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_duplicate_update.result @@ -29,8 +29,15 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL UNIQUE); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1; c1 10:10:34 diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_error.result index 9f6a205530c..c96cd4ba8a8 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_error.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_error.result @@ -28,7 +28,11 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL UNIQUE); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()); ERROR 23000: Duplicate entry '09:09:33' for key 'c1' SELECT * FROM t1; diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_ignore.result index 5469527b762..210460d33f1 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_ignore.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_ignore.result @@ -28,8 +28,14 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL UNIQUE); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT IGNORE INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1; c1 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_duplicate_update.result index d7dfc9d794c..209f61440cd 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_duplicate_update.result @@ -61,11 +61,40 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NOT NULL, c3 TIME NOT NULL, PRIMARY KEY(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 10:10:34 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_error.result index d71af8d6375..9c310d3d457 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_error.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_error.result @@ -52,9 +52,25 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NOT NULL, c3 TIME NOT NULL, PRIMARY KEY(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); ERROR 23000: Duplicate entry '09:09:33-09:09:33-09:09:33' for key 'PRIMARY' INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_ignore.result index d71af8d6375..9c310d3d457 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_ignore.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_ignore.result @@ -52,9 +52,25 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NOT NULL, c3 TIME NOT NULL, PRIMARY KEY(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); ERROR 23000: Duplicate entry '09:09:33-09:09:33-09:09:33' for key 'PRIMARY' INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_duplicate_update.result index edad4bb218d..fe509a0615c 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_duplicate_update.result @@ -61,11 +61,40 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL, c3 TIME NULL, UNIQUE(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 10:10:34 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_error.result index 4d7cadac70c..78b0e81cd56 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_error.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_error.result @@ -52,9 +52,25 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL, c3 TIME NULL, UNIQUE(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); ERROR 23000: Duplicate entry '09:09:33-09:09:33-09:09:33' for key 'c1' INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result index 31f7db1dc9a..a884345be84 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result @@ -56,11 +56,35 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL, c3 TIME NULL, UNIQUE(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 09:09:33 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_number_pk_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_number_pk_constraint_duplicate_update.result index d7dfc9d794c..209f61440cd 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_number_pk_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_number_pk_constraint_duplicate_update.result @@ -61,11 +61,40 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NOT NULL, c3 TIME NOT NULL, PRIMARY KEY(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 10:10:34 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_number_boundary_error.result b/mysql-test/suite/engines/funcs/r/in_number_boundary_error.result index 556b5a05764..53964697506 100644 --- a/mysql-test/suite/engines/funcs/r/in_number_boundary_error.result +++ b/mysql-test/suite/engines/funcs/r/in_number_boundary_error.result @@ -7,7 +7,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -26,7 +26,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -45,7 +45,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -64,7 +64,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -83,7 +83,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -102,7 +102,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows diff --git a/mysql-test/suite/engines/funcs/r/in_number_decimal_boundary_error.result b/mysql-test/suite/engines/funcs/r/in_number_decimal_boundary_error.result index fe7fc0e38d7..62ad9a568f9 100644 --- a/mysql-test/suite/engines/funcs/r/in_number_decimal_boundary_error.result +++ b/mysql-test/suite/engines/funcs/r/in_number_decimal_boundary_error.result @@ -7,7 +7,7 @@ INSERT INTO t5 (c1) VALUES(0); INSERT INTO t5 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES('x'); -ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect decimal value: 'x' for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES(999999); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT COUNT(c1) AS total_rows FROM t5; @@ -27,7 +27,7 @@ INSERT INTO t5 (c1) VALUES(0); INSERT INTO t5 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES('x'); -ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect decimal value: 'x' for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES(999999); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT COUNT(c1) AS total_rows FROM t5; @@ -47,7 +47,7 @@ INSERT INTO t5 (c1) VALUES(0); INSERT INTO t5 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES('x'); -ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect decimal value: 'x' for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES(999999); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT COUNT(c1) AS total_rows FROM t5; @@ -67,7 +67,7 @@ INSERT INTO t5 (c1) VALUES(0); INSERT INTO t5 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES('x'); -ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect decimal value: 'x' for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES(999999); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT COUNT(c1) AS total_rows FROM t5; diff --git a/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result b/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result index 63d36edd3aa..4776a3ac748 100644 --- a/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result +++ b/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result @@ -61,6 +61,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -77,6 +81,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -93,6 +101,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -325,6 +337,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -341,6 +357,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -357,6 +377,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -589,6 +613,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -605,6 +633,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -621,6 +653,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -853,6 +889,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -869,6 +909,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -885,6 +929,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1117,6 +1165,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1133,6 +1185,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1149,6 +1205,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1381,6 +1441,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1397,6 +1461,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1413,6 +1481,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1645,6 +1717,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1661,6 +1737,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1677,6 +1757,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1909,6 +1993,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1925,6 +2013,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1941,6 +2033,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2173,6 +2269,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2189,6 +2289,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2205,6 +2309,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2437,6 +2545,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2453,6 +2565,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2469,6 +2585,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2701,6 +2821,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2717,6 +2841,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2733,6 +2861,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2965,6 +3097,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2981,6 +3117,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2997,6 +3137,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3229,6 +3373,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3245,6 +3393,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3261,6 +3413,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3493,6 +3649,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3509,6 +3669,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3525,6 +3689,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3757,6 +3925,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3773,6 +3945,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3789,6 +3965,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4021,6 +4201,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4037,6 +4221,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4053,6 +4241,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4285,6 +4477,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4301,6 +4497,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4317,6 +4517,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4549,6 +4753,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4565,6 +4773,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4581,6 +4793,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4813,6 +5029,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4829,6 +5049,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4845,6 +5069,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5077,6 +5305,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5093,6 +5325,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5109,6 +5345,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5341,6 +5581,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5357,6 +5601,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5373,6 +5621,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5605,6 +5857,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5621,6 +5877,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5637,6 +5897,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5869,6 +6133,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5885,6 +6153,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5901,6 +6173,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6133,6 +6409,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6149,6 +6429,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6165,6 +6449,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6397,6 +6685,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6413,6 +6705,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6429,6 +6725,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6661,6 +6961,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6677,6 +6981,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6693,6 +7001,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6925,6 +7237,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6941,6 +7257,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6957,6 +7277,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7189,6 +7513,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7205,6 +7533,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7221,6 +7553,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7453,6 +7789,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7469,6 +7809,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7485,6 +7829,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7717,6 +8065,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7733,6 +8085,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7749,6 +8105,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7981,6 +8341,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7997,6 +8361,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8013,6 +8381,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8245,6 +8617,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8261,6 +8637,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8277,6 +8657,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8509,6 +8893,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8525,6 +8913,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8541,6 +8933,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8773,6 +9169,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8789,6 +9189,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8805,6 +9209,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9037,6 +9445,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9053,6 +9465,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9069,6 +9485,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9301,6 +9721,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9317,6 +9741,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9333,6 +9761,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9565,6 +9997,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9581,6 +10017,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9597,6 +10037,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9829,6 +10273,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9845,6 +10293,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9861,6 +10313,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10093,6 +10549,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10109,6 +10569,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10125,6 +10589,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10357,6 +10825,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10373,6 +10845,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10389,6 +10865,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10621,6 +11101,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10637,6 +11121,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10653,6 +11141,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10885,6 +11377,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10901,6 +11397,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10917,6 +11417,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11149,6 +11653,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11165,6 +11673,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11181,6 +11693,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11413,6 +11929,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11429,6 +11949,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11445,6 +11969,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11677,6 +12205,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11693,6 +12225,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11709,6 +12245,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11941,6 +12481,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11957,6 +12501,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11973,6 +12521,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12205,6 +12757,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12221,6 +12777,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12237,6 +12797,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12469,6 +13033,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12485,6 +13053,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12501,6 +13073,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12733,6 +13309,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12749,6 +13329,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12765,6 +13349,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12997,6 +13585,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13013,6 +13605,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13029,6 +13625,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13261,6 +13861,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13277,6 +13881,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13293,6 +13901,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13525,6 +14137,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13541,6 +14157,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13557,6 +14177,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13789,6 +14413,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13805,6 +14433,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13821,6 +14453,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14053,6 +14689,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14069,6 +14709,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14085,6 +14729,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14317,6 +14965,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14333,6 +14985,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14349,6 +15005,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14581,6 +15241,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14597,6 +15261,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14613,6 +15281,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 diff --git a/mysql-test/suite/engines/funcs/r/sq_all.result b/mysql-test/suite/engines/funcs/r/sq_all.result index ac1908b7b1b..24e62a3f3ba 100644 --- a/mysql-test/suite/engines/funcs/r/sq_all.result +++ b/mysql-test/suite/engines/funcs/r/sq_all.result @@ -13,13 +13,10 @@ SELECT c1 FROM t1 WHERE c1 > ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); c1 -100 SELECT c1 FROM t1 WHERE c1 = ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 <= ALL (SELECT c1 FROM t2); c1 -1 -2 SELECT c1 FROM t1 WHERE c1 <> ALL (SELECT c1 FROM t2); c1 DROP TABLE t1; @@ -37,13 +34,10 @@ SELECT c1 FROM t1 WHERE c1 > ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); c1 -100 SELECT c1 FROM t1 WHERE c1 = ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 <= ALL (SELECT c1 FROM t2); c1 -1 -2 SELECT c1 FROM t1 WHERE c1 <> ALL (SELECT c1 FROM t2); c1 DROP TABLE t1; @@ -61,13 +55,10 @@ SELECT c1 FROM t1 WHERE c1 > ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); c1 -100 SELECT c1 FROM t1 WHERE c1 = ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 <= ALL (SELECT c1 FROM t2); c1 -1 -2 SELECT c1 FROM t1 WHERE c1 <> ALL (SELECT c1 FROM t2); c1 DROP TABLE t1; @@ -85,13 +76,10 @@ SELECT c1 FROM t1 WHERE c1 > ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); c1 -100 SELECT c1 FROM t1 WHERE c1 = ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 <= ALL (SELECT c1 FROM t2); c1 -1 -2 SELECT c1 FROM t1 WHERE c1 <> ALL (SELECT c1 FROM t2); c1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/sq_error.result b/mysql-test/suite/engines/funcs/r/sq_error.result index 5ce36f50e49..c983ff73d12 100644 --- a/mysql-test/suite/engines/funcs/r/sq_error.result +++ b/mysql-test/suite/engines/funcs/r/sq_error.result @@ -11,7 +11,7 @@ INSERT INTO t2 VALUES (2,'abcde'); SELECT * FROM t1 WHERE c2 IN (SELECT c2 FROM t2 ORDER BY c1 LIMIT 1) --error 1241 SELECT (SELECT c1, c2 FROM t2) FROM t1; -ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); @@ -30,7 +30,7 @@ INSERT INTO t2 VALUES (2,'abcde'); SELECT * FROM t1 WHERE c2 IN (SELECT c2 FROM t2 ORDER BY c1 LIMIT 1) --error 1241 SELECT (SELECT c1, c2 FROM t2) FROM t1; -ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); @@ -49,7 +49,7 @@ INSERT INTO t2 VALUES (2,'abcde'); SELECT * FROM t1 WHERE c2 IN (SELECT c2 FROM t2 ORDER BY c1 LIMIT 1) --error 1241 SELECT (SELECT c1, c2 FROM t2) FROM t1; -ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); @@ -68,7 +68,7 @@ INSERT INTO t2 VALUES (2,'abcde'); SELECT * FROM t1 WHERE c2 IN (SELECT c2 FROM t2 ORDER BY c1 LIMIT 1) --error 1241 SELECT (SELECT c1, c2 FROM t2) FROM t1; -ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); diff --git a/mysql-test/suite/engines/funcs/r/up_calendar_range.result b/mysql-test/suite/engines/funcs/r/up_calendar_range.result index dbd6e2cf8a6..10bef827a88 100644 --- a/mysql-test/suite/engines/funcs/r/up_calendar_range.result +++ b/mysql-test/suite/engines/funcs/r/up_calendar_range.result @@ -39,10 +39,20 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1 ORDER BY c1; c1 09:09:33 @@ -54,10 +64,10 @@ UPDATE t1 SET c1 = NOW() WHERE c1 >= ADDTIME(NOW(),'2 02:01:01'); SELECT * FROM t1 ORDER BY c1; c1 09:09:33 -09:09:33 -09:09:33 -09:09:33 10:10:34 +11:10:34 +12:10:34 +13:10:34 DROP TABLE t1; CREATE TABLE t1(c1 DATETIME NOT NULL); SET TIMESTAMP=1171346973; diff --git a/mysql-test/suite/engines/funcs/t/se_join_left.test b/mysql-test/suite/engines/funcs/t/se_join_left.test index 005936acb3b..792f2cdd699 100644 --- a/mysql-test/suite/engines/funcs/t/se_join_left.test +++ b/mysql-test/suite/engines/funcs/t/se_join_left.test @@ -12,8 +12,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -27,8 +30,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -42,8 +48,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -57,8 +66,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -72,8 +84,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -87,8 +102,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -102,8 +120,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -117,8 +138,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -132,8 +156,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -147,8 +174,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -162,8 +192,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -177,8 +210,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -192,8 +228,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -207,8 +246,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -222,8 +264,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -237,8 +282,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -252,8 +300,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -267,8 +318,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -282,8 +336,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -297,8 +354,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -312,8 +372,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -327,8 +390,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -342,8 +408,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -357,8 +426,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -372,8 +444,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -387,8 +462,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -402,8 +480,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -417,8 +498,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -432,8 +516,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -447,8 +534,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -462,8 +552,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -477,8 +570,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -492,8 +588,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -507,8 +606,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -522,8 +624,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -537,8 +642,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -552,8 +660,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -567,8 +678,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -582,8 +696,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -597,8 +714,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -612,8 +732,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -627,8 +750,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -642,8 +768,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -657,8 +786,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -672,8 +804,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -687,8 +822,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -702,8 +840,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -717,8 +858,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -732,8 +876,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -747,8 +894,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -762,8 +912,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -777,8 +930,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -792,8 +948,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -807,8 +966,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -822,8 +984,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -837,8 +1002,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -852,8 +1020,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -867,8 +1038,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -882,8 +1056,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -897,8 +1074,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -912,8 +1092,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -927,8 +1110,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -942,8 +1128,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -957,8 +1146,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -972,8 +1164,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -987,8 +1182,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1002,8 +1200,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1017,8 +1218,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1032,8 +1236,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1047,8 +1254,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1062,8 +1272,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1077,8 +1290,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1092,8 +1308,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1107,8 +1326,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1122,8 +1344,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1137,8 +1362,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1152,8 +1380,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1167,8 +1398,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1182,8 +1416,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1197,8 +1434,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1212,8 +1452,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1227,8 +1470,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1242,8 +1488,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1257,8 +1506,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1272,8 +1524,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1287,8 +1542,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1302,8 +1560,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1317,8 +1578,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1332,8 +1596,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1347,8 +1614,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1362,8 +1632,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1377,8 +1650,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1392,8 +1668,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1407,8 +1686,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1422,8 +1704,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1437,8 +1722,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1452,8 +1740,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1467,8 +1758,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1482,8 +1776,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1497,8 +1794,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1512,8 +1812,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1527,8 +1830,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1542,8 +1848,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1557,8 +1866,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1572,8 +1884,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1587,8 +1902,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1602,8 +1920,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1617,8 +1938,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1632,8 +1956,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1647,8 +1974,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1662,8 +1992,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1677,8 +2010,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1692,8 +2028,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1707,8 +2046,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1722,8 +2064,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1737,8 +2082,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1752,8 +2100,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1767,8 +2118,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1782,8 +2136,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1797,8 +2154,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1812,8 +2172,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1827,8 +2190,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1842,8 +2208,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1857,8 +2226,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1872,8 +2244,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1887,8 +2262,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1902,8 +2280,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1917,8 +2298,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1932,8 +2316,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1947,8 +2334,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1962,8 +2352,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1977,8 +2370,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1992,8 +2388,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2007,8 +2406,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2022,8 +2424,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2037,8 +2442,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2052,8 +2460,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2067,8 +2478,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2082,8 +2496,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2097,8 +2514,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2112,8 +2532,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2127,8 +2550,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2142,8 +2568,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2157,8 +2586,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2172,8 +2604,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2187,8 +2622,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2202,8 +2640,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2217,8 +2658,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2232,8 +2676,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2247,8 +2694,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2262,8 +2712,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2277,8 +2730,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2292,8 +2748,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2307,8 +2766,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2322,8 +2784,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2337,8 +2802,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2352,8 +2820,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2367,8 +2838,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2382,8 +2856,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2397,8 +2874,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2412,8 +2892,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2427,8 +2910,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2442,8 +2928,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2457,8 +2946,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2472,8 +2964,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2487,8 +2982,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2502,8 +3000,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2517,8 +3018,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2532,8 +3036,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2547,8 +3054,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2562,8 +3072,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2577,8 +3090,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2592,8 +3108,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2607,8 +3126,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2622,8 +3144,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2637,8 +3162,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2652,8 +3180,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2667,8 +3198,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2682,8 +3216,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2697,8 +3234,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2712,8 +3252,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2727,8 +3270,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2742,8 +3288,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2757,8 +3306,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2772,8 +3324,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2787,8 +3342,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2802,8 +3360,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2817,8 +3378,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2832,8 +3396,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2847,8 +3414,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2862,8 +3432,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2877,8 +3450,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2892,8 +3468,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2907,8 +3486,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2922,8 +3504,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2937,8 +3522,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2952,8 +3540,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2967,8 +3558,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2982,8 +3576,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2997,8 +3594,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -3012,8 +3612,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -3027,8 +3630,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -3042,8 +3648,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -3057,8 +3666,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -3072,8 +3684,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -3087,8 +3702,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -3102,8 +3720,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -3117,8 +3738,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -3132,8 +3756,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -3147,8 +3774,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/engines/funcs/t/se_join_left_outer.test b/mysql-test/suite/engines/funcs/t/se_join_left_outer.test index d986159078b..5e6b8af633b 100644 --- a/mysql-test/suite/engines/funcs/t/se_join_left_outer.test +++ b/mysql-test/suite/engines/funcs/t/se_join_left_outer.test @@ -12,7 +12,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -26,7 +28,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -40,7 +44,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -54,7 +60,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -68,7 +76,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -82,7 +92,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -96,7 +108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -110,7 +124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -124,7 +140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -138,7 +156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -152,7 +172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -166,7 +188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -180,7 +204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -194,7 +220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -208,7 +236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -222,7 +252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -236,7 +268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -250,7 +284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -264,7 +300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -278,7 +316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -292,7 +332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -306,7 +348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -320,7 +364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -334,7 +380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -348,7 +396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -362,7 +412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -376,7 +428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -390,7 +444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -404,7 +460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -418,7 +476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -432,7 +492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -446,7 +508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -460,7 +524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -474,7 +540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -488,7 +556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -502,7 +572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -516,7 +588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -530,7 +604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -544,7 +620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -558,7 +636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -572,7 +652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -586,7 +668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -600,7 +684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -614,7 +700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -628,7 +716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -642,7 +732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -656,7 +748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -670,7 +764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -684,7 +780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -698,7 +796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -712,7 +812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -726,7 +828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -740,7 +844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -754,7 +860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -768,7 +876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -782,7 +892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -796,7 +908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -810,7 +924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -824,7 +940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -838,7 +956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -852,7 +972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -866,7 +988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -880,7 +1004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -894,7 +1020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -908,7 +1036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -922,7 +1052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -936,7 +1068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -950,7 +1084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -964,7 +1100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -978,7 +1116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -992,7 +1132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1006,7 +1148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1020,7 +1164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1034,7 +1180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1048,7 +1196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1062,7 +1212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1076,7 +1228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1090,7 +1244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1104,7 +1260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1118,7 +1276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1132,7 +1292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1146,7 +1308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1160,7 +1324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1174,7 +1340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1188,7 +1356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1202,7 +1372,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1216,7 +1388,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1230,7 +1404,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1244,7 +1420,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1258,7 +1436,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1272,7 +1452,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1286,7 +1468,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1300,7 +1484,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1314,7 +1500,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1328,7 +1516,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1342,7 +1532,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1356,7 +1548,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1370,7 +1564,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1384,7 +1580,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1398,7 +1596,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1412,7 +1612,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1426,7 +1628,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1440,7 +1644,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1454,7 +1660,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1468,7 +1676,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1482,7 +1692,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1496,7 +1708,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1510,7 +1724,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1524,7 +1740,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1538,7 +1756,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1552,7 +1772,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1566,7 +1788,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1580,7 +1804,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1594,7 +1820,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1608,7 +1836,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1622,7 +1852,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1636,7 +1868,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1650,7 +1884,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1664,7 +1900,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1678,7 +1916,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1692,7 +1932,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1706,7 +1948,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1720,7 +1964,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1734,7 +1980,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1748,7 +1996,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1762,7 +2012,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1776,7 +2028,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1790,7 +2044,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1804,7 +2060,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1818,7 +2076,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1832,7 +2092,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1846,7 +2108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1860,7 +2124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1874,7 +2140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1888,7 +2156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1902,7 +2172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1916,7 +2188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1930,7 +2204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1944,7 +2220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1958,7 +2236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1972,7 +2252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1986,7 +2268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2000,7 +2284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2014,7 +2300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2028,7 +2316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2042,7 +2332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2056,7 +2348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2070,7 +2364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2084,7 +2380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2098,7 +2396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2112,7 +2412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2126,7 +2428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2140,7 +2444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2154,7 +2460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2168,7 +2476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2182,7 +2492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2196,7 +2508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2210,7 +2524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2224,7 +2540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2238,7 +2556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2252,7 +2572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2266,7 +2588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2280,7 +2604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2294,7 +2620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2308,7 +2636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2322,7 +2652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2336,7 +2668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2350,7 +2684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2364,7 +2700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2378,7 +2716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2392,7 +2732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2406,7 +2748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2420,7 +2764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2434,7 +2780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2448,7 +2796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2462,7 +2812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2476,7 +2828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2490,7 +2844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2504,7 +2860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2518,7 +2876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2532,7 +2892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2546,7 +2908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2560,7 +2924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2574,7 +2940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2588,7 +2956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2602,7 +2972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2616,7 +2988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2630,7 +3004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2644,7 +3020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2658,7 +3036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2672,7 +3052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2686,7 +3068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2700,7 +3084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2714,7 +3100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2728,7 +3116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2742,7 +3132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2756,7 +3148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2770,7 +3164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2784,7 +3180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2798,7 +3196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2812,7 +3212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2826,7 +3228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2840,7 +3244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2854,7 +3260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2868,7 +3276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2882,7 +3292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2896,7 +3308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2910,7 +3324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2924,7 +3340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2938,7 +3356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/engines/funcs/t/se_join_natural_left.test b/mysql-test/suite/engines/funcs/t/se_join_natural_left.test index 2ff6276cfa5..7b9deea3cb6 100644 --- a/mysql-test/suite/engines/funcs/t/se_join_natural_left.test +++ b/mysql-test/suite/engines/funcs/t/se_join_natural_left.test @@ -12,7 +12,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -26,7 +28,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -40,7 +44,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -54,7 +60,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -68,7 +76,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -82,7 +92,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -96,7 +108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -110,7 +124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -124,7 +140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -138,7 +156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -152,7 +172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -166,7 +188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -180,7 +204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -194,7 +220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -208,7 +236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -222,7 +252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -236,7 +268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -250,7 +284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -264,7 +300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -278,7 +316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -292,7 +332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -306,7 +348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -320,7 +364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -334,7 +380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -348,7 +396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -362,7 +412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -376,7 +428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -390,7 +444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -404,7 +460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -418,7 +476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -432,7 +492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -446,7 +508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -460,7 +524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -474,7 +540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -488,7 +556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -502,7 +572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -516,7 +588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -530,7 +604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -544,7 +620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -558,7 +636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -572,7 +652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -586,7 +668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -600,7 +684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -614,7 +700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -628,7 +716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -642,7 +732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -656,7 +748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -670,7 +764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -684,7 +780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -698,7 +796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -712,7 +812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -726,7 +828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -740,7 +844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -754,7 +860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -768,7 +876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -782,7 +892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -796,7 +908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -810,7 +924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -824,7 +940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -838,7 +956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -852,7 +972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -866,7 +988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -880,7 +1004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -894,7 +1020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -908,7 +1036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -922,7 +1052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -936,7 +1068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -950,7 +1084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -964,7 +1100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -978,7 +1116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -992,7 +1132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1006,7 +1148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1020,7 +1164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1034,7 +1180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1048,7 +1196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1062,7 +1212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1076,7 +1228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1090,7 +1244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1104,7 +1260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1118,7 +1276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1132,7 +1292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1146,7 +1308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1160,7 +1324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1174,7 +1340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1188,7 +1356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1202,7 +1372,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1216,7 +1388,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1230,7 +1404,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1244,7 +1420,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1258,7 +1436,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1272,7 +1452,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1286,7 +1468,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1300,7 +1484,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1314,7 +1500,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1328,7 +1516,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1342,7 +1532,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1356,7 +1548,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1370,7 +1564,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1384,7 +1580,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1398,7 +1596,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1412,7 +1612,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1426,7 +1628,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1440,7 +1644,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1454,7 +1660,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1468,7 +1676,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1482,7 +1692,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1496,7 +1708,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1510,7 +1724,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1524,7 +1740,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1538,7 +1756,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1552,7 +1772,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1566,7 +1788,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1580,7 +1804,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1594,7 +1820,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1608,7 +1836,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1622,7 +1852,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1636,7 +1868,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1650,7 +1884,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1664,7 +1900,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1678,7 +1916,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1692,7 +1932,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1706,7 +1948,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1720,7 +1964,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1734,7 +1980,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1748,7 +1996,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1762,7 +2012,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1776,7 +2028,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1790,7 +2044,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1804,7 +2060,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1818,7 +2076,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1832,7 +2092,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1846,7 +2108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1860,7 +2124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1874,7 +2140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1888,7 +2156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1902,7 +2172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1916,7 +2188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1930,7 +2204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1944,7 +2220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1958,7 +2236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1972,7 +2252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1986,7 +2268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2000,7 +2284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2014,7 +2300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2028,7 +2316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2042,7 +2332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2056,7 +2348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2070,7 +2364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2084,7 +2380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2098,7 +2396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2112,7 +2412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2126,7 +2428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2140,7 +2444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2154,7 +2460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2168,7 +2476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2182,7 +2492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2196,7 +2508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2210,7 +2524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2224,7 +2540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2238,7 +2556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2252,7 +2572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2266,7 +2588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2280,7 +2604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2294,7 +2620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2308,7 +2636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2322,7 +2652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2336,7 +2668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2350,7 +2684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2364,7 +2700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2378,7 +2716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2392,7 +2732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2406,7 +2748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2420,7 +2764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2434,7 +2780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2448,7 +2796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2462,7 +2812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2476,7 +2828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2490,7 +2844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2504,7 +2860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2518,7 +2876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2532,7 +2892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2546,7 +2908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2560,7 +2924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2574,7 +2940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2588,7 +2956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2602,7 +2972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2616,7 +2988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2630,7 +3004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2644,7 +3020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2658,7 +3036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2672,7 +3052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2686,7 +3068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2700,7 +3084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2714,7 +3100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2728,7 +3116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2742,7 +3132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2756,7 +3148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2770,7 +3164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2784,7 +3180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2798,7 +3196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2812,7 +3212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2826,7 +3228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2840,7 +3244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2854,7 +3260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2868,7 +3276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2882,7 +3292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2896,7 +3308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2910,7 +3324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2924,7 +3340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2938,7 +3356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/engines/funcs/t/se_join_natural_left_outer.test b/mysql-test/suite/engines/funcs/t/se_join_natural_left_outer.test index 93384418d80..d484cbe5216 100644 --- a/mysql-test/suite/engines/funcs/t/se_join_natural_left_outer.test +++ b/mysql-test/suite/engines/funcs/t/se_join_natural_left_outer.test @@ -12,7 +12,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -26,7 +28,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -40,7 +44,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -54,7 +60,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -68,7 +76,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -82,7 +92,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -96,7 +108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -110,7 +124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -124,7 +140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -138,7 +156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -152,7 +172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -166,7 +188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -180,7 +204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -194,7 +220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -208,7 +236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -222,7 +252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -236,7 +268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -250,7 +284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -264,7 +300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -278,7 +316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -292,7 +332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -306,7 +348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -320,7 +364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -334,7 +380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -348,7 +396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -362,7 +412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -376,7 +428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -390,7 +444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -404,7 +460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -418,7 +476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -432,7 +492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -446,7 +508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -460,7 +524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -474,7 +540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -488,7 +556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -502,7 +572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -516,7 +588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -530,7 +604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -544,7 +620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -558,7 +636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -572,7 +652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -586,7 +668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -600,7 +684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -614,7 +700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -628,7 +716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -642,7 +732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -656,7 +748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -670,7 +764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -684,7 +780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -698,7 +796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -712,7 +812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -726,7 +828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -740,7 +844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -754,7 +860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -768,7 +876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -782,7 +892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -796,7 +908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -810,7 +924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -824,7 +940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -838,7 +956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -852,7 +972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -866,7 +988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -880,7 +1004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -894,7 +1020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -908,7 +1036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -922,7 +1052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -936,7 +1068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -950,7 +1084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -964,7 +1100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -978,7 +1116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -992,7 +1132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1006,7 +1148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1020,7 +1164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1034,7 +1180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1048,7 +1196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1062,7 +1212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1076,7 +1228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1090,7 +1244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1104,7 +1260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1118,7 +1276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1132,7 +1292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1146,7 +1308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1160,7 +1324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1174,7 +1340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1188,7 +1356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1202,7 +1372,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1216,7 +1388,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1230,7 +1404,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1244,7 +1420,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1258,7 +1436,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1272,7 +1452,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1286,7 +1468,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1300,7 +1484,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1314,7 +1500,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1328,7 +1516,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1342,7 +1532,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1356,7 +1548,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1370,7 +1564,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1384,7 +1580,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1398,7 +1596,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1412,7 +1612,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1426,7 +1628,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1440,7 +1644,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1454,7 +1660,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1468,7 +1676,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1482,7 +1692,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1496,7 +1708,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1510,7 +1724,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1524,7 +1740,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1538,7 +1756,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1552,7 +1772,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1566,7 +1788,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1580,7 +1804,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1594,7 +1820,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1608,7 +1836,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1622,7 +1852,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1636,7 +1868,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1650,7 +1884,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1664,7 +1900,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1678,7 +1916,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1692,7 +1932,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1706,7 +1948,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1720,7 +1964,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1734,7 +1980,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1748,7 +1996,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1762,7 +2012,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1776,7 +2028,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1790,7 +2044,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1804,7 +2060,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1818,7 +2076,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1832,7 +2092,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1846,7 +2108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1860,7 +2124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1874,7 +2140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1888,7 +2156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1902,7 +2172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1916,7 +2188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1930,7 +2204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1944,7 +2220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1958,7 +2236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1972,7 +2252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1986,7 +2268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2000,7 +2284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2014,7 +2300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2028,7 +2316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2042,7 +2332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2056,7 +2348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2070,7 +2364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2084,7 +2380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2098,7 +2396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2112,7 +2412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2126,7 +2428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2140,7 +2444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2154,7 +2460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2168,7 +2476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2182,7 +2492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2196,7 +2508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2210,7 +2524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2224,7 +2540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2238,7 +2556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2252,7 +2572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2266,7 +2588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2280,7 +2604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2294,7 +2620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2308,7 +2636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2322,7 +2652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2336,7 +2668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2350,7 +2684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2364,7 +2700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2378,7 +2716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2392,7 +2732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2406,7 +2748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2420,7 +2764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2434,7 +2780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2448,7 +2796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2462,7 +2812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2476,7 +2828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2490,7 +2844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2504,7 +2860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2518,7 +2876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2532,7 +2892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2546,7 +2908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2560,7 +2924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2574,7 +2940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2588,7 +2956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2602,7 +2972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2616,7 +2988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2630,7 +3004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2644,7 +3020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2658,7 +3036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2672,7 +3052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2686,7 +3068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2700,7 +3084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2714,7 +3100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2728,7 +3116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2742,7 +3132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2756,7 +3148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2770,7 +3164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2784,7 +3180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2798,7 +3196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2812,7 +3212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2826,7 +3228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2840,7 +3244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2854,7 +3260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2868,7 +3276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2882,7 +3292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2896,7 +3308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2910,7 +3324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2924,7 +3340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2938,7 +3356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/engines/iuds/r/delete_time.result b/mysql-test/suite/engines/iuds/r/delete_time.result index 619b31bf4ce..00b2262e07b 100644 --- a/mysql-test/suite/engines/iuds/r/delete_time.result +++ b/mysql-test/suite/engines/iuds/r/delete_time.result @@ -497,10 +497,10 @@ c2 00:13:13 00:51:51 01:01:01 -02:02:02 03:03:00 08:08:08 100:04:04 +11:11:11 11:11:27 125:00:00 125:05:00 @@ -644,7 +644,7 @@ c1 c2 -838:59:59 -838:59:59 00:04:00 00:04:00 00:54:54 00:54:54 -11:11:11 11:11:11 +02:02:02 02:02:02 12:34:56 NULL SELECT * FROM t2; c1 c2 diff --git a/mysql-test/suite/engines/iuds/r/delete_year.result b/mysql-test/suite/engines/iuds/r/delete_year.result index 02cbe24ecc9..c82f0dae7d9 100644 --- a/mysql-test/suite/engines/iuds/r/delete_year.result +++ b/mysql-test/suite/engines/iuds/r/delete_year.result @@ -2,7 +2,13 @@ DROP TABLE IF EXISTS t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1)); CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); diff --git a/mysql-test/suite/engines/iuds/r/insert_decimal.result b/mysql-test/suite/engines/iuds/r/insert_decimal.result index 6aa7f5aab01..50fde80d81d 100644 --- a/mysql-test/suite/engines/iuds/r/insert_decimal.result +++ b/mysql-test/suite/engines/iuds/r/insert_decimal.result @@ -1013,7 +1013,7 @@ ROUND(c1,c2) TRUNCATE(c1,c2) 1.133000 1.132000 DROP TABLE t5; CREATE TABLE t7(c1 DECIMAL(66,0)); -ERROR 42000: Too big precision 66 specified for column 'c1'. Maximum is 65. +ERROR 42000: Too big precision 66 specified for 'c1'. Maximum is 65. CREATE TABLE t7(c1 DECIMAL(5,10)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'c1'). DROP TABLE t1,t2; diff --git a/mysql-test/suite/engines/iuds/r/insert_number.result b/mysql-test/suite/engines/iuds/r/insert_number.result index fed2e0f683b..ce6a2af6d5f 100644 --- a/mysql-test/suite/engines/iuds/r/insert_number.result +++ b/mysql-test/suite/engines/iuds/r/insert_number.result @@ -5316,12 +5316,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -128 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 128 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -128 1 2 3 4 5 @@ -11010,12 +11018,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -32768 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 32768 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -32768 1 2 3 4 5 @@ -16809,12 +16825,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -8388608 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 8388608 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -8388608 1 2 3 4 5 @@ -22713,12 +22737,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -2147483648 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 2147483648 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -2147483648 1 2 3 4 5 @@ -28627,12 +28659,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -2147483648 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 2147483648 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -2147483648 1 2 3 4 5 @@ -32275,8 +32315,6 @@ total_rows min_value max(c1) 23 0 18446744073709551615 SELECT * FROM t2 WHERE c2 = -9223372036854775809; c1 c2 c3 c4 c5 c6 c7 -Warning 1292 Truncated incorrect DECIMAL value: '' -Warnings: SELECT c1,c6 FROM t2; c1 c6 0 0 @@ -34112,20 +34150,12 @@ c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 SELECT * FROM t3 WHERE c2 = -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 = -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 = -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 = -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <> -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34149,14 +34179,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <> -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 > -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34180,14 +34206,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 > -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34211,38 +34233,22 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 < -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 < -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <= -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <= -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <=> -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <=> -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34266,14 +34272,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34285,13 +34287,9 @@ c1 c2 c3 c4 c5 c6 c7 SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 105 NULL 102 103 104 105 106 @@ -34348,14 +34346,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <> -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 > -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34379,14 +34373,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 > -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34410,38 +34400,22 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 < -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 < -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <= -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <= -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <=> -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <=> -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34465,14 +34439,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34484,13 +34454,9 @@ c1 c2 c3 c4 c5 c6 c7 SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 105 NULL 102 103 104 105 106 @@ -34611,12 +34577,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 9223372036854775808 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34733,14 +34707,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34752,13 +34722,9 @@ c1 c2 c3 c4 c5 c6 c7 SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 105 NULL 102 103 104 105 106 @@ -34908,14 +34874,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34927,13 +34889,9 @@ c1 c2 c3 c4 c5 c6 c7 SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 105 NULL 102 103 104 105 106 diff --git a/mysql-test/suite/engines/iuds/r/insert_time.result b/mysql-test/suite/engines/iuds/r/insert_time.result index bb7ad5d7c0b..39bbb0f179d 100644 --- a/mysql-test/suite/engines/iuds/r/insert_time.result +++ b/mysql-test/suite/engines/iuds/r/insert_time.result @@ -40,12 +40,12 @@ INSERT INTO t4 VALUES('10.22.22','10.22.22','2009-01-26'),(1234567,1234567,'2009 Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1264 Out of range value for column 'c1' at row 2 -Warning 1264 Out of range value for column 'c2' at row 2 -Warning 1264 Out of range value for column 'c1' at row 3 -Warning 1264 Out of range value for column 'c2' at row 3 -Warning 1264 Out of range value for column 'c1' at row 4 -Warning 1264 Out of range value for column 'c2' at row 4 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c2' at row 2 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c2' at row 3 +Warning 1265 Data truncated for column 'c1' at row 4 +Warning 1265 Data truncated for column 'c2' at row 4 Warning 1265 Data truncated for column 'c1' at row 6 Warning 1265 Data truncated for column 'c2' at row 6 INSERT INTO t1 VALUES('8:29:45',NULL,'2009-02-01'); @@ -135,6 +135,8 @@ c1 c2 c3 -838:59:59 -838:59:59 2009-01-08 00:00:00 00:00:00 2009-01-09 00:00:00 00:00:00 2009-01-27 +00:00:00 00:00:00 2009-01-28 +00:00:00 00:00:00 2009-01-29 00:00:10 00:00:10 2009-01-26 00:00:11 00:00:11 2009-01-20 00:00:12 00:00:12 2009-01-13 @@ -160,8 +162,6 @@ c1 c2 c3 491:22:33 491:22:33 2009-01-04 825:23:00 825:23:00 2009-01-05 838:59:59 838:59:59 2009-01-10 -838:59:59 838:59:59 2009-01-28 -838:59:59 838:59:59 2009-01-29 SELECT * FROM t1; c1 c2 c3 -838:59:59 -838:59:59 2009-01-21 @@ -1650,8 +1650,10 @@ SELECT * FROM t1 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c2 LIMIT 2; c1 c2 c3 SELECT * FROM t1 WHERE c2 IN (NULL,'10:22:33') ORDER BY c2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t1 WHERE c2 IN (NULL,'10:22:33') ORDER BY c2 LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t1 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c2; c1 c2 c3 SELECT * FROM t1 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c2 LIMIT 2; @@ -1723,8 +1725,10 @@ SELECT * FROM t1 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 SELECT * FROM t1 WHERE c2 IN (NULL,'10:22:33') ORDER BY c2 DESC; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t1 WHERE c2 IN (NULL,'10:22:33') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t1 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c2 DESC; c1 c2 c3 SELECT * FROM t1 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c2 DESC LIMIT 2; @@ -3218,8 +3222,10 @@ SELECT * FROM t2 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 SELECT * FROM t2 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t2 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t2 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2; c1 c2 c3 SELECT * FROM t2 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 LIMIT 2; @@ -3287,8 +3293,10 @@ SELECT * FROM t2 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c1,c2 DESC LIMIT c1 c2 c3 SELECT * FROM t2 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 DESC; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t2 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t2 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 DESC; c1 c2 c3 SELECT * FROM t2 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 DESC LIMIT 2; @@ -4814,8 +4822,10 @@ SELECT * FROM t3 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 SELECT * FROM t3 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t3 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t3 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2; c1 c2 c3 SELECT * FROM t3 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 LIMIT 2; @@ -4887,8 +4897,10 @@ SELECT * FROM t3 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c1,c2 DESC LIMIT c1 c2 c3 SELECT * FROM t3 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 DESC; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t3 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t3 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 DESC; c1 c2 c3 SELECT * FROM t3 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 DESC LIMIT 2; @@ -5008,28 +5020,24 @@ c1 MIN(c2) 838:59:59 838:59:59 SELECT CAST(235959.123456 AS TIME); CAST(235959.123456 AS TIME) -23:59:59.123456 +23:59:59 SELECT CAST(0.235959123456e+6 AS TIME); CAST(0.235959123456e+6 AS TIME) -23:59:59.123456 +23:59:59 SELECT CAST(235959123456e-6 AS TIME); CAST(235959123456e-6 AS TIME) -23:59:59.123456 +23:59:59 SELECT CAST(235959.1234567 AS TIME); CAST(235959.1234567 AS TIME) -23:59:59.123456 -Warnings: -Warning 1292 Truncated incorrect time value: '235959.1234567' +23:59:59 SELECT CAST(0.2359591234567e6 AS TIME); CAST(0.2359591234567e6 AS TIME) -23:59:59.123456 -Warnings: -Warning 1292 Truncated incorrect time value: '235959.1234567' +23:59:59 SELECT CAST(0.2359591234567e+30 AS TIME); CAST(0.2359591234567e+30 AS TIME) NULL Warnings: -Warning 1292 Truncated incorrect time value: '2.359591234567e29' +Warning 1292 Incorrect datetime value: '2.359591234567e29' select cast('100:55:50' as time) < cast('24:00:00' as time); cast('100:55:50' as time) < cast('24:00:00' as time) 0 @@ -5077,7 +5085,6 @@ c1 c2 c3 INSERT INTO t2(c1,c2) VALUES('12:34:56.78','12:34:56.78') ON DUPLICATE KEY UPDATE c1='12:34:56.79',c2='12:34:57.78'; SELECT * FROM t2 WHERE c1='12:34:56.79' AND c2='12:34:57.78' /* 1 row */; c1 c2 c3 -12:34:56 12:34:57 2009-01-01 SELECT * FROM t1 WHERE c1='10:22:35' AND c2='33 9:23' /* no rows */; c1 c2 c3 INSERT INTO t1(c1,c2) VALUES('10:22:34','34 9:23') ON DUPLICATE KEY UPDATE c1='10:22:35',c2='33 9:23'; @@ -5137,8 +5144,8 @@ c1 c2 c3 09:36:00 09:36:00 2009-01-25 00:00:10 00:00:10 2009-01-26 00:00:00 00:00:00 2009-01-27 -838:59:59 838:59:59 2009-01-28 -838:59:59 838:59:59 2009-01-29 +00:00:00 00:00:00 2009-01-28 +00:00:00 00:00:00 2009-01-29 262:22:00 262:22:00 2009-01-30 00:00:12 00:00:12 2009-01-31 08:29:45 NULL 2009-02-01 @@ -5146,15 +5153,39 @@ c1 c2 c3 TRUNCATE TABLE t5; INSERT INTO t5 SELECT * FROM t4 WHERE c1 >='12colon34colon56'; Warnings: -Warning 1292 Incorrect time value: '12colon34colon56' for column 'c1' at row 1 +Warning 1292 Truncated incorrect time value: '12colon34colon56' SELECT * FROM t5; c1 c2 c3 +12:34:56 12:34:56 2009-01-01 +10:22:33 10:22:33 2009-01-02 +01:23:00 01:23:00 2009-01-03 491:22:33 491:22:33 2009-01-04 825:23:00 825:23:00 2009-01-05 +10:00:00 10:00:00 2009-01-06 +00:00:45 00:00:45 2009-01-07 +00:00:00 00:00:00 2009-01-09 838:59:59 838:59:59 2009-01-10 -838:59:59 838:59:59 2009-01-28 -838:59:59 838:59:59 2009-01-29 +10:11:12 10:11:12 2009-01-11 +11:11:12 11:11:12 2009-01-12 +00:00:12 00:00:12 2009-01-13 +00:12:34 00:12:34 2009-01-14 +12:34:58 12:34:58 2009-01-15 +12:35:56 12:35:56 2009-01-16 +11:11:27 11:11:27 2009-01-17 +08:03:02 08:03:02 2009-01-18 +00:11:12 00:11:12 2009-01-19 +00:00:11 00:00:11 2009-01-20 +00:12:30 00:12:30 2009-01-23 +09:00:45 09:00:45 2009-01-24 +09:36:00 09:36:00 2009-01-25 +00:00:10 00:00:10 2009-01-26 +00:00:00 00:00:00 2009-01-27 +00:00:00 00:00:00 2009-01-28 +00:00:00 00:00:00 2009-01-29 262:22:00 262:22:00 2009-01-30 +00:00:12 00:00:12 2009-01-31 +08:29:45 NULL 2009-02-01 +00:00:00 07:23:55 NULL TRUNCATE TABLE t5; DROP TABLE t5; DROP TABLE t1,t2,t3,t4; diff --git a/mysql-test/suite/engines/iuds/r/insert_year.result b/mysql-test/suite/engines/iuds/r/insert_year.result index 386c8090434..b9618ba4e2d 100644 --- a/mysql-test/suite/engines/iuds/r/insert_year.result +++ b/mysql-test/suite/engines/iuds/r/insert_year.result @@ -3235,9 +3235,21 @@ c1 c2 c3 c4 1999 1999 1998-12-30 1998-12-30 11:30:45 DROP TABLE t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1), UNIQUE INDEX(c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t2(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t3(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t2 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t3 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); diff --git a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result index 47e5234f795..e01c7d78680 100644 --- a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result +++ b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result @@ -55941,7 +55941,7 @@ SELECT 0 + (101010101010101010101010101010<<0); 0 + (101010101010101010101010101010<<0) 9223372036854775807 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(0)); CREATE TABLE t2(c1 BIT(0), c2 BIT(0), c3 BIT(0)); INSERT INTO t1 VALUES (b'101010101010101010101010101010'); @@ -56712,7 +56712,7 @@ SELECT 0 + (101010101010101010101010101010<<1); 0 + (101010101010101010101010101010<<1) 18446744073709551614 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(1)); CREATE TABLE t2(c1 BIT(1), c2 BIT(1), c3 BIT(1)); set @v1=1; @@ -57532,7 +57532,7 @@ SELECT 0 + (101010101010101010101010101010<<2); 0 + (101010101010101010101010101010<<2) 18446744073709551612 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(2)); CREATE TABLE t2(c1 BIT(2), c2 BIT(2), c3 BIT(2)); set @v1=2; @@ -58375,7 +58375,7 @@ SELECT 0 + (101010101010101010101010101010<<4); 0 + (101010101010101010101010101010<<4) 18446744073709551600 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(4)); CREATE TABLE t2(c1 BIT(4), c2 BIT(4), c3 BIT(4)); set @v1=4; @@ -59296,7 +59296,7 @@ SELECT 0 + (101010101010101010101010101010<<8); 0 + (101010101010101010101010101010<<8) 18446744073709551360 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(8)); CREATE TABLE t2(c1 BIT(8), c2 BIT(8), c3 BIT(8)); set @v1=8; @@ -60503,7 +60503,7 @@ SELECT 0 + (101010101010101010101010101010<<16); 0 + (101010101010101010101010101010<<16) 18446744073709486080 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(16)); CREATE TABLE t2(c1 BIT(16), c2 BIT(16), c3 BIT(16)); set @v1=16; @@ -61915,7 +61915,7 @@ SELECT 0 + (101010101010101010101010101010<<32); 0 + (101010101010101010101010101010<<32) 18446744069414584320 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(32)); CREATE TABLE t2(c1 BIT(32), c2 BIT(32), c3 BIT(32)); set @v1=32; @@ -63988,7 +63988,7 @@ SELECT 0 + (101010101010101010101010101010<<64); 0 + (101010101010101010101010101010<<64) 0 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(64)); CREATE TABLE t2(c1 BIT(64), c2 BIT(64), c3 BIT(64)); set @v1=64; @@ -67165,7 +67165,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<0) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<0) 9223372036854775807 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(0)); CREATE TABLE t2(c1 BIT(0), c2 BIT(0), c3 BIT(0)); INSERT INTO t1 VALUES (b'1010101010101010101010101010101010101010101010101010101010101010'); @@ -67933,7 +67933,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<1) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<1) 18446744073709551614 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(1)); CREATE TABLE t2(c1 BIT(1), c2 BIT(1), c3 BIT(1)); set @v1=1; @@ -68750,7 +68750,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<2) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<2) 18446744073709551612 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(2)); CREATE TABLE t2(c1 BIT(2), c2 BIT(2), c3 BIT(2)); set @v1=2; @@ -69590,7 +69590,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<4) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<4) 18446744073709551600 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(4)); CREATE TABLE t2(c1 BIT(4), c2 BIT(4), c3 BIT(4)); set @v1=4; @@ -70508,7 +70508,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<8) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<8) 18446744073709551360 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(8)); CREATE TABLE t2(c1 BIT(8), c2 BIT(8), c3 BIT(8)); set @v1=8; @@ -71712,7 +71712,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<16 0 + (1010101010101010101010101010101010101010101010101010101010101010<<16) 18446744073709486080 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(16)); CREATE TABLE t2(c1 BIT(16), c2 BIT(16), c3 BIT(16)); set @v1=16; @@ -73121,7 +73121,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<32 0 + (1010101010101010101010101010101010101010101010101010101010101010<<32) 18446744069414584320 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(32)); CREATE TABLE t2(c1 BIT(32), c2 BIT(32), c3 BIT(32)); set @v1=32; @@ -75197,7 +75197,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<64 0 + (1010101010101010101010101010101010101010101010101010101010101010<<64) 0 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(64)); CREATE TABLE t2(c1 BIT(64), c2 BIT(64), c3 BIT(64)); set @v1=64; @@ -78374,7 +78374,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<0 0 + (10101010101010101010101010101010101010101010101010101010101010101<<0) 9223372036854775807 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(0)); CREATE TABLE t2(c1 BIT(0), c2 BIT(0), c3 BIT(0)); INSERT INTO t1 VALUES (b'10101010101010101010101010101010101010101010101010101010101010101'); @@ -79142,7 +79142,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<1 0 + (10101010101010101010101010101010101010101010101010101010101010101<<1) 18446744073709551614 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(1)); CREATE TABLE t2(c1 BIT(1), c2 BIT(1), c3 BIT(1)); set @v1=1; @@ -79959,7 +79959,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<2 0 + (10101010101010101010101010101010101010101010101010101010101010101<<2) 18446744073709551612 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(2)); CREATE TABLE t2(c1 BIT(2), c2 BIT(2), c3 BIT(2)); set @v1=2; @@ -80799,7 +80799,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<4 0 + (10101010101010101010101010101010101010101010101010101010101010101<<4) 18446744073709551600 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(4)); CREATE TABLE t2(c1 BIT(4), c2 BIT(4), c3 BIT(4)); set @v1=4; @@ -81717,7 +81717,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<8 0 + (10101010101010101010101010101010101010101010101010101010101010101<<8) 18446744073709551360 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(8)); CREATE TABLE t2(c1 BIT(8), c2 BIT(8), c3 BIT(8)); set @v1=8; @@ -82921,7 +82921,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<1 0 + (10101010101010101010101010101010101010101010101010101010101010101<<16) 18446744073709486080 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(16)); CREATE TABLE t2(c1 BIT(16), c2 BIT(16), c3 BIT(16)); set @v1=16; @@ -84330,7 +84330,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<3 0 + (10101010101010101010101010101010101010101010101010101010101010101<<32) 18446744069414584320 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(32)); CREATE TABLE t2(c1 BIT(32), c2 BIT(32), c3 BIT(32)); set @v1=32; @@ -86406,7 +86406,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<6 0 + (10101010101010101010101010101010101010101010101010101010101010101<<64) 0 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(64)); CREATE TABLE t2(c1 BIT(64), c2 BIT(64), c3 BIT(64)); set @v1=64; diff --git a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result index a04585dfd72..e8324c8b368 100644 --- a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result +++ b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result @@ -71,13 +71,6 @@ Warning 1265 Data truncated for column 'c2' at row 1 SELECT count(*) FROM t1 WHERE c2='10:45:15' OR c2='2009-01-32' OR c2='2009-02-30' OR c2='2009-04-31' OR c2='2009-06-31' OR c2='2009-09-31' /* returns 0 */; count(*) 0 -Warnings: -Warning 1292 Incorrect date value: '10:45:15' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '2009-01-32' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '10:45:15' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '2009-01-32' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '10:45:15' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '2009-01-32' for column 'c2' at row 1 UPDATE t1 SET c2='2009-11-31' WHERE c2='2001-01-16'; Warnings: Warning 1265 Data truncated for column 'c2' at row 1 @@ -108,8 +101,7 @@ c1 c2 c3 2001-01-16 0000-00-00 12 2001-01-17 0000-00-00 13 Warnings: -Warning 1292 Incorrect date value: '0000-00-00' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '0000-00-00' for column 'c2' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 UPDATE t1 SET c2='0000-00-00' WHERE c2='2001-01-18'; ERROR 22007: Incorrect date value: '0000-00-00' for column 'c2' at row 1 SET SQL_MODE=DEFAULT; @@ -774,20 +766,17 @@ c1 c2 c3 INSERT INTO t1 VALUES('2001-01-09','2001-01-10',6),('2001-01-11','2001-01-12',7); UPDATE t1 SET c1='2001-01-09 24:59:59',c2='2009-01-10 23:60:59' WHERE c1='2001-01-09'; Warnings: -Warning 1264 Out of range value for column 'c1' at row 1 -Warning 1264 Out of range value for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 UPDATE t1 SET c2='2001-01-11 23:59:60' WHERE c1='2001-01-11'; Warnings: -Warning 1264 Out of range value for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 SELECT count(*) FROM t1 WHERE c1='2001-01-09 24:59:59' AND c2='2009-01-10 23:60:59'; count(*) 1 Warnings: -Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' for column 'c1' at row 1 -Warning 1292 Incorrect datetime value: '2009-01-10 23:60:59' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' for column 'c1' at row 1 -Warning 1292 Truncated incorrect datetime value: '2001-01-09 24:59:59' -Warning 1292 Truncated incorrect datetime value: '2009-01-10 23:60:59' +Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' +Warning 1292 Incorrect datetime value: '2009-01-10 23:60:59' SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */; count(*) 0 @@ -806,8 +795,7 @@ c1 c2 c3 2001-01-11 00:00:00 0000-00-00 00:00:00 7 2001-01-17 00:00:00 0000-00-00 00:00:00 8 Warnings: -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 UPDATE t1 SET c2='0000-00-00 00:00:00' WHERE c2='2001-01-18 07:35'; ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 SET SQL_MODE=DEFAULT; @@ -949,15 +937,13 @@ c1 c2 c3 2003-01-01 01:02:03 2002-01-09 01:30:30 10 UPDATE t1 SET c1='2003-01-01 1:2:3' WHERE c2 BETWEEN '20020109 01:30:40' AND '20020109 01:30:50' ORDER BY c2 LIMIT 2; Warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:50' for column 'c2' at row 1 +Warning 1292 Incorrect datetime value: '20020109 01:30:40' +Warning 1292 Incorrect datetime value: '20020109 01:30:50' SELECT * FROM t1 WHERE c2 BETWEEN '20020109 01:30:40' AND '20020109 01:30:50' ORDER BY c2; c1 c2 c3 Warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:50' for column 'c2' at row 1 +Warning 1292 Incorrect datetime value: '20020109 01:30:40' +Warning 1292 Incorrect datetime value: '20020109 01:30:50' UPDATE t1 SET c1='2003-01-01 1:2:3' WHERE c2 IN('2002-01-09 1:30:55','2002-01-09 2:00') ORDER BY c2 DESC LIMIT 2; SELECT * FROM t1 WHERE c2 IN('2002-01-09 1:30:55','2002-01-09 2:00') ORDER BY c2 DESC; c1 c2 c3 @@ -1389,17 +1375,13 @@ SELECT count(*) FROM t1 WHERE c1='2001-01-09 24:59:59' AND c2='2009-01-10 23:60: count(*) 1 Warnings: -Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' for column 'c1' at row 1 -Warning 1292 Incorrect datetime value: '2009-01-10 23:60:59' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' for column 'c1' at row 1 -Warning 1292 Truncated incorrect datetime value: '2001-01-09 24:59:59' -Warning 1292 Truncated incorrect datetime value: '2009-01-10 23:60:59' +Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' +Warning 1292 Incorrect datetime value: '2009-01-10 23:60:59' SELECT count(*) FROM t1 WHERE c1='2001-01-11 23:59:59' AND c2='2001-01-11 23:59:60'; count(*) 1 Warnings: -Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1 -Warning 1292 Truncated incorrect datetime value: '2001-01-11 23:59:60' +Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00'; c1 c2 c3 0000-00-00 00:00:00 0000-00-00 00:00:00 6 @@ -1412,8 +1394,7 @@ c1 c2 c3 2001-01-11 23:59:59 0000-00-00 00:00:00 7 2001-01-17 00:00:00 0000-00-00 00:00:00 8 Warnings: -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 UPDATE t1 SET c1='1972-01-01 07:35',c2='0000-00-00 00:00:00' WHERE c2='2001-01-18 07:35'; ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 SET SQL_MODE=DEFAULT; @@ -1552,15 +1533,13 @@ c1 c2 c3 2003-01-01 01:02:03 2002-01-09 01:30:30 10 UPDATE t1 SET c1='2003-01-01 1:2:3' WHERE c2 BETWEEN '20020109 01:30:40' AND '20020109 01:30:50' ORDER BY c2 LIMIT 2; Warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:50' for column 'c2' at row 1 +Warning 1292 Incorrect datetime value: '20020109 01:30:40' +Warning 1292 Incorrect datetime value: '20020109 01:30:50' SELECT * FROM t1 WHERE c2 BETWEEN '20020109 01:30:40' AND '20020109 01:30:50' ORDER BY c2; c1 c2 c3 Warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:50' for column 'c2' at row 1 +Warning 1292 Incorrect datetime value: '20020109 01:30:40' +Warning 1292 Incorrect datetime value: '20020109 01:30:50' UPDATE t1 SET c1='2003-01-01 1:2:3' WHERE c2 IN('2002-01-09 1:30:55','2002-01-09 2:00') ORDER BY c2 DESC LIMIT 2; SELECT * FROM t1 WHERE c2 IN('2002-01-09 1:30:55','2002-01-09 2:00') ORDER BY c2 DESC; c1 c2 c3 diff --git a/mysql-test/suite/engines/iuds/r/update_delete_number.result b/mysql-test/suite/engines/iuds/r/update_delete_number.result index 8e190870092..7c183068724 100644 --- a/mysql-test/suite/engines/iuds/r/update_delete_number.result +++ b/mysql-test/suite/engines/iuds/r/update_delete_number.result @@ -56,6 +56,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=4294967296 AND c2=2147483648 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=4294967295 AND c2=2147483647; c1 c2 c3 4294967295 2147483647 10 @@ -1150,6 +1152,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=256 AND c2=128 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=255 AND c2=127; c1 c2 c3 255 127 10 @@ -1922,6 +1926,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=65536 AND c2=32768 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=65535 AND c2=32767; c1 c2 c3 65535 32767 10 @@ -2669,6 +2675,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=16777216 AND c2=8388608 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=16777215 AND c2=8388607; c1 c2 c3 16777215 8388607 10 @@ -3416,6 +3424,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=18446744073709551616 AND c2=9223372036854775808 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=18446744073709551615 AND c2=9223372036854775807; c1 c2 c3 18446744073709551615 9223372036854775807 10 diff --git a/mysql-test/suite/engines/iuds/r/update_time.result b/mysql-test/suite/engines/iuds/r/update_time.result index 3073f3c985f..09a7cbf0c7f 100644 --- a/mysql-test/suite/engines/iuds/r/update_time.result +++ b/mysql-test/suite/engines/iuds/r/update_time.result @@ -793,10 +793,10 @@ c2 00:09:09 00:11:11 00:11:11 +00:11:11 00:13:13 00:51:51 01:01:01 -02:02:02 03:03:00 08:08:08 100:04:04 @@ -1122,7 +1122,7 @@ c2 838:59:59 NULL UPDATE t4 SET c1=11:11:11 WHERE c2=NULL; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':11:11 WHERE c2=NULL' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':11:11 WHERE c2=NULL' at line 1 SELECT c1 FROM t4; c1 00:00:01 @@ -1262,7 +1262,7 @@ c1 c2 838:59:59 838:59:59 UPDATE t1 SET c1=c1+1,c2=c2-1 WHERE c1 IN (222222,8385955,1500000) ORDER BY c1; Warnings: -Warning 1264 Out of range value for column 'c2' at row 2 +Warning 1265 Data truncated for column 'c2' at row 2 SELECT * FROM t1; c1 c2 -12:12:12 12:12:12 @@ -1332,7 +1332,7 @@ c1 c2 00:51:51 02:22:22 00:54:54 00:54:54 01:01:01 02:22:22 -02:02:02 02:22:22 +02:02:02 02:02:02 03:03:00 02:22:22 08:08:08 00:00:00 100:04:04 100:04:04 @@ -1374,7 +1374,7 @@ c1 c2 00:51:51 00:51:51 00:54:54 00:11:11 01:01:01 01:01:01 -02:02:02 02:02:02 +02:02:02 00:11:11 03:03:00 03:03:00 08:08:08 08:08:08 11:11:11 00:11:11 diff --git a/mysql-test/suite/engines/iuds/r/update_year.result b/mysql-test/suite/engines/iuds/r/update_year.result index 1b0ead45314..c762d70a276 100644 --- a/mysql-test/suite/engines/iuds/r/update_year.result +++ b/mysql-test/suite/engines/iuds/r/update_year.result @@ -2,7 +2,13 @@ DROP TABLE IF EXISTS t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1)); CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result index dd376154100..5504ec7efc2 100644 --- a/mysql-test/suite/funcs_1/r/innodb_func_view.result +++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result @@ -3801,7 +3801,7 @@ NULL NULL 1 00:00:00 2 00:00:00 <--------30 characters-------> 3 -00:00:00 ---äÖüß@µ*$-- 4 -NULL -1 5 +-00:00:01 -1 5 41:58:00 1 17:58 22 Warnings: Warning 1292 Truncated incorrect time value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3820,7 +3820,7 @@ NULL NULL 1 00:00:00 00:00:00 <--------30 characters-------> 3 -00:00:00 ---äÖüß@µ*$-- -NULL -1 +-00:00:01 -1 41:58:00 1 17:58 Warnings: Warning 1292 Truncated incorrect time value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index d9cd0f1e7f8..b50f5640520 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -53,6 +53,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; DROP DATABASE IF EXISTS test1; @@ -112,6 +114,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result index f3d3c6b7bad..085017fb529 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result +++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result @@ -132,6 +132,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -262,6 +264,8 @@ f239 varchar(20000) binary, f240 varchar(2000), f241 char(100) ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb4.txt' into table tb4; USE test1; @@ -319,6 +323,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result index 39a5dcd0b0c..7521a9857a6 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_memory.result +++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result @@ -128,6 +128,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; drop table if exists tb3; @@ -251,6 +253,8 @@ f238 varchar(25000) binary, f239 varbinary(0), f240 varchar(1200) ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb4.txt' into table tb4; USE test1; @@ -308,6 +312,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result index 03af4ebb89f..6c2586cc3c1 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result @@ -144,6 +144,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -283,6 +285,8 @@ f240 varchar(120), f241 char(100), f242 bit(30) ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' into table tb4; USE test1; @@ -348,6 +352,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result index dd8e508e821..150469a4a2f 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result @@ -144,6 +144,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -283,6 +285,8 @@ f240 varchar(120), f241 char(100), f242 bit(30) ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' into table tb4; USE test1; @@ -348,6 +352,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result index 03e4c647d6d..7f7baf65d1f 100644 --- a/mysql-test/suite/funcs_1/r/memory_func_view.result +++ b/mysql-test/suite/funcs_1/r/memory_func_view.result @@ -3802,7 +3802,7 @@ NULL NULL 1 00:00:00 2 00:00:00 <--------30 characters-------> 3 -00:00:00 ---äÖüß@µ*$-- 4 -NULL -1 5 +-00:00:01 -1 5 41:58:00 1 17:58 22 Warnings: Warning 1292 Truncated incorrect time value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3821,7 +3821,7 @@ NULL NULL 1 00:00:00 00:00:00 <--------30 characters-------> 3 -00:00:00 ---äÖüß@µ*$-- -NULL -1 +-00:00:01 -1 41:58:00 1 17:58 Warnings: Warning 1292 Truncated incorrect time value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index 864cbb93b29..a718f986648 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -54,6 +54,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; DROP DATABASE IF EXISTS test1; @@ -113,6 +115,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; USE test; diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result index 03e4c647d6d..7f7baf65d1f 100644 --- a/mysql-test/suite/funcs_1/r/myisam_func_view.result +++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result @@ -3802,7 +3802,7 @@ NULL NULL 1 00:00:00 2 00:00:00 <--------30 characters-------> 3 -00:00:00 ---äÖüß@µ*$-- 4 -NULL -1 5 +-00:00:01 -1 5 41:58:00 1 17:58 22 Warnings: Warning 1292 Truncated incorrect time value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3821,7 +3821,7 @@ NULL NULL 1 00:00:00 00:00:00 <--------30 characters-------> 3 -00:00:00 ---äÖüß@µ*$-- -NULL -1 +-00:00:01 -1 41:58:00 1 17:58 Warnings: Warning 1292 Truncated incorrect time value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result index f4025dfef2a..1ee9c6e0cd6 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views-big.result +++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result @@ -62,6 +62,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; DROP DATABASE IF EXISTS test1; @@ -129,6 +131,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index 7b45ec4c9e1..179d0cd814e 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -7499,9 +7499,13 @@ BEGIN declare x, y, z year(3) default 2005; SELECT x, y, z; END// +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CALL sp1(); x y z 2005 2005 2005 +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead DROP PROCEDURE IF EXISTS sp1; CREATE PROCEDURE sp1( ) BEGIN diff --git a/mysql-test/suite/heap/heap.result b/mysql-test/suite/heap/heap.result index f058c9f9c72..ae562a0dda1 100644 --- a/mysql-test/suite/heap/heap.result +++ b/mysql-test/suite/heap/heap.result @@ -738,3 +738,55 @@ SELECT c2 FROM t1; c2 0 DROP TABLE t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100; +insert into t1 values(1); +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +1600 2400 +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000; +insert into t1 values(1); +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +16000 24000 +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000; +insert into t1 values(1); +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +48000 72000 +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000; +insert into t1 values(1); +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +24000 36000 +drop table t1; +create table t1 (c1 int, index(c1)) engine=heap max_rows=10000; +insert into t1 select rand(100000000); +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1 limit 488; +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +16000 24000 +insert into t1 select rand(100000000) from t1 limit 1; +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +33024 49024 +insert into t1 select rand(100000000) from t1 limit 1000; +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +49024 73024 +insert into t1 select rand(100000000) from t1; +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +81024 121024 +drop table t1; diff --git a/mysql-test/suite/heap/heap.test b/mysql-test/suite/heap/heap.test index 7d56425799a..6f5046af139 100644 --- a/mysql-test/suite/heap/heap.test +++ b/mysql-test/suite/heap/heap.test @@ -485,3 +485,55 @@ INSERT INTO t1 VALUES('', 0); ALTER TABLE t1 MODIFY c1 VARCHAR(101); SELECT c2 FROM t1; DROP TABLE t1; + +# +# Show that MIN_ROWS and MAX_ROWS have an effect on how data_length +# and index_length are allocated. +# Result is different for 32 / 64 bit machines as pointer lengths are different +# + +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100; +insert into t1 values(1); +--replace_result 800 1600 1200 2400 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000; +insert into t1 values(1); +--replace_result 8000 16000 12000 24000 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000; +insert into t1 values(1); +--replace_result 24000 48000 36000 72000 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000; +insert into t1 values(1); +--replace_result 12000 24000 18000 36000 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; + +create table t1 (c1 int, index(c1)) engine=heap max_rows=10000; +insert into t1 select rand(100000000); +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1 limit 488; +--replace_result 8000 16000 12000 24000 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +insert into t1 select rand(100000000) from t1 limit 1; +--replace_result 16512 33024 24512 49024 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +insert into t1 select rand(100000000) from t1 limit 1000; +--replace_result 24512 49024 36512 73024 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +insert into t1 select rand(100000000) from t1; +--replace_result 40512 81024 60512 121024 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; diff --git a/mysql-test/suite/heap/heap_hash.result b/mysql-test/suite/heap/heap_hash.result index 453bfc0c165..ac62427c81c 100644 --- a/mysql-test/suite/heap/heap_hash.result +++ b/mysql-test/suite/heap/heap_hash.result @@ -427,4 +427,23 @@ INDEX(col_int_key) USING HASH) ENGINE = HEAP; INSERT INTO t1 (col_int_nokey, col_int_key) VALUES (3, 0), (4, 0), (3, 1); DELETE FROM t1 WHERE col_int_nokey = 5 ORDER BY col_int_key LIMIT 2; DROP TABLE t1; +# +# Bug #1002564: Wrong result for a lookup query from a heap table +# +CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL, KEY i1 (c1(3))) ENGINE=MEMORY DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('foo1'), ('bar2'), ('baz3'); +explain SELECT * FROM t1 WHERE c1='bar2'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i1 i1 5 const 2 Using where +SELECT * FROM t1 WHERE c1='bar2'; +c1 +bar2 +ALTER TABLE t1 DROP KEY i1, ADD KEY il (c1(3)) using btree; +explain SELECT * FROM t1 WHERE c1='bar2'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref il il 5 const 1 Using where +SELECT * FROM t1 WHERE c1='bar2'; +c1 +bar2 +DROP TABLE t1; End of 5.5 tests diff --git a/mysql-test/suite/heap/heap_hash.test b/mysql-test/suite/heap/heap_hash.test index 80ae01e9547..80d6ef9c8f2 100644 --- a/mysql-test/suite/heap/heap_hash.test +++ b/mysql-test/suite/heap/heap_hash.test @@ -316,4 +316,17 @@ DELETE FROM t1 WHERE col_int_nokey = 5 ORDER BY col_int_key LIMIT 2; DROP TABLE t1; +--echo # +--echo # Bug #1002564: Wrong result for a lookup query from a heap table +--echo # + +CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL, KEY i1 (c1(3))) ENGINE=MEMORY DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('foo1'), ('bar2'), ('baz3'); +explain SELECT * FROM t1 WHERE c1='bar2'; +SELECT * FROM t1 WHERE c1='bar2'; +ALTER TABLE t1 DROP KEY i1, ADD KEY il (c1(3)) using btree; +explain SELECT * FROM t1 WHERE c1='bar2'; +SELECT * FROM t1 WHERE c1='bar2'; +DROP TABLE t1; + --echo End of 5.5 tests diff --git a/mysql-test/suite/innodb/r/auto_increment_dup.result b/mysql-test/suite/innodb/r/auto_increment_dup.result new file mode 100644 index 00000000000..5bf901cb212 --- /dev/null +++ b/mysql-test/suite/innodb/r/auto_increment_dup.result @@ -0,0 +1,33 @@ +drop table if exists t1; +CREATE TABLE t1( +id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +k INT, +c CHAR(1), +UNIQUE KEY(k)) ENGINE=InnoDB; +# +# Connection 1 +# +SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1'; +affected rows: 0 +INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1'; +# +# Connection 2 +# +SET DEBUG_SYNC='start_ha_write_row WAIT_FOR continue2'; +affected rows: 0 +SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1'; +affected rows: 0 +INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +affected rows: 4 +info: Records: 3 Duplicates: 1 Warnings: 0 +SET DEBUG_SYNC='RESET'; +SELECT * FROM t1 ORDER BY k; +id k c +1 1 NULL +4 2 1 +2 3 NULL +5 4 NULL +6 5 NULL +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/binlog_consistent.result b/mysql-test/suite/innodb/r/binlog_consistent.result index 2e523c40a5b..f0b665b5ac9 100644 --- a/mysql-test/suite/innodb/r/binlog_consistent.result +++ b/mysql-test/suite/innodb/r/binlog_consistent.result @@ -3,11 +3,11 @@ RESET MASTER; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb; SHOW MASTER STATUS; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 380 +master-bin.000001 421 SHOW STATUS LIKE 'binlog_snapshot_%'; Variable_name Value binlog_snapshot_file master-bin.000001 -binlog_snapshot_position 380 +binlog_snapshot_position 421 BEGIN; INSERT INTO t1 VALUES (0, ""); # Connection con1 @@ -38,10 +38,10 @@ a b SHOW STATUS LIKE 'binlog_snapshot_%'; Variable_name Value binlog_snapshot_file master-bin.000001 -binlog_snapshot_position 904 +binlog_snapshot_position 945 SHOW MASTER STATUS; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 1316 +master-bin.000001 1357 SELECT * FROM t2 ORDER BY a; a 2 @@ -60,44 +60,45 @@ a b SHOW STATUS LIKE 'binlog_snapshot_%'; Variable_name Value binlog_snapshot_file master-bin.000001 -binlog_snapshot_position 904 +binlog_snapshot_position 945 SHOW MASTER STATUS; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000002 245 +master-bin.000002 326 COMMIT; SHOW STATUS LIKE 'binlog_snapshot_%'; Variable_name Value binlog_snapshot_file master-bin.000002 -binlog_snapshot_position 245 +binlog_snapshot_position 326 SHOW MASTER STATUS; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000002 245 +master-bin.000002 326 SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 245 Server ver: #, Binlog ver: # -master-bin.000001 245 Query 1 380 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb -master-bin.000001 380 Query 1 492 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam -master-bin.000001 492 Query 1 560 BEGIN -master-bin.000001 560 Query 1 648 use `test`; INSERT INTO t2 VALUES (2) -master-bin.000001 648 Query 1 717 COMMIT -master-bin.000001 717 Query 1 785 BEGIN -master-bin.000001 785 Query 1 877 use `test`; INSERT INTO t1 VALUES (0, "") -master-bin.000001 877 Xid 1 904 COMMIT /* XID */ -master-bin.000001 904 Query 1 972 BEGIN -master-bin.000001 972 Query 1 1060 use `test`; INSERT INTO t2 VALUES (3) -master-bin.000001 1060 Query 1 1129 COMMIT -master-bin.000001 1129 Query 1 1197 BEGIN -master-bin.000001 1197 Query 1 1289 use `test`; INSERT INTO t1 VALUES (4, "") -master-bin.000001 1289 Xid 1 1316 COMMIT /* XID */ -master-bin.000001 1316 Query 1 1384 BEGIN -master-bin.000001 1384 Query 1 1476 use `test`; INSERT INTO t1 VALUES (1, "") -master-bin.000001 1476 Xid 1 1503 COMMIT /* XID */ -master-bin.000001 1503 Query 1 1571 BEGIN -master-bin.000001 1571 Query 1 1668 use `test`; INSERT INTO t1 VALUES (2, "first") -master-bin.000001 1668 Query 1 1766 use `test`; INSERT INTO t1 VALUES (2, "second") -master-bin.000001 1766 Xid 1 1793 COMMIT /* XID */ -master-bin.000001 1793 Query 1 1861 BEGIN -master-bin.000001 1861 Query 1 1953 use `test`; INSERT INTO t1 VALUES (3, "") -master-bin.000001 1953 Xid 1 1980 COMMIT /* XID */ -master-bin.000001 1980 Rotate 1 2024 master-bin.000002;pos=4 +master-bin.000001 4 Format_desc 1 246 Server ver: #, Binlog ver: # +master-bin.000001 246 Binlog_checkpoint 1 286 master-bin.000001 +master-bin.000001 286 Query 1 421 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb +master-bin.000001 421 Query 1 533 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam +master-bin.000001 533 Query 1 601 BEGIN +master-bin.000001 601 Query 1 689 use `test`; INSERT INTO t2 VALUES (2) +master-bin.000001 689 Query 1 758 COMMIT +master-bin.000001 758 Query 1 826 BEGIN +master-bin.000001 826 Query 1 918 use `test`; INSERT INTO t1 VALUES (0, "") +master-bin.000001 918 Xid 1 945 COMMIT /* XID */ +master-bin.000001 945 Query 1 1013 BEGIN +master-bin.000001 1013 Query 1 1101 use `test`; INSERT INTO t2 VALUES (3) +master-bin.000001 1101 Query 1 1170 COMMIT +master-bin.000001 1170 Query 1 1238 BEGIN +master-bin.000001 1238 Query 1 1330 use `test`; INSERT INTO t1 VALUES (4, "") +master-bin.000001 1330 Xid 1 1357 COMMIT /* XID */ +master-bin.000001 1357 Query 1 1425 BEGIN +master-bin.000001 1425 Query 1 1517 use `test`; INSERT INTO t1 VALUES (1, "") +master-bin.000001 1517 Xid 1 1544 COMMIT /* XID */ +master-bin.000001 1544 Query 1 1612 BEGIN +master-bin.000001 1612 Query 1 1709 use `test`; INSERT INTO t1 VALUES (2, "first") +master-bin.000001 1709 Query 1 1807 use `test`; INSERT INTO t1 VALUES (2, "second") +master-bin.000001 1807 Xid 1 1834 COMMIT /* XID */ +master-bin.000001 1834 Query 1 1902 BEGIN +master-bin.000001 1902 Query 1 1994 use `test`; INSERT INTO t1 VALUES (3, "") +master-bin.000001 1994 Xid 1 2021 COMMIT /* XID */ +master-bin.000001 2021 Rotate 1 2065 master-bin.000002;pos=4 DROP TABLE t1,t2; diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result index d28ad1fd70e..ccf458809d8 100644 --- a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result +++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result @@ -1,3 +1,4 @@ +SET GLOBAL innodb_flush_log_at_trx_commit=3; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb; INSERT INTO t1 VALUES (0); SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con1_waiting WAIT_FOR con3_queued"; @@ -30,6 +31,6 @@ a 1 2 3 -InnoDB: Last MySQL binlog file position 0 906, file name ./master-bin.000001 +InnoDB: Last MySQL binlog file position 0 947, file name ./master-bin.000001 SET DEBUG_SYNC= 'RESET'; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result index da8cff142b8..44cf2f3979d 100644 --- a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result +++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result @@ -1,3 +1,4 @@ +SET GLOBAL innodb_flush_log_at_trx_commit=3; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb; INSERT INTO t1 VALUES (0); SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con1_waiting WAIT_FOR con3_queued"; @@ -31,6 +32,6 @@ a 1 2 3 -InnoDB: Last MySQL binlog file position 0 906, file name ./master-bin.000001 +InnoDB: Last MySQL binlog file position 0 947, file name ./master-bin.000001 SET DEBUG_SYNC= 'RESET'; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/group_commit_crash.result b/mysql-test/suite/innodb/r/group_commit_crash.result index cd47ba62ff2..c084f854e79 100644 --- a/mysql-test/suite/innodb/r/group_commit_crash.result +++ b/mysql-test/suite/innodb/r/group_commit_crash.result @@ -36,7 +36,7 @@ COMMIT; Got one of the listed errors SELECT * FROM t1 ORDER BY id; a b c d id -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info delete from t1; SET binlog_format= mixed; @@ -58,7 +58,7 @@ a b c d 7 a b c d 8 a b c d 9 a b c d 10 -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2 delete from t1; @@ -81,7 +81,7 @@ a b c d 7 a b c d 8 a b c d 9 a b c d 10 -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2 delete from t1; @@ -104,7 +104,7 @@ a b c d 7 a b c d 8 a b c d 9 a b c d 10 -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2 delete from t1; @@ -117,7 +117,7 @@ COMMIT; Got one of the listed errors SELECT * FROM t1 ORDER BY id; a b c d id -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info delete from t1; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result index c1ae510d45b..40c270a76d3 100644 --- a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result +++ b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result @@ -36,7 +36,7 @@ COMMIT; Got one of the listed errors SELECT * FROM t1 ORDER BY id; a b c d id -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info delete from t1; SET binlog_format= mixed; @@ -58,7 +58,7 @@ a b c d 7 a b c d 8 a b c d 9 a b c d 10 -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2 delete from t1; @@ -81,7 +81,7 @@ a b c d 7 a b c d 8 a b c d 9 a b c d 10 -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2 delete from t1; @@ -104,7 +104,7 @@ a b c d 7 a b c d 8 a b c d 9 a b c d 10 -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2 delete from t1; @@ -117,7 +117,7 @@ COMMIT; Got one of the listed errors SELECT * FROM t1 ORDER BY id; a b c d id -SHOW BINLOG EVENTS LIMIT 2,1; +SHOW BINLOG EVENTS LIMIT 3,1; Log_name Pos Event_type Server_id End_log_pos Info delete from t1; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index d4b6c6839c2..8c4c1c20590 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -2,7 +2,7 @@ drop table if exists t1; CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (9223372036854775807, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 9223372036854775807 NULL @@ -10,7 +10,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (127, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 127 NULL @@ -18,7 +18,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (255, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 255 NULL @@ -26,7 +26,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (32767, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 32767 NULL @@ -34,7 +34,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (65535, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 65535 NULL @@ -42,7 +42,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (8388607, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 8388607 NULL @@ -50,7 +50,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (16777215, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 16777215 NULL @@ -58,7 +58,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (2147483647, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 2147483647 NULL @@ -66,7 +66,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (4294967295, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 4294967295 NULL @@ -74,7 +74,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (9223372036854775807, null); INSERT INTO t1 (c2) VALUES ('innodb'); -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 c2 9223372036854775807 NULL @@ -366,7 +366,7 @@ c1 310 400 1000 -1110 +1010 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; @@ -567,7 +567,7 @@ Variable_name Value auto_increment_increment 65535 auto_increment_offset 65535 INSERT INTO t1 VALUES (NULL),(NULL); -ERROR 22003: Out of range value for column 't1' at row 167 +ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * FROM t1; c1 1 @@ -648,7 +648,7 @@ t2 CREATE TABLE `t2` ( `n` int(10) unsigned NOT NULL, `o` enum('FALSE','TRUE') DEFAULT NULL, PRIMARY KEY (`m`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; SHOW CREATE TABLE t1; Table Create Table @@ -858,7 +858,7 @@ PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t2 SELECT c1 FROM t1; Got one of the listed errors INSERT INTO t2 SELECT NULL FROM t1; -Got one of the listed errors +ERROR 22003: Out of range value for column 'c1' at row 1 DROP TABLE t1; DROP TABLE t2; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; diff --git a/mysql-test/suite/innodb/r/innodb-lock.result b/mysql-test/suite/innodb/r/innodb-lock.result index 439a8d6513c..7191bcd238a 100644 --- a/mysql-test/suite/innodb/r/innodb-lock.result +++ b/mysql-test/suite/innodb/r/innodb-lock.result @@ -98,8 +98,12 @@ CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL) ENGINE=InnoDB; INSERT INTO t1 VALUES(3,1); BEGIN; INSERT IGNORE INTO t1 VALUES(3,14); +Warnings: +Warning 1062 Duplicate entry '3' for key 'PRIMARY' BEGIN; INSERT IGNORE INTO t1 VALUES(3,23); +Warnings: +Warning 1062 Duplicate entry '3' for key 'PRIMARY' SELECT * FROM t1 FOR UPDATE; COMMIT; a b diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index b5e4d5cfae8..2f2f81db204 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -816,6 +816,8 @@ id 1 2 insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); +Warnings: +Warning 1062 Duplicate entry '1-1' for key 'PRIMARY' commit; select id,id3 from t1; id id3 diff --git a/mysql-test/suite/innodb/r/innodb_bug52745.result b/mysql-test/suite/innodb/r/innodb_bug52745.result index 74db8b0c20a..927ba0e0e53 100644 --- a/mysql-test/suite/innodb/r/innodb_bug52745.result +++ b/mysql-test/suite/innodb/r/innodb_bug52745.result @@ -58,6 +58,7 @@ col89 float unsigned zerofill DEFAULT NULL, col90 tinyblob ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead Note 1291 Column 'col82' has duplicated value '' in ENUM Note 1291 Column 'col82' has duplicated value '' in ENUM INSERT INTO bug52745 SET diff --git a/mysql-test/suite/innodb/r/innodb_bug56947.result b/mysql-test/suite/innodb/r/innodb_bug56947.result index b279069d834..8b864b62e81 100644 --- a/mysql-test/suite/innodb/r/innodb_bug56947.result +++ b/mysql-test/suite/innodb/r/innodb_bug56947.result @@ -3,6 +3,6 @@ SET GLOBAL innodb_file_per_table=0; create table bug56947(a int not null) engine = innodb; CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB; alter table bug56947 add unique index (a); -ERROR HY000: Table 'test.bug56947#1' already exists +ERROR 42S01: Table 'test.bug56947#1' already exists drop table `bug56947#1`; drop table bug56947; diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 2b3d24551c7..be2b4b28f6a 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -1480,10 +1480,15 @@ k a c 1 6 2 2 7 NULL insert ignore into t2 values (null,6,1),(10,8,1); +Warnings: +Warning 1062 Duplicate entry '6' for key 'idx_1' select last_insert_id(); last_insert_id() 0 insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1); +Warnings: +Warning 1062 Duplicate entry '6' for key 'idx_1' +Warning 1062 Duplicate entry '8' for key 'idx_1' select last_insert_id(); last_insert_id() 11 diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.test b/mysql-test/suite/innodb/t/auto_increment_dup.test new file mode 100644 index 00000000000..ad439024f65 --- /dev/null +++ b/mysql-test/suite/innodb/t/auto_increment_dup.test @@ -0,0 +1,51 @@ +########################################################################## +# LP bug #1035225 / MySQL bug #66301: INSERT ... ON DUPLICATE KEY UPDATE + +# innodb_autoinc_lock_mode=1 is broken +########################################################################## + +--source include/have_innodb.inc +--source include/have_debug_sync.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +CREATE TABLE t1( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + k INT, + c CHAR(1), + UNIQUE KEY(k)) ENGINE=InnoDB; + +--enable_info + +--connect(con1, localhost, root) +--connect(con2, localhost, root) + +--connection con1 + +--echo # +--echo # Connection 1 +--echo # +SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1'; +--send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1' + +--connection con2 +--echo # +--echo # Connection 2 +--echo # +SET DEBUG_SYNC='start_ha_write_row WAIT_FOR continue2'; +SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1'; +INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; + +--connection con1 +--reap +--disable_info +SET DEBUG_SYNC='RESET'; +SELECT * FROM t1 ORDER BY k; + +--disconnect con1 +--disconnect con2 + +--connection default + +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/group_commit_binlog_pos.test b/mysql-test/suite/innodb/t/group_commit_binlog_pos.test index 72798a68a1e..213dbc9d3d8 100644 --- a/mysql-test/suite/innodb/t/group_commit_binlog_pos.test +++ b/mysql-test/suite/innodb/t/group_commit_binlog_pos.test @@ -17,6 +17,19 @@ # Test that we get the correct position when we group commit several # transactions together. +# What we really want to test here is what happens when a group of +# transactions get written only partially to disk inside InnoDB before +# the crash. But that is hard to test in mysql-test-run automated +# tests. Instead, we use debug_sync to tightly control when each +# transaction is written to the redo log. And we set +# innodb_flush_log_at_trx_commit=3 so that we can write out +# transactions individually - as with +# innodb_flush_log_at_trx_commit=1, all commits are written together, +# as part of a commit_checkpoint. +# (Note that we do not have to restore innodb_flush_log_at_trx_commit, as +# we crash the server). +SET GLOBAL innodb_flush_log_at_trx_commit=3; + CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb; INSERT INTO t1 VALUES (0); diff --git a/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test index e9a234577e2..3ae3c50085d 100644 --- a/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test +++ b/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test @@ -17,6 +17,19 @@ # Test that we get the correct position when we group commit several # transactions together. +# What we really want to test here is what happens when a group of +# transactions get written only partially to disk inside InnoDB before +# the crash. But that is hard to test in mysql-test-run automated +# tests. Instead, we use debug_sync to tightly control when each +# transaction is written to the redo log. And we set +# innodb_flush_log_at_trx_commit=3 so that we can write out +# transactions individually - as with +# innodb_flush_log_at_trx_commit=1, all commits are written together, +# as part of a commit_checkpoint. +# (Note that we do not have to restore innodb_flush_log_at_trx_commit, as +# we crash the server). +SET GLOBAL innodb_flush_log_at_trx_commit=3; + CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb; INSERT INTO t1 VALUES (0); diff --git a/mysql-test/suite/innodb/t/group_commit_crash.test b/mysql-test/suite/innodb/t/group_commit_crash.test index 12c92d19244..0a297e3c570 100644 --- a/mysql-test/suite/innodb/t/group_commit_crash.test +++ b/mysql-test/suite/innodb/t/group_commit_crash.test @@ -66,7 +66,7 @@ while ($numtests) # table and binlog should be in sync. SELECT * FROM t1 ORDER BY id; --replace_column 2 # 5 # - SHOW BINLOG EVENTS LIMIT 2,1; + SHOW BINLOG EVENTS LIMIT 3,1; delete from t1; diff --git a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test index 2de09d6b0b6..4214c2a6b03 100644 --- a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test +++ b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test @@ -66,7 +66,7 @@ while ($numtests) # table and binlog should be in sync. SELECT * FROM t1 ORDER BY id; --replace_column 2 # 5 # - SHOW BINLOG EVENTS LIMIT 2,1; + SHOW BINLOG EVENTS LIMIT 3,1; delete from t1; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test index 4f54a8ff957..888c73bacdf 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -11,7 +11,7 @@ drop table if exists t1; # CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (9223372036854775807, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -22,14 +22,14 @@ DROP TABLE t1; # TINYINT CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (127, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (255, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -38,14 +38,14 @@ DROP TABLE t1; # CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (32767, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (65535, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -54,14 +54,14 @@ DROP TABLE t1; # CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (8388607, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (16777215, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -70,14 +70,14 @@ DROP TABLE t1; # CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (2147483647, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (4294967295, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -86,7 +86,7 @@ DROP TABLE t1; # CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (9223372036854775807, null); --- error ER_DUP_ENTRY,1062 +-- error 167 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -349,7 +349,7 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; SHOW VARIABLES LIKE "%auto_inc%"; ---error ER_WARN_DATA_OUT_OF_RANGE +--error 167 INSERT INTO t1 VALUES (NULL),(NULL); SELECT * FROM t1; DROP TABLE t1; @@ -437,7 +437,7 @@ CREATE TABLE t2( PRIMARY KEY) ENGINE=InnoDB; -- error ER_DUP_ENTRY,1062 INSERT INTO t2 SELECT c1 FROM t1; --- error ER_DUP_ENTRY,1467 +-- error 167 INSERT INTO t2 SELECT NULL FROM t1; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/innodb/t/innodb_bug14007649.test b/mysql-test/suite/innodb/t/innodb_bug14007649.test index 5f613cad6f1..da413e0ce59 100644 --- a/mysql-test/suite/innodb/t/innodb_bug14007649.test +++ b/mysql-test/suite/innodb/t/innodb_bug14007649.test @@ -1,9 +1,9 @@ --source include/have_innodb.inc --source include/have_debug.inc -if (`select plugin_auth_version <= "1.1.8-26.0" from information_schema.plugins where plugin_name='innodb'`) +if (`select plugin_auth_version <= "1.0.17-13.01" from information_schema.plugins where plugin_name='innodb'`) { - --skip Not fixed in XtraDB 1.1.8-26.0 or earlier + --skip Not fixed in XtraDB 1.0.17-13.01 or earlier } create table t1 ( diff --git a/mysql-test/suite/maria/lock.result b/mysql-test/suite/maria/lock.result index 101347c7d4c..b67d1ab7b0d 100644 --- a/mysql-test/suite/maria/lock.result +++ b/mysql-test/suite/maria/lock.result @@ -27,3 +27,6 @@ i drop table t2; unlock tables; drop table t1; +CREATE TABLE t1 (i INT) ENGINE=Aria; +LOCK TABLES t1 WRITE, t1 AS t1a WRITE; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/lock.test b/mysql-test/suite/maria/lock.test index 6116f0b5f08..5b6d17069e7 100644 --- a/mysql-test/suite/maria/lock.test +++ b/mysql-test/suite/maria/lock.test @@ -42,3 +42,11 @@ select * from t1; drop table t2; unlock tables; drop table t1; + +# +# MDEV-366: lock table twice with LOCK TABLES and then drop it +# + +CREATE TABLE t1 (i INT) ENGINE=Aria; +LOCK TABLES t1 WRITE, t1 AS t1a WRITE; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/maria-connect.result b/mysql-test/suite/maria/maria-connect.result index ed626a003f5..d79ebbdb86c 100644 --- a/mysql-test/suite/maria/maria-connect.result +++ b/mysql-test/suite/maria/maria-connect.result @@ -16,6 +16,7 @@ a 4 SHOW BINLOG EVENTS FROM <start_pos>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a int primary key) master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # use `test`; insert t1 values (1),(2),(3) diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result index 37613875f38..27d72b75930 100644 --- a/mysql-test/suite/maria/maria3.result +++ b/mysql-test/suite/maria/maria3.result @@ -452,6 +452,8 @@ SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; CREATE TABLE t1 (id int(11) PRIMARY KEY auto_increment,f1 varchar(10) NOT NULL UNIQUE); INSERT IGNORE INTO t1 (f1) VALUES ("test1"); INSERT IGNORE INTO t1 (f1) VALUES ("test1"); +Warnings: +Warning 1062 Duplicate entry 'test1' for key 'f1' INSERT IGNORE INTO t1 (f1) VALUES ("test2"); SELECT * FROM t1; id f1 diff --git a/mysql-test/suite/maria/mrr.result b/mysql-test/suite/maria/mrr.result index af7789eebff..06be64566e5 100644 --- a/mysql-test/suite/maria/mrr.result +++ b/mysql-test/suite/maria/mrr.result @@ -277,6 +277,8 @@ bb-1 NULL cc-2 NULL-1 drop table t1, t2, t3, t4; create table t1 (a int, b int not null,unique key (a,b),index(b)); insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6); +Warnings: +Warning 1062 Duplicate entry '6-6' for key 'a' create table t2 like t1; insert into t2 select * from t1; alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10)); diff --git a/mysql-test/suite/mtr2/combinations b/mysql-test/suite/mtr2/combinations new file mode 100644 index 00000000000..b26eab8ce1d --- /dev/null +++ b/mysql-test/suite/mtr2/combinations @@ -0,0 +1,5 @@ +[1st] +lock-wait-timeout=5 + +[2nd] +lock-wait-timeout=3 diff --git a/mysql-test/suite/multi_source/info_logs-master.opt b/mysql-test/suite/multi_source/info_logs-master.opt new file mode 100644 index 00000000000..da4e6d3c455 --- /dev/null +++ b/mysql-test/suite/multi_source/info_logs-master.opt @@ -0,0 +1 @@ +--relay-log=relay.bin --relay-log-info=relay.bin.info diff --git a/mysql-test/suite/multi_source/info_logs.result b/mysql-test/suite/multi_source/info_logs.result new file mode 100644 index 00000000000..3c99c755af9 --- /dev/null +++ b/mysql-test/suite/multi_source/info_logs.result @@ -0,0 +1,115 @@ +# +# List of files matching '*info*' pattern before starting any slaves +multi-master.info +# End of list +# +# Contents of multi-master.info +# EOF +# +change master 'master1' to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root'; +start slave 'master1'; +set default_master_connection = 'master1'; +include/wait_for_slave_to_start.inc +# +# List of files matching '*info*' pattern while 'master1' is running +master-master1.info +multi-master.info +relay.bin-master1.info +# End of list +# +# Contents of multi-master.info +master1 +# EOF +# +change master 'MASTER 2.2' to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root'; +start slave 'MASTER 2.2'; +set default_master_connection = 'MASTER 2.2'; +include/wait_for_slave_to_start.inc +# +# List of files matching '*info*' pattern +# while 'master1' and 'MASTER 2.2' are running +master-master1.info +master-master@00202@002e2.info +multi-master.info +relay.bin-master1.info +relay.bin-master@00202@002e2.info +# End of list +# +# Contents of multi-master.info +master1 +MASTER 2.2 +# EOF +# +stop slave 'master1'; +set default_master_connection = 'master1'; +include/wait_for_slave_to_stop.inc +reset slave 'master1' all; +# +# List of files matching '*info*' pattern +# after 'master1' was completely reset, 'MASTER 2.2' still running +master-master@00202@002e2.info +multi-master.info +relay.bin-master@00202@002e2.info +# End of list +# +# Contents of multi-master.info +MASTER 2.2 +# EOF +# +set default_master_connection = ''; +change master to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root'; +start slave; +include/wait_for_slave_to_start.inc +# +# List of files matching '*info*' pattern +# while 'MASTER 2.2' and '' are running +master-master@00202@002e2.info +master.info +multi-master.info +relay.bin-master@00202@002e2.info +relay.bin.info +# End of list +# +# Contents of multi-master.info +MASTER 2.2 +# EOF +# +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period + Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 relay.000002 572 master-bin.000001 Yes Yes 0 0 286 857 None 0 No 0 No 0 0 1 0 1073741824 6 0 60.000 +MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 relay-master@00202@002e2.000002 572 master-bin.000001 Yes Yes 0 0 286 876 None 0 No 0 No 0 0 2 0 1073741824 6 0 60.000 +include/wait_for_slave_to_start.inc +set default_master_connection = 'MASTER 2.2'; +include/wait_for_slave_to_start.inc +set default_master_connection = ''; +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period + Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 relay.000004 532 master-bin.000001 Yes Yes 0 0 286 817 None 0 No 0 No 0 0 1 0 1073741824 6 0 60.000 +MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 relay-master@00202@002e2.000004 532 master-bin.000001 Yes Yes 0 0 286 836 None 0 No 0 No 0 0 2 0 1073741824 6 0 60.000 +# +# List of files matching '*info*' pattern +# after slave server restart +# while 'MASTER 2.2' and '' are running +master-master@00202@002e2.info +master.info +multi-master.info +relay.bin-master@00202@002e2.info +relay.bin.info +# End of list +# +# Contents of multi-master.info +MASTER 2.2 +# EOF +# +include/reset_master_slave.inc +include/reset_master_slave.inc +include/reset_master_slave.inc diff --git a/mysql-test/suite/multi_source/info_logs.test b/mysql-test/suite/multi_source/info_logs.test new file mode 100644 index 00000000000..73e6ee73722 --- /dev/null +++ b/mysql-test/suite/multi_source/info_logs.test @@ -0,0 +1,178 @@ +# +# Check log files with multi-source +# + +--source include/not_embedded.inc + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +--let $datadir = `SELECT @@datadir` + +# +# Check creation and updating of multi-source *info* logs +# + +--echo # +--echo # List of files matching '*info*' pattern before starting any slaves +--list_files $datadir *info* +--echo # End of list +--echo # +--echo # Contents of multi-master.info +--cat_file $datadir/multi-master.info +--echo # EOF +--echo # + +# Start replication from the first master + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'master1' to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root'; + +start slave 'master1'; +set default_master_connection = 'master1'; +--source include/wait_for_slave_to_start.inc + +# Check the files + +--echo # +--echo # List of files matching '*info*' pattern while 'master1' is running +--list_files $datadir *info* +--echo # End of list +--echo # +--echo # Contents of multi-master.info +--cat_file $datadir/multi-master.info +--echo # EOF +--echo # + +# Start replication from the second master + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master 'MASTER 2.2' to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root'; + +start slave 'MASTER 2.2'; +set default_master_connection = 'MASTER 2.2'; +--source include/wait_for_slave_to_start.inc + +--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2) +--save_master_pos + +--connection slave +--sync_with_master 0,'MASTER 2.2' + +# Check the files + +--echo # +--echo # List of files matching '*info*' pattern +--echo # while 'master1' and 'MASTER 2.2' are running +--list_files $datadir *info* +--echo # End of list +--echo # +--echo # Contents of multi-master.info +--cat_file $datadir/multi-master.info +--echo # EOF +--echo # + +# Remove master1 configuration + +stop slave 'master1'; +set default_master_connection = 'master1'; +--source include/wait_for_slave_to_stop.inc +reset slave 'master1' all; + +# Check the files + +--echo # +--echo # List of files matching '*info*' pattern +--echo # after 'master1' was completely reset, 'MASTER 2.2' still running +--list_files $datadir *info* +--echo # End of list +--echo # +--echo # Contents of multi-master.info +--cat_file $datadir/multi-master.info +--echo # EOF +--echo # + +# Start replication from the first master, +# now with the default empty name + +set default_master_connection = ''; +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root'; + +start slave; +--source include/wait_for_slave_to_start.inc + +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) +--save_master_pos + +--connection slave +--sync_with_master + +# Check the files + +--echo # +--echo # List of files matching '*info*' pattern +--echo # while 'MASTER 2.2' and '' are running +--list_files $datadir *info* +--echo # End of list +--echo # +--echo # Contents of multi-master.info +--cat_file $datadir/multi-master.info +--echo # EOF +--echo # + +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +show all slaves status; + +# Restart the slave server + +--enable_reconnect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect +restart +EOF +--shutdown_server 60 +--source include/wait_until_connected_again.inc +--source include/wait_for_slave_to_start.inc +set default_master_connection = 'MASTER 2.2'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = ''; + +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +show all slaves status; + +# Check the files + +--echo # +--echo # List of files matching '*info*' pattern +--echo # after slave server restart +--echo # while 'MASTER 2.2' and '' are running +--list_files $datadir *info* +--echo # End of list +--echo # +--echo # Contents of multi-master.info +--cat_file $datadir/multi-master.info +--echo # EOF +--echo # + + +# Cleanup + +--source reset_master_slave.inc +--disconnect slave + +--connection master1 +--source reset_master_slave.inc +--disconnect master1 + +--connection master2 +--source reset_master_slave.inc +--disconnect master2 + diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result new file mode 100644 index 00000000000..b190a0b525d --- /dev/null +++ b/mysql-test/suite/multi_source/multisource.result @@ -0,0 +1,140 @@ +change master 'master1' to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root'; +start slave 'master1'; +set default_master_connection = 'master1'; +include/wait_for_slave_to_start.inc +show slave 'master1' status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath +Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 mysqld-relay-bin-master1.000002 572 master-bin.000001 Yes Yes 0 0 286 876 None 0 No 0 No 0 0 1 +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath +Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 mysqld-relay-bin-master1.000002 572 master-bin.000001 Yes Yes 0 0 286 876 None 0 No 0 No 0 0 1 +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period +master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 mysqld-relay-bin-master1.000002 572 master-bin.000001 Yes Yes 0 0 286 876 None 0 No 0 No 0 0 1 0 1073741824 6 0 60.000 +drop database if exists db1; +create database db1; +use db1; +create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM; +insert into t1 (f1) values ('one'),('two'); +select * from db1.t1; +i f1 +1 one +2 two +# List of relay log files in the datadir +mysqld-relay-bin-master1.000001 +mysqld-relay-bin-master1.000002 +mysqld-relay-bin-master1.index +show relaylog events; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin-master1.000001 4 Format_desc 3 246 Server version +mysqld-relay-bin-master1.000001 246 Rotate 3 304 mysqld-relay-bin-master1.000002;pos=4 +show relaylog events in 'mysqld-relay-bin-master1.000002'; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin-master1.000002 4 Format_desc 3 246 Server version +mysqld-relay-bin-master1.000002 246 Rotate 1 0 master-bin.000001;pos=4 +mysqld-relay-bin-master1.000002 290 Format_desc 1 246 Server version +mysqld-relay-bin-master1.000002 532 Binlog_checkpoint 1 286 master-bin.000001 +mysqld-relay-bin-master1.000002 572 Query 1 375 drop database if exists db1 +mysqld-relay-bin-master1.000002 661 Query 1 456 create database db1 +mysqld-relay-bin-master1.000002 742 Query 1 609 use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM +mysqld-relay-bin-master1.000002 895 Query 1 676 BEGIN +mysqld-relay-bin-master1.000002 962 Intvar 1 704 INSERT_ID=1 +mysqld-relay-bin-master1.000002 990 Query 1 808 use `db1`; insert into t1 (f1) values ('one'),('two') +mysqld-relay-bin-master1.000002 1094 Query 1 876 COMMIT +change master 'master1' to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root'; +ERROR HY000: This operation cannot be performed as you have a running slave 'master1'; run STOP SLAVE 'master1' first +change master to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root'; +ERROR HY000: This operation cannot be performed as you have a running slave 'master1'; run STOP SLAVE 'master1' first +change master 'master2' to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root'; +ERROR HY000: Connection 'master2' conflicts with existing connection 'master1' +set default_master_connection = ''; +change master to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root'; +start slave; +include/wait_for_slave_to_start.inc +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period + Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 mysqld-relay-bin.000002 572 master-bin.000001 Yes Yes 0 0 286 868 None 0 No 0 No 0 0 2 0 1073741824 6 0 60.000 +master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 876 mysqld-relay-bin-master1.000002 1162 master-bin.000001 Yes Yes 0 0 876 1466 None 0 No 0 No 0 0 1 0 1073741824 13 0 60.000 +insert into t1 (f1) values ('three'); +drop database if exists db2; +create database db2; +use db2; +create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB; +begin; +insert into t1 (f1) values (1),(2); +select * from db1.t1; +i f1 +1 one +2 two +3 three +select * from db2.t1; +pk f1 +commit; +select * from db2.t1; +pk f1 +1 1 +2 2 +flush logs; +purge binary logs to 'master-bin.000002'; +show binary logs; +Log_name File_size +master-bin.000002 326 +insert into t1 (f1) values ('four'); +create table db1.t3 (f1 int) engine=InnoDB; +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period + Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 809 mysqld-relay-bin.000002 1095 master-bin.000001 Yes Yes 0 0 809 1391 None 0 No 0 No 0 0 2 0 1073741824 13 0 60.000 +master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000002 690 mysqld-relay-bin-master1.000004 976 master-bin.000002 Yes Yes 0 0 690 1324 None 0 No 0 No 0 0 1 0 1073741824 31 0 60.000 +select * from db1.t1; +i f1 +1 one +2 two +3 three +4 four +show relaylog events; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin.000001 4 Format_desc 3 246 Server version +mysqld-relay-bin.000001 246 Rotate 3 296 mysqld-relay-bin.000002;pos=4 +show relaylog events in 'mysqld-relay-bin.000002'; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin.000002 4 Format_desc 3 246 Server version +mysqld-relay-bin.000002 246 Rotate 2 0 master-bin.000001;pos=4 +mysqld-relay-bin.000002 290 Format_desc 2 246 Server version +mysqld-relay-bin.000002 532 Binlog_checkpoint 2 286 master-bin.000001 +mysqld-relay-bin.000002 572 Query 2 375 drop database if exists db2 +mysqld-relay-bin.000002 661 Query 2 456 create database db2 +mysqld-relay-bin.000002 742 Query 2 591 use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB +mysqld-relay-bin.000002 877 Query 2 658 BEGIN +mysqld-relay-bin.000002 944 Intvar 2 686 INSERT_ID=1 +mysqld-relay-bin.000002 972 Query 2 782 use `db2`; insert into t1 (f1) values (1),(2) +mysqld-relay-bin.000002 1068 Xid 2 809 COMMIT /* xid=<num> */ +stop slave io_thread; +show status like 'Slave_running'; +Variable_name Value +Slave_running OFF +set default_master_connection = 'master1'; +show status like 'Slave_running'; +Variable_name Value +Slave_running ON +drop database db1; +drop database db2; +include/reset_master_slave.inc +drop database db1; +include/reset_master_slave.inc +drop database db2; +include/reset_master_slave.inc diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test new file mode 100644 index 00000000000..e9d672a9ae3 --- /dev/null +++ b/mysql-test/suite/multi_source/multisource.test @@ -0,0 +1,229 @@ +# +# Test basic replication functionality +# in multi-source setup +# + +--source include/not_embedded.inc +--source include/have_innodb.inc + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +# Start replication from the first master + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'master1' to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root'; + +start slave 'master1'; +set default_master_connection = 'master1'; +--source include/wait_for_slave_to_start.inc + +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' + +# Here and further: add an extra check on SQL thread status +# as the normal sync is not always enough +--source wait_for_sql_thread_read_all.inc + +# each of the 3 commands should produce +# 'master1' status + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +show slave 'master1' status; +--replace_result $SERVER_MYPORT_1 MYPORT_1 +show slave status; +--replace_result $SERVER_MYPORT_1 MYPORT_1 +show all slaves status; + + +# Check that replication actually works + +--connection master1 + +--disable_warnings +drop database if exists db1; +--enable_warnings +create database db1; +use db1; +create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM; +insert into t1 (f1) values ('one'),('two'); +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' + +--sorted_result +select * from db1.t1; + +--let $datadir = `SELECT @@datadir` + +--echo # List of relay log files in the datadir +--list_files $datadir mysqld-relay-bin-master1.* + +# Check that relay logs are recognizable + +--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/ +show relaylog events; +--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/ +show relaylog events in 'mysqld-relay-bin-master1.000002'; + + +# Try to configure connection with the same name again, +# should get an error because the slave is running + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +--error ER_SLAVE_MUST_STOP +eval change master 'master1' to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root'; + +# Try to configure using the default connection name +# (which is 'master1' at the moment), +# again, should get an error + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +--error ER_SLAVE_MUST_STOP +eval change master to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root'; + +# Try to configure a connection with the same master +# using a different name, should get a conflict + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +--error ER_CONNECTION_ALREADY_EXISTS +eval change master 'master2' to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root'; + + +# Set up a proper 'default' connection to master2 + +set default_master_connection = ''; + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root'; + +start slave; +--source include/wait_for_slave_to_start.inc + +--source wait_for_sql_thread_read_all.inc + +# See both connections in the same status output + +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +show all slaves status; + +# Check that replication from two servers actually works + +--connection master1 + +insert into t1 (f1) values ('three'); +--save_master_pos + +--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2) + +--disable_warnings +drop database if exists db2; +--enable_warnings +create database db2; +use db2; +create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB; +begin; +insert into t1 (f1) values (1),(2); + +--connection slave +--sync_with_master 0,'master1' + +--connection master2 +--save_master_pos + +--connection slave +--sync_with_master 0 +--sorted_result +select * from db1.t1; +select * from db2.t1; + +--connection master2 +commit; +--save_master_pos + +--connection slave +--sync_with_master 0 +--sorted_result +select * from db2.t1; + +# Flush and purge logs on one master, +# make sure slaves don't get confused + +--connection master1 +flush logs; +--save_master_pos +--connection slave +--sync_with_master 0, 'master1' + +--connection master1 +purge binary logs to 'master-bin.000002'; +show binary logs; +insert into t1 (f1) values ('four'); +create table db1.t3 (f1 int) engine=InnoDB; +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' + +--source wait_for_sql_thread_read_all.inc + +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +show all slaves status; + +--sorted_result +select * from db1.t1; + +# This should show relay log events for the default master +# (the one with the empty name) +--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/ +show relaylog events; +--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/ +show relaylog events in 'mysqld-relay-bin.000002'; + +# Make sure we don't lose control over replication connections +# after reconnecting to the slave + +--disconnect slave +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +stop slave io_thread; +show status like 'Slave_running'; +set default_master_connection = 'master1'; +show status like 'Slave_running'; + +# Cleanup + +drop database db1; +drop database db2; + +--source reset_master_slave.inc +--disconnect slave + +--connection master1 +drop database db1; +--source reset_master_slave.inc +--disconnect master1 + +--connection master2 +drop database db2; +--source reset_master_slave.inc +--disconnect master2 + diff --git a/mysql-test/suite/multi_source/my.cnf b/mysql-test/suite/multi_source/my.cnf new file mode 100644 index 00000000000..826967b52f9 --- /dev/null +++ b/mysql-test/suite/multi_source/my.cnf @@ -0,0 +1,25 @@ +# cat t/multisource1.cnf +!include include/default_mysqld.cnf +!include include/default_client.cnf + +[mysqld.1] +server-id=1 +log-bin=master-bin +log-warnings=2 + +[mysqld.2] +server-id=2 +log-bin=master-bin +log-warnings=2 + +[mysqld.3] +server-id=3 +log-warnings=2 + +[ENV] +SERVER_MYPORT_1= @mysqld.1.port +SERVER_MYSOCK_1= @mysqld.1.socket +SERVER_MYPORT_2= @mysqld.2.port +SERVER_MYSOCK_2= @mysqld.2.socket +SERVER_MYPORT_3= @mysqld.3.port +SERVER_MYSOCK_3= @mysqld.3.socket diff --git a/mysql-test/suite/multi_source/relaylog_events.result b/mysql-test/suite/multi_source/relaylog_events.result new file mode 100644 index 00000000000..1f3b57b045d --- /dev/null +++ b/mysql-test/suite/multi_source/relaylog_events.result @@ -0,0 +1,27 @@ +change master 'master1' to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root'; +start slave 'master1'; +set default_master_connection = 'master1'; +include/wait_for_slave_to_start.inc +drop table if exists t1; +create table t1 (i int) engine=MyISAM; +mysqld-relay-bin-master1.000001 +mysqld-relay-bin-master1.000002 +mysqld-relay-bin-master1.index +show relaylog events in 'mysqld-relay-bin-master1.000002'; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin-master1.000002 4 Format_desc 3 246 Server version +mysqld-relay-bin-master1.000002 246 Rotate 1 0 master-bin.000001;pos=4 +mysqld-relay-bin-master1.000002 290 Format_desc 1 246 Server version +mysqld-relay-bin-master1.000002 532 Binlog_checkpoint 1 286 master-bin.000001 +mysqld-relay-bin-master1.000002 572 Query 1 400 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ +mysqld-relay-bin-master1.000002 686 Query 1 500 use `test`; create table t1 (i int) engine=MyISAM +show relaylog events; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin-master1.000001 4 Format_desc 3 246 Server version +mysqld-relay-bin-master1.000001 246 Rotate 3 304 mysqld-relay-bin-master1.000002;pos=4 +drop table t1; +include/reset_master_slave.inc +include/reset_master_slave.inc diff --git a/mysql-test/suite/multi_source/relaylog_events.test b/mysql-test/suite/multi_source/relaylog_events.test new file mode 100644 index 00000000000..ba13a4dd7e9 --- /dev/null +++ b/mysql-test/suite/multi_source/relaylog_events.test @@ -0,0 +1,51 @@ +# +# Check that SHOW RELAYLOG EVENTS can be used +# for a named master connection +# + +--source include/not_embedded.inc + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'master1' to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root'; + +start slave 'master1'; +set default_master_connection = 'master1'; +--source include/wait_for_slave_to_start.inc + +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1 (i int) engine=MyISAM; +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' + +--let $datadir = `SELECT @@datadir` +--list_files $datadir mysqld-relay-bin-master1.* + +--replace_regex /Server ver:.*/Server version/ +show relaylog events in 'mysqld-relay-bin-master1.000002'; +--replace_regex /Server ver:.*/Server version/ +show relaylog events; + +--connection master1 +drop table t1; +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' + +--source reset_master_slave.inc +--disconnect slave + +--connection master1 +--source reset_master_slave.inc +--disconnect master1 + diff --git a/mysql-test/suite/multi_source/reset_master_slave.inc b/mysql-test/suite/multi_source/reset_master_slave.inc new file mode 100644 index 00000000000..63ba3ee00af --- /dev/null +++ b/mysql-test/suite/multi_source/reset_master_slave.inc @@ -0,0 +1,29 @@ +# +# The include file runs RESET ALL for every replication connection +# currently present in SHOW FULL SLAVE STATUS output on the server, +# and also runs RESET MASTER on the same server. +# + +--let $include_filename= reset_master_slave.inc +--source include/begin_include_file.inc + +--disable_query_log +--disable_result_log +--disable_warnings +--let $default_master = `SELECT @@default_master_connection` +--let $con_name = query_get_value(show all slaves status, Connection_name, 1) +while ($con_name != 'No such row') +{ + eval set default_master_connection = '$con_name'; + stop slave; + --source include/wait_for_slave_to_stop.inc + reset slave all; + --let $con_name = query_get_value(show all slaves status, Connection_name, 1) +} + +--error 0,ER_FLUSH_MASTER_BINLOG_CLOSED +reset master; +eval set default_master_connection = '$default_master'; + +--source include/end_include_file.inc + diff --git a/mysql-test/suite/multi_source/reset_slave.result b/mysql-test/suite/multi_source/reset_slave.result new file mode 100644 index 00000000000..498188db6cd --- /dev/null +++ b/mysql-test/suite/multi_source/reset_slave.result @@ -0,0 +1,28 @@ +change master 'master1' to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root'; +start slave 'master1'; +set default_master_connection = 'master1'; +include/wait_for_slave_to_start.inc +drop table if exists t1; +create table t1 (i int) engine=MyISAM; +insert into t1 values (1),(2); +stop slave 'master1'; +show slave 'master1' status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath + 127.0.0.1 root MYPORT_1 60 master-bin.000001 729 mysqld-relay-bin-master1.000002 1015 master-bin.000001 No No 0 0 729 1319 None 0 No NULL No 0 0 1 +mysqld-relay-bin-master1.000001 +mysqld-relay-bin-master1.000002 +mysqld-relay-bin-master1.index +reset slave 'master1'; +show slave 'master1' status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath + 127.0.0.1 root MYPORT_1 60 4 1015 No No 0 0 0 1319 None 0 No NULL No 0 0 1 +reset slave 'master1' all; +show slave 'master1' status; +ERROR HY000: There is no master connection 'master1' +drop table t1; +include/reset_master_slave.inc +drop table t1; +include/reset_master_slave.inc diff --git a/mysql-test/suite/multi_source/reset_slave.test b/mysql-test/suite/multi_source/reset_slave.test new file mode 100644 index 00000000000..bcc0560fe5b --- /dev/null +++ b/mysql-test/suite/multi_source/reset_slave.test @@ -0,0 +1,68 @@ +# +# Check RESET SLAVE [name] [ALL] for multi-source replication +# + +--source include/not_embedded.inc + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'master1' to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root'; + +start slave 'master1'; + +set default_master_connection = 'master1'; +--source include/wait_for_slave_to_start.inc + +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) + +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (i int) engine=MyISAM; +insert into t1 values (1),(2); + +--save_master_pos + +--connection slave + +--sync_with_master 0,'master1' +stop slave 'master1'; + +--wait_for_slave_to_stop + +--let $datadir = `SELECT @@datadir` + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +show slave 'master1' status; +--list_files $datadir mysqld* + +reset slave 'master1'; + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +show slave 'master1' status; +--list_files $datadir mysqld* + +reset slave 'master1' all; + +--error WARN_NO_MASTER_INFO +show slave 'master1' status; +--list_files $datadir mysqld* + +# Cleanup + +drop table t1; +--source reset_master_slave.inc +--disconnect slave + +--connection master1 +drop table t1; +--source reset_master_slave.inc +--disconnect master1 + + + diff --git a/mysql-test/suite/multi_source/simple.result b/mysql-test/suite/multi_source/simple.result new file mode 100644 index 00000000000..d38b3087263 --- /dev/null +++ b/mysql-test/suite/multi_source/simple.result @@ -0,0 +1,79 @@ +change master 'slave1' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root'; +change master 'slave2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root'; +start slave 'slave1'; +set default_master_connection = 'slave1'; +include/wait_for_slave_to_start.inc +set default_master_connection = 'slave2'; +start all slaves; +Warnings: +Note 1937 SLAVE 'slave2' started +include/wait_for_slave_to_start.inc +set default_master_connection = ''; +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period +slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 mysqld-relay-bin-slave1.000002 572 master-bin.000001 Yes Yes 0 0 286 875 None 0 No 0 No 0 0 1 0 1073741824 6 0 60.000 +slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 mysqld-relay-bin-slave2.000002 572 master-bin.000001 Yes Yes 0 0 286 875 None 0 No 0 No 0 0 2 0 1073741824 6 0 60.000 +start all slaves; +stop slave 'slave1'; +show slave 'slave1' status; +Slave_IO_State +Master_Host 127.0.0.1 +Master_User root +Master_Port MYPORT_1 +Connect_Retry 60 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 286 +Relay_Log_File mysqld-relay-bin-slave1.000002 +Relay_Log_Pos 572 +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running No +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 286 +Relay_Log_Space 875 +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master NULL +Master_SSL_Verify_Server_Cert No +Last_IO_Errno 0 +Last_IO_Error +Last_SQL_Errno 0 +Last_SQL_Error +Replicate_Ignore_Server_Ids +Master_Server_Id 1 +Master_SSL_Crl +Master_SSL_Crlpath +reset slave 'slave1'; +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period +slave1 127.0.0.1 root MYPORT_1 60 4 572 No No 0 0 0 875 None 0 No NULL No 0 0 1 0 1073741824 6 0 60.000 +slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 mysqld-relay-bin-slave2.000002 572 master-bin.000001 Yes Yes 0 0 286 875 None 0 No 0 No 0 0 2 0 1073741824 6 0 60.000 +reset slave 'slave1' all; +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period +slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 mysqld-relay-bin-slave2.000002 572 master-bin.000001 Yes Yes 0 0 286 875 None 0 No 0 No 0 0 2 0 1073741824 6 0 60.000 +stop all slaves; +Warnings: +Note 1938 SLAVE 'slave2' stopped +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period +slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 mysqld-relay-bin-slave2.000002 572 master-bin.000001 No No 0 0 286 875 None 0 No NULL No 0 0 2 0 1073741824 6 0 60.000 +stop all slaves; +include/reset_master_slave.inc +include/reset_master_slave.inc +include/reset_master_slave.inc diff --git a/mysql-test/suite/multi_source/simple.test b/mysql-test/suite/multi_source/simple.test new file mode 100644 index 00000000000..915cbd73941 --- /dev/null +++ b/mysql-test/suite/multi_source/simple.test @@ -0,0 +1,73 @@ +# +# Simple multi-master test +# + +--source include/not_embedded.inc + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) +--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2) +--connection slave + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'slave1' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root'; +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master 'slave2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root'; +start slave 'slave1'; +set default_master_connection = 'slave1'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = 'slave2'; +start all slaves; + +--source include/wait_for_slave_to_start.inc +set default_master_connection = ''; + +# Ensure that all data is in the relay log +--connection master1 +--save_master_pos +--connection slave +--sync_with_master 0,'slave1' +--connection master2 +--save_master_pos +--connection slave +--sync_with_master 0,'slave2' + +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +show all slaves status; + +# Ensure that start all slaves doesn't do anything as all slaves are started +start all slaves; + +stop slave 'slave1'; + +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +query_vertical show slave 'slave1' status; + +reset slave 'slave1'; +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +show all slaves status; + +reset slave 'slave1' all; +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +show all slaves status; + +stop all slaves; +--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 +show all slaves status; + +# Ensure that start all slaves doesn't do anything as all slaves are stopped +stop all slaves; + +# +# clean up +# + +--source reset_master_slave.inc +--disconnect slave +--connection master1 +--source reset_master_slave.inc +--disconnect master1 +--connection master2 +--source reset_master_slave.inc +--disconnect master2 + diff --git a/mysql-test/suite/multi_source/skip_counter.result b/mysql-test/suite/multi_source/skip_counter.result new file mode 100644 index 00000000000..42ad961d6dd --- /dev/null +++ b/mysql-test/suite/multi_source/skip_counter.result @@ -0,0 +1,113 @@ +drop database if exists db; +create database db; +create table db.t1 (i int) engine=MyISAM; +drop database if exists db; +create database db; +create table db.t2 (i int) engine=MyISAM; +change master 'master1' to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root'; +start slave 'master1'; +set default_master_connection = 'master1'; +include/wait_for_slave_to_start.inc +set default_master_connection = 'master2'; +change master 'master2' to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root'; +set global sql_slave_skip_counter = 2; +select @@global.sql_slave_skip_counter; +@@global.sql_slave_skip_counter +2 +select @@session.sql_slave_skip_counter; +@@session.sql_slave_skip_counter +2 +set session sql_slave_skip_counter = 3; +select @@global.sql_slave_skip_counter; +@@global.sql_slave_skip_counter +3 +select @@session.sql_slave_skip_counter; +@@session.sql_slave_skip_counter +3 +set global sql_slave_skip_counter= default; +select @@global.sql_slave_skip_counter; +@@global.sql_slave_skip_counter +0 +select @@session.sql_slave_skip_counter; +@@session.sql_slave_skip_counter +0 +set global sql_slave_skip_counter= 3; +set default_master_connection = 'master1'; +select @@session.sql_slave_skip_counter; +@@session.sql_slave_skip_counter +0 +set default_master_connection = 'qqq'; +select @@session.sql_slave_skip_counter; +@@session.sql_slave_skip_counter +0 +Warnings: +Warning 1617 There is no master connection 'qqq' +set default_master_connection = 'master2'; +select @@session.sql_slave_skip_counter; +@@session.sql_slave_skip_counter +3 +select @@global.max_relay_log_size; +@@global.max_relay_log_size +1073741824 +set global max_relay_log_size = 1*1024*1024; +select @@global.max_relay_log_size; +@@global.max_relay_log_size +1048576 +select @@session.max_relay_log_size; +@@session.max_relay_log_size +1048576 +set session max_relay_log_size = 3*1024*1024; +select @@global.max_relay_log_size; +@@global.max_relay_log_size +3145728 +select @@session.max_relay_log_size; +@@session.max_relay_log_size +3145728 +set global max_relay_log_size= default; +select @@global.max_relay_log_size; +@@global.max_relay_log_size +1073741824 +select @@session.max_relay_log_size; +@@session.max_relay_log_size +1073741824 +set global max_relay_log_size= 3*1024*1024; +set default_master_connection = 'master1'; +select @@session.max_relay_log_size; +@@session.max_relay_log_size +1073741824 +set default_master_connection = 'qqq'; +select @@session.max_relay_log_size; +@@session.max_relay_log_size +0 +Warnings: +Warning 1617 There is no master connection 'qqq' +set default_master_connection = 'master2'; +select @@session.max_relay_log_size; +@@session.max_relay_log_size +3145728 +set global max_binlog_size= 4*1024*1024; +select @@global.max_relay_log_size; +@@global.max_relay_log_size +3145728 +start slave 'master2'; +include/wait_for_slave_to_start.inc +set default_master_connection = ''; +show tables in db; +Tables_in_db +t1 +t2 +drop database db; +set global sql_slave_skip_counter = 0; +set global max_relay_log_size = 1073741824; +set global max_binlog_size = 1073741824; +include/reset_master_slave.inc +drop database db; +include/reset_master_slave.inc +drop database db; +include/reset_master_slave.inc diff --git a/mysql-test/suite/multi_source/skip_counter.test b/mysql-test/suite/multi_source/skip_counter.test new file mode 100644 index 00000000000..d158f382a97 --- /dev/null +++ b/mysql-test/suite/multi_source/skip_counter.test @@ -0,0 +1,143 @@ +# +# Test of sql_slave_skip_counter and rpl_max_size +# + +# Create a schema and a table i +# on the 1st master + +--source include/not_embedded.inc + +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) + +--disable_warnings +drop database if exists db; +--enable_warnings +create database db; +create table db.t1 (i int) engine=MyISAM; +--save_master_pos + +# Create the same schema and another table +# on the 2nd master + +--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2) + +--disable_warnings +drop database if exists db; +--enable_warnings +create database db; +create table db.t2 (i int) engine=MyISAM; + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +# Start replication from the first master + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'master1' to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root'; + +start slave 'master1'; +set default_master_connection = 'master1'; +--source include/wait_for_slave_to_start.inc +--sync_with_master 0,'master1' + +# Start replication from the second master + +set default_master_connection = 'master2'; + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master 'master2' to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root'; + +# the schema creation will be replicated from the 1st master, +# so we want to skip it in the second replication connection. + +# Normally it should have been 2 events, but +# currently Binlog_checkpoint also counts. Maybe we'll need +# to modify the test later + +--let $skip_counter_saved = `select @@global.sql_slave_skip_counter` +--let $max_relay_log_size_saved= `select @@global.max_relay_log_size` +--let $max_binlog_size_saved= `select @@global.max_binlog_size` +set global sql_slave_skip_counter = 2; +select @@global.sql_slave_skip_counter; +select @@session.sql_slave_skip_counter; +set session sql_slave_skip_counter = 3; +select @@global.sql_slave_skip_counter; +select @@session.sql_slave_skip_counter; +set global sql_slave_skip_counter= default; +select @@global.sql_slave_skip_counter; +select @@session.sql_slave_skip_counter; +set global sql_slave_skip_counter= 3; +set default_master_connection = 'master1'; +select @@session.sql_slave_skip_counter; +set default_master_connection = 'qqq'; +select @@session.sql_slave_skip_counter; +set default_master_connection = 'master2'; +select @@session.sql_slave_skip_counter; + +# Test of setting max_relay_log_size +select @@global.max_relay_log_size; +set global max_relay_log_size = 1*1024*1024; +select @@global.max_relay_log_size; +select @@session.max_relay_log_size; +set session max_relay_log_size = 3*1024*1024; +select @@global.max_relay_log_size; +select @@session.max_relay_log_size; +set global max_relay_log_size= default; +select @@global.max_relay_log_size; +select @@session.max_relay_log_size; +set global max_relay_log_size= 3*1024*1024; +set default_master_connection = 'master1'; +select @@session.max_relay_log_size; +set default_master_connection = 'qqq'; +select @@session.max_relay_log_size; +set default_master_connection = 'master2'; +select @@session.max_relay_log_size; +set global max_binlog_size= 4*1024*1024; +select @@global.max_relay_log_size; + + +start slave 'master2'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = ''; + +--connection master2 +--save_master_pos + +--connection slave + +--sync_with_master 0,'master2' + +# If the skip_counter worked as expected, we should +# get here (replication shouldn't have broken) +# and should see both tables here +# (drop database which came from master2 shoudn't have been executed +# so t1 should still exist) + +show tables in db; + +# Cleanup + +drop database db; + +--eval set global sql_slave_skip_counter = $skip_counter_saved +--eval set global max_relay_log_size = $max_relay_log_size_saved +--eval set global max_binlog_size = $max_binlog_size_saved + +--source reset_master_slave.inc +--disconnect slave + +--connection master1 +drop database db; +--source reset_master_slave.inc +--disconnect master1 + +--connection master2 +drop database db; +--source reset_master_slave.inc +--disconnect master2 + diff --git a/mysql-test/suite/multi_source/status_vars.result b/mysql-test/suite/multi_source/status_vars.result new file mode 100644 index 00000000000..12917f94140 --- /dev/null +++ b/mysql-test/suite/multi_source/status_vars.result @@ -0,0 +1,97 @@ +call mtr.add_suppression("Connection 'master1' already exists"); +change master 'master1' to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root', +master_heartbeat_period = 25; +start slave 'master1'; +set default_master_connection = 'master1'; +include/wait_for_slave_to_start.inc +set default_master_connection = ''; +change master to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root', +master_heartbeat_period=35; +start slave; +include/wait_for_slave_to_start.inc +# +# Check how status works for the default connection, anonymous or named +# +# Slave_running and Slave_heartbeat_period should be local for a connection +# +set default_master_connection = ''; +show status like 'Slave_running'; +Variable_name Value +Slave_running ON +show status like 'Slave_heartbeat_period'; +Variable_name Value +Slave_heartbeat_period 35.000 +stop slave io_thread; +include/wait_for_slave_io_to_stop.inc +show status like 'Slave_running'; +Variable_name Value +Slave_running OFF +set default_master_connection = 'master1'; +show status like 'Slave_running'; +Variable_name Value +Slave_running ON +show status like 'Slave_heartbeat_period'; +Variable_name Value +Slave_heartbeat_period 25.000 +# +# Slave_received_heartbeats should also be local +# +set default_master_connection = ''; +stop slave sql_thread; +include/wait_for_slave_sql_to_stop.inc +change master to master_heartbeat_period=1; +show status like 'Slave_received_heartbeats'; +Variable_name Value +Slave_received_heartbeats 0 +start slave; +include/wait_for_slave_to_start.inc +show status like 'Slave_received_heartbeats'; +Variable_name Value +Slave_received_heartbeats 2 +stop slave; +include/wait_for_slave_to_stop.inc +set default_master_connection = 'master1'; +show status like 'Slave_received_heartbeats'; +Variable_name Value +Slave_received_heartbeats 0 +stop slave; +include/wait_for_slave_to_stop.inc +change master to master_heartbeat_period=2; +start slave; +include/wait_for_slave_to_start.inc +show status like 'Slave_received_heartbeats'; +Variable_name Value +Slave_received_heartbeats 1 +# +# Slave_open_temp_tables should be global +# +set default_master_connection = ''; +start slave; +include/wait_for_slave_to_start.inc +set binlog_format = statement; +create temporary table tmp1 (i int) engine=MyISAM; +show status like 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 1 +set default_master_connection = 'master1'; +show status like 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 1 +set binlog_format = statement; +create temporary table tmp1 (i int) engine=MyISAM; +show status like 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 2 +set default_master_connection = ''; +show status like 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 2 +include/reset_master_slave.inc +include/reset_master_slave.inc +include/reset_master_slave.inc diff --git a/mysql-test/suite/multi_source/status_vars.test b/mysql-test/suite/multi_source/status_vars.test new file mode 100644 index 00000000000..eec89ee4e81 --- /dev/null +++ b/mysql-test/suite/multi_source/status_vars.test @@ -0,0 +1,138 @@ +# +# Status variables related to a replication connection +# + +--source include/not_embedded.inc + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +call mtr.add_suppression("Connection 'master1' already exists"); + +# Start replication from the first master + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'master1' to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root', +master_heartbeat_period = 25; + +start slave 'master1'; +set default_master_connection = 'master1'; +--source include/wait_for_slave_to_start.inc + + +# Set up a proper 'default' connection to master2 + +set default_master_connection = ''; + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root', +master_heartbeat_period=35; + +start slave; +--source include/wait_for_slave_to_start.inc + +--echo # +--echo # Check how status works for the default connection, anonymous or named +--echo # + +--echo # Slave_running and Slave_heartbeat_period should be local for a connection +--echo # + +set default_master_connection = ''; +show status like 'Slave_running'; +show status like 'Slave_heartbeat_period'; +stop slave io_thread; +--source include/wait_for_slave_io_to_stop.inc +show status like 'Slave_running'; + +set default_master_connection = 'master1'; +show status like 'Slave_running'; +show status like 'Slave_heartbeat_period'; + +--echo # +--echo # Slave_received_heartbeats should also be local +--echo # + +set default_master_connection = ''; +stop slave sql_thread; +--source include/wait_for_slave_sql_to_stop.inc +change master to master_heartbeat_period=1; +show status like 'Slave_received_heartbeats'; +start slave; +--source include/wait_for_slave_to_start.inc + +--let $status_var = Slave_received_heartbeats +--let $status_var_value = 2 +# The units are tens of seconds +--let $status_timeout = 30 +--source include/wait_for_status_var.inc +show status like 'Slave_received_heartbeats'; +stop slave; +--source include/wait_for_slave_to_stop.inc + +set default_master_connection = 'master1'; +show status like 'Slave_received_heartbeats'; + +stop slave; +--source include/wait_for_slave_to_stop.inc +change master to master_heartbeat_period=2; +start slave; +--source include/wait_for_slave_to_start.inc + +--let $status_var = Slave_received_heartbeats +--let $status_var_value = 1 +--let $status_timeout = 30 +--source include/wait_for_status_var.inc +show status like 'Slave_received_heartbeats'; + + +--echo # +--echo # Slave_open_temp_tables should be global +--echo # + +set default_master_connection = ''; +start slave; +--source include/wait_for_slave_to_start.inc + +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) +set binlog_format = statement; +create temporary table tmp1 (i int) engine=MyISAM; +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' +show status like 'Slave_open_temp_tables'; + +set default_master_connection = 'master1'; +show status like 'Slave_open_temp_tables'; + +--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2) +set binlog_format = statement; +create temporary table tmp1 (i int) engine=MyISAM; +--save_master_pos + +--connection slave +--sync_with_master 0,'' +show status like 'Slave_open_temp_tables'; + +set default_master_connection = ''; +show status like 'Slave_open_temp_tables'; + + +# Cleanup + +--source reset_master_slave.inc +--disconnect slave +--connection master1 +--source reset_master_slave.inc +--disconnect master1 +--connection master2 +--source reset_master_slave.inc +--disconnect master2 + + diff --git a/mysql-test/suite/multi_source/syntax.result b/mysql-test/suite/multi_source/syntax.result new file mode 100644 index 00000000000..3d91bfea753 --- /dev/null +++ b/mysql-test/suite/multi_source/syntax.result @@ -0,0 +1,87 @@ +include/master-slave.inc +[connection master] +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath +show slave '' status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath +show all slaves status; +Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period +# +# Check error handling +# +show slave 'qqq' status; +ERROR HY000: There is no master connection 'qqq' +show slave 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' status; +ERROR HY000: There is no master connection 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' +show slave 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' status; +ERROR HY000: Incorrect arguments to MASTER_CONNECTION_NAME +change master 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' to master_host='dummy'; +ERROR HY000: Incorrect arguments to MASTER_CONNECTION_NAME +start slave 'qqq'; +ERROR HY000: There is no master connection 'qqq' +stop slave 'qqq'; +ERROR HY000: There is no master connection 'qqq' +slave 'qqq' start; +ERROR HY000: There is no master connection 'qqq' +slave 'qqq' stop; +ERROR HY000: There is no master connection 'qqq' +flush slave 'qqq'; +ERROR HY000: There is no master connection 'qqq' +reset slave 'qqq'; +ERROR HY000: There is no master connection 'qqq' +select master_pos_wait('master-bin.999999',0,2,'qqq'); +master_pos_wait('master-bin.999999',0,2,'qqq') +NULL +Warnings: +Warning 1617 There is no master connection 'qqq' +select master_pos_wait('master-bin.999999',0,2,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'); +master_pos_wait('master-bin.999999',0,2,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc') +NULL +Warnings: +Warning 1210 Incorrect arguments to MASTER_CONNECTION_NAME +# +# checking usage of default_master_connection; +# +select @@default_master_connection; +@@default_master_connection + +select @@global.default_master_connection; +ERROR HY000: Variable 'default_master_connection' is a SESSION variable +set @@global.default_master_connection='qqq'; +ERROR HY000: Variable 'default_master_connection' is a SESSION variable and can't be used with SET GLOBAL +set @@default_master_connection='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'; +ERROR 42000: Variable 'default_master_connection' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' +select @@default_master_connection; +@@default_master_connection + +set @@default_master_connection='qqq'; +select @@default_master_connection; +@@default_master_connection +qqq +show variables like "default_master_connection"; +Variable_name Value +default_master_connection qqq +show slave status; +ERROR HY000: There is no master connection 'qqq' +select master_pos_wait('master-bin.999999',0,2); +master_pos_wait('master-bin.999999',0,2) +NULL +Warnings: +Warning 1617 There is no master connection 'qqq' +set @@default_master_connection=''; +select master_pos_wait('master-bin.999999',0,2); +master_pos_wait('master-bin.999999',0,2) +-1 +set @@default_master_connection=''; +# +# checking variables +# +show status like "Slave_running"; +Variable_name Value +Slave_running ON +set @@default_master_connection='qqq'; +show status like "Slave_running"; +Variable_name Value +Slave_running +set @@default_master_connection=''; +include/rpl_end.inc diff --git a/mysql-test/suite/multi_source/syntax.test b/mysql-test/suite/multi_source/syntax.test new file mode 100644 index 00000000000..ae493200bf1 --- /dev/null +++ b/mysql-test/suite/multi_source/syntax.test @@ -0,0 +1,79 @@ +# Test multi master syntax + +--source include/not_embedded.inc +--source include/master-slave.inc + +# Check syntax of multi source replication + +show slave status; +show slave '' status; +show all slaves status; + +--echo # +--echo # Check error handling +--echo # + +--error WARN_NO_MASTER_INFO +show slave 'qqq' status; +--error WARN_NO_MASTER_INFO +show slave 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' status; +--error ER_WRONG_ARGUMENTS +show slave 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' status; +--error ER_WRONG_ARGUMENTS +change master 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' to master_host='dummy'; + +--error WARN_NO_MASTER_INFO +start slave 'qqq'; +--error WARN_NO_MASTER_INFO +stop slave 'qqq'; +--error WARN_NO_MASTER_INFO +slave 'qqq' start; +--error WARN_NO_MASTER_INFO +slave 'qqq' stop; +--error WARN_NO_MASTER_INFO +flush slave 'qqq'; +--error WARN_NO_MASTER_INFO +reset slave 'qqq'; + +select master_pos_wait('master-bin.999999',0,2,'qqq'); +select master_pos_wait('master-bin.999999',0,2,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'); + +save_master_pos; +connection slave; +sync_with_master 0,''; +sync_with_master 0 ,''; +sync_with_master 0, ''; + +--echo # +--echo # checking usage of default_master_connection; +--echo # +select @@default_master_connection; + +--error 1238 +select @@global.default_master_connection; +--error 1228 +set @@global.default_master_connection='qqq'; +--error 1231 +set @@default_master_connection='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'; +select @@default_master_connection; +set @@default_master_connection='qqq'; +select @@default_master_connection; +show variables like "default_master_connection"; + +--error WARN_NO_MASTER_INFO +show slave status; +select master_pos_wait('master-bin.999999',0,2); +set @@default_master_connection=''; +select master_pos_wait('master-bin.999999',0,2); + +set @@default_master_connection=''; + +--echo # +--echo # checking variables +--echo # +show status like "Slave_running"; +set @@default_master_connection='qqq'; +show status like "Slave_running"; +set @@default_master_connection=''; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc b/mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc new file mode 100644 index 00000000000..ec5ecd0cb17 --- /dev/null +++ b/mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc @@ -0,0 +1,6 @@ +--let $show_statement = show all slaves status +--let $field = Slave_SQL_State +--let $condition = = 'Slave has read all relay log; waiting for the slave I/O thread to update it' +--let $wait_for_all = 1 +--source include/wait_show_condition.inc + diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result index 3c19a37c95d..505dd587d0b 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result +++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result @@ -38,7 +38,11 @@ c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 INSERT IGNORE INTO t1(c1,c2) VALUES('20070525','20070527') /* doesnt throw error */; +Warnings: +Warning 1062 Duplicate entry '2007-05-25 00:00:00' for key 'PRIMARY' INSERT IGNORE INTO t1(c1,c2) VALUES(19840905,830907) /* doesnt throw error */; +Warnings: +Warning 1062 Duplicate entry '1983-09-07 00:00:00' for key 'c2' SELECT * FROM t1 WHERE c1='20070527' /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t1(c1) VALUES('20070525') ON DUPLICATE KEY UPDATE c1='20070527'; diff --git a/mysql-test/suite/perfschema/disabled.def b/mysql-test/suite/perfschema/disabled.def index 065e13d374a..a72014a652b 100644 --- a/mysql-test/suite/perfschema/disabled.def +++ b/mysql-test/suite/perfschema/disabled.def @@ -9,7 +9,6 @@ # Do not use any TAB characters for whitespace. # ############################################################################## - ddl_host_cache: dml_host_cache: hostcache_ipv4_addrinfo_again_allow: diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result index f7d9d7116c0..dcc62e0d5c4 100644 --- a/mysql-test/suite/perfschema/r/digest_table_full.result +++ b/mysql-test/suite/perfschema/r/digest_table_full.result @@ -76,7 +76,7 @@ SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS, SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest; DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS NULL NULL 29 21 1 2 -05a0fd27e76f6e38420b5dcae970c1d1 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 +b94bc8f50c92e01784d3148b3d2086c8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 SHOW VARIABLES LIKE "performance_schema_digests_size"; Variable_name Value performance_schema_digests_size 2 diff --git a/mysql-test/suite/perfschema/r/func_file_io.result b/mysql-test/suite/perfschema/r/func_file_io.result index b66ab0b4eaa..2b39c4c1ab9 100644 --- a/mysql-test/suite/perfschema/r/func_file_io.result +++ b/mysql-test/suite/perfschema/r/func_file_io.result @@ -17,6 +17,9 @@ SET @before_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD')); +SELECT (@before_count >= 0) as have_before_count; +have_before_count +1 SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation; has_instrumentation Success @@ -29,6 +32,9 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1)); +SELECT (@after_count >= 0) as have_after_count; +have_after_count +1 SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed; test_ff1_timed Success @@ -37,6 +43,9 @@ SET @before_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2)); +SELECT (@before_count >= 0) as have_before_count; +have_before_count +1 SELECT * FROM t1 WHERE id < 6; id b 1 initial value @@ -48,6 +57,9 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3)); +SELECT (@after_count >= 0) as have_after_count; +have_after_count +1 SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed; test_ff2_timed Success diff --git a/mysql-test/suite/perfschema/r/nesting.result b/mysql-test/suite/perfschema/r/nesting.result index 0414b5d0fc1..a7b26b34776 100644 --- a/mysql-test/suite/perfschema/r/nesting.result +++ b/mysql-test/suite/perfschema/r/nesting.result @@ -106,7 +106,7 @@ and (end_event_id <= @marker_end) ) all_events order by relative_event_id asc; relative_event_id relative_end_event_id event_name comment nesting_event_type relative_nesting_event_id -0 17 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL +0 19 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL 1 5 stage/sql/init (stage) STATEMENT 0 2 2 wait/io/socket/sql/client_connection recv STAGE 1 3 3 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1 @@ -116,116 +116,130 @@ relative_event_id relative_end_event_id event_name comment nesting_event_type re 7 7 stage/sql/Opening tables (stage) STATEMENT 0 8 8 stage/sql/init (stage) STATEMENT 0 9 9 stage/sql/optimizing (stage) STATEMENT 0 -10 10 stage/sql/executing (stage) STATEMENT 0 -11 11 stage/sql/end (stage) STATEMENT 0 -12 12 stage/sql/query end (stage) STATEMENT 0 -13 13 stage/sql/closing tables (stage) STATEMENT 0 -14 15 stage/sql/freeing items (stage) STATEMENT 0 -15 15 wait/io/socket/sql/client_connection send STAGE 14 -16 17 stage/sql/cleaning up (stage) STATEMENT 0 -17 17 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 16 -18 18 idle idle NULL NULL -19 36 statement/sql/select select "This is simple statement one" as payload NULL NULL -20 24 stage/sql/init (stage) STATEMENT 19 -21 21 wait/io/socket/sql/client_connection recv STAGE 20 -22 22 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 20 -23 23 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 20 -24 24 wait/io/file/sql/query_log write STAGE 20 -25 25 stage/sql/checking permissions (stage) STATEMENT 19 -26 26 stage/sql/Opening tables (stage) STATEMENT 19 -27 27 stage/sql/init (stage) STATEMENT 19 -28 28 stage/sql/optimizing (stage) STATEMENT 19 -29 29 stage/sql/executing (stage) STATEMENT 19 -30 30 stage/sql/end (stage) STATEMENT 19 -31 31 stage/sql/query end (stage) STATEMENT 19 -32 32 stage/sql/closing tables (stage) STATEMENT 19 -33 34 stage/sql/freeing items (stage) STATEMENT 19 -34 34 wait/io/socket/sql/client_connection send STAGE 33 -35 36 stage/sql/cleaning up (stage) STATEMENT 19 -36 36 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 35 -37 37 idle idle NULL NULL -38 55 statement/sql/select select "This is simple statement two" as payload NULL NULL -39 43 stage/sql/init (stage) STATEMENT 38 -40 40 wait/io/socket/sql/client_connection recv STAGE 39 -41 41 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 39 -42 42 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 39 -43 43 wait/io/file/sql/query_log write STAGE 39 -44 44 stage/sql/checking permissions (stage) STATEMENT 38 -45 45 stage/sql/Opening tables (stage) STATEMENT 38 -46 46 stage/sql/init (stage) STATEMENT 38 -47 47 stage/sql/optimizing (stage) STATEMENT 38 -48 48 stage/sql/executing (stage) STATEMENT 38 -49 49 stage/sql/end (stage) STATEMENT 38 -50 50 stage/sql/query end (stage) STATEMENT 38 -51 51 stage/sql/closing tables (stage) STATEMENT 38 -52 53 stage/sql/freeing items (stage) STATEMENT 38 -53 53 wait/io/socket/sql/client_connection send STAGE 52 -54 55 stage/sql/cleaning up (stage) STATEMENT 38 -55 55 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 54 -56 56 idle idle NULL NULL -57 72 statement/sql/select select "This is the first part of a multi query" as payload; +10 12 stage/sql/executing (stage) STATEMENT 0 +11 11 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 10 +12 12 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 10 +13 13 stage/sql/end (stage) STATEMENT 0 +14 14 stage/sql/query end (stage) STATEMENT 0 +15 15 stage/sql/closing tables (stage) STATEMENT 0 +16 16 stage/sql/freeing items (stage) STATEMENT 0 +17 17 wait/io/socket/sql/client_connection send STATEMENT 0 +18 19 stage/sql/cleaning up (stage) STATEMENT 0 +19 19 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 18 +20 20 idle idle NULL NULL +21 40 statement/sql/select select "This is simple statement one" as payload NULL NULL +22 26 stage/sql/init (stage) STATEMENT 21 +23 23 wait/io/socket/sql/client_connection recv STAGE 22 +24 24 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 22 +25 25 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 22 +26 26 wait/io/file/sql/query_log write STAGE 22 +27 27 stage/sql/checking permissions (stage) STATEMENT 21 +28 28 stage/sql/Opening tables (stage) STATEMENT 21 +29 29 stage/sql/init (stage) STATEMENT 21 +30 30 stage/sql/optimizing (stage) STATEMENT 21 +31 33 stage/sql/executing (stage) STATEMENT 21 +32 32 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 31 +33 33 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 31 +34 34 stage/sql/end (stage) STATEMENT 21 +35 35 stage/sql/query end (stage) STATEMENT 21 +36 36 stage/sql/closing tables (stage) STATEMENT 21 +37 37 stage/sql/freeing items (stage) STATEMENT 21 +38 38 wait/io/socket/sql/client_connection send STATEMENT 21 +39 40 stage/sql/cleaning up (stage) STATEMENT 21 +40 40 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 39 +41 41 idle idle NULL NULL +42 61 statement/sql/select select "This is simple statement two" as payload NULL NULL +43 47 stage/sql/init (stage) STATEMENT 42 +44 44 wait/io/socket/sql/client_connection recv STAGE 43 +45 45 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 43 +46 46 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 43 +47 47 wait/io/file/sql/query_log write STAGE 43 +48 48 stage/sql/checking permissions (stage) STATEMENT 42 +49 49 stage/sql/Opening tables (stage) STATEMENT 42 +50 50 stage/sql/init (stage) STATEMENT 42 +51 51 stage/sql/optimizing (stage) STATEMENT 42 +52 54 stage/sql/executing (stage) STATEMENT 42 +53 53 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 52 +54 54 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 52 +55 55 stage/sql/end (stage) STATEMENT 42 +56 56 stage/sql/query end (stage) STATEMENT 42 +57 57 stage/sql/closing tables (stage) STATEMENT 42 +58 58 stage/sql/freeing items (stage) STATEMENT 42 +59 59 wait/io/socket/sql/client_connection send STATEMENT 42 +60 61 stage/sql/cleaning up (stage) STATEMENT 42 +61 61 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 60 +62 62 idle idle NULL NULL +63 80 statement/sql/select select "This is the first part of a multi query" as payload; select "And this is the second part of a multi query" as payload; select "With a third part to make things complete" as payload NULL NULL -58 62 stage/sql/init (stage) STATEMENT 57 -59 59 wait/io/socket/sql/client_connection recv STAGE 58 -60 60 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 58 -61 61 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 58 -62 62 wait/io/file/sql/query_log write STAGE 58 -63 63 stage/sql/checking permissions (stage) STATEMENT 57 -64 64 stage/sql/Opening tables (stage) STATEMENT 57 -65 65 stage/sql/init (stage) STATEMENT 57 -66 66 stage/sql/optimizing (stage) STATEMENT 57 -67 67 stage/sql/executing (stage) STATEMENT 57 -68 68 stage/sql/end (stage) STATEMENT 57 -69 69 stage/sql/query end (stage) STATEMENT 57 -70 70 stage/sql/closing tables (stage) STATEMENT 57 -71 72 stage/sql/freeing items (stage) STATEMENT 57 -72 72 wait/io/socket/sql/client_connection send STAGE 71 -73 85 statement/sql/select select "And this is the second part of a multi query" as payload; +64 68 stage/sql/init (stage) STATEMENT 63 +65 65 wait/io/socket/sql/client_connection recv STAGE 64 +66 66 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 64 +67 67 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 64 +68 68 wait/io/file/sql/query_log write STAGE 64 +69 69 stage/sql/checking permissions (stage) STATEMENT 63 +70 70 stage/sql/Opening tables (stage) STATEMENT 63 +71 71 stage/sql/init (stage) STATEMENT 63 +72 72 stage/sql/optimizing (stage) STATEMENT 63 +73 75 stage/sql/executing (stage) STATEMENT 63 +74 74 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73 +75 75 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73 +76 76 stage/sql/end (stage) STATEMENT 63 +77 77 stage/sql/query end (stage) STATEMENT 63 +78 78 stage/sql/closing tables (stage) STATEMENT 63 +79 80 stage/sql/freeing items (stage) STATEMENT 63 +80 80 wait/io/socket/sql/client_connection send STAGE 79 +81 95 statement/sql/select select "And this is the second part of a multi query" as payload; select "With a third part to make things complete" as payload NULL NULL -74 75 stage/sql/init (stage) STATEMENT 73 -75 75 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 74 -76 76 stage/sql/checking permissions (stage) STATEMENT 73 -77 77 stage/sql/Opening tables (stage) STATEMENT 73 -78 78 stage/sql/init (stage) STATEMENT 73 -79 79 stage/sql/optimizing (stage) STATEMENT 73 -80 80 stage/sql/executing (stage) STATEMENT 73 -81 81 stage/sql/end (stage) STATEMENT 73 -82 82 stage/sql/query end (stage) STATEMENT 73 -83 83 stage/sql/closing tables (stage) STATEMENT 73 -84 85 stage/sql/freeing items (stage) STATEMENT 73 -85 85 wait/io/socket/sql/client_connection send STAGE 84 -86 100 statement/sql/select select "With a third part to make things complete" as payload NULL NULL -87 88 stage/sql/init (stage) STATEMENT 86 -88 88 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 87 -89 89 stage/sql/checking permissions (stage) STATEMENT 86 -90 90 stage/sql/Opening tables (stage) STATEMENT 86 -91 91 stage/sql/init (stage) STATEMENT 86 -92 92 stage/sql/optimizing (stage) STATEMENT 86 -93 93 stage/sql/executing (stage) STATEMENT 86 -94 94 stage/sql/end (stage) STATEMENT 86 -95 95 stage/sql/query end (stage) STATEMENT 86 -96 96 stage/sql/closing tables (stage) STATEMENT 86 -97 98 stage/sql/freeing items (stage) STATEMENT 86 -98 98 wait/io/socket/sql/client_connection send STAGE 97 -99 100 stage/sql/cleaning up (stage) STATEMENT 86 -100 100 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 99 -101 101 idle idle NULL NULL -102 119 statement/sql/select select "MARKER_END" as marker NULL NULL -103 107 stage/sql/init (stage) STATEMENT 102 -104 104 wait/io/socket/sql/client_connection recv STAGE 103 +82 83 stage/sql/init (stage) STATEMENT 81 +83 83 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 82 +84 84 stage/sql/checking permissions (stage) STATEMENT 81 +85 85 stage/sql/Opening tables (stage) STATEMENT 81 +86 86 stage/sql/init (stage) STATEMENT 81 +87 87 stage/sql/optimizing (stage) STATEMENT 81 +88 90 stage/sql/executing (stage) STATEMENT 81 +89 89 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 88 +90 90 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 88 +91 91 stage/sql/end (stage) STATEMENT 81 +92 92 stage/sql/query end (stage) STATEMENT 81 +93 93 stage/sql/closing tables (stage) STATEMENT 81 +94 95 stage/sql/freeing items (stage) STATEMENT 81 +95 95 wait/io/socket/sql/client_connection send STAGE 94 +96 112 statement/sql/select select "With a third part to make things complete" as payload NULL NULL +97 98 stage/sql/init (stage) STATEMENT 96 +98 98 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 97 +99 99 stage/sql/checking permissions (stage) STATEMENT 96 +100 100 stage/sql/Opening tables (stage) STATEMENT 96 +101 101 stage/sql/init (stage) STATEMENT 96 +102 102 stage/sql/optimizing (stage) STATEMENT 96 +103 105 stage/sql/executing (stage) STATEMENT 96 +104 104 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 103 105 105 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 103 -106 106 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 103 -107 107 wait/io/file/sql/query_log write STAGE 103 -108 108 stage/sql/checking permissions (stage) STATEMENT 102 -109 109 stage/sql/Opening tables (stage) STATEMENT 102 -110 110 stage/sql/init (stage) STATEMENT 102 -111 111 stage/sql/optimizing (stage) STATEMENT 102 -112 112 stage/sql/executing (stage) STATEMENT 102 -113 113 stage/sql/end (stage) STATEMENT 102 -114 114 stage/sql/query end (stage) STATEMENT 102 -115 115 stage/sql/closing tables (stage) STATEMENT 102 -116 117 stage/sql/freeing items (stage) STATEMENT 102 -117 117 wait/io/socket/sql/client_connection send STAGE 116 -118 119 stage/sql/cleaning up (stage) STATEMENT 102 -119 119 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 118 +106 106 stage/sql/end (stage) STATEMENT 96 +107 107 stage/sql/query end (stage) STATEMENT 96 +108 108 stage/sql/closing tables (stage) STATEMENT 96 +109 109 stage/sql/freeing items (stage) STATEMENT 96 +110 110 wait/io/socket/sql/client_connection send STATEMENT 96 +111 112 stage/sql/cleaning up (stage) STATEMENT 96 +112 112 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 111 +113 113 idle idle NULL NULL +114 133 statement/sql/select select "MARKER_END" as marker NULL NULL +115 119 stage/sql/init (stage) STATEMENT 114 +116 116 wait/io/socket/sql/client_connection recv STAGE 115 +117 117 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 115 +118 118 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 115 +119 119 wait/io/file/sql/query_log write STAGE 115 +120 120 stage/sql/checking permissions (stage) STATEMENT 114 +121 121 stage/sql/Opening tables (stage) STATEMENT 114 +122 122 stage/sql/init (stage) STATEMENT 114 +123 123 stage/sql/optimizing (stage) STATEMENT 114 +124 126 stage/sql/executing (stage) STATEMENT 114 +125 125 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 124 +126 126 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 124 +127 127 stage/sql/end (stage) STATEMENT 114 +128 128 stage/sql/query end (stage) STATEMENT 114 +129 129 stage/sql/closing tables (stage) STATEMENT 114 +130 130 stage/sql/freeing items (stage) STATEMENT 114 +131 131 wait/io/socket/sql/client_connection send STATEMENT 114 +132 133 stage/sql/cleaning up (stage) STATEMENT 114 +133 133 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 132 diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result index d4ba3477c7c..6a4fde4287a 100644 --- a/mysql-test/suite/perfschema/r/ortho_iter.result +++ b/mysql-test/suite/perfschema/r/ortho_iter.result @@ -115,7 +115,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result index 9dda2e321de..92c5d36ed9f 100644 --- a/mysql-test/suite/perfschema/r/privilege_table_io.result +++ b/mysql-test/suite/perfschema/r/privilege_table_io.result @@ -40,7 +40,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result index 9496dcc5aee..8786cd055ca 100644 --- a/mysql-test/suite/perfschema/r/query_cache.result +++ b/mysql-test/suite/perfschema/r/query_cache.result @@ -36,9 +36,9 @@ Qcache_hits 1 select spins from performance_schema.events_waits_current order by event_name limit 1; spins NULL -select name from performance_schema.setup_instruments order by name limit 1; -name -idle +select * from performance_schema.setup_timers where name='wait'; +NAME TIMER_NAME +wait CYCLE show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 @@ -51,9 +51,9 @@ Qcache_hits 1 select spins from performance_schema.events_waits_current order by event_name limit 1; spins NULL -select name from performance_schema.setup_instruments order by name limit 1; -name -idle +select * from performance_schema.setup_timers where name='wait'; +NAME TIMER_NAME +wait CYCLE show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result index c276507820a..8e4039c00c6 100644 --- a/mysql-test/suite/perfschema/r/relaylog.result +++ b/mysql-test/suite/perfschema/r/relaylog.result @@ -56,10 +56,10 @@ where event_name like "%MYSQL_BIN_LOG%" and event_name not like "%MYSQL_BIN_LOG::update_cond" order by event_name; EVENT_NAME COUNT_STAR -wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_xid_list NONE wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY -wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xid_list MANY "Expect no slave relay log" select * from performance_schema.file_summary_by_instance where event_name like "%relaylog%" order by file_name; @@ -131,10 +131,10 @@ where event_name like "%MYSQL_BIN_LOG%" and event_name not like "%MYSQL_BIN_LOG::update_cond" order by event_name; EVENT_NAME COUNT_STAR -wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_xid_list NONE wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY -wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xid_list MANY "Expect a slave relay log" select substring(file_name, locate("slave-", file_name)) as FILE_NAME, diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result index 64648a79330..48501d2ae26 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result index 905e27f1347..f03b7b27546 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result index 512fa6fe462..46ddeb32c08 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result index d9150ec9ac7..00d98b6af78 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result index 13b6406250a..da836c0f933 100644 --- a/mysql-test/suite/perfschema/r/start_server_innodb.result +++ b/mysql-test/suite/perfschema/r/start_server_innodb.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result index cda9ca9722c..201df2c98bd 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_account.result +++ b/mysql-test/suite/perfschema/r/start_server_no_account.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result index 689c9ec94c0..e8ee3d0e429 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result index 3cc5dba7376..5bc02d14e7e 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result index 27c76d3ede1..64d99d2109a 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result index c1b3c14058d..388ab1796b6 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result index 51e693b53b4..b09adcfe953 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_host.result +++ b/mysql-test/suite/perfschema/r/start_server_no_host.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result index 79131abc2e5..e4264ad0554 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result index 0756da7589c..4a642fda1e1 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result index a89f7a0ad1a..79636014743 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result index 5399344f675..88003d2978c 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 0 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result index 38d5eb3cd81..47b5c326703 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result +++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result index 489884a179e..66adafb7dd5 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result +++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result index d114de58c3e..612cc625132 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 0 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result index eed4a67f74d..981b322041c 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 0 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result index 8ec63865763..172f3e87d13 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 0 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result index 1633a413ae9..8f3bd08a5de 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result index 2218358dfad..1cd07ad93a6 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result index 423b7c07af0..d2d0bd012c7 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result index 162036c67b6..16eb55d80e4 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result index 5f7bb2b7728..23248e97911 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 0 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result index b3ba8940d46..4cfe58e360a 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 0 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result index 03e3823c6d7..98cc88ec36a 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result index db3ce741da7..dd22fb22773 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result index f04cbe1358f..de1f2dc0b6f 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_user.result +++ b/mysql-test/suite/perfschema/r/start_server_no_user.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result index 3781f25d8f1..36a8307de13 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result index 524c8b12872..5954fe64333 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result index 030448ecaa5..ad019bbc650 100644 --- a/mysql-test/suite/perfschema/r/start_server_off.result +++ b/mysql-test/suite/perfschema/r/start_server_off.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result index 13b6406250a..da836c0f933 100644 --- a/mysql-test/suite/perfschema/r/start_server_on.result +++ b/mysql-test/suite/perfschema/r/start_server_on.result @@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/statement_digest.result b/mysql-test/suite/perfschema/r/statement_digest.result index c6ffea69148..00476d957f6 100644 --- a/mysql-test/suite/perfschema/r/statement_digest.result +++ b/mysql-test/suite/perfschema/r/statement_digest.result @@ -75,28 +75,28 @@ Warning 1265 Data truncated for column 'c' at row 1 SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS, SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest; DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS -05a0fd27e76f6e38420b5dcae970c1d1 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 -cc0d093a57fbe1694ee003da61a18f50 SELECT ? FROM t1 1 0 0 0 -0bf450b7940cf3dd7fc720fdd6281d77 SELECT ? FROM `t1` 1 0 0 0 -3ea6d9e2c71e6fe84643d647f257ef22 SELECT ?, ... FROM t1 2 0 0 0 -e9d6214db9270d8e3b12694483a7ece0 SELECT ? FROM t2 1 0 0 0 -8bfd768d8ce6c88ca3ace9e9eaf74fad SELECT ?, ... FROM t2 2 0 0 0 -49358f164df227c622fa9438e17c5a45 INSERT INTO t1 VALUES (?) 1 1 0 0 -b5777ff47c7e7d37c738c3bbc99a5f50 INSERT INTO t2 VALUES (?) 1 1 0 0 -b8f5b0056d36e62b060d605227e26bfb INSERT INTO t3 VALUES (...) 1 1 0 0 -835ec262d10fbedce1e31c397bdae877 INSERT INTO t4 VALUES (...) 1 1 0 0 -c0cfc65392e6ea3d51708967b0795f09 INSERT INTO t5 VALUES (...) 1 1 0 0 -3e743e4d942c7b76fccddbf15211367e INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0 -6048c5411fb3037b4db7a24eed82b83c INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0 -2312fd042d1232cd30e4172c69b0b2e4 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0 -33ebf25ca2afeea44fd5390801df4a0a SELECT ? + ? 3 0 0 0 -eb4368e66ef2ee0713b22abe1b94b5e7 SELECT ? 1 0 0 0 +b94bc8f50c92e01784d3148b3d2086c8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 +ea6492426a33544a059bc12766c5ba3d SELECT ? FROM t1 1 0 0 0 +692668ddf608983c586aef1c575ee9c6 SELECT ? FROM `t1` 1 0 0 0 +f630f3ea22832be48798c5e51bb88189 SELECT ?, ... FROM t1 2 0 0 0 +a98062477bd693dacfc0df96c68c5585 SELECT ? FROM t2 1 0 0 0 +12cd65a2242b7643f9ad4418c389677a SELECT ?, ... FROM t2 2 0 0 0 +32d8fa3c3ed3b6c26ac792495188f4a4 INSERT INTO t1 VALUES (?) 1 1 0 0 +8bf0b320418673ba7d23f11f61bae318 INSERT INTO t2 VALUES (?) 1 1 0 0 +a411b3681f67af51cddca60a3d5c260f INSERT INTO t3 VALUES (...) 1 1 0 0 +23d0399fcd03fabcc9eeadb387121a44 INSERT INTO t4 VALUES (...) 1 1 0 0 +c0ec9a3fd081147370256fb6b64e2f67 INSERT INTO t5 VALUES (...) 1 1 0 0 +ba58da885d020e31d8c38b67e0f6da4c INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0 +9c272a31286b15643b38fecc33599eea INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0 +a7d009150c5da8b925776dea63ed77d7 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0 +b695dab1504c4e588a91af231b9c9e26 SELECT ? + ? 3 0 0 0 +a2635fa56a271bdf473419620249f7ef SELECT ? 1 0 0 0 bce3f7384ae2ab78354b031184fde12d CREATE SCHEMA statements_digest_temp 2 2 0 0 2a0e36afeaac85dc117c3856388a4fae DROP SCHEMA statements_digest_temp 2 0 0 0 -5a6f99b35d55cdcb4c9bd755ff6bed58 SELECT ? FROM t11 1 0 0 1 -88305d7ed153aeef764d4fb992f28034 CREATE TABLE t11 ( c CHARACTER (?) ) 2 0 0 1 -2a533c9f7e3b5d9dac18c4f8a0a49e53 INSERT INTO t11 VALUES (?) 1 1 1 0 -35c70a6aa7abc3da331ef84b3663534b SHOW WARNINGS 1 0 0 0 +bb607bee73d602560af915aa4514eac4 SELECT ? FROM t11 1 0 0 1 +4cd9bc5a9ed1ac12cd380187dab2921a CREATE TABLE t11 ( c CHARACTER (?) ) 2 0 0 1 +bd53dcd5e36e77d74df5358baf658cee INSERT INTO t11 VALUES (?) 1 1 1 0 +f62dd76b64fad47e6558f3d1b03ff215 SHOW WARNINGS 1 0 0 0 #################################### # CLEANUP #################################### diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers.result b/mysql-test/suite/perfschema/r/statement_digest_consumers.result index 70e5c98435a..722a9e4bf2b 100644 --- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result +++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result @@ -88,28 +88,28 @@ Warning 1265 Data truncated for column 'c' at row 1 #################################### SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest; digest digest_text count_star -05a0fd27e76f6e38420b5dcae970c1d1 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 -cc0d093a57fbe1694ee003da61a18f50 SELECT ? FROM t1 1 -0bf450b7940cf3dd7fc720fdd6281d77 SELECT ? FROM `t1` 1 -3ea6d9e2c71e6fe84643d647f257ef22 SELECT ?, ... FROM t1 2 -e9d6214db9270d8e3b12694483a7ece0 SELECT ? FROM t2 1 -8bfd768d8ce6c88ca3ace9e9eaf74fad SELECT ?, ... FROM t2 2 -49358f164df227c622fa9438e17c5a45 INSERT INTO t1 VALUES (?) 1 -b5777ff47c7e7d37c738c3bbc99a5f50 INSERT INTO t2 VALUES (?) 1 -b8f5b0056d36e62b060d605227e26bfb INSERT INTO t3 VALUES (...) 1 -835ec262d10fbedce1e31c397bdae877 INSERT INTO t4 VALUES (...) 1 -c0cfc65392e6ea3d51708967b0795f09 INSERT INTO t5 VALUES (...) 1 -3e743e4d942c7b76fccddbf15211367e INSERT INTO t1 VALUES (?) /* , ... */ 2 -6048c5411fb3037b4db7a24eed82b83c INSERT INTO t3 VALUES (...) /* , ... */ 1 -2312fd042d1232cd30e4172c69b0b2e4 INSERT INTO t5 VALUES (...) /* , ... */ 1 -33ebf25ca2afeea44fd5390801df4a0a SELECT ? + ? 3 -eb4368e66ef2ee0713b22abe1b94b5e7 SELECT ? 1 +b94bc8f50c92e01784d3148b3d2086c8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 +ea6492426a33544a059bc12766c5ba3d SELECT ? FROM t1 1 +692668ddf608983c586aef1c575ee9c6 SELECT ? FROM `t1` 1 +f630f3ea22832be48798c5e51bb88189 SELECT ?, ... FROM t1 2 +a98062477bd693dacfc0df96c68c5585 SELECT ? FROM t2 1 +12cd65a2242b7643f9ad4418c389677a SELECT ?, ... FROM t2 2 +32d8fa3c3ed3b6c26ac792495188f4a4 INSERT INTO t1 VALUES (?) 1 +8bf0b320418673ba7d23f11f61bae318 INSERT INTO t2 VALUES (?) 1 +a411b3681f67af51cddca60a3d5c260f INSERT INTO t3 VALUES (...) 1 +23d0399fcd03fabcc9eeadb387121a44 INSERT INTO t4 VALUES (...) 1 +c0ec9a3fd081147370256fb6b64e2f67 INSERT INTO t5 VALUES (...) 1 +ba58da885d020e31d8c38b67e0f6da4c INSERT INTO t1 VALUES (?) /* , ... */ 2 +9c272a31286b15643b38fecc33599eea INSERT INTO t3 VALUES (...) /* , ... */ 1 +a7d009150c5da8b925776dea63ed77d7 INSERT INTO t5 VALUES (...) /* , ... */ 1 +b695dab1504c4e588a91af231b9c9e26 SELECT ? + ? 3 +a2635fa56a271bdf473419620249f7ef SELECT ? 1 bce3f7384ae2ab78354b031184fde12d CREATE SCHEMA statements_digest_temp 2 2a0e36afeaac85dc117c3856388a4fae DROP SCHEMA statements_digest_temp 2 -5a6f99b35d55cdcb4c9bd755ff6bed58 SELECT ? FROM t11 1 -88305d7ed153aeef764d4fb992f28034 CREATE TABLE t11 ( c CHARACTER (?) ) 2 -2a533c9f7e3b5d9dac18c4f8a0a49e53 INSERT INTO t11 VALUES (?) 1 -35c70a6aa7abc3da331ef84b3663534b SHOW WARNINGS 1 +bb607bee73d602560af915aa4514eac4 SELECT ? FROM t11 1 +4cd9bc5a9ed1ac12cd380187dab2921a CREATE TABLE t11 ( c CHARACTER (?) ) 2 +bd53dcd5e36e77d74df5358baf658cee INSERT INTO t11 VALUES (?) 1 +f62dd76b64fad47e6558f3d1b03ff215 SHOW WARNINGS 1 SELECT digest, digest_text FROM performance_schema.events_statements_current; digest digest_text #################################### diff --git a/mysql-test/suite/perfschema/r/statement_digest_long_query.result b/mysql-test/suite/perfschema/r/statement_digest_long_query.result index 225977a62af..580bf1ef627 100644 --- a/mysql-test/suite/perfschema/r/statement_digest_long_query.result +++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result @@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1 #################################### SELECT digest, digest_text, count_star FROM events_statements_summary_by_digest; digest digest_text count_star -e56a507698736d9cf34a6b043f9e5ed8 TRUNCATE TABLE events_statements_summary_by_digest 1 -9eef21cb9bfa3ff9732c95e0ef47dbf1 SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1 +551139187583b3dff117e28b5935406c TRUNCATE TABLE events_statements_summary_by_digest 1 +6b577979631439bd015b7675abcd91fe SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result index 1952803291a..98f21895e81 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result index bd7ac2c995b..6d983b32bd3 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result index 3bfdf10401c..45935f943ff 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result index 6a31f6458d9..6feab956ef3 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result index c630dbc7dcb..50217f4fb32 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result @@ -61,7 +61,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result index bee77262317..47bd8f84455 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result @@ -60,7 +60,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result index 93320407993..26e86a12f24 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result @@ -61,7 +61,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result index d60641bf68f..67a80884008 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result @@ -60,7 +60,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result index cf7778b0c3e..8c2ff29c2ce 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_off.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result index 1cda3600046..31b43996de4 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result index 5f951adfb00..1379d07719a 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result index 6c3c14fe190..3001ad34e68 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result index 0ee9d266a59..feed7c53c93 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result index 6703860caa3..dac12573832 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result index e918764c34c..1f3e0fb9ef1 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result index c7ea909d1b2..ee7958082f6 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result index 5f6c7dff212..ee04ee712f0 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result index 8c003f5e7bc..9c1fbf6d557 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result index 79cae48d78a..d537088ddfd 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result index 52f5878c3ea..217cbced878 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result index 3957481897e..f25669430a0 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result index 791786246dd..681a9019281 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result index da16a14a51f..a852647f566 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result index 5ab36b8f109..caedc66d8a7 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result index 2393d357c93..1b860c73ae6 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result index 73bbe77bc1b..df500a28e44 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result index 9e7427f57f4..4afca2b1133 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result index 06e910c777b..86cd1d5efe6 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result index 0d7bca40fbb..fd4d0ef1b93 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result index fd8d845c0be..3d54f3822ec 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result index 9b4fe6d14ab..7df9f026f85 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result index f6ee9067ab3..34a7864fce1 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result index a6d042bcd4a..051df916023 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result index f41524bde4a..4f4de1d0416 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result index d227366563a..c79f6134e0a 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result index fd780e3204c..777a169c194 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result index 4acefcaa5b1..ad08341c159 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 170 +performance_schema_max_statement_classes 173 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-test/suite/perfschema/t/func_file_io.test index a20929481c5..25e84292c97 100644 --- a/mysql-test/suite/perfschema/t/func_file_io.test +++ b/mysql-test/suite/perfschema/t/func_file_io.test @@ -44,6 +44,7 @@ SET @before_count = (SELECT SUM(TIMER_WAIT) WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD')); +SELECT (@before_count >= 0) as have_before_count; SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation; SELECT * FROM t1 WHERE id < 4; @@ -53,6 +54,7 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1)); +SELECT (@after_count >= 0) as have_after_count; SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed; UPDATE performance_schema.setup_instruments SET enabled='NO'; @@ -62,6 +64,7 @@ SET @before_count = (SELECT SUM(TIMER_WAIT) WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2)); +SELECT (@before_count >= 0) as have_before_count; SELECT * FROM t1 WHERE id < 6; SET @after_count = (SELECT SUM(TIMER_WAIT) @@ -69,6 +72,7 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3)); +SELECT (@after_count >= 0) as have_after_count; SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed; # diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test index 8c9e5fcd0ed..60d4a648222 100644 --- a/mysql-test/suite/perfschema/t/query_cache.test +++ b/mysql-test/suite/perfschema/t/query_cache.test @@ -34,7 +34,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; -select name from performance_schema.setup_instruments order by name limit 1; +select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; @@ -42,7 +42,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; -select name from performance_schema.setup_instruments order by name limit 1; +select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; diff --git a/mysql-test/suite/plugins/t/feedback_plugin_send.test b/mysql-test/suite/plugins/t/feedback_plugin_send.test index 3324ef469fe..45b507f8e78 100644 --- a/mysql-test/suite/plugins/t/feedback_plugin_send.test +++ b/mysql-test/suite/plugins/t/feedback_plugin_send.test @@ -1,3 +1,6 @@ +# Restart of server does not work for embedded. +--source include/not_embedded.inc + source feedback_plugin_load.test; if (!$MTR_FEEDBACK_PLUGIN) { diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result index 8b41a01cb6e..41bacd78f52 100644 --- a/mysql-test/suite/rpl/r/rpl_auto_increment.result +++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result @@ -125,6 +125,10 @@ insert into t1 values(600),(NULL),(NULL); ERROR 23000: Duplicate entry '600' for key 'PRIMARY' set @@insert_id=600; insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL); +Warnings: +Warning 1062 Duplicate entry '600' for key 'PRIMARY' +Warning 1062 Duplicate entry '600' for key 'PRIMARY' +Warning 1062 Duplicate entry '600' for key 'PRIMARY' select * from t1; a 1 @@ -186,7 +190,7 @@ set auto_increment_offset=4; insert into t1 values(null); insert into t1 values(null); insert into t1 values(null); -ERROR 23000: Duplicate entry '125' for key 'PRIMARY' +ERROR 22003: Out of range value for column 'a' at row 1 select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a; a mod(a-@@auto_increment_offset,@@auto_increment_increment) 103 0 @@ -196,21 +200,19 @@ create table t2 (a tinyint unsigned not null auto_increment primary key) engine= set auto_increment_increment=10; set auto_increment_offset=1; set insert_id=1000; +insert into t2 values(10); insert into t2 values(null); -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +ERROR 22003: Out of range value for column 'a' at row 1 select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a; a mod(a-@@auto_increment_offset,@@auto_increment_increment) -251 0 +10 9 create table t3 like t1; set auto_increment_increment=1000; set auto_increment_offset=700; insert into t3 values(null); -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +ERROR 22003: Out of range value for column 'a' at row 1 select * from t3 order by a; a -127 select * from t1 order by a; a 103 @@ -218,10 +220,9 @@ a 125 select * from t2 order by a; a -251 +10 select * from t3 order by a; a -127 drop table t1,t2,t3; set auto_increment_increment=1; set auto_increment_offset=1; diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result index ba5cb1b1b2b..fb61f159c80 100644 --- a/mysql-test/suite/rpl/r/rpl_checksum.result +++ b/mysql-test/suite/rpl/r/rpl_checksum.result @@ -71,7 +71,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */; set @@global.debug_dbug='d,simulate_slave_unaware_checksum'; start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 245, the last event read from 'master-bin.000010' at 245, the last byte read from 'master-bin.000010' at 245.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 326, the last event read from 'master-bin.000010' at 246, the last byte read from 'master-bin.000010' at 246.'' select count(*) as zero from t1; zero 0 diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result index 37d209bbcf6..f2128f8d855 100644 --- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result @@ -76,6 +76,8 @@ include/check_slave_is_running.inc *** Test lock wait timeout and purged relay logs *** SET @my_max_relay_log_size= @@global.max_relay_log_size; SET global max_relay_log_size=0; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '0' include/stop_slave.inc DELETE FROM t2; CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>; diff --git a/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result index 321b8d912e6..eaa2ed9a61d 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result +++ b/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result @@ -1,9 +1,9 @@ include/master-slave.inc [connection master] SET @@GLOBAL.replicate_do_db="db1"; -ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first +ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first SET @@GLOBAL.replicate_ignore_db="db2"; -ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first +ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first include/stop_slave.inc SET @@GLOBAL.replicate_do_db="db1"; SET @@GLOBAL.replicate_ignore_db="db2"; diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result index 9eb803d17ea..3d03d36828a 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result @@ -1,9 +1,9 @@ include/master-slave.inc [connection master] SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3"; -ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first +ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6"; -ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first +ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first include/stop_slave.inc SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3"; SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6"; diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result index fcd03ea74b8..baf0cf81cec 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result @@ -114,22 +114,23 @@ id c 3 3 [on master] drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); +CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); CREATE TABLE test.t1 (a INT); INSERT INTO test.t1 VALUES(1); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); +CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW -INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c); +INSERT INTO test.t_slave VALUES(NULL, RAND(), @c); SET INSERT_ID=2; SET @c=2; SET @@rand_seed1=10000000, @@rand_seed2=1000000; -INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); +INSERT INTO t5 VALUES (NULL, RAND(), @c); SELECT b into @b FROM test.t5; UPDATE test.t1 SET a=2; SELECT a AS 'ONE' into @a FROM test.t_slave; SELECT c AS 'NULL' into @c FROM test.t_slave; SELECT b into @b FROM test.t_slave; +include/assert.inc [Random values from master and slave must be different] drop table test.t5; drop table test.t1; drop table test.t_slave; diff --git a/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result index 6858181234e..19d8e513e6f 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result +++ b/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result @@ -1,9 +1,9 @@ include/master-slave.inc [connection master] SET @@GLOBAL.replicate_wild_do_table="test.a%"; -ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first +ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first SET @@GLOBAL.replicate_wild_ignore_table="test.b%"; -ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first +ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first include/stop_slave.inc SET @@GLOBAL.replicate_wild_do_table="test.a%"; SET @@GLOBAL.replicate_wild_ignore_table="test.b%"; diff --git a/mysql-test/suite/rpl/r/rpl_flush_logs.result b/mysql-test/suite/rpl/r/rpl_flush_logs.result index 4fce91a7234..1f543cd9f43 100644 --- a/mysql-test/suite/rpl/r/rpl_flush_logs.result +++ b/mysql-test/suite/rpl/r/rpl_flush_logs.result @@ -8,7 +8,7 @@ flush error logs; # after execute 'flush error logs' statement. # Test if support 'flush relay logs' statement. flush relay logs; -# Check the 'slave-relay-bin.000003' file is created +# Check the 'slave-relay-bin.000003' file is not created # after executed 'flush relay logs' statement. # Make sure binary logs was not be flushed # after execute 'flush relay logs' statement. @@ -30,21 +30,21 @@ flush engine logs; flush binary logs; # Check the 'master-bin.000002' file is created # after executed 'flush binary logs' statement. -# Make sure the 'slave-relay-bin.000006' file does not exist +# Make sure the 'slave-relay-bin.000005' file does not exist # exist before execute 'flush error logs, relay logs' statement. # Test if support to combine all kinds of logs into one statement. flush error logs, relay logs; # Make sure binary logs was not be flushed # after execute 'flush error logs, relay logs' statement. -# Check the 'slave-relay-bin.000006' file is created after +# Check the 'slave-relay-bin.000004' file is created after # execute 'flush error logs, relay logs' statement. -# Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008' +# Make sure the 'slave-relay-bin.000005' and 'slave-relay-bin.000006' # files do not exist before execute 'flush error logs, relay logs' # statement. # Test if 'flush logs' statement works fine and flush all the logs. flush logs; # Check 'master-bin.000003' is created # after execute 'flush logs' statement. -# Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008' +# Check the 'slave-relay-bin.000005' and 'slave-relay-bin.000006' # files are created after execute 'flush logs' statement. include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result index d4bdb77ef0b..b0f36558d10 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result @@ -41,8 +41,6 @@ show status like 'Slave_heartbeat_period';; Variable_name Slave_heartbeat_period Value 4.000 set @@global.slave_net_timeout= 3 /* must be a warning */; -Warnings: -Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout. reset slave; drop table if exists t1; set @@global.slave_net_timeout= 10; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index cc9d1f99f7c..0c274165e1e 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -33,8 +33,6 @@ RESET SLAVE; *** Warning if updated slave_net_timeout < slave_heartbeat_timeout *** SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1; -Warnings: -Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout. SET @@global.slave_net_timeout=@restore_slave_net_timeout; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result index e4a825591bf..fbe4ba28409 100644 --- a/mysql-test/suite/rpl/r/rpl_hrtime.result +++ b/mysql-test/suite/rpl/r/rpl_hrtime.result @@ -30,7 +30,7 @@ include/rpl_end.inc /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1293832861/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff index 0c16e9d9bd7..801044d8fcd 100644 --- a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff +++ b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff @@ -1,5 +1,5 @@ ---- suite/rpl/r/rpl_insert_delayed.result 2012-02-06 21:37:21.000000000 +0100 -+++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2012-02-06 23:12:55.000000000 +0100 +--- suite/rpl/r/rpl_insert_delayed.result 2012-09-18 01:37:45.317521958 +0300 ++++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2012-09-18 01:36:16.637514667 +0300 @@ -15,17 +15,17 @@ insert delayed into t1 values(10, "my name"); flush table t1; diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result index 257d5f580e8..16fd3f19c4a 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result +++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result @@ -14,6 +14,8 @@ select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1; drop table t1; create table t1(a int primary key); load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1; +Warnings: +Warning 1062 Duplicate entry '2' for key 'PRIMARY' SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 8910f7c8f74..610d18a88c6 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -11,7 +11,7 @@ include/stop_slave.inc change master to master_log_pos=MASTER_LOG_POS; start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result new file mode 100644 index 00000000000..0073c71507d --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result @@ -0,0 +1,98 @@ +include/master-slave.inc +[connection master] +set @old_master_binlog_checksum= @@global.binlog_checksum; +set @old_slave_dbug= @@global.debug_dbug; +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (0); +# Test slave with no capability gets dummy event, which is ignored. +include/stop_slave.inc +SET @@global.debug_dbug='+d,simulate_slave_capability_none'; +include/start_slave.inc +ALTER TABLE t1 ORDER BY a; +SET SESSION binlog_annotate_row_events = ON; +DELETE FROM t1; +INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Annotate_rows # # DELETE FROM t1 +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Annotate_rows # # INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +SELECT * FROM t1; +a +1 +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # User var # # @`!dummyvar`=NULL +slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000003 # Delete_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Query # # # Dummy event replacing event type 160 that slave cannot handle. +slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000003 # Query # # COMMIT +set @@global.debug_dbug= @old_slave_dbug; +# Test dummy event is checksummed correctly. +set @@global.binlog_checksum = CRC32; +TRUNCATE t1; +INSERT INTO t1 VALUES(2); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Annotate_rows # # INSERT INTO t1 VALUES(2) +master-bin.000002 # Table_map # # table_id: # (test.t1) +master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000002 # Query # # COMMIT +SELECT * FROM t1; +a +2 +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000005 # Query # # BEGIN +slave-relay-bin.000005 # Query # # # Dummy ev +slave-relay-bin.000005 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000005 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000005 # Query # # COMMIT +# Test that slave which cannot tolerate holes in binlog stream but +# knows the event does not get dummy event +include/stop_slave.inc +SET @@global.debug_dbug='+d,simulate_slave_capability_old_53'; +include/start_slave.inc +ALTER TABLE t1 ORDER BY a; +UPDATE t1 SET a = 3; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Annotate_rows # # UPDATE t1 SET a = 3 +master-bin.000002 # Table_map # # table_id: # (test.t1) +master-bin.000002 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000002 # Query # # COMMIT +SELECT * FROM t1; +a +3 +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Query # # BEGIN +slave-relay-bin.000006 # Annotate_rows # # UPDATE t1 SET a = 3 +slave-relay-bin.000006 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000006 # Update_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000006 # Query # # COMMIT +select @@global.log_slave_updates; +@@global.log_slave_updates +1 +select @@global.replicate_annotate_row_events; +@@global.replicate_annotate_row_events +0 +set @@global.debug_dbug= @old_slave_dbug; +Clean up. +set @@global.binlog_checksum = @old_master_binlog_checksum; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result new file mode 100644 index 00000000000..13bf7bf0a3e --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mdev382.result @@ -0,0 +1,368 @@ +include/master-slave.inc +[connection master] +create table t1 (a int primary key) engine=innodb; +create table t2 (a int primary key) engine=myisam; +begin; +insert into t1 values (1); +SET sql_mode = 'ANSI_QUOTES'; +savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`; +insert into t1 values (2); +insert into t2 values (1); +SET sql_mode = ''; +rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +insert into t1 values (3); +commit; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 +master-bin.000001 # Query 1 # use `test`; create table t1 (a int primary key) engine=innodb +master-bin.000001 # Query 1 # use `test`; create table t2 (a int primary key) engine=myisam +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use `test`; insert into t2 values (1) +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use `test`; insert into t1 values (1) +master-bin.000001 # Query 1 # SAVEPOINT "a`; create database couldbebadthingshere; savepoint `dummy" +master-bin.000001 # Query 1 # use `test`; insert into t1 values (2) +master-bin.000001 # Query 1 # ROLLBACK TO `a``; create database couldbebadthingshere; savepoint ``dummy` +master-bin.000001 # Query 1 # use `test`; insert into t1 values (3) +master-bin.000001 # Xid 1 # COMMIT /* XID */ +BEGIN; +insert into t1 values(10); +set sql_mode = 'ANSI_QUOTES'; +set sql_quote_show_create = 1; +savepoint a; +insert into t1 values(11); +savepoint "a""a"; +insert into t1 values(12); +set sql_quote_show_create = 0; +savepoint b; +insert into t1 values(13); +savepoint "b""b"; +insert into t1 values(14); +set sql_mode = ''; +set sql_quote_show_create = 1; +savepoint c; +insert into t1 values(15); +savepoint `c``c`; +insert into t1 values(16); +set sql_quote_show_create = 0; +savepoint d; +insert into t1 values(17); +savepoint `d``d`; +insert into t1 values(18); +COMMIT; +set sql_quote_show_create = 1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use `test`; insert into t1 values(10) +master-bin.000001 # Query 1 # SAVEPOINT "a" +master-bin.000001 # Query 1 # use `test`; insert into t1 values(11) +master-bin.000001 # Query 1 # SAVEPOINT "a""a" +master-bin.000001 # Query 1 # use `test`; insert into t1 values(12) +master-bin.000001 # Query 1 # SAVEPOINT b +master-bin.000001 # Query 1 # use `test`; insert into t1 values(13) +master-bin.000001 # Query 1 # SAVEPOINT "b""b" +master-bin.000001 # Query 1 # use `test`; insert into t1 values(14) +master-bin.000001 # Query 1 # SAVEPOINT `c` +master-bin.000001 # Query 1 # use `test`; insert into t1 values(15) +master-bin.000001 # Query 1 # SAVEPOINT `c``c` +master-bin.000001 # Query 1 # use `test`; insert into t1 values(16) +master-bin.000001 # Query 1 # SAVEPOINT d +master-bin.000001 # Query 1 # use `test`; insert into t1 values(17) +master-bin.000001 # Query 1 # SAVEPOINT `d``d` +master-bin.000001 # Query 1 # use `test`; insert into t1 values(18) +master-bin.000001 # Xid 1 # COMMIT /* XID */ +*** Test correct USE statement in SHOW BINLOG EVENTS *** +set sql_mode = 'ANSI_QUOTES'; +CREATE DATABASE "db1`; select 'oops!'"; +use "db1`; select 'oops!'"; +CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM; +INSERT INTO t1 VALUES (1); +set sql_mode = ''; +INSERT INTO t1 VALUES (2); +set sql_mode = 'ANSI_QUOTES'; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'" +master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query 1 # COMMIT +set sql_mode = ''; +set sql_quote_show_create = 0; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'" +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query 1 # COMMIT +set sql_quote_show_create = 1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'" +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query 1 # COMMIT +DROP TABLE t1; +use test; +***Test LOAD DATA INFILE with various identifiers that need correct quoting *** +use `db1``; select 'oops!'`; +set timestamp=1000000000; +CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3), +`c``3` VARCHAR(7)); +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1` + FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY '''' + LINES TERMINATED BY '\n' + (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!"); +SELECT * FROM `t``1`; +a`1 b`2 c`3 +fo\o bar |b"a'z! +truncate `t``1`; +use test; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt' + INTO TABLE `db1``; select 'oops!'`.`t``1` + FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY '''' + LINES TERMINATED BY '\n' + (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!"); +SELECT * FROM `db1``; select 'oops!'`.`t``1`; +a`1 b`2 c`3 +fo\o bar |b"a'z! +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3), +`c``3` VARCHAR(7)) +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=14 +master-bin.000001 # Execute_load_query 1 # use `db1``; select 'oops!'`; LOAD DATA INFILE '/usr/home/serg/Abk/mysql/10.0-monty/mysql-test/var/tmp/f\'le.txt' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!") ;file_id=# +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; truncate `t``1` +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=14 +master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '/usr/home/serg/Abk/mysql/10.0-monty/mysql-test/var/tmp/f\'le.txt' INTO TABLE `db1``; select 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!") ;file_id=# +master-bin.000001 # Query 1 # COMMIT +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +ROLLBACK/*!*/; +use `db1``; select 'oops!'`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3), +`c``3` VARCHAR(7)) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +LOAD DATA LOCAL INFILE '<name>' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!") +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +truncate `t``1` +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +use `test`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +LOAD DATA LOCAL INFILE '<name>' INTO TABLE `db1``; select 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!") +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +SELECT * FROM `db1``; select 'oops!'`.`t``1`; +a`1 b`2 c`3 +fo\o bar |b"a'z! +DROP TABLE `db1``; select 'oops!'`.`t``1`; +drop table t1,t2; +*** Test truncation of long SET expression in LOAD DATA *** +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000)); +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE t1 +FIELDS TERMINATED BY ',' + (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b); +SELECT * FROM t1 ORDER BY a; +a b +1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X +2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=8 +master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '/usr/home/serg/Abk/mysql/10.0-monty/mysql-test/var/tmp/file.txt' INTO TABLE `t1` FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b) ;file_id=# +master-bin.000001 # Query 1 # COMMIT +SELECT * FROM t1 ORDER BY a; +a b +1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X +2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A +DROP TABLE t1; +*** Test user variables whose names require correct quoting *** +use `db1``; select 'oops!'`; +CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100)); +INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100)); +SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1; +@`a``1`:=a1 @`a``2`:=a2 @`a``3`:=a3 @`a``4`:=a4 @`b```:=b @```c`:=c @```d```:=d +-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)); +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100)) +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100)) +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # User var 1 # @`a``1`=-9223372036854775808 +master-bin.000001 # User var 1 # @`a``2`=42 +master-bin.000001 # User var 1 # @`a``3`=9223372036854775807 +master-bin.000001 # User var 1 # @`a``4`=18446744073709551615 +master-bin.000001 # User var 1 # @`b```=-1.234560123456789e125 +master-bin.000001 # User var 1 # @```c`=-1234501234567890123456789012345678901234567890123456789.0123456789 +master-bin.000001 # User var 1 # @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE latin1_swedish_ci +master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)) +master-bin.000001 # Query 1 # COMMIT +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +ROLLBACK/*!*/; +use `db1``; select 'oops!'`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100)) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100)) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET @`a``1`:=-9223372036854775808/*!*/; +SET @`a``2`:=42/*!*/; +SET @`a``3`:=9223372036854775807/*!*/; +SET @`a``4`:=18446744073709551615/*!*/; +SET @`b```:=-1.2345601234568e+125/*!*/; +SET @```c`:=-1234501234567890123456789012345678901234567890123456789.0123456789/*!*/; +SET @```d```:=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE `latin1_swedish_ci`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +SELECT * FROM `db1``; select 'oops!'`.t1 ORDER BY a1; +a1 a2 a3 a4 b c d +-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +-9223372036854775807 4200 9223372036854775806 18446744073709551614 -6.172800617283945e124 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +DROP TABLE t1; +*** Test correct quoting in foreign key error message *** +use `db1``; select 'oops!'`; +CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb; +CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL, +FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb; +TRUNCATE `t``1`; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `INNODB_FOREIGN_KEY_NAME` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```)) +DROP TABLE `t``2`; +DROP TABLE `t``1`; +*** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart +include/stop_slave.inc +CREATE TABLE `db1``; select 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap; +INSERT INTO `db1``; select 'oops!'`.`t``1` VALUES (1), (2), (5); +SELECT * FROM `db1``; select 'oops!'`.`t``1` ORDER BY 1; +a` +1 +2 +5 +set timestamp=1000000000; +# The table should be empty on the master. +SELECT * FROM `db1``; select 'oops!'`.`t``1`; +a` +# The DELETE statement should be correctly quoted +show binlog events in 'master-bin.000002' from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query 1 # DELETE FROM `db1``; select 'oops!'`.`t``1` +include/start_slave.inc +# The table should be empty on the slave also. +SELECT * FROM `db1``; select 'oops!'`.`t``1`; +a` +DROP TABLE `db1``; select 'oops!'`.`t``1`; +use test; +DROP DATABASE `db1``; select 'oops!'`; +*** Test correct quoting of mysqlbinlog --rewrite-db option *** +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES(1); +show binlog events in 'master-bin.000002' from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query 1 # BEGIN +master-bin.000002 # Query 1 # use `test`; INSERT INTO t1 VALUES(1) +master-bin.000002 # Query 1 # COMMIT +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +BEGIN +/*!*/; +use `ts``et`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +INSERT INTO t1 VALUES(1) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 4d5ffae2d63..65fd2800e7d 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153"); -call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:"); +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153"); +call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; SET @@global.max_allowed_packet=1024; @@ -30,14 +30,14 @@ include/start_slave.inc CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); include/wait_for_slave_io_error.inc [errno=1153] -Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes' +Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' include/stop_slave_sql.inc include/rpl_reset.inc DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); -include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event '.' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' +include/wait_for_slave_io_error.inc [errno=1153] +Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' STOP SLAVE; RESET SLAVE; RESET MASTER; @@ -52,6 +52,7 @@ SET @@global.max_allowed_packet= 1024; Warnings: Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.net_buffer_length= 1024; +SET @@global.slave_max_allowed_packet= 1073741824; DROP TABLE t1; RESET SLAVE; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result index 562aac11879..32299cb27c4 100644 --- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result +++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result @@ -25,8 +25,8 @@ Warnings: Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'd' at row 1 -Warning 1264 Out of range value for column 'a' at row 2 -Warning 1264 Out of range value for column 'b' at row 2 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'b' at row 2 Warning 1265 Data truncated for column 'd' at row 2 load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; select * from rewrite.t1; @@ -40,7 +40,7 @@ load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated Warnings: Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'd' at row 1 -Warning 1264 Out of range value for column 'b' at row 2 +Warning 1265 Data truncated for column 'b' at row 2 Warning 1265 Data truncated for column 'd' at row 2 select * from rewrite.t1; a b c d diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index f10e30c698d..783c02b961c 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -2,9 +2,9 @@ CALL mtr.add_suppression("Unsafe statement written to the binary log using state start slave; Got one of the listed errors start slave; -ERROR HY000: Could not initialize master info structure; more error messages can be found in the MariaDB error log +ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; -ERROR HY000: Could not initialize master info structure; more error messages can be found in the MariaDB error log +ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log reset slave; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; reset master; diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result index a7dc2a569a1..cb1aab28603 100644 --- a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result +++ b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result @@ -55,6 +55,7 @@ a b FLUSH LOGS; show binlog events in 'slave-bin.000001' from <start_pos>; Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Binlog_checkpoint 2 # slave-bin.000001 slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1 slave-bin.000001 # Query 1 # CREATE DATABASE test1 slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t1(a int primary key, b int) diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result index 2a3b5b1870e..b7648fd8592 100644 --- a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result +++ b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result @@ -47,6 +47,7 @@ a b FLUSH LOGS; show binlog events in 'slave-bin.000001' from <start_pos>; Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Binlog_checkpoint 2 # slave-bin.000001 slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1 slave-bin.000001 # Query 1 # CREATE DATABASE test1 slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t1(a int primary key, b int) diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result index b2b1417defd..856679e49f6 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log.result +++ b/mysql-test/suite/rpl/r/rpl_row_log.result @@ -205,6 +205,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM master-bin.000002 # Query # # BEGIN @@ -236,6 +237,7 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM slave-bin.000002 # Query # # BEGIN slave-bin.000002 # Table_map # # table_id: # (test.t2) diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result index 333836605d8..404d3e424e6 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result @@ -205,6 +205,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Rotate # # master-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=InnoDB master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=InnoDB master-bin.000002 # Query # # BEGIN @@ -236,6 +237,7 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=InnoDB slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=InnoDB slave-bin.000002 # Query # # BEGIN slave-bin.000002 # Table_map # # table_id: # (test.t2) diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result index 379cea4d3fc..88d68bb50ee 100644 --- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result +++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result @@ -10,7 +10,7 @@ reset slave; # # Test 1 # -set @my_max_binlog_size= @@global.max_binlog_size; +set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; Warnings: @@ -36,8 +36,10 @@ include/check_slave_is_running.inc stop slave; reset slave; set global max_relay_log_size=0; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '0' select @@global.max_relay_log_size; -@@global.max_relay_log_size 0 +@@global.max_relay_log_size 4096 start slave; include/check_slave_is_running.inc # @@ -65,6 +67,7 @@ show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB> set global max_binlog_size= @my_max_binlog_size; +set global max_relay_log_size= @my_max_relay_log_size; # # End of 4.1 tests # diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result index 9e3577e1d5c..1a4d5c7574d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result @@ -154,7 +154,7 @@ c1 c3 c4 c5 /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -176,7 +176,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -287,7 +287,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -318,7 +318,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result index 88812786948..e186fabfff3 100644 --- a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result +++ b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result @@ -92,48 +92,52 @@ slave-bin.000001 # Query # # COMMIT ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS -slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000003 # Query # # BEGIN -slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000003 # Query # # COMMIT -slave-relay-bin.000003 # Query # # BEGIN -slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000003 # Query # # COMMIT -slave-relay-bin.000003 # Query # # BEGIN -slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000002 # Query # # BEGIN +slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000002 # Query # # COMMIT +slave-relay-bin.000002 # Query # # BEGIN +slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000002 # Query # # COMMIT +slave-relay-bin.000002 # Query # # BEGIN +slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000002 # Query # # COMMIT ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) ******** [slave] SHOW RELAYLOG EVENTS ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=POS +slave-relay-bin.000001 # Rotate # # slave-relay-bin.000002;pos=POS FLUSH LOGS; FLUSH LOGS; DROP TABLE t1; ******** [master] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 ******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [master] SHOW BINLOG EVENTS ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -154,13 +158,16 @@ master-bin.000001 # Rotate # # master-bin.000002;pos=POS ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 ******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [slave] SHOW BINLOG EVENTS ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -181,21 +188,24 @@ slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS -slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000002 +slave-relay-bin.000005 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +slave-relay-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000002 ******** [slave] SHOW RELAYLOG EVENTS ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS -slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=POS +slave-relay-bin.000004 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000004 # Rotate # # slave-relay-bin.000005;pos=POS include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_skip_replication.result b/mysql-test/suite/rpl/r/rpl_skip_replication.result index c19f9009021..92b5fa5f629 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_replication.result +++ b/mysql-test/suite/rpl/r/rpl_skip_replication.result @@ -10,7 +10,7 @@ SELECT @@global.replicate_events_marked_for_skip; @@global.replicate_events_marked_for_skip replicate SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; -ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first +ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first SELECT @@global.replicate_events_marked_for_skip; @@global.replicate_events_marked_for_skip replicate diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index 331c1e91bd9..c2d3f5ce212 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -670,7 +670,7 @@ drop database if exists mysqltest1 SET TIMESTAMP=t/*!*/; create database mysqltest1 /*!*/; -use mysqltest1/*!*/; +use `mysqltest1`/*!*/; SET TIMESTAMP=t/*!*/; create table t1 (a varchar(100)) /*!*/; @@ -1015,7 +1015,7 @@ drop database mysqltest1 SET TIMESTAMP=t/*!*/; drop user "zedjzlcsjhd"@127.0.0.1 /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=t/*!*/; drop function if exists f1 /*!*/; @@ -1112,7 +1112,7 @@ create database mysqltest SET TIMESTAMP=t/*!*/; create database mysqltest2 /*!*/; -use mysqltest2/*!*/; +use `mysqltest2`/*!*/; SET TIMESTAMP=t/*!*/; create table t ( t integer ) /*!*/; @@ -1139,7 +1139,7 @@ end SET TIMESTAMP=t/*!*/; BEGIN /*!*/; -use mysqltest/*!*/; +use `mysqltest`/*!*/; SET TIMESTAMP=t/*!*/; SELECT `mysqltest2`.`f1`() /*!*/; @@ -1152,14 +1152,14 @@ drop database mysqltest SET TIMESTAMP=t/*!*/; drop database mysqltest2 /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=t/*!*/; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltestbug36570_p1`() begin select 1; end /*!*/; -use mysql/*!*/; +use `mysql`/*!*/; SET TIMESTAMP=t/*!*/; CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.` mysqltestbug36570_p2`( a int) `label`: diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result index 6dc199f9295..35b1438bade 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_log.result +++ b/mysql-test/suite/rpl/r/rpl_stm_log.result @@ -205,6 +205,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM master-bin.000002 # Query # # BEGIN @@ -235,6 +236,7 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM slave-bin.000002 # Query # # BEGIN slave-bin.000002 # Query # # use `test`; insert into t2 values (1) diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result index 379cea4d3fc..88d68bb50ee 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result @@ -10,7 +10,7 @@ reset slave; # # Test 1 # -set @my_max_binlog_size= @@global.max_binlog_size; +set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; Warnings: @@ -36,8 +36,10 @@ include/check_slave_is_running.inc stop slave; reset slave; set global max_relay_log_size=0; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '0' select @@global.max_relay_log_size; -@@global.max_relay_log_size 0 +@@global.max_relay_log_size 4096 start slave; include/check_slave_is_running.inc # @@ -65,6 +67,7 @@ show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB> set global max_binlog_size= @my_max_binlog_size; +set global max_relay_log_size= @my_max_relay_log_size; # # End of 4.1 tests # diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result index 7a4a324e580..a722f91e2e7 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result @@ -80,45 +80,49 @@ slave-bin.000001 # Query # # COMMIT ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS -slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000003 # Query # # BEGIN -slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (1) -slave-relay-bin.000003 # Query # # COMMIT -slave-relay-bin.000003 # Query # # BEGIN -slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (2) -slave-relay-bin.000003 # Query # # COMMIT -slave-relay-bin.000003 # Query # # BEGIN -slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (3) -slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000002 # Query # # BEGIN +slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-relay-bin.000002 # Query # # COMMIT +slave-relay-bin.000002 # Query # # BEGIN +slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-relay-bin.000002 # Query # # COMMIT +slave-relay-bin.000002 # Query # # BEGIN +slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-relay-bin.000002 # Query # # COMMIT ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) ******** [slave] SHOW RELAYLOG EVENTS ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=POS +slave-relay-bin.000001 # Rotate # # slave-relay-bin.000002;pos=POS FLUSH LOGS; FLUSH LOGS; DROP TABLE t1; ******** [master] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 ******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [master] SHOW BINLOG EVENTS ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -136,13 +140,16 @@ master-bin.000001 # Rotate # # master-bin.000002;pos=POS ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 ******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [slave] SHOW BINLOG EVENTS ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -160,21 +167,24 @@ slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS -slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000002 +slave-relay-bin.000005 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS ******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +slave-relay-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000002 ******** [slave] SHOW RELAYLOG EVENTS ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS -slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=POS +slave-relay-bin.000004 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000004 # Rotate # # slave-relay-bin.000005;pos=POS include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result index 784cd1bcdff..ac6d9155f4b 100644 --- a/mysql-test/suite/rpl/r/rpl_trigger.result +++ b/mysql-test/suite/rpl/r/rpl_trigger.result @@ -4,7 +4,7 @@ DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t3; create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); -create table t2 (a int auto_increment, primary key (a), b int); +create table t2 (a int auto_increment, primary key (a), b int) engine=innodb; create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); create trigger t1 before insert on t1 for each row begin @@ -29,7 +29,7 @@ a b 1 2 3 0 4 0 -5 0 +6 0 500 0 select a,name, old_a, old_b, truncate(rand_value,4) from t3; a name old_a old_b truncate(rand_value,4) @@ -39,7 +39,7 @@ a name old_a old_b truncate(rand_value,4) 103 t2 1 2 0.9164 104 t2 3 0 0.8826 105 t2 4 0 0.6635 -106 t2 5 0 0.6699 +106 t2 6 0 0.6699 107 t2 500 0 0.3593 --- On slave -- @@ -52,7 +52,7 @@ a b 1 2 3 0 4 0 -5 0 +6 0 500 0 select a,name, old_a, old_b, truncate(rand_value,4) from t3; a name old_a old_b truncate(rand_value,4) @@ -62,7 +62,7 @@ a name old_a old_b truncate(rand_value,4) 103 t2 1 2 0.9164 104 t2 3 0 0.8826 105 t2 4 0 0.6635 -106 t2 5 0 0.6699 +106 t2 6 0 0.6699 107 t2 500 0 0.3593 drop table t1,t2,t3; select get_lock("bug12480",2); diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test index b62a6e96437..3572dd53ea7 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test @@ -215,21 +215,23 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; # be filtered as well. # connection master; -CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); # ignored on slave +# Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D. +CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); # ignored on slave CREATE TABLE test.t1 (a INT); # accepted on slave INSERT INTO test.t1 VALUES(1); --sync_slave_with_master call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); +# Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D. +CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW - INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c); + INSERT INTO test.t_slave VALUES(NULL, RAND(), @c); connection master; SET INSERT_ID=2; SET @c=2; SET @@rand_seed1=10000000, @@rand_seed2=1000000; -INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); # to be ignored +INSERT INTO t5 VALUES (NULL, RAND(), @c); # to be ignored SELECT b into @b FROM test.t5; --let $b_master=`select @b` UPDATE test.t1 SET a=2; # to run trigger on slave @@ -253,10 +255,9 @@ if (`SELECT @a != 2 and @c != NULL`) SELECT b into @b FROM test.t_slave; --let $b_slave=`select @b` -if (`SELECT $b_slave = $b_master`) -{ - --echo Might be pure coincidence of two randoms from master and slave table. Don not panic yet. -} +--let $assert_text= Random values from master and slave must be different +--let $assert_cond= $b_master != $b_slave +--source include/assert.inc # cleanup BUG#11754117 connection master; diff --git a/mysql-test/suite/rpl/t/rpl_flush_logs.test b/mysql-test/suite/rpl/t/rpl_flush_logs.test index 6e9de634157..1d19576d47c 100644 --- a/mysql-test/suite/rpl/t/rpl_flush_logs.test +++ b/mysql-test/suite/rpl/t/rpl_flush_logs.test @@ -31,8 +31,9 @@ connection master; flush relay logs; sync_slave_with_master; ---echo # Check the 'slave-relay-bin.000003' file is created +--echo # Check the 'slave-relay-bin.000003' file is not created --echo # after executed 'flush relay logs' statement. +--error 1 file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003; connection master; @@ -89,10 +90,10 @@ file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000001; # Test 'flush error logs, relay logs' statement sync_slave_with_master; ---echo # Make sure the 'slave-relay-bin.000006' file does not exist +--echo # Make sure the 'slave-relay-bin.000005' file does not exist --echo # exist before execute 'flush error logs, relay logs' statement. --error 1 -file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006; +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000005; connection master; @@ -107,19 +108,18 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003; sync_slave_with_master; ---echo # Check the 'slave-relay-bin.000006' file is created after +--echo # Check the 'slave-relay-bin.000004' file is created after --echo # execute 'flush error logs, relay logs' statement. -file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006; - +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004; # Test 'flush logs' statement ---echo # Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008' +--echo # Make sure the 'slave-relay-bin.000005' and 'slave-relay-bin.000006' --echo # files do not exist before execute 'flush error logs, relay logs' --echo # statement. --error 1 -file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007; +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000005; --error 1 -file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008; +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006; connection master; @@ -133,9 +133,9 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003; sync_slave_with_master; ---echo # Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008' +--echo # Check the 'slave-relay-bin.000005' and 'slave-relay-bin.000006' --echo # files are created after execute 'flush logs' statement. -file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007; -file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008; +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000005; +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006; --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test new file mode 100644 index 00000000000..251136a2fe1 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test @@ -0,0 +1,104 @@ +--source include/master-slave.inc +--source include/have_debug.inc +--source include/have_binlog_format_row.inc + +connection master; + +set @old_master_binlog_checksum= @@global.binlog_checksum; +set @old_slave_dbug= @@global.debug_dbug; +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (0); + +sync_slave_with_master; +connection slave; + +--echo # Test slave with no capability gets dummy event, which is ignored. +--source include/stop_slave.inc +SET @@global.debug_dbug='+d,simulate_slave_capability_none'; +--source include/start_slave.inc +connection master; +# Add a dummy event just to have something to sync_slave_with_master on. +# Otherwise we occasionally get different $relaylog_start, depending on +# whether Format_description_log_event was written to relay log or not +# at the time of SHOW SLAVE STATUS. +ALTER TABLE t1 ORDER BY a; +sync_slave_with_master; +connection slave; +let $relaylog_start= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1); + +connection master; +SET SESSION binlog_annotate_row_events = ON; +let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +# A short event, to test when we need to use user_var_event for dummy event. +DELETE FROM t1; +INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1); +let $binlog_limit= 0, 10; +--source include/show_binlog_events.inc +sync_slave_with_master; +connection slave; + +SELECT * FROM t1; +let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); +let $binlog_start= $relaylog_start; +let $binlog_limit=0,10; +--source include/show_relaylog_events.inc +set @@global.debug_dbug= @old_slave_dbug; + +--echo # Test dummy event is checksummed correctly. + +connection master; +set @@global.binlog_checksum = CRC32; +TRUNCATE t1; +let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +INSERT INTO t1 VALUES(2); +let $binlog_limit= 0, 5; +--source include/show_binlog_events.inc +sync_slave_with_master; +connection slave; + +SELECT * FROM t1; +let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); +let $binlog_start= 0; +let $binlog_limit=5,5; +--source include/show_relaylog_events.inc + +--echo # Test that slave which cannot tolerate holes in binlog stream but +--echo # knows the event does not get dummy event + +--source include/stop_slave.inc +SET @@global.debug_dbug='+d,simulate_slave_capability_old_53'; +--source include/start_slave.inc +connection master; +ALTER TABLE t1 ORDER BY a; +sync_slave_with_master; +connection slave; +let $relaylog_start= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1); + +connection master; +let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +UPDATE t1 SET a = 3; +let $binlog_limit= 0, 5; +--source include/show_binlog_events.inc +sync_slave_with_master; +connection slave; + +SELECT * FROM t1; +let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); +let $binlog_start= $relaylog_start; +let $binlog_limit=0,5; +--source include/show_relaylog_events.inc + +select @@global.log_slave_updates; +select @@global.replicate_annotate_row_events; + +set @@global.debug_dbug= @old_slave_dbug; + +--echo Clean up. +connection master; +set @@global.binlog_checksum = @old_master_binlog_checksum; +DROP TABLE t1; +sync_slave_with_master; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test new file mode 100644 index 00000000000..5df382f6f06 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mdev382.test @@ -0,0 +1,265 @@ +--source include/have_innodb.inc +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc + +# MDEV-382: multiple SQL injections in replication code. + +# Test previous SQL injection attack against binlog for SAVEPOINT statement. +# The test would cause syntax error on slave due to improper quoting of +# the savepoint name. +connection master; +create table t1 (a int primary key) engine=innodb; +create table t2 (a int primary key) engine=myisam; + +begin; +insert into t1 values (1); +SET sql_mode = 'ANSI_QUOTES'; +savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`; +insert into t1 values (2); +insert into t2 values (1); +SET sql_mode = ''; +rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`; +insert into t1 values (3); +commit; + +--source include/show_binlog_events2.inc + +# This failed due to syntax error in query when the bug was not fixed. +sync_slave_with_master; +connection slave; + +# Test some more combinations of ANSI_QUOTES and sql_quote_show_create +connection master; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +BEGIN; +insert into t1 values(10); +set sql_mode = 'ANSI_QUOTES'; +set sql_quote_show_create = 1; +savepoint a; +insert into t1 values(11); +savepoint "a""a"; +insert into t1 values(12); +set sql_quote_show_create = 0; +savepoint b; +insert into t1 values(13); +savepoint "b""b"; +insert into t1 values(14); +set sql_mode = ''; +set sql_quote_show_create = 1; +savepoint c; +insert into t1 values(15); +savepoint `c``c`; +insert into t1 values(16); +set sql_quote_show_create = 0; +savepoint d; +insert into t1 values(17); +savepoint `d``d`; +insert into t1 values(18); +COMMIT; +set sql_quote_show_create = 1; + +--source include/show_binlog_events2.inc + +--echo *** Test correct USE statement in SHOW BINLOG EVENTS *** +connection master; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +set sql_mode = 'ANSI_QUOTES'; +CREATE DATABASE "db1`; select 'oops!'"; +use "db1`; select 'oops!'"; +CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM; +INSERT INTO t1 VALUES (1); +set sql_mode = ''; +INSERT INTO t1 VALUES (2); +set sql_mode = 'ANSI_QUOTES'; +--source include/show_binlog_events2.inc +set sql_mode = ''; +set sql_quote_show_create = 0; +--source include/show_binlog_events2.inc +set sql_quote_show_create = 1; +--source include/show_binlog_events2.inc +DROP TABLE t1; + +use test; + +--echo ***Test LOAD DATA INFILE with various identifiers that need correct quoting *** + +--let $load_file= $MYSQLTEST_VARDIR/tmp/f'le.txt +--write_file $load_file +'fo\\o','bar' +EOF + +use `db1``; select 'oops!'`; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +set timestamp=1000000000; +CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3), + `c``3` VARCHAR(7)); +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1` + FIELDS TERMINATED BY ',' ESCAPED BY '\\\\' ENCLOSED BY '''' + LINES TERMINATED BY '\\n' + (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!"); + +SELECT * FROM `t``1`; +# Also test when code prefixes table name with database. +truncate `t``1`; +use test; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/f''le.txt' + INTO TABLE `db1``; select 'oops!'`.`t``1` + FIELDS TERMINATED BY ',' ESCAPED BY '\\\\' ENCLOSED BY '''' + LINES TERMINATED BY '\\n' + (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!"); +SELECT * FROM `db1``; select 'oops!'`.`t``1`; +let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1); + +--source include/show_binlog_events2.inc +let $MYSQLD_DATADIR= `select @@datadir`; +--replace_regex /LOCAL INFILE '.*SQL_LOAD.*' INTO/LOCAL INFILE '<name>' INTO/ +--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 $MYSQLD_DATADIR/master-bin.000001 + +sync_slave_with_master; +connection slave; +SELECT * FROM `db1``; select 'oops!'`.`t``1`; +connection master; + +DROP TABLE `db1``; select 'oops!'`.`t``1`; +--remove_file $load_file + +connection master; +drop table t1,t2; + + +--echo *** Test truncation of long SET expression in LOAD DATA *** +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000)); +--let $load_file= $MYSQLTEST_VARDIR/tmp/file.txt +--write_file $load_file +1,X +2,A +EOF + +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +# The bug was that the SET expression was truncated to 256 bytes, so test with +# an expression longer than that. +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$load_file' INTO TABLE t1 + FIELDS TERMINATED BY ',' + (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b); + +SELECT * FROM t1 ORDER BY a; +--source include/show_binlog_events2.inc + +sync_slave_with_master; +connection slave; +SELECT * FROM t1 ORDER BY a; + +connection master; +--remove_file $load_file +DROP TABLE t1; + + +--echo *** Test user variables whose names require correct quoting *** +use `db1``; select 'oops!'`; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100)); +INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100)); +SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1; +INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)); +let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1); + +--source include/show_binlog_events2.inc + +--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 $MYSQLD_DATADIR/master-bin.000001 + +sync_slave_with_master; +connection slave; +SELECT * FROM `db1``; select 'oops!'`.t1 ORDER BY a1; + +connection master; +DROP TABLE t1; + +--echo *** Test correct quoting in foreign key error message *** +use `db1``; select 'oops!'`; +CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb; +CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL, + FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb; +--replace_regex /t@[0-9]+_ibfk_[0-9]+/INNODB_FOREIGN_KEY_NAME/ +--error ER_TRUNCATE_ILLEGAL_FK +TRUNCATE `t``1`; +DROP TABLE `t``2`; +DROP TABLE `t``1`; + + +--echo *** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart + +# Let's keep the slave stopped during master restart, to avoid any potential +# races between slave reconnect and master restart. +connection slave; +--source include/stop_slave.inc + +connection master; +CREATE TABLE `db1``; select 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap; +INSERT INTO `db1``; select 'oops!'`.`t``1` VALUES (1), (2), (5); +SELECT * FROM `db1``; select 'oops!'`.`t``1` ORDER BY 1; + +# Restart the master mysqld. +# This will cause an implicit truncation of the memory-based table, which will +# cause logging of an explicit DELETE FROM to binlog. +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-rpl_mdev382.test +EOF + +--shutdown_server 30 + +--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-rpl_mdev382.test +EOF + +connection default; +--enable_reconnect +--source include/wait_until_connected_again.inc +# rpl_end.inc needs to use the connection server_1 +connection server_1; +--enable_reconnect +--source include/wait_until_connected_again.inc +connection master; +--enable_reconnect +--source include/wait_until_connected_again.inc +set timestamp=1000000000; + +--echo # The table should be empty on the master. +let $binlog_file= master-bin.000002; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +SELECT * FROM `db1``; select 'oops!'`.`t``1`; + +--echo # The DELETE statement should be correctly quoted +--source include/show_binlog_events2.inc + +connection slave; +--source include/start_slave.inc + +connection master; +sync_slave_with_master; +connection slave; +--echo # The table should be empty on the slave also. +SELECT * FROM `db1``; select 'oops!'`.`t``1`; + +connection master; +DROP TABLE `db1``; select 'oops!'`.`t``1`; +sync_slave_with_master; + + +connection master; +use test; +DROP DATABASE `db1``; select 'oops!'`; + +--echo *** Test correct quoting of mysqlbinlog --rewrite-db option *** +CREATE TABLE t1 (a INT PRIMARY KEY); +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +INSERT INTO t1 VALUES(1); +--source include/show_binlog_events2.inc +let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1); +--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 --rewrite-db='test->ts`et' $MYSQLD_DATADIR/master-bin.000002 +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_packet-slave.opt b/mysql-test/suite/rpl/t/rpl_packet-slave.opt index 412bc079caa..1aed7d07572 100644 --- a/mysql-test/suite/rpl/t/rpl_packet-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_packet-slave.opt @@ -1 +1 @@ ---max_allowed_packet=1024 --net_buffer_length=1024 +--max_allowed_packet=1024 --net_buffer_length=1024 --slave_max_allowed_packet=1024 diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 4f296fed68e..c49d9490bd9 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -11,9 +11,8 @@ # max-out size db name source include/master-slave.inc; source include/have_binlog_format_row.inc; -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153"); -call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:"); - +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153"); +call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; disable_warnings; eval drop database if exists $db; @@ -23,6 +22,7 @@ eval create database $db; connection master; let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`; let $old_net_buffer_length= `SELECT @@global.net_buffer_length`; +let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`; SET @@global.max_allowed_packet=1024; SET @@global.net_buffer_length=1024; @@ -123,11 +123,9 @@ INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), R connection slave; # The slave I/O thread must stop after receiving -# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. ---let $slave_io_errno= 1236 - -# Mask line numbers ---let $slave_io_error_replace= / at [0-9]*/ at XXX/ +# 1153 = ER_NET_PACKET_TOO_LARGE +--let $slave_io_errno= 1153 +--let $show_slave_io_error= 1 --source include/wait_for_slave_io_error.inc # Remove the bad binlog and clear error status on slave. @@ -167,6 +165,7 @@ connection master; DROP TABLE t1; eval SET @@global.max_allowed_packet= $old_max_allowed_packet; eval SET @@global.net_buffer_length= $old_net_buffer_length; +eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet; # slave is stopped connection slave; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test index c9c8f043668..ab388f3eebc 100644 --- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test @@ -21,6 +21,16 @@ connection slave; --let $connection_id=`SELECT id FROM information_schema.processlist where state LIKE 'Waiting for master to send event'` +if(!$connection_id) +{ + # Something went wrong (timing) + # Show process list so that we can debug. In this case we will abort with + # wrong result + -- echo "Could not find connect id. Dumping process list for debugging" + SELECT * FROM information_schema.processlist; + exit; +} + set @time_before_kill := (select CURRENT_TIMESTAMP); --echo [Time before the query] diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index e2974a21bf7..723fa3e44e2 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -3,13 +3,10 @@ # Adding statement include due to Bug 12574 # TODO: Remove statement include once 12574 is patched --source include/have_binlog_format_mixed_or_statement.inc ---source include/master-slave.inc ---source include/have_innodb.inc -connection slave; --source include/have_innodb.inc +--source include/master-slave.inc connection master; - disable_query_log; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); enable_query_log; @@ -26,7 +23,7 @@ DROP TABLE IF EXISTS t3; # create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); -create table t2 (a int auto_increment, primary key (a), b int); +create table t2 (a int auto_increment, primary key (a), b int) engine=innodb; create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); delimiter |; diff --git a/mysql-test/suite/storage_engine/1st.result b/mysql-test/suite/storage_engine/1st.result new file mode 100644 index 00000000000..6b686c2b2b4 --- /dev/null +++ b/mysql-test/suite/storage_engine/1st.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +SHOW COLUMNS IN t1; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 (a,b) VALUES (2,'b'); +SELECT * FROM t1; +a b +1 a +2 b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/1st.test b/mysql-test/suite/storage_engine/1st.test new file mode 100644 index 00000000000..af7a4503948 --- /dev/null +++ b/mysql-test/suite/storage_engine/1st.test @@ -0,0 +1,81 @@ +# +# This test checks some very basic capabilities +# which will be used in almost every other test, +# and will not be checked through support* variables. +# If this test does not pass, there is no point +# at executing other ones. +# +# Minimal requirements: +# - supported column types: INT, CHAR (default CHAR(8), INT(11)); +# - column attributes as declared in define_engine.inc ($default_col_opts) +# (by default empty, which means no additional attributes apart from the type); +# - table attributes as declared in define_engine.inc ($default_tbl_opts) +# (by default empty, which means no additional attributes apart from ENGINE); +# - CREATE TABLE .. (column1 <column options>, column2 <column options>) ENGINE=<storage_engine>; +# - INSERT INTO TABLE .. VALUES (val1,val2); +# - DROP TABLE .. +# - SELECT * FROM .. +# - SHOW CREATE TABLE .. +# - SHOW COLUMNS IN ... +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --disable_result_log + SHOW CREATE TABLE t1; + if ($mysql_errname) + { + --let $functionality = SHOW CREATE TABLE + --source unexpected_result.inc + } + SHOW COLUMNS IN t1; + if ($mysql_errname) + { + --let $functionality = SHOW COLUMNS + --source unexpected_result.inc + } + --enable_result_log + + INSERT INTO t1 VALUES (1,'a'); + if ($mysql_errname) + { + --let $functionality = INSERT INTO .. VALUES + --source unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (2,'b'); + if ($mysql_errname) + { + --let $functionality = INSERT INTO .. (column_list) VALUES + --source unexpected_result.inc + } + + SELECT * FROM t1; + if ($mysql_errname) + { + --let $functionality = SELECT * FROM .. + --source unexpected_result.inc + } + + DROP TABLE t1; + if ($mysql_errname) + { + --let $functionality = DROP TABLE + --source unexpected_result.inc + } + +} +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/alter_table.inc b/mysql-test/suite/storage_engine/alter_table.inc new file mode 100644 index 00000000000..0f78c597455 --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table.inc @@ -0,0 +1,91 @@ +################################## +# +# This include file will be used for all ALTER TABLE statements in the suite. +# If you need to add additional steps or change the logic, copy the file +# to storage/<engine>/mysql-test/storage_engine/ folder and modify it there. +# +################## +# +# Parameters: +# +# --let $alter_definition = <alter definition> # mandatory, everything that goes after the table name in ALTER statement +# --let $table_name = <table name> # optional, default t1 +# --let $error_codes = <expected error codes, as in --error> # optional, default 0 +# --let $online = [0|1] # optional, default 0 (1 adds ONLINE) +# --let $rename_to = <new table name> # optional, default empty. +# # If set, means we are running RENAME TO, then alter definition is ignored +# +# Usage examples: +# +# --let $alter_definition = ADD COLUMN b $char_col DEFAULT '' +# + +if ($rename_to) +{ + --let $alter_definition = RENAME TO $rename_to +} + +if (!$alter_definition) +{ + --die # The ALTER statement is empty +} + +--let $alter_statement = ALTER + +if ($online) +{ + --let $alter_statement = $alter_statement ONLINE +} + +if (!$table_name) +{ + --let $table_name = t1 +} + +--let $alter_statement = $alter_statement TABLE $table_name $alter_definition + + +# We now have the complete ALTER statement in $alter_statement. +# If your ALTER statement should be composed differently, +# modify the logic above. + +##################### +# Here you can add logic needed BEFORE the main statement +# (e.g. base tables need to be altered, etc.). +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + +--source obfuscate.inc + +eval $alter_statement; +--source check_errors.inc + +# Make sure you don't add any statements between the main ALTER (above) +# and saving mysql_errno and mysql_errname (below) +# They are saved in case you want to add more logic after the main ALTER, +# because we need the result code of the statement. +# Also, do not change $alter_statement after it is executed! + +--let $my_errno = $mysql_errno +--let $my_errname = $mysql_errname + +##################### +# Here you can add logic needed AFTER the main statement. +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + +# Unset the parameters, we don't want them to be accidentally reused later +--let $alter_definition = +--let $table_name = +--let $error_codes = +--let $online = 0 +--let $rename_to = + +# Restore the error codes of the main statement +--let $mysql_errno = $my_errno +--let $mysql_errname = $my_errname +# Make sure you don't add any SQL statements after restoring +# mysql_errno and mysql_errname (above) + diff --git a/mysql-test/suite/storage_engine/alter_table.result b/mysql-test/suite/storage_engine/alter_table.result new file mode 100644 index 00000000000..6d868a27a36 --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table.result @@ -0,0 +1,147 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,c) VALUES (1,'a'),(5,'z'); +ALTER TABLE t1 ADD COLUMN b <INT_COLUMN>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT '0'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT '0', + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 ALTER a DROP DEFAULT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 CHANGE COLUMN b b1 <CHAR_COLUMN> FIRST; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b1` char(8) DEFAULT NULL, + `a` int(11), + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 CHANGE b1 b <INT_COLUMN> AFTER c; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 CHANGE b b <CHAR_COLUMN>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 MODIFY COLUMN b <INT_COLUMN>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 MODIFY COLUMN b <CHAR_COLUMN> FIRST; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` char(8) DEFAULT NULL, + `a` int(11), + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 MODIFY COLUMN b <INT_COLUMN> AFTER a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `b` int(11) DEFAULT NULL, + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 DROP COLUMN b; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 RENAME TO t2; +SHOW CREATE TABLE t1; +ERROR 42S02: Table 'test.t1' doesn't exist +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11), + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,5),(2,2),(4,3); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 ORDER BY b ASC, a DESC; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +SELECT * FROM t1; +a b +2 2 +4 3 +1 5 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET latin1 COLLATE latin1_general_cs; +INSERT INTO t1 (a,b,c) VALUES (5,'z','t'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) COLLATE latin1_general_cs DEFAULT NULL, + `c` char(8) COLLATE latin1_general_cs DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL, + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 +ALTER TABLE t1 DEFAULT CHARACTER SET = latin1 COLLATE latin1_general_ci; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) CHARACTER SET utf8 DEFAULT NULL, + `c` char(8) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci +ALTER TABLE t1 FORCE; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) CHARACTER SET utf8 DEFAULT NULL, + `c` char(8) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/alter_table.test b/mysql-test/suite/storage_engine/alter_table.test new file mode 100644 index 00000000000..023d8927e16 --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table.test @@ -0,0 +1,148 @@ +# +# Basic ALTER TABLE statements. +# +# USAGE of table options in ALTER statements +# is covered in tbl_standard_opts and tbl_opt*.tests. +# +# Index operations are covered in index* tests. +# +# ALTER ONLINE syntax is covered in alter_online_table.test +# ALTER OFFLINE is not covered as it is not supported, as of 5.5.23 +# +# ALTER TABLE ... DISCARD|IMPORT TABLESPACE is covered in alter_tablespace.test +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--let $create_definition = a $int_col, c $char_col +--source create_table.inc +INSERT INTO t1 (a,c) VALUES (1,'a'),(5,'z'); + +# Column operations + +--let $alter_definition = ADD COLUMN b $int_col +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} + +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = ALTER COLUMN a SET DEFAULT '0' +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = ALTER a DROP DEFAULT +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CHANGE COLUMN b b1 $char_col FIRST +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CHANGE b1 b $int_col AFTER c +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CHANGE b b $char_col +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MODIFY COLUMN b $int_col +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MODIFY COLUMN b $char_col FIRST +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MODIFY COLUMN b $int_col AFTER a +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = DROP COLUMN b +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + + +# Rename table + +--let $rename_to = t2 +--source alter_table.inc +--let $error_codes = ER_NO_SUCH_TABLE +SHOW CREATE TABLE t1; +--source check_errors.inc +if ($mysql_errname != 'ER_NO_SUCH_TABLE') +{ + --let $functionality = ALTER TABLE + --source unexpected_result.inc + DROP TABLE t1; +} +if ($mysql_errname == ER_NO_SUCH_TABLE) +{ + --source mask_engine.inc + SHOW CREATE TABLE t2; + DROP TABLE t2; +} + +# ORDER BY +--let $create_definition = a $int_col, b $int_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,5),(2,2),(4,3); +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = ORDER BY b ASC, a DESC +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +# Character set, collate + +--let $table_options = CHARACTER SET latin1 COLLATE latin1_general_cs +--let $create_definition = a $int_col, b $char_col, c $char_col +--source create_table.inc +INSERT INTO t1 (a,b,c) VALUES (5,'z','t'); + +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CONVERT TO CHARACTER SET utf8 +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = DEFAULT CHARACTER SET = latin1 COLLATE latin1_general_ci +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +# A 'null' ALTER operation + +--let $alter_definition = FORCE +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +# Cleanup +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/alter_table_online.result b/mysql-test/suite/storage_engine/alter_table_online.result new file mode 100644 index 00000000000..0e606bf1f7e --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table_online.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS t1,t2,t3; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); +ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5; +ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>; +ALTER ONLINE TABLE t1 COMMENT 'new comment'; +ALTER ONLINE TABLE t1 RENAME TO t2; +DROP TABLE IF EXISTS t2; +CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 COMMENT 'new comment'; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 RENAME TO t2; +ERROR HY000: Can't execute the given 'ALTER' command as online +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); +ALTER ONLINE TABLE t1 DROP COLUMN b, ADD b <INT_COLUMN>; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 ENGINE=MEMORY; +ERROR HY000: Can't execute the given 'ALTER' command as online +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ALTER ONLINE TABLE t1 ADD INDEX (b); +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER TABLE t1 ADD INDEX (b); +ALTER ONLINE TABLE t1 DROP INDEX b; +ERROR HY000: Can't execute the given 'ALTER' command as online +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/alter_table_online.test b/mysql-test/suite/storage_engine/alter_table_online.test new file mode 100644 index 00000000000..94dec2a72bb --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table_online.test @@ -0,0 +1,160 @@ +# +# ALTER ONLINE TABLE +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2,t3; +--enable_warnings + +# +# Test of things that can be done online +# We are repeating notification here, because for some engines +# only a part of these ALTER ONLINE statements might be supported. +# + +let $create_definition = a $int_col, b $int_col, c $char_col; +--source create_table.inc + +INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); + +--let $online = 1 +--let $alter_definition = MODIFY b $int_col DEFAULT 5 +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} + +--let $online = 1 +--let $alter_definition = CHANGE b new_name $int_col +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} + +--let $online = 1 +--let $alter_definition = COMMENT 'new comment' +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} + +--let $online = 1 +--let $rename_to = t2 +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc + DROP TABLE t1; +} +DROP TABLE IF EXISTS t2; + +# +# temporary tables always require a copy +# + +--let $temporary = 1 +--source create_table.inc + +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = MODIFY b $int_col DEFAULT 5 +--source alter_table.inc +if ($mysql_errname != ER_CANT_DO_ONLINE) +{ + --source unexpected_result.inc +} + + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = CHANGE b new_name $int_col +--source alter_table.inc + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = COMMENT 'new comment' +--source alter_table.inc + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $rename_to = t2 +--source alter_table.inc + +DROP TABLE t1; + +# +# Test of things that is not possible to do online +# + +--let $create_definition = a $int_col, b $int_col, c $char_col +--source create_table.inc + +INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = DROP COLUMN b, ADD b $int_col +--source alter_table.inc +if ($mysql_errname!=ER_CANT_DO_ONLINE) +{ + --source unexpected_result.inc +} + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = MODIFY b BIGINT $default_col_opts +--source alter_table.inc + +--let $alternative_engine = `SELECT engine FROM information_schema.engines WHERE engine != '$storage_engine' AND support IN ('YES','DEFAULT')` + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = ENGINE=$alternative_engine +--source alter_table.inc + +DROP TABLE t1; + +--let $create_definition = a $int_col, b $int_indexed_col, c $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Column options + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --let $error_codes = ER_CANT_DO_ONLINE + --let $online = 1 + --let $alter_definition = ADD INDEX (b) + --source alter_table.inc + if ($mysql_errname!=ER_CANT_DO_ONLINE) + { + --let $functionality = Adding an index or ALTER ONLINE + --source unexpected_result.inc + } + + --let $alter_definition = ADD INDEX (b) + --source alter_table.inc + if ($mysql_errname) + { + --let $functionality = Adding an index or ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $error_codes = ER_CANT_DO_ONLINE + --let $online = 1 + --let $alter_definition = DROP INDEX b + --source alter_table.inc + } + DROP TABLE t1; +} + +--source cleanup_engine.inc diff --git a/mysql-test/suite/storage_engine/alter_tablespace.result b/mysql-test/suite/storage_engine/alter_tablespace.result new file mode 100644 index 00000000000..5d8709b2357 --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_tablespace.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ALTER TABLE t1 DISCARD TABLESPACE; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (1),(2); +SELECT * FROM t1; +a +1 +2 +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Got error -1 from storage engine +ALTER TABLE t1 IMPORT TABLESPACE; +SELECT * FROM t1; +a +1 +2 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/alter_tablespace.test b/mysql-test/suite/storage_engine/alter_tablespace.test new file mode 100644 index 00000000000..6c429bb98ea --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_tablespace.test @@ -0,0 +1,91 @@ +# +# IMPORT / DISCARD TABLESPACE +# +# The test might require additional engine options, +# e.g. for InnoDB it is --innodb-file-per-table + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--let $create_definition = a $int_col +--source create_table.inc + +--let $alter_definition = DISCARD TABLESPACE + +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = Tablespace operations + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + DROP TABLE t1; + + --let $create_definition = a $int_col + --source create_table.inc + INSERT INTO t1 (a) VALUES (1),(2); + --sorted_result + SELECT * FROM t1; + +# http://dev.mysql.com/doc/mysql-enterprise-backup/3.5/en/partial.restoring.single.html +# To get a "clean" backup we need to either use innobackup, or to monitor show engine innodb status, +# and the documented conditions do not look exactly feasible. So, we will go a simple way: +# just restart the server, and take the backup while the server is down. +# (And we need to have a really clean backup, see MySQL:65429 / LP:1004910) + + --let $datadir = `SELECT @@datadir` + + --write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +wait +EOF + + --enable_reconnect + --shutdown_server 60 + + --source include/wait_until_disconnected.inc + + --replace_result $datadir <DATADIR> + --copy_file $datadir/test/t1.ibd $datadir/test/t1.ibd.save + + --remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF + + --source include/wait_until_connected_again.inc + + --let $alter_definition = DISCARD TABLESPACE + --source alter_table.inc + + --let $error_codes = ER_GET_ERRNO + SELECT * FROM t1; + --source check_errors.inc + if ($mysql_errname != ER_GET_ERRNO) + { + --let $functionality = Tablespace operations + --source unexpected_result.inc + } + + --move_file $datadir/test/t1.ibd.save $datadir/test/t1.ibd + --let $alter_definition = IMPORT TABLESPACE + --source alter_table.inc + --sorted_result + SELECT * FROM t1; + + # Adding a warning suppression based on what InnoDB currently does + # when it attempts to access a table without an *.ibd file + --disable_query_log + eval CALL mtr.add_suppression('$storage_engine: Error:.*'); + --enable_query_log +} + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/analyze_table.inc b/mysql-test/suite/storage_engine/analyze_table.inc new file mode 100644 index 00000000000..2cbfc17aaa9 --- /dev/null +++ b/mysql-test/suite/storage_engine/analyze_table.inc @@ -0,0 +1,43 @@ +# +# ANALYZE TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support ANALYZE. +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--let $create_definition = a $int_col, b $char_col +--let $table_name = t2 +--source create_table.inc + +INSERT INTO t1 (a,b) VALUES (3,'c'); +ANALYZE TABLE t1; +INSERT INTO t2 (a,b) VALUES (4,'d'); +ANALYZE NO_WRITE_TO_BINLOG TABLE t2; +INSERT INTO t1 (a,b) VALUES (5,'e'); +INSERT INTO t2 (a,b) VALUES (6,'f'); +ANALYZE LOCAL TABLE t1, t2; + +DROP TABLE t1, t2; + +--let $continue = 1 +--source have_default_index.inc + +if ($have_default_index) +{ + --let $create_definition = a $int_indexed_col, $default_index(a) + --source create_table.inc + INSERT INTO t1 (a) VALUES (1),(2),(4),(7); + ANALYZE TABLE t1; + INSERT INTO t1 (a) VALUES (8),(10),(11),(12); + ANALYZE TABLE t1; + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/analyze_table.result b/mysql-test/suite/storage_engine/analyze_table.result new file mode 100644 index 00000000000..42904ed334d --- /dev/null +++ b/mysql-test/suite/storage_engine/analyze_table.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (3,'c'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +ANALYZE NO_WRITE_TO_BINLOG TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +INSERT INTO t1 (a,b) VALUES (5,'e'); +INSERT INTO t2 (a,b) VALUES (6,'f'); +ANALYZE LOCAL TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (1),(2),(4),(7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1 (a) VALUES (8),(10),(11),(12); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/analyze_table.test b/mysql-test/suite/storage_engine/analyze_table.test new file mode 100644 index 00000000000..5222ec8af54 --- /dev/null +++ b/mysql-test/suite/storage_engine/analyze_table.test @@ -0,0 +1,14 @@ +# +# ANALYZE TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support ANALYZE. +# + +--source have_engine.inc + +--source analyze_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/autoinc_secondary.result b/mysql-test/suite/storage_engine/autoinc_secondary.result new file mode 100644 index 00000000000..ad2b43bc6fe --- /dev/null +++ b/mysql-test/suite/storage_engine/autoinc_secondary.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, PRIMARY KEY (a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (b) VALUES ('a'),('b'),('b'),('c'),('a'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +a b +1 a +2 b +3 b +4 c +5 a +DROP TABLE t1; +CREATE TABLE t1 (a <CHAR_COLUMN>, b <INT_COLUMN> AUTO_INCREMENT, PRIMARY KEY (a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +a b +a 1 +a 2 +b 1 +b 2 +c 1 +DROP TABLE t1; +CREATE TABLE t1 (a <CHAR_COLUMN>, b <INT_COLUMN> AUTO_INCREMENT, PRIMARY KEY (a,b), <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +a b +a 1 +a 5 +b 2 +b 3 +c 4 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/autoinc_secondary.test b/mysql-test/suite/storage_engine/autoinc_secondary.test new file mode 100644 index 00000000000..8b95f1d859e --- /dev/null +++ b/mysql-test/suite/storage_engine/autoinc_secondary.test @@ -0,0 +1,73 @@ +# +# AUTO_INCREMENT on a secondary column in a multi-part key +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# AUTO_INCREMENT is the primary column in a multiple-column index +# + +--let $create_definition = a $int_col AUTO_INCREMENT, b $char_col, PRIMARY KEY (a,b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multi-part keys or PK or AUTO_INCREMENT (on a primary column) + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (b) VALUES ('a'),('b'),('b'),('c'),('a'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +# +# AUTO_INCREMENT is the secondary column in a multiple-column index +# + +--let $create_definition = a $char_col, b $int_col AUTO_INCREMENT, PRIMARY KEY (a,b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multi-part keys or PK or AUTO_INCREMENT (on a secondary column) + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +# AUTO_INCREMENT is the secondary column in a multiple-column index, +# and primary in another index +# + +--let $create_definition = a $char_col, b $int_indexed_col AUTO_INCREMENT, PRIMARY KEY (a,b), $default_index(b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multi-part keys or AUTO_INCREMENT (on the secondary column) or multiple keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/autoinc_vars.result b/mysql-test/suite/storage_engine/autoinc_vars.result new file mode 100644 index 00000000000..60e7d74a22a --- /dev/null +++ b/mysql-test/suite/storage_engine/autoinc_vars.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS t1; +SET auto_increment_offset = 200; +CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +a b +1 a +2 b +3 c +SET auto_increment_increment = 300; +INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +200 +SELECT * FROM t1; +a b +1 a +2 b +200 d +3 c +500 e +800 f +SET auto_increment_increment = 50; +INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +850 +SELECT * FROM t1; +a b +1 a +2 b +200 d +3 c +500 e +800 f +850 g +900 h +950 i +DROP TABLE t1; +SET auto_increment_increment = 500; +SET auto_increment_offset = 300; +CREATE TABLE t1 (a TINYINT <CUSTOM_COL_OPTIONS> AUTO_INCREMENT, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (NULL); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +127 +SELECT * FROM t1; +a +127 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/autoinc_vars.test b/mysql-test/suite/storage_engine/autoinc_vars.test new file mode 100644 index 00000000000..ceafcd7138f --- /dev/null +++ b/mysql-test/suite/storage_engine/autoinc_vars.test @@ -0,0 +1,68 @@ +# +# auto-increment-offset and auto-increment-increment +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# auto_increment_offset +SET auto_increment_offset = 200; +--let $create_definition = a $int_indexed_col AUTO_INCREMENT, b $char_col, $default_index(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = AUTO_INCREMENT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + # If auto_increment_offset is greater than auto_increment_increment, + # the offset is ignored + INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + + # auto_increment_increment + + SET auto_increment_increment = 300; + # offset should not be ignored anymore + INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + + SET auto_increment_increment = 50; + INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +# offset is greater than the max value + +SET auto_increment_increment = 500; +SET auto_increment_offset = 300; +--let $create_definition = a TINYINT $default_col_indexed_opts AUTO_INCREMENT, $default_index(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = AUTO_INCREMENT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES (NULL); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/autoincrement.result b/mysql-test/suite/storage_engine/autoincrement.result new file mode 100644 index 00000000000..bc51a2a82af --- /dev/null +++ b/mysql-test/suite/storage_engine/autoincrement.result @@ -0,0 +1,133 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` char(8) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +INSERT INTO t1 (b) VALUES ('a'),('b'); +SELECT * FROM t1 ORDER BY a; +a b +1 a +2 b +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +INSERT INTO t1 (a,b) VALUES (NULL,'c'),(0,'d'); +SELECT * FROM t1 ORDER BY a; +a b +1 a +2 b +3 c +4 d +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3 +SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; +INSERT INTO t1 (a,b) VALUES (NULL,'e'); +SELECT * FROM t1 ORDER BY a; +a b +1 a +2 b +3 c +4 d +5 e +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5 +INSERT INTO t1 (a,b) VALUES (0,'f'); +SELECT * FROM t1 ORDER BY a; +a b +0 f +1 a +2 b +3 c +4 d +5 e +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5 +SET sql_mode = '<INITIAL_SQL_MODE>'; +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 <STORAGE_ENGINE> # # # # # # # # 6 # # # # # # # +INSERT INTO t1 (a,b) VALUES (6,'g'),(7,'h'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5 +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 8 # # # # # # # +INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j'); +SELECT * FROM t1 ORDER BY a; +a b +0 f +1 a +2 b +3 c +4 d +5 e +6 g +7 h +8 i +9 j +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +8 +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 10 # # # # # # # +INSERT INTO t1 (a,b) VALUES (20,'k'); +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 21 # # # # # # # +INSERT INTO t1 (a,b) VALUES (NULL,'l'); +SELECT * FROM t1 ORDER BY a; +a b +0 f +1 a +2 b +3 c +4 d +5 e +6 g +7 h +8 i +9 j +20 k +21 l +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +21 +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 22 # # # # # # # +INSERT INTO t1 (a,b) VALUES (-5,'m'); +SELECT * FROM t1 ORDER BY a; +a b +-5 m +0 f +1 a +2 b +3 c +4 d +5 e +6 g +7 h +8 i +9 j +20 k +21 l +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AUTO_INCREMENT = 100; +INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'); +SELECT * FROM t1; +a b +100 a +101 b +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +100 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/autoincrement.test b/mysql-test/suite/storage_engine/autoincrement.test new file mode 100644 index 00000000000..fb07ea55c57 --- /dev/null +++ b/mysql-test/suite/storage_engine/autoincrement.test @@ -0,0 +1,114 @@ +# +# Basic AUTO_INCREMENT capabilities +# + +--source have_engine.inc + +--let $skip = 1 +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_indexed_col AUTO_INCREMENT, b $char_col, $default_index(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = AUTO_INCREMENT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + + # Automatic values + + INSERT INTO t1 (b) VALUES ('a'),('b'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + INSERT INTO t1 (a,b) VALUES (NULL,'c'),(0,'d'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + let $sql_mode = `SELECT @@sql_mode`; + SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; + + INSERT INTO t1 (a,b) VALUES (NULL,'e'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + INSERT INTO t1 (a,b) VALUES (0,'f'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + --replace_result $sql_mode <INITIAL_SQL_MODE> + eval SET sql_mode = '$sql_mode'; + + # SHOW TABLE STATUS shows the auto-increment value in column 11, + # that's all we need here and further + --source mask_engine.inc + --replace_column 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + # Mix of automatic and explicit values + + INSERT INTO t1 (a,b) VALUES (6,'g'),(7,'h'); + SELECT LAST_INSERT_ID(); + + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + + INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + # Creating a gap in the sequence + + INSERT INTO t1 (a,b) VALUES (20,'k'); + + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + INSERT INTO t1 (a,b) VALUES (NULL,'l'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + # Negative values: we will try to insert one just to check that it does not cause a crash, + # but won't check what happens to the sequence after that, since the behavior is undefined + + INSERT INTO t1 (a,b) VALUES (-5,'m'); + SELECT * FROM t1 ORDER BY a; + + DROP TABLE t1; +} + +# Autoincrement with table option AUTO_INCREMENT + +--let $create_definition = a $int_indexed_col AUTO_INCREMENT, b $char_col, $default_index(a) +--let $table_options = AUTO_INCREMENT = 100 +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = AUTO_INCREMENT column or table option + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'); + --sorted_result + SELECT * FROM t1; + SELECT LAST_INSERT_ID(); + DROP TABLE t1; +} +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/cache_index.result b/mysql-test/suite/storage_engine/cache_index.result new file mode 100644 index 00000000000..c8cf0ce2090 --- /dev/null +++ b/mysql-test/suite/storage_engine/cache_index.result @@ -0,0 +1,69 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CACHE INDEX t1 INDEX (a), t2 IN <CACHE_NAME>; +ERROR HY000: Unknown key cache '<CACHE_NAME>' +SET GLOBAL <CACHE_NAME>.key_buffer_size=128*1024; +CACHE INDEX t1 INDEX (a), t2 IN <CACHE_NAME>; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +test.t2 assign_to_keycache status OK +LOAD INDEX INTO CACHE t1, t2; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +test.t2 preload_keys status OK +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +SET GLOBAL <CACHE_NAME>.key_buffer_size=8*1024; +LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +test.t2 preload_keys status OK +SET GLOBAL <CACHE_NAME>.key_cache_age_threshold = 100, <CACHE_NAME>.key_cache_block_size = 512, <CACHE_NAME>.key_cache_division_limit = 1, <CACHE_NAME>.key_cache_segments=2; +INSERT INTO t1 (a,b) VALUES (5,'e'),(6,'f'); +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +SET GLOBAL new_<CACHE_NAME>.key_buffer_size=128*1024; +CACHE INDEX t1 IN new_<CACHE_NAME>; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +LOAD INDEX INTO CACHE t1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +INSERT INTO t1 (a,b) VALUES (9,'i'); +DROP TABLE t2; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a), +<CUSTOM_INDEX> (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CACHE INDEX t1 IN <CACHE_NAME>; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b (a,b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CACHE INDEX t1 IN <CACHE_NAME>; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +DROP TABLE t1; +SET GLOBAL <CACHE_NAME>.key_buffer_size=0; +SET GLOBAL new_<CACHE_NAME>.key_buffer_size=0; diff --git a/mysql-test/suite/storage_engine/cache_index.test b/mysql-test/suite/storage_engine/cache_index.test new file mode 100644 index 00000000000..42ba9615a40 --- /dev/null +++ b/mysql-test/suite/storage_engine/cache_index.test @@ -0,0 +1,142 @@ +# +# CACHE INDEX and LOAD INDEX INTO CACHE +# + +--source have_engine.inc +--source have_default_index.inc + + +# Due to ancient MySQL bug#16111 we need to generate a unique cache name +--let $cache_name = `SELECT CONNECTION_ID()` +--let $cache_name = my_cache_$cache_name + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +let $create_definition = + a $int_indexed_col, + b $char_col, + $default_index (a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Indexes on INT columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + let $create_definition = + a $int_col, + b $char_indexed_col, + $default_index (b) + ; + let $table_name = t2; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Indexes on CHAR columns + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_result $cache_name <CACHE_NAME> + --let $error_codes = ER_UNKNOWN_KEY_CACHE + eval CACHE INDEX t1 INDEX (a), t2 IN $cache_name; + --source check_errors.inc + if ($mysql_errname != ER_UNKNOWN_KEY_CACHE) + { + --let $functionality = Key cache or indexes + --source unexpected_result.inc + } + + --replace_result $cache_name <CACHE_NAME> + eval SET GLOBAL $cache_name.key_buffer_size=128*1024; + --replace_result $cache_name <CACHE_NAME> + eval CACHE INDEX t1 INDEX (a), t2 IN $cache_name; + if ($mysql_errname) + { + --let $functionality = Indexes + --source unexpected_result.inc + } + + LOAD INDEX INTO CACHE t1, t2; + if ($mysql_errname) + { + --let $functionality = Indexes + --source unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); + --replace_result $cache_name <CACHE_NAME> + eval SET GLOBAL $cache_name.key_buffer_size=8*1024; + LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; + + --replace_result $cache_name <CACHE_NAME> + eval SET GLOBAL $cache_name.key_cache_age_threshold = 100, $cache_name.key_cache_block_size = 512, $cache_name.key_cache_division_limit = 1, $cache_name.key_cache_segments=2; + INSERT INTO t1 (a,b) VALUES (5,'e'),(6,'f'); + LOAD INDEX INTO CACHE t1; + + --replace_result $cache_name <CACHE_NAME> + eval SET GLOBAL new_$cache_name.key_buffer_size=128*1024; + --replace_result $cache_name <CACHE_NAME> + eval CACHE INDEX t1 IN new_$cache_name; + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + LOAD INDEX INTO CACHE t1 IGNORE LEAVES; + INSERT INTO t1 (a,b) VALUES (9,'i'); + DROP TABLE t2; + } + DROP TABLE t1; +} + +let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index (a), + $default_index (b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multiple keys or indexes on INT or CHAR columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_result $cache_name <CACHE_NAME> + eval CACHE INDEX t1 IN $cache_name; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + LOAD INDEX INTO CACHE t1; + + DROP TABLE t1; + let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index a_b (a,b) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Multi-part keys + --source unexpected_result.inc + } + + --replace_result $cache_name <CACHE_NAME> + eval CACHE INDEX t1 IN $cache_name; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + LOAD INDEX INTO CACHE t1; + + DROP TABLE t1; +} + +# Cleanup + +--replace_result $cache_name <CACHE_NAME> +eval SET GLOBAL $cache_name.key_buffer_size=0; +--replace_result $cache_name <CACHE_NAME> +eval SET GLOBAL new_$cache_name.key_buffer_size=0; + + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/check_errors.inc b/mysql-test/suite/storage_engine/check_errors.inc new file mode 100644 index 00000000000..e38ff2962f1 --- /dev/null +++ b/mysql-test/suite/storage_engine/check_errors.inc @@ -0,0 +1,80 @@ +# +# Since we run tests in disable_abort_on_error mode, we cannot use --error command, +# and need to check the result manually. +# Usage in a test: +# --let $error_codes = <comma-separated list> # optional, default '' +# --let $mysql_errname = <error name> # optional, default current $mysql_errname (from the last SQL command) +# --let $mysql_errno = <error code> # optional, default current $mysql_errno (from the last SQL command) +# + +if ($error_codes == '0') +{ + --let $error_codes = +} +if ($error_codes == '') +{ + if ($mysql_errname) + { + --echo # ERROR: Statement ended with errno $mysql_errno, errname $mysql_errname (expected to succeed) + } + + # If both error_codes and mysql_errname are false, all is good, no logic needed +} + +if ($error_codes != '') +{ + # If mysql_errname or mysql_errno is equal to $error_codes, it's good too, nothing to do + + if ($mysql_errname != $error_codes) + { + if ($mysql_errno != $error_codes) + { + --let $save_errno = $mysql_errno + --let $save_errname = $mysql_errname + + --let $codeline = `SELECT CONCAT('\'',REPLACE('$error_codes',',','\',\''),'\'')` + --let $result = `SELECT '$save_errname' IN($codeline) or '$save_errno' IN ($codeline)` + + --let $mysql_errno = $save_errno + --let $mysql_errname = $save_errname + + if (!$result) + { + if ($mysql_errname) + { + --echo # ERROR: Statement ended with errno $mysql_errno, errname $mysql_errname (expected results: $error_codes) + } + if (!$mysql_errname) + { + --echo # ERROR: Statement succeeded (expected results: $error_codes) + } + } + # If a list contained more than one error, it could be on one of two reasons: + # first, we do not care which code it is, as long as it is one of the listed errors. + # In this case we will suggest to add an rdiff file if the message differs. + # Second, check_errors might be called from a generalized include file or test, + # which runs with different parameters and thus might produce different results for the same statement. + # Then, the message will be stricter, as the difference with the result file is actually a problem + # which needs to be checked at least. + if ($result) + { + if (!$strict_check) + { + --echo # Statement ended with one of expected results ($error_codes). + --echo # If you got a difference in error message, just add it to rdiff file + } + if ($strict_check) + { + --echo # WARNING: Statement ended with errno $mysql_errno, errname '$mysql_errname'. + --echo # If it differs from the result file, it might indicate a problem. + } + + } + } + } +} + +# Don't want the variables to be accidentally reused later +--let $error_codes = +--let $strict_check = + diff --git a/mysql-test/suite/storage_engine/check_table.inc b/mysql-test/suite/storage_engine/check_table.inc new file mode 100644 index 00000000000..54bdf511cb8 --- /dev/null +++ b/mysql-test/suite/storage_engine/check_table.inc @@ -0,0 +1,62 @@ +# +# CHECK TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support CHECK. +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + +--let $table_name = t2 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc + +CHECK TABLE t1; +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +CHECK TABLE t1, t2 FOR UPGRADE; +INSERT INTO t2 (a,b) VALUES (5,'e'); +CHECK TABLE t2 QUICK; +INSERT INTO t1 (a,b) VALUES (6,'f'); +CHECK TABLE t1 FAST; +INSERT INTO t1 (a,b) VALUES (7,'g'); +INSERT INTO t2 (a,b) VALUES (8,'h'); +CHECK TABLE t2, t1 MEDIUM; +INSERT INTO t1 (a,b) VALUES (9,'i'); +INSERT INTO t2 (a,b) VALUES (10,'j'); +CHECK TABLE t1, t2 EXTENDED; +INSERT INTO t1 (a,b) VALUES (11,'k'); +CHECK TABLE t1 CHANGED; + +DROP TABLE t1, t2; + +--let $continue = 1 +--source have_default_index.inc +if ($have_default_index) +{ + --let $create_definition = a $int_indexed_col, $default_index(a) + --source create_table.inc + INSERT INTO t1 (a) VALUES (1),(2),(5); + CHECK TABLE t1; + INSERT INTO t1 (a) VALUES (6),(8),(12); + CHECK TABLE t1 FOR UPGRADE; + INSERT INTO t1 (a) VALUES (13),(15),(16); + CHECK TABLE t1 QUICK; + INSERT INTO t1 (a) VALUES (17),(120),(132); + CHECK TABLE t1 FAST; + INSERT INTO t1 (a) VALUES (801),(900),(7714); + CHECK TABLE t1 MEDIUM; + INSERT INTO t1 (a) VALUES (8760),(10023),(12000); + CHECK TABLE t1 EXTENDED; + INSERT INTO t1 (a) VALUES (13345),(24456),(78302),(143028); + CHECK TABLE t1 CHANGED; + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/check_table.result b/mysql-test/suite/storage_engine/check_table.result new file mode 100644 index 00000000000..83c32778959 --- /dev/null +++ b/mysql-test/suite/storage_engine/check_table.result @@ -0,0 +1,68 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +CHECK TABLE t1, t2 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +CHECK TABLE t2 QUICK; +Table Op Msg_type Msg_text +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (6,'f'); +CHECK TABLE t1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (7,'g'); +INSERT INTO t2 (a,b) VALUES (8,'h'); +CHECK TABLE t2, t1 MEDIUM; +Table Op Msg_type Msg_text +test.t2 check status OK +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (9,'i'); +INSERT INTO t2 (a,b) VALUES (10,'j'); +CHECK TABLE t1, t2 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (11,'k'); +CHECK TABLE t1 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (1),(2),(5); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (6),(8),(12); +CHECK TABLE t1 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (13),(15),(16); +CHECK TABLE t1 QUICK; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (17),(120),(132); +CHECK TABLE t1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (801),(900),(7714); +CHECK TABLE t1 MEDIUM; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (8760),(10023),(12000); +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (13345),(24456),(78302),(143028); +CHECK TABLE t1 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/check_table.test b/mysql-test/suite/storage_engine/check_table.test new file mode 100644 index 00000000000..243c8e07161 --- /dev/null +++ b/mysql-test/suite/storage_engine/check_table.test @@ -0,0 +1,14 @@ +# +# CHECK TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support CHECK. +# + +--source have_engine.inc + +--source check_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/checksum_table.inc b/mysql-test/suite/storage_engine/checksum_table.inc new file mode 100644 index 00000000000..d4bacce93b7 --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table.inc @@ -0,0 +1,31 @@ +# +# CHECKSUM TABLE statements for standard CHECKSUM properties. +# Live checksums are covered in checksum_table_live.test +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +# For most engines CHECKSUM=0 option will be ignored, +# but we are setting it here for those which have it 1 by default +# (there will be another test for live checksum) + +--let $table_options = CHECKSUM=0 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + +--let $table_name = t2 +--let $table_options = CHECKSUM=0 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc + +CHECKSUM TABLE t1; +CHECKSUM TABLE t2, t1; +CHECKSUM TABLE t1, t2 QUICK; +CHECKSUM TABLE t1, t2 EXTENDED; + +DROP TABLE t1, t2; + + diff --git a/mysql-test/suite/storage_engine/checksum_table.result b/mysql-test/suite/storage_engine/checksum_table.result new file mode 100644 index 00000000000..02d70491fa9 --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=0; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=0; +CHECKSUM TABLE t1; +Table Checksum +test.t1 4272806499 +CHECKSUM TABLE t2, t1; +Table Checksum +test.t2 0 +test.t1 4272806499 +CHECKSUM TABLE t1, t2 QUICK; +Table Checksum +test.t1 NULL +test.t2 NULL +CHECKSUM TABLE t1, t2 EXTENDED; +Table Checksum +test.t1 4272806499 +test.t2 0 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/checksum_table.test b/mysql-test/suite/storage_engine/checksum_table.test new file mode 100644 index 00000000000..5693e9a1ad3 --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table.test @@ -0,0 +1,11 @@ +# +# CHECKSUM TABLE statements for standard CHECKSUM properties. +# Live checksums are covered in checksum_table_live.test +# + +--source have_engine.inc + +--source checksum_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/checksum_table_live.inc b/mysql-test/suite/storage_engine/checksum_table_live.inc new file mode 100644 index 00000000000..9614494e620 --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table_live.inc @@ -0,0 +1,30 @@ +# +# CHECKSUM TABLE statements for live CHECKSUM. +# +# Note: the feature is likely to be unsupported, in which case +# instead of numeric values some CHECKSUMs will produce NULL +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +# For most engines CHECKSUM=1 option will be ignored, +# and the results will be different + +--let $table_options = CHECKSUM=1 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--let $table_name = t2 +--let $table_options = CHECKSUM=1 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc + +CHECKSUM TABLE t1; +CHECKSUM TABLE t2, t1; +CHECKSUM TABLE t1, t2 QUICK; +CHECKSUM TABLE t1, t2 EXTENDED; + +DROP TABLE t1, t2; + diff --git a/mysql-test/suite/storage_engine/checksum_table_live.result b/mysql-test/suite/storage_engine/checksum_table_live.result new file mode 100644 index 00000000000..59ab8f1688a --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table_live.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1; +CHECKSUM TABLE t1; +Table Checksum +test.t1 4272806499 +CHECKSUM TABLE t2, t1; +Table Checksum +test.t2 0 +test.t1 4272806499 +CHECKSUM TABLE t1, t2 QUICK; +Table Checksum +test.t1 4272806499 +test.t2 0 +CHECKSUM TABLE t1, t2 EXTENDED; +Table Checksum +test.t1 4272806499 +test.t2 0 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/checksum_table_live.test b/mysql-test/suite/storage_engine/checksum_table_live.test new file mode 100644 index 00000000000..347755f24df --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table_live.test @@ -0,0 +1,13 @@ +# +# CHECKSUM TABLE statements for live CHECKSUM. +# +# Note: the feature is likely to be unsupported, in which case +# instead of numeric values some CHECKSUMs will produce NULL +# + +--source have_engine.inc + +--source checksum_table_live.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/cleanup_engine.inc b/mysql-test/suite/storage_engine/cleanup_engine.inc new file mode 100644 index 00000000000..de3d57eeaeb --- /dev/null +++ b/mysql-test/suite/storage_engine/cleanup_engine.inc @@ -0,0 +1,11 @@ +########################################### +# +# This is a stub of the include file cleanup_engine.inc which +# should be placed in storage/<engine>/mysql-test/storage_engine folder. +# +################################ +# +# Here you can add whatever is needed to cleanup +# in case your define_engine.inc created any artefacts, +# e.g. an additional schema and/or tables. + diff --git a/mysql-test/suite/storage_engine/col_not_null.inc b/mysql-test/suite/storage_engine/col_not_null.inc new file mode 100644 index 00000000000..5f980b0a915 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_not_null.inc @@ -0,0 +1,92 @@ +# +# NOT NULL attribute in columns +# +# Usage: +# let $col_definition = <column type (and possibly more options)>; +# let $col_default = <default non-null value for a column>; +# --source col_not_null.inc +# +# We will add NOT NULL at the end of $col; +# +# Also, if $col_default is defined, +# we will create a table with 2 columns +# (one with DEFAULT $col_default, and one without any default), +# and will also attempt to add a column with DEFAULT NULL. +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = c $col_definition NOT NULL +--source create_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + SHOW COLUMNS IN t1; + + --let $error_codes = ER_BAD_NULL_ERROR + INSERT INTO t1 (c) VALUES (NULL); + --source check_errors.inc + + DROP TABLE t1; +} + +if ($col_default != '') +{ + let $create_definition = + c $col_definition NOT NULL, + c2 $col_definition NOT NULL DEFAULT $col_default + ; + --source create_table.inc + if ($mysql_errname) + { + --source unexpected_result.inc + } + if (!$mysql_errname) + { + SHOW COLUMNS IN t1; + + --let $error_codes = ER_INVALID_DEFAULT + --let $alter_definition = ADD COLUMN err $col_definition NOT NULL DEFAULT NULL + --source alter_table.inc + if ($mysql_errname != ER_INVALID_DEFAULT) + { + --let $functionality = ALTER or DEFAULT + --source unexpected_result.inc + } + + --let $error_codes = ER_BAD_NULL_ERROR + INSERT INTO t1 (c) VALUES (NULL); + --source check_errors.inc + if ($mysql_errname != ER_BAD_NULL_ERROR) + { + --let $functionality = NOT NULL columns + --source unexpected_result.inc + } + + # HEX should be universal for all column types + SELECT HEX(c), HEX(c2) FROM t1; + + --let $error_codes = ER_BAD_NULL_ERROR + INSERT INTO t1 (c2) VALUES (NULL); + --source check_errors.inc + + --eval INSERT INTO t1 (c) VALUES ($col_default) + if ($mysql_errname) + { + --let $functionality = DEFAULT + --source unexpected_result.inc + } + SELECT COUNT(c), COUNT(c2) FROM t1; + + DROP TABLE t1; + } +} + +# We don't want to preserve it +let $col_default = ; + diff --git a/mysql-test/suite/storage_engine/col_null.inc b/mysql-test/suite/storage_engine/col_null.inc new file mode 100644 index 00000000000..6f74609869f --- /dev/null +++ b/mysql-test/suite/storage_engine/col_null.inc @@ -0,0 +1,65 @@ +# +# NULL attribute and DEFAULT NULL in columns +# +# Usage: +# let $col_definition = <column type (and possibly more options)>; +# let $col_default = <default non-null value for a column>; +# --source col_null.inc +# +# We will add NULL at the end of $col; +# +# Also, if $col_default is defined, +# we will create a table with 3 columns (one with DEFAULT NULL, +# one with DEFAULT $col_default, and one without any default) +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = c $col_definition NULL +--source create_table.inc +SHOW COLUMNS IN t1; +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (c) VALUES (NULL); + if ($mysql_errname) + { + --let $functionality = NULLable columns + --source unexpected_result.inc + } + SELECT COUNT(c), COUNT(*) FROM t1; + + DROP TABLE t1; +} + +if ($col_default != '') +{ + let $create_definition = + c $col_definition NULL, + c1 $col_definition NULL DEFAULT NULL, + c2 $col_definition NULL DEFAULT $col_default + ; + --source create_table.inc + if ($mysql_errname) + { + --source unexpected_result.inc + } + if (!$mysql_errname) + { + SHOW COLUMNS IN t1; + + INSERT INTO t1 (c) VALUES (NULL); + SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; + + DROP TABLE t1; + } +} + +# We don't want to preserve it +let $col_default = ; + diff --git a/mysql-test/suite/storage_engine/col_opt_default.result b/mysql-test/suite/storage_engine/col_opt_default.result new file mode 100644 index 00000000000..2d0a8508b99 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_default.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN> DEFAULT '0') ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # 0 +INSERT INTO t1 (a) VALUES (1); +SELECT * FROM t1; +a +1 +ALTER TABLE t1 ADD COLUMN b <CHAR_COLUMN> DEFAULT ''; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # 0 +b char(8) # +INSERT INTO t1 (b) VALUES ('a'); +SELECT * FROM t1; +a b +0 a +1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_default.test b/mysql-test/suite/storage_engine/col_opt_default.test new file mode 100644 index 00000000000..f59daef37fc --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_default.test @@ -0,0 +1,49 @@ +# +# Check whether DEFAULT column attribute +# is supported in CREATE and ALTER TABLE. +# If the attribute is supported at all, it will be covered +# in more details in col_option_null and col_option_not_null tests. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col DEFAULT '0' +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = DEFAULT values + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1); + --sorted_result + SELECT * FROM t1; + + --let $alter_definition = ADD COLUMN b $char_col DEFAULT '' + --source alter_table.inc + if ($mysql_errname) + { + --let $functionality = ALTER or DEFAULT + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 3 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (b) VALUES ('a'); + --sorted_result + SELECT * FROM t1; + } + DROP TABLE t1; +} +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/col_opt_not_null.result b/mysql-test/suite/storage_engine/col_opt_not_null.result new file mode 100644 index 00000000000..00a863fccce --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_not_null.result @@ -0,0 +1,2062 @@ +# +# BINARY columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS> NOT NULL, +b0 BINARY(0) <CUSTOM_COL_OPTIONS> NOT NULL, +b1 BINARY(1) <CUSTOM_COL_OPTIONS> NOT NULL, +b20 BINARY(20) <CUSTOM_COL_OPTIONS> NOT NULL, +b255 BINARY(255) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b0' at row 2 +Warning 1265 Data truncated for column 'b1' at row 2 +Warning 1265 Data truncated for column 'b20' at row 2 +Warning 1265 Data truncated for column 'b255' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 +Warning 1265 Data truncated for column 'b0' at row 3 +Warning 1265 Data truncated for column 'b1' at row 3 +Warning 1265 Data truncated for column 'b20' at row 3 +Warning 1265 Data truncated for column 'b255' at row 3 +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +43 43 4372656174696E6720616E2061727469636C6520 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +61 61 6161616161616161616161616161616161616161 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +78 78 7878787878787878787878787878787878787878 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +ALTER TABLE t1 ADD COLUMN b257 BINARY(257) <CUSTOM_COL_OPTIONS> NOT NULL; +ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BINARY <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c binary(1) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c BINARY <CUSTOM_COL_OPTIONS> NOT NULL, +c2 BINARY <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c binary(1) NO NULL +c2 binary(1) NO 0 +ALTER TABLE t1 ADD COLUMN err BINARY <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (0); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# VARBINARY columns +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARBINARY(0) <CUSTOM_COL_OPTIONS> NOT NULL, +v1 VARBINARY(1) <CUSTOM_COL_OPTIONS> NOT NULL, +v64 VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL, +v65000 VARBINARY(65000) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +CREATE TABLE t2 (v VARBINARY(65532) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varbinary(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1; +HEX(v0) HEX(v1) HEX(v64) HEX(v65000) + + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020202020202020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204D7953514C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A0A2020202020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A2020202020202020202020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569646520666F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696320756E6465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20 +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; +HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) + 0 + 0 + 48 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E20576527766520 5932 + 61 61626364656667686920616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364 130000 + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 5930 + 79 63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 130000 +ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) <CUSTOM_COL_OPTIONS> NOT NULL; +Warnings: +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +v65536 mediumblob # # # +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varbinary(64) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL, +c2 VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 'test' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varbinary(64) NO NULL +c2 varbinary(64) NO test +ALTER TABLE t1 ADD COLUMN err VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('test'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# BIT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS> NOT NULL, +b BIT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +c BIT(64) <CUSTOM_COL_OPTIONS> NOT NULL, +d BIT(1) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN d BIT(0) <CUSTOM_COL_OPTIONS> NOT NULL; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; +BIN(a) HEX(b) c+0 +0 FFFFF 18446744073709551615 +INSERT INTO t1 VALUES (1,0,-1,0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; +a+0 b+0 c+0 +0 1048575 18446744073709551615 +1 0 18446744073709551615 +INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); +a+0 b+0 c+0 +1 0 18446744073709551615 +1 102 255 +INSERT INTO t1 VALUES (0x10,0,0,1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b c d +INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +SELECT * FROM t1; +a b c d +DROP TABLE t1; +CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR 42000: Display width out of range for 'a' (max = 64) +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BIT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bit(1) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c BIT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 BIT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bit(1) NO NULL +c2 bit(1) NO b'1' +ALTER TABLE t1 ADD COLUMN err BIT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (1); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# BLOB columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS> NOT NULL, +b0 BLOB(0) <CUSTOM_COL_OPTIONS> NOT NULL, +b1 BLOB(1) <CUSTOM_COL_OPTIONS> NOT NULL, +b300 BLOB(300) <CUSTOM_COL_OPTIONS> NOT NULL, +bm BLOB(65535) <CUSTOM_COL_OPTIONS> NOT NULL, +b70k BLOB(70000) <CUSTOM_COL_OPTIONS> NOT NULL, +b17m BLOB(17000000) <CUSTOM_COL_OPTIONS> NOT NULL, +t TINYBLOB <CUSTOM_COL_OPTIONS> NOT NULL, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS> NOT NULL, +l LONGBLOB <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b blob # # # +b0 blob # # # +b1 tinyblob # # # +b300 blob # # # +bm blob # # # +b70k mediumblob # # # +b17m longblob # # # +t tinyblob # # # +m mediumblob # # # +l longblob # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) ); +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b300' at row 1 +Warning 1265 Data truncated for column 'bm' at row 1 +Warning 1265 Data truncated for column 't' at row 1 +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296); +ERROR 42000: Display width out of range for 'bbb' (max = 4294967295) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BLOB <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c blob NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYBLOB <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyblob NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMBLOB <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumblob NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c LONGBLOB <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c longblob NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +# +# BOOL columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b1 BOOL <CUSTOM_COL_OPTIONS> NOT NULL, +b2 BOOLEAN <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b1 tinyint(1) # # # +b2 tinyint(1) # # # +INSERT INTO t1 VALUES (1,TRUE); +SELECT * FROM t1; +b1 b2 +1 1 +INSERT INTO t1 VALUES (FALSE,0); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +INSERT INTO t1 VALUES (2,3); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (-1,-2); +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +1 1 +2 3 +SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; +a b +false false +true true +true true +true true +SELECT * FROM t1 WHERE b1 = TRUE; +b1 b2 +1 1 +SELECT * FROM t1 WHERE b2 = FALSE; +b1 b2 +0 0 +INSERT INTO t1 VALUES ('a','b'); +Warnings: +Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 +Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (128,-129); +Warnings: +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +127 -128 +2 3 +ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNSIGNED' at line 1 +ALTER TABLE t1 ADD COLUMN b3 BOOL ZEROFILL; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ZEROFILL' at line 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BOOL <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(1) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c BOOL <CUSTOM_COL_OPTIONS> NOT NULL, +c2 BOOL <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '0' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(1) NO NULL +c2 tinyint(1) NO 0 +ALTER TABLE t1 ADD COLUMN err BOOL <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('0'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# CHAR columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NOT NULL, +c0 CHAR(0) <CUSTOM_COL_OPTIONS> NOT NULL, +c1 CHAR(1) <CUSTOM_COL_OPTIONS> NOT NULL, +c20 CHAR(20) <CUSTOM_COL_OPTIONS> NOT NULL, +c255 CHAR(255) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) # # # +c0 char(0) # # # +c1 char(1) # # # +c20 char(20) # # # +c255 char(255) # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT * FROM t1; +c c0 c1 c20 c255 + +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'c0' at row 1 +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c20' at row 1 +Warning 1265 Data truncated for column 'c255' at row 1 +INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 +SELECT * FROM t1; +c c0 c1 c20 c255 + + +C C Creating an article Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b +a a aaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +x x xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; +c20 REPEAT('a',LENGTH(c20)) COUNT(*) + 2 +Creating an article aaaaaaaaaaaaaaaaaaa 1 +aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa 1 +abcdefghi klmnopqrst aaaaaaaaaaaaaaaaaaaa 1 +xxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaaaaa 1 +ALTER TABLE t1 ADD COLUMN c257 CHAR(257) <CUSTOM_COL_OPTIONS> NOT NULL; +ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NOT NULL, +c2 CHAR <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '_' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) NO NULL +c2 char(1) NO _ +ALTER TABLE t1 ADD COLUMN err CHAR <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('_'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# VARCHAR columns +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARCHAR(0) <CUSTOM_COL_OPTIONS> NOT NULL, +v1 VARCHAR(1) <CUSTOM_COL_OPTIONS> NOT NULL, +v64 VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL, +v65000 VARCHAR(65000) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +CREATE TABLE t2 (v VARCHAR(65532) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varchar(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT * FROM t1; +v0 v1 v64 v65000 + + + + + + + + + + + + y Once there, double check that an article doesn't already exist Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) + o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Free to read in the Knowledgebase! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + o The 'default' book to read if you wont to learn to use MySQL / MariaDB. + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + * MariaDB Crash Course by Ben Forta + * MySQL (4th Edition) by Paul DuBois + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + * MySQL Admin Cookbook + * MySQL Cookbook by Paul DuBois + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + For MariaDB / MySQL end users + For developers who want to code on MariaDB or MySQL + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT v0, v1, v64, LENGTH(v65000) FROM t1; +v0 v1 v64 LENGTH(v65000) + 0 + 0 + H Here is a list of recommended books on MariaDB and MySQL. We've 2966 + a abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcd 65000 + y Once there, double check that an article doesn't already exist 2965 + y cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 65000 +ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) <CUSTOM_COL_OPTIONS> NOT NULL; +Warnings: +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +v65536 mediumtext # # # +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varchar(64) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL, +c2 VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 'test default' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varchar(64) NO NULL +c2 varchar(64) NO test default +ALTER TABLE t1 ADD COLUMN err VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('test default'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# date and time columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS> NOT NULL, +dt DATETIME <CUSTOM_COL_OPTIONS> NOT NULL, +ts TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL, +t TIME <CUSTOM_COL_OPTIONS> NOT NULL, +y YEAR <CUSTOM_COL_OPTIONS> NOT NULL, +y4 YEAR(4) <CUSTOM_COL_OPTIONS> NOT NULL, +y2 YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d date # # # +dt datetime # # # +ts timestamp # # # on update CURRENT_TIMESTAMP +t time # # # +y year(4) # # # +y4 year(4) # # # +y2 year(2) # # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 VALUES +('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), +('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), +('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +INSERT INTO t1 VALUES +('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'dt' at row 1 +Warning 1265 Data truncated for column 'ts' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'y4' at row 1 +Warning 1264 Out of range value for column 'y2' at row 1 +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DATE <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c date NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c DATE <CUSTOM_COL_OPTIONS> NOT NULL, +c2 DATE <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '2012-12-21' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c date NO NULL +c2 date NO 2012-12-21 +ALTER TABLE t1 ADD COLUMN err DATE <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('2012-12-21'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DATETIME <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c datetime NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c DATETIME <CUSTOM_COL_OPTIONS> NOT NULL, +c2 DATETIME <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '2012-12-21 12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c datetime NO NULL +c2 datetime NO 2012-12-21 12:21:12 +ALTER TABLE t1 ADD COLUMN err DATETIME <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('2012-12-21 12:21:12'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +CREATE TABLE t1 (c TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL, +c2 TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '2012-02-21 12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ALTER TABLE t1 ADD COLUMN err TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +INSERT INTO t1 (c2) VALUES (NULL); +SELECT c, c2 FROM t1; +c c2 +<TIMESTAMP> <DEFAULT_TIMESTAMP> +<TIMESTAMP> <TIMESTAMP> +DROP TABLE t1; +CREATE TABLE t1 (c TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +INSERT INTO t1 (c) VALUES (NULL); +SELECT * FROM t1; +c +<TIMESTAMP> +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TIME <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c time NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c TIME <CUSTOM_COL_OPTIONS> NOT NULL, +c2 TIME <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c time NO NULL +c2 time NO 12:21:12 +ALTER TABLE t1 ADD COLUMN err TIME <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('12:21:12'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c YEAR <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(4) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c YEAR <CUSTOM_COL_OPTIONS> NOT NULL, +c2 YEAR <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '2012' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(4) NO NULL +c2 year(4) NO 2012 +ALTER TABLE t1 ADD COLUMN err YEAR <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('2012'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(2) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL, +c2 YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(2) NO NULL +c2 year(2) NO 12 +ALTER TABLE t1 ADD COLUMN err YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('12'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# ENUM columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a ENUM('') <CUSTOM_COL_OPTIONS> NOT NULL, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS> NOT NULL, +c ENUM('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +INSERT INTO t1 VALUES ('','test2','4'),('',5,2); +SELECT * FROM t1; +a b c + test2 4 + test5 2 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + + test2 4 + test5 2 +ALTER TABLE t1 ADD COLUMN e ENUM('a','A') <CUSTOM_COL_OPTIONS> NOT NULL; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in ENUM +Note 1291 Column 'e' has duplicated value 'a' in ENUM +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +e enum('a','A') # # # +INSERT INTO t1 VALUES ('','test3','75','A'); +SELECT * FROM t1; +a b c e + a + test2 4 a + test3 75 a + test5 2 a +SELECT * FROM t1 WHERE b='test2' OR a != ''; +a b c e + test2 4 a +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c enum('test1','test2','test3') NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL, +c2 ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 'test2' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c enum('test1','test2','test3') NO NULL +c2 enum('test1','test2','test3') NO test2 +ALTER TABLE t1 ADD COLUMN err ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('test2'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# Fixed point columns (NUMERIC, DECIMAL) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL, +d0 DECIMAL(0) <CUSTOM_COL_OPTIONS> NOT NULL, +d1_1 DECIMAL(1,1) <CUSTOM_COL_OPTIONS> NOT NULL, +d10_2 DECIMAL(10,2) <CUSTOM_COL_OPTIONS> NOT NULL, +d60_10 DECIMAL(60,10) <CUSTOM_COL_OPTIONS> NOT NULL, +n NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL, +n0_0 NUMERIC(0,0) <CUSTOM_COL_OPTIONS> NOT NULL, +n1 NUMERIC(1) <CUSTOM_COL_OPTIONS> NOT NULL, +n20_4 NUMERIC(20,4) <CUSTOM_COL_OPTIONS> NOT NULL, +n65_4 NUMERIC(65,4) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) # # # +d0 decimal(10,0) # # # +d1_1 decimal(1,1) # # # +d10_2 decimal(10,2) # # # +d60_10 decimal(60,10) # # # +n decimal(10,0) # # # +n0_0 decimal(10,0) # # # +n1 decimal(1,0) # # # +n20_4 decimal(20,4) # # # +n65_4 decimal(65,4) # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL, +c2 DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 1.1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +Warnings: +Note 1265 Data truncated for column 'c2' at row 1 +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) NO NULL +c2 decimal(10,0) NO 1 +ALTER TABLE t1 ADD COLUMN err DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (1.1); +Warnings: +Note 1265 Data truncated for column 'c' at row 1 +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL, +c2 NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) NO NULL +c2 decimal(10,0) NO 0 +ALTER TABLE t1 ADD COLUMN err NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (0); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# Floating point columns (FLOAT, DOUBLE) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS> NOT NULL, +f0 FLOAT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +r1_1 REAL(1,1) <CUSTOM_COL_OPTIONS> NOT NULL, +f23_0 FLOAT(23) <CUSTOM_COL_OPTIONS> NOT NULL, +f20_3 FLOAT(20,3) <CUSTOM_COL_OPTIONS> NOT NULL, +d DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL, +d1_0 DOUBLE(1,0) <CUSTOM_COL_OPTIONS> NOT NULL, +d10_10 DOUBLE PRECISION (10,10) <CUSTOM_COL_OPTIONS> NOT NULL, +d53 DOUBLE(53,0) <CUSTOM_COL_OPTIONS> NOT NULL, +d53_10 DOUBLE(53,10) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float # # # +f0 float # # # +r1_1 double(1,1) # # # +f23_0 float # # # +f20_3 float(20,3) # # # +d double # # # +d1_0 double(1,0) # # # +d10_10 double(10,10) # # # +d53 double(53,0) # # # +d53_10 double(53,10) # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 12345.1 +d 11111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 1234566789123456800 +d53_10 100000000000000000.0000000000 +f0 12345.1 +f20_3 56789.988 +f23_0 123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 1e38 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e65 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c FLOAT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c float NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c FLOAT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 FLOAT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 1.1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c float NO NULL +c2 float NO 1.1 +ALTER TABLE t1 ADD COLUMN err FLOAT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (1.1 ); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c double NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL, +c2 DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c double NO NULL +c2 double NO 0 +ALTER TABLE t1 ADD COLUMN err DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (0); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# INT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS> NOT NULL, +i0 INT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +i1 INT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +i20 INT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +t TINYINT <CUSTOM_COL_OPTIONS> NOT NULL, +t0 TINYINT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +t1 TINYINT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +t20 TINYINT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +s SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL, +s0 SMALLINT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +s1 SMALLINT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +s20 SMALLINT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +m MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL, +m0 MEDIUMINT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +m1 MEDIUMINT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +m20 MEDIUMINT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +b BIGINT <CUSTOM_COL_OPTIONS> NOT NULL, +b0 BIGINT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +b1 BIGINT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +b20 BIGINT(20) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(11) # # # +i0 int(11) # # # +i1 int(1) # # # +i20 int(20) # # # +t tinyint(4) # # # +t0 tinyint(4) # # # +t1 tinyint(1) # # # +t20 tinyint(20) # # # +s smallint(6) # # # +s0 smallint(6) # # # +s1 smallint(1) # # # +s20 smallint(20) # # # +m mediumint(9) # # # +m0 mediumint(9) # # # +m1 mediumint(1) # # # +m20 mediumint(20) # # # +b bigint(20) # # # +b0 bigint(20) # # # +b1 bigint(1) # # # +b20 bigint(20) # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c INT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c int(11) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c INT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 INT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 2147483647 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c int(11) NO NULL +c2 int(11) NO 2147483647 +ALTER TABLE t1 ADD COLUMN err INT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (2147483647); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYINT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(4) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c TINYINT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 TINYINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 127 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(4) NO NULL +c2 tinyint(4) NO 127 +ALTER TABLE t1 ADD COLUMN err TINYINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (127 ); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c smallint(6) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c smallint(6) NO NULL +c2 smallint(6) NO 0 +ALTER TABLE t1 ADD COLUMN err SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (0); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumint(9) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumint(9) NO NULL +c2 mediumint(9) NO 1 +ALTER TABLE t1 ADD COLUMN err MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (1); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BIGINT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bigint(20) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c BIGINT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 BIGINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 9223372036854775807 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bigint(20) NO NULL +c2 bigint(20) NO 9223372036854775807 +ALTER TABLE t1 ADD COLUMN err BIGINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (9223372036854775807); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# SET columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a SET('') <CUSTOM_COL_OPTIONS> NOT NULL, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS> NOT NULL, +c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +INSERT INTO t1 VALUES +('','test2,test3','01,34,44,,23'), +('',5,2), +(',','test4,test2',''); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +ALTER TABLE t1 ADD COLUMN e SET('a','A') <CUSTOM_COL_OPTIONS> NOT NULL; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in SET +Note 1291 Column 'e' has duplicated value 'a' in SET +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +e set('a','A') # # # +ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS> NOT NULL; +ERROR HY000: Too many strings for column f and SET +SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +a b c e + test2,test3 01,23,34,44 + test2,test4 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c set('test1','test2','test3') NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL, +c2 SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 'test2,test3' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c set('test1','test2','test3') NO NULL +c2 set('test1','test2','test3') NO test2,test3 +ALTER TABLE t1 ADD COLUMN err SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('test2,test3'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# TEXT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS> NOT NULL, +t0 TEXT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +t1 TEXT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +t300 TEXT(300) <CUSTOM_COL_OPTIONS> NOT NULL, +tm TEXT(65535) <CUSTOM_COL_OPTIONS> NOT NULL, +t70k TEXT(70000) <CUSTOM_COL_OPTIONS> NOT NULL, +t17m TEXT(17000000) <CUSTOM_COL_OPTIONS> NOT NULL, +tt TINYTEXT <CUSTOM_COL_OPTIONS> NOT NULL, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS> NOT NULL, +l LONGTEXT <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t text # # # +t0 text # # # +t1 tinytext # # # +t300 text # # # +tm text # # # +t70k mediumtext # # # +t17m longtext # # # +tt tinytext # # # +m mediumtext # # # +l longtext # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) ); +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1265 Data truncated for column 't0' at row 1 +Warning 1265 Data truncated for column 't1' at row 1 +Warning 1265 Data truncated for column 't300' at row 1 +Warning 1265 Data truncated for column 'tm' at row 1 +Warning 1265 Data truncated for column 'tt' at row 1 +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296); +ERROR 42000: Display width out of range for 'ttt' (max = 4294967295) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TEXT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c text NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYTEXT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinytext NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMTEXT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumtext NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c LONGTEXT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c longtext NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_not_null.test b/mysql-test/suite/storage_engine/col_opt_not_null.test new file mode 100644 index 00000000000..2cd0e909536 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_not_null.test @@ -0,0 +1,260 @@ +# +# NOT NULL column attribute +# + +let $extra_col_opts = NOT NULL; + +--source have_engine.inc + +--echo # +--echo # BINARY columns +--echo # + +--source type_binary.inc +--let $col_definition = BINARY $default_col_opts +--let $col_default = 0 +--source col_not_null.inc + +--echo # +--echo # VARBINARY columns +--echo # + +--source type_varbinary.inc +--let $col_definition = VARBINARY(64) $default_col_opts +--let $col_default = 'test' +--source col_not_null.inc + +--echo # +--echo # BIT columns +--echo # + +--source type_bit.inc +--let $col_definition = BIT $default_col_opts +--let $col_default = 1 +--source col_not_null.inc + +--echo # +--echo # BLOB columns +--echo # + +--source type_blob.inc + +--let $col_definition = BLOB $default_col_opts +--source col_not_null.inc + +--let $col_definition = TINYBLOB $default_col_opts +--source col_not_null.inc + +--let $col_definition = MEDIUMBLOB $default_col_opts +--source col_not_null.inc + +--let $col_definition = LONGBLOB $default_col_opts +--source col_not_null.inc + +--echo # +--echo # BOOL columns +--echo # + +--source type_bool.inc +--let $col_definition = BOOL $default_col_opts +--let $col_default = '0' +--source col_not_null.inc + +--echo # +--echo # CHAR columns +--echo # + +--source type_char.inc +--let $col_definition = CHAR $default_col_opts +--let $col_default = '_' +--source col_not_null.inc + +--echo # +--echo # VARCHAR columns +--echo # + +--source type_varchar.inc +--let $col_definition = VARCHAR(64) $default_col_opts +--let $col_default = 'test default' +--source col_not_null.inc + +--echo # +--echo # date and time columns +--echo # + +--source type_date_time.inc + +--let $col_definition = DATE $default_col_opts +--let $col_default = '2012-12-21' +--source col_not_null.inc + +--let $col_definition = DATETIME $default_col_opts +--let $col_default = '2012-12-21 12:21:12' +--source col_not_null.inc + +# For TIMESTAMP the behavior is non-standard + +# $col_opts already contains NOT NULL part (it's set in have_engine.inc) + +let $create_definition = + c TIMESTAMP $col_opts, + c2 TIMESTAMP $col_opts DEFAULT '2012-02-21 12:21:12' +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = TIMESTAMP type or NOT NULL columns or DEFAULT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --let $error_codes = ER_INVALID_DEFAULT + --let $alter_definition = ADD COLUMN err TIMESTAMP $col_opts DEFAULT NULL + --source alter_table.inc + if ($mysql_errname!=ER_INVALID_DEFAULT) + { + --let $functionality = ALTER or DEFAULT + --source unexpected_result.inc + } + + INSERT INTO t1 (c) VALUES (NULL); + INSERT INTO t1 (c2) VALUES (NULL); + --replace_regex /2012-02-21 12:21:12/<DEFAULT_TIMESTAMP>/ /[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}/<TIMESTAMP>/ + SELECT c, c2 FROM t1; + + DROP TABLE t1; +} + +--let $create_definition = c TIMESTAMP $col_opts +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = TIMESTAMP type + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + SHOW COLUMNS IN t1; + + INSERT INTO t1 (c) VALUES (NULL); + if ($mysql_errname) + { + --let $functionality = TIMESTAMP + --source unexpected_result.inc + } + + --replace_regex /[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}/<TIMESTAMP>/ + SELECT * FROM t1; + DROP TABLE t1; +} + +# End of TIMESTAMP exception + + +--let $col_definition = TIME $default_col_opts +--let $col_default = '12:21:12' +--source col_not_null.inc + +--let $col_definition = YEAR $default_col_opts +--let $col_default = '2012' +--source col_not_null.inc + +--let $col_definition = YEAR(2) $default_col_opts +--let $col_default = '12' +--source col_not_null.inc + + +--echo # +--echo # ENUM columns +--echo # + +--source type_enum.inc + +--let $col_definition = ENUM('test1','test2','test3') $default_col_opts +--let $col_default = 'test2' +--source col_not_null.inc + + +--echo # +--echo # Fixed point columns (NUMERIC, DECIMAL) +--echo # + +--source type_fixed.inc + +--let $col_definition = DECIMAL $default_col_opts +--let $col_default = 1.1 +--source col_not_null.inc + +--let $col_definition = NUMERIC $default_col_opts +--let $col_default = 0 +--source col_not_null.inc + +--echo # +--echo # Floating point columns (FLOAT, DOUBLE) +--echo # + +--source type_float.inc + +--let $col_definition = FLOAT $default_col_opts +--let $col_default = 1.1 +--source col_not_null.inc + +--let $col_definition = DOUBLE $default_col_opts +--let $col_default = 0 +--source col_not_null.inc + +--echo # +--echo # INT columns +--echo # + +--source type_int.inc + +--let $col_definition = INT $default_col_opts +--let $col_default = 2147483647 +--source col_not_null.inc + +--let $col_definition = TINYINT $default_col_opts +--let $col_default = 127 +--source col_not_null.inc + +--let $col_definition = SMALLINT $default_col_opts +--let $col_default = 0 +--source col_not_null.inc + +--let $col_definition = MEDIUMINT $default_col_opts +--let $col_default = 1 +--source col_not_null.inc + +--let $col_definition = BIGINT $default_col_opts +--let $col_default = 9223372036854775807 +--source col_not_null.inc + +--echo # +--echo # SET columns +--echo # + +--source type_set.inc +--let $col_definition = SET('test1','test2','test3') $default_col_opts +--let $col_default = 'test2,test3' +--source col_not_null.inc + +--echo # +--echo # TEXT columns +--echo # + +--source type_text.inc + +--let $col_definition = TEXT $default_col_opts +--source col_not_null.inc + +--let $col_definition = TINYTEXT $default_col_opts +--source col_not_null.inc + +--let $col_definition = MEDIUMTEXT $default_col_opts +--source col_not_null.inc + +--let $col_definition = LONGTEXT $default_col_opts +--source col_not_null.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/col_opt_null.result b/mysql-test/suite/storage_engine/col_opt_null.result new file mode 100644 index 00000000000..c6a46f8c18f --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_null.result @@ -0,0 +1,1991 @@ +# +# BINARY columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS> NULL, +b0 BINARY(0) <CUSTOM_COL_OPTIONS> NULL, +b1 BINARY(1) <CUSTOM_COL_OPTIONS> NULL, +b20 BINARY(20) <CUSTOM_COL_OPTIONS> NULL, +b255 BINARY(255) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b0' at row 2 +Warning 1265 Data truncated for column 'b1' at row 2 +Warning 1265 Data truncated for column 'b20' at row 2 +Warning 1265 Data truncated for column 'b255' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 +Warning 1265 Data truncated for column 'b0' at row 3 +Warning 1265 Data truncated for column 'b1' at row 3 +Warning 1265 Data truncated for column 'b20' at row 3 +Warning 1265 Data truncated for column 'b255' at row 3 +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +43 43 4372656174696E6720616E2061727469636C6520 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +61 61 6161616161616161616161616161616161616161 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +78 78 7878787878787878787878787878787878787878 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +ALTER TABLE t1 ADD COLUMN b257 BINARY(257) <CUSTOM_COL_OPTIONS> NULL; +ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BINARY <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c binary(1) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c BINARY <CUSTOM_COL_OPTIONS> NULL, +c1 BINARY <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 BINARY <CUSTOM_COL_OPTIONS> NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c binary(1) YES NULL +c1 binary(1) YES NULL +c2 binary(1) YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# VARBINARY columns +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARBINARY(0) <CUSTOM_COL_OPTIONS> NULL, +v1 VARBINARY(1) <CUSTOM_COL_OPTIONS> NULL, +v64 VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL, +v65000 VARBINARY(65000) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +CREATE TABLE t2 (v VARBINARY(65532) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varbinary(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1; +HEX(v0) HEX(v1) HEX(v64) HEX(v65000) + + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020202020202020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204D7953514C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A0A2020202020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A2020202020202020202020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569646520666F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696320756E6465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20 +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; +HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) + 0 + 0 + 48 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E20576527766520 5932 + 61 61626364656667686920616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364 130000 + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 5930 + 79 63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 130000 +ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) <CUSTOM_COL_OPTIONS> NULL; +Warnings: +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +v65536 mediumblob # # # +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varbinary(64) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL, +c1 VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL DEFAULT 'test' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varbinary(64) YES NULL +c1 varbinary(64) YES NULL +c2 varbinary(64) YES test +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# BIT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS> NULL, +b BIT(20) <CUSTOM_COL_OPTIONS> NULL, +c BIT(64) <CUSTOM_COL_OPTIONS> NULL, +d BIT(1) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN d BIT(0) <CUSTOM_COL_OPTIONS> NULL; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; +BIN(a) HEX(b) c+0 +0 FFFFF 18446744073709551615 +INSERT INTO t1 VALUES (1,0,-1,0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; +a+0 b+0 c+0 +0 1048575 18446744073709551615 +1 0 18446744073709551615 +INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); +a+0 b+0 c+0 +1 0 18446744073709551615 +1 102 255 +INSERT INTO t1 VALUES (0x10,0,0,1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b c d +INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +SELECT * FROM t1; +a b c d +DROP TABLE t1; +CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR 42000: Display width out of range for 'a' (max = 64) +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BIT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bit(1) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c BIT <CUSTOM_COL_OPTIONS> NULL, +c1 BIT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 BIT <CUSTOM_COL_OPTIONS> NULL DEFAULT 1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bit(1) YES NULL +c1 bit(1) YES NULL +c2 bit(1) YES b'1' +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# BLOB columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS> NULL, +b0 BLOB(0) <CUSTOM_COL_OPTIONS> NULL, +b1 BLOB(1) <CUSTOM_COL_OPTIONS> NULL, +b300 BLOB(300) <CUSTOM_COL_OPTIONS> NULL, +bm BLOB(65535) <CUSTOM_COL_OPTIONS> NULL, +b70k BLOB(70000) <CUSTOM_COL_OPTIONS> NULL, +b17m BLOB(17000000) <CUSTOM_COL_OPTIONS> NULL, +t TINYBLOB <CUSTOM_COL_OPTIONS> NULL, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS> NULL, +l LONGBLOB <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b blob # # # +b0 blob # # # +b1 tinyblob # # # +b300 blob # # # +bm blob # # # +b70k mediumblob # # # +b17m longblob # # # +t tinyblob # # # +m mediumblob # # # +l longblob # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) ); +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b300' at row 1 +Warning 1265 Data truncated for column 'bm' at row 1 +Warning 1265 Data truncated for column 't' at row 1 +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296); +ERROR 42000: Display width out of range for 'bbb' (max = 4294967295) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BLOB <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c blob YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYBLOB <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyblob YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMBLOB <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumblob YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c LONGBLOB <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c longblob YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +# +# BOOL columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b1 BOOL <CUSTOM_COL_OPTIONS> NULL, +b2 BOOLEAN <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b1 tinyint(1) # # # +b2 tinyint(1) # # # +INSERT INTO t1 VALUES (1,TRUE); +SELECT * FROM t1; +b1 b2 +1 1 +INSERT INTO t1 VALUES (FALSE,0); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +INSERT INTO t1 VALUES (2,3); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (-1,-2); +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +1 1 +2 3 +SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; +a b +false false +true true +true true +true true +SELECT * FROM t1 WHERE b1 = TRUE; +b1 b2 +1 1 +SELECT * FROM t1 WHERE b2 = FALSE; +b1 b2 +0 0 +INSERT INTO t1 VALUES ('a','b'); +Warnings: +Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 +Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (128,-129); +Warnings: +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +127 -128 +2 3 +ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNSIGNED' at line 1 +ALTER TABLE t1 ADD COLUMN b3 BOOL ZEROFILL; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ZEROFILL' at line 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BOOL <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(1) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c BOOL <CUSTOM_COL_OPTIONS> NULL, +c1 BOOL <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 BOOL <CUSTOM_COL_OPTIONS> NULL DEFAULT '0' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(1) YES NULL +c1 tinyint(1) YES NULL +c2 tinyint(1) YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# CHAR columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NULL, +c0 CHAR(0) <CUSTOM_COL_OPTIONS> NULL, +c1 CHAR(1) <CUSTOM_COL_OPTIONS> NULL, +c20 CHAR(20) <CUSTOM_COL_OPTIONS> NULL, +c255 CHAR(255) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) # # # +c0 char(0) # # # +c1 char(1) # # # +c20 char(20) # # # +c255 char(255) # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT * FROM t1; +c c0 c1 c20 c255 + +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'c0' at row 1 +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c20' at row 1 +Warning 1265 Data truncated for column 'c255' at row 1 +INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 +SELECT * FROM t1; +c c0 c1 c20 c255 + + +C C Creating an article Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b +a a aaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +x x xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; +c20 REPEAT('a',LENGTH(c20)) COUNT(*) + 2 +Creating an article aaaaaaaaaaaaaaaaaaa 1 +aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa 1 +abcdefghi klmnopqrst aaaaaaaaaaaaaaaaaaaa 1 +xxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaaaaa 1 +ALTER TABLE t1 ADD COLUMN c257 CHAR(257) <CUSTOM_COL_OPTIONS> NULL; +ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NULL, +c1 CHAR <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 CHAR <CUSTOM_COL_OPTIONS> NULL DEFAULT '_' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) YES NULL +c1 char(1) YES NULL +c2 char(1) YES _ +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# VARCHAR columns +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARCHAR(0) <CUSTOM_COL_OPTIONS> NULL, +v1 VARCHAR(1) <CUSTOM_COL_OPTIONS> NULL, +v64 VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL, +v65000 VARCHAR(65000) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +CREATE TABLE t2 (v VARCHAR(65532) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varchar(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT * FROM t1; +v0 v1 v64 v65000 + + + + + + + + + + + + y Once there, double check that an article doesn't already exist Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) + o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Free to read in the Knowledgebase! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + o The 'default' book to read if you wont to learn to use MySQL / MariaDB. + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + * MariaDB Crash Course by Ben Forta + * MySQL (4th Edition) by Paul DuBois + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + * MySQL Admin Cookbook + * MySQL Cookbook by Paul DuBois + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + For MariaDB / MySQL end users + For developers who want to code on MariaDB or MySQL + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT v0, v1, v64, LENGTH(v65000) FROM t1; +v0 v1 v64 LENGTH(v65000) + 0 + 0 + H Here is a list of recommended books on MariaDB and MySQL. We've 2966 + a abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcd 65000 + y Once there, double check that an article doesn't already exist 2965 + y cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 65000 +ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) <CUSTOM_COL_OPTIONS> NULL; +Warnings: +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +v65536 mediumtext # # # +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varchar(64) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL, +c1 VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL DEFAULT 'test default' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varchar(64) YES NULL +c1 varchar(64) YES NULL +c2 varchar(64) YES test default +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# date and time columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS> NULL, +dt DATETIME <CUSTOM_COL_OPTIONS> NULL, +ts TIMESTAMP <CUSTOM_COL_OPTIONS> NULL, +t TIME <CUSTOM_COL_OPTIONS> NULL, +y YEAR <CUSTOM_COL_OPTIONS> NULL, +y4 YEAR(4) <CUSTOM_COL_OPTIONS> NULL, +y2 YEAR(2) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d date # # # +dt datetime # # # +ts timestamp # # # +t time # # # +y year(4) # # # +y4 year(4) # # # +y2 year(2) # # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 VALUES +('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), +('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), +('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +INSERT INTO t1 VALUES +('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'dt' at row 1 +Warning 1265 Data truncated for column 'ts' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'y4' at row 1 +Warning 1264 Out of range value for column 'y2' at row 1 +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DATE <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c date YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c DATE <CUSTOM_COL_OPTIONS> NULL, +c1 DATE <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 DATE <CUSTOM_COL_OPTIONS> NULL DEFAULT '2012-12-21' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c date YES NULL +c1 date YES NULL +c2 date YES 2012-12-21 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DATETIME <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c datetime YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c DATETIME <CUSTOM_COL_OPTIONS> NULL, +c1 DATETIME <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 DATETIME <CUSTOM_COL_OPTIONS> NULL DEFAULT '2012-12-21 12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c datetime YES NULL +c1 datetime YES NULL +c2 datetime YES 2012-12-21 12:21:12 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TIMESTAMP <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c timestamp YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c TIMESTAMP <CUSTOM_COL_OPTIONS> NULL, +c1 TIMESTAMP <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 TIMESTAMP <CUSTOM_COL_OPTIONS> NULL DEFAULT '2012-12-21 12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c timestamp YES NULL +c1 timestamp YES NULL +c2 timestamp YES 2012-12-21 12:21:12 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TIME <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c time YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c TIME <CUSTOM_COL_OPTIONS> NULL, +c1 TIME <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 TIME <CUSTOM_COL_OPTIONS> NULL DEFAULT '12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c time YES NULL +c1 time YES NULL +c2 time YES 12:21:12 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c YEAR <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(4) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c YEAR <CUSTOM_COL_OPTIONS> NULL, +c1 YEAR <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 YEAR <CUSTOM_COL_OPTIONS> NULL DEFAULT '2012' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(4) YES NULL +c1 year(4) YES NULL +c2 year(4) YES 2012 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(2) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NULL, +c1 YEAR(2) <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 YEAR(2) <CUSTOM_COL_OPTIONS> NULL DEFAULT '12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(2) YES NULL +c1 year(2) YES NULL +c2 year(2) YES 12 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# ENUM columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a ENUM('') <CUSTOM_COL_OPTIONS> NULL, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS> NULL, +c ENUM('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +INSERT INTO t1 VALUES ('','test2','4'),('',5,2); +SELECT * FROM t1; +a b c + test2 4 + test5 2 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + + test2 4 + test5 2 +ALTER TABLE t1 ADD COLUMN e ENUM('a','A') <CUSTOM_COL_OPTIONS> NULL; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in ENUM +Note 1291 Column 'e' has duplicated value 'a' in ENUM +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +e enum('a','A') # # # +INSERT INTO t1 VALUES ('','test3','75','A'); +SELECT * FROM t1; +a b c e + NULL + test2 4 NULL + test3 75 a + test5 2 NULL +SELECT * FROM t1 WHERE b='test2' OR a != ''; +a b c e + test2 4 NULL +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c enum('test1','test2','test3') YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL, +c1 ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL DEFAULT 'test2' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c enum('test1','test2','test3') YES NULL +c1 enum('test1','test2','test3') YES NULL +c2 enum('test1','test2','test3') YES test2 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# Fixed point columns (NUMERIC, DECIMAL) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL <CUSTOM_COL_OPTIONS> NULL, +d0 DECIMAL(0) <CUSTOM_COL_OPTIONS> NULL, +d1_1 DECIMAL(1,1) <CUSTOM_COL_OPTIONS> NULL, +d10_2 DECIMAL(10,2) <CUSTOM_COL_OPTIONS> NULL, +d60_10 DECIMAL(60,10) <CUSTOM_COL_OPTIONS> NULL, +n NUMERIC <CUSTOM_COL_OPTIONS> NULL, +n0_0 NUMERIC(0,0) <CUSTOM_COL_OPTIONS> NULL, +n1 NUMERIC(1) <CUSTOM_COL_OPTIONS> NULL, +n20_4 NUMERIC(20,4) <CUSTOM_COL_OPTIONS> NULL, +n65_4 NUMERIC(65,4) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) # # # +d0 decimal(10,0) # # # +d1_1 decimal(1,1) # # # +d10_2 decimal(10,2) # # # +d60_10 decimal(60,10) # # # +n decimal(10,0) # # # +n0_0 decimal(10,0) # # # +n1 decimal(1,0) # # # +n20_4 decimal(20,4) # # # +n65_4 decimal(65,4) # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DECIMAL <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c DECIMAL <CUSTOM_COL_OPTIONS> NULL, +c1 DECIMAL <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 DECIMAL <CUSTOM_COL_OPTIONS> NULL DEFAULT 1.1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +Warnings: +Note 1265 Data truncated for column 'c2' at row 1 +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +c1 decimal(10,0) YES NULL +c2 decimal(10,0) YES 1 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c NUMERIC <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c NUMERIC <CUSTOM_COL_OPTIONS> NULL, +c1 NUMERIC <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 NUMERIC <CUSTOM_COL_OPTIONS> NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +c1 decimal(10,0) YES NULL +c2 decimal(10,0) YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# Floating point columns (FLOAT, DOUBLE) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS> NULL, +f0 FLOAT(0) <CUSTOM_COL_OPTIONS> NULL, +r1_1 REAL(1,1) <CUSTOM_COL_OPTIONS> NULL, +f23_0 FLOAT(23) <CUSTOM_COL_OPTIONS> NULL, +f20_3 FLOAT(20,3) <CUSTOM_COL_OPTIONS> NULL, +d DOUBLE <CUSTOM_COL_OPTIONS> NULL, +d1_0 DOUBLE(1,0) <CUSTOM_COL_OPTIONS> NULL, +d10_10 DOUBLE PRECISION (10,10) <CUSTOM_COL_OPTIONS> NULL, +d53 DOUBLE(53,0) <CUSTOM_COL_OPTIONS> NULL, +d53_10 DOUBLE(53,10) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float # # # +f0 float # # # +r1_1 double(1,1) # # # +f23_0 float # # # +f20_3 float(20,3) # # # +d double # # # +d1_0 double(1,0) # # # +d10_10 double(10,10) # # # +d53 double(53,0) # # # +d53_10 double(53,10) # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 12345.1 +d 11111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 1234566789123456800 +d53_10 100000000000000000.0000000000 +f0 12345.1 +f20_3 56789.988 +f23_0 123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 1e38 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e65 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c FLOAT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c float YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c FLOAT <CUSTOM_COL_OPTIONS> NULL, +c1 FLOAT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 FLOAT <CUSTOM_COL_OPTIONS> NULL DEFAULT 1.1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c float YES NULL +c1 float YES NULL +c2 float YES 1.1 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DOUBLE <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c double YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c DOUBLE <CUSTOM_COL_OPTIONS> NULL, +c1 DOUBLE <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 DOUBLE <CUSTOM_COL_OPTIONS> NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c double YES NULL +c1 double YES NULL +c2 double YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# INT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS> NULL, +i0 INT(0) <CUSTOM_COL_OPTIONS> NULL, +i1 INT(1) <CUSTOM_COL_OPTIONS> NULL, +i20 INT(20) <CUSTOM_COL_OPTIONS> NULL, +t TINYINT <CUSTOM_COL_OPTIONS> NULL, +t0 TINYINT(0) <CUSTOM_COL_OPTIONS> NULL, +t1 TINYINT(1) <CUSTOM_COL_OPTIONS> NULL, +t20 TINYINT(20) <CUSTOM_COL_OPTIONS> NULL, +s SMALLINT <CUSTOM_COL_OPTIONS> NULL, +s0 SMALLINT(0) <CUSTOM_COL_OPTIONS> NULL, +s1 SMALLINT(1) <CUSTOM_COL_OPTIONS> NULL, +s20 SMALLINT(20) <CUSTOM_COL_OPTIONS> NULL, +m MEDIUMINT <CUSTOM_COL_OPTIONS> NULL, +m0 MEDIUMINT(0) <CUSTOM_COL_OPTIONS> NULL, +m1 MEDIUMINT(1) <CUSTOM_COL_OPTIONS> NULL, +m20 MEDIUMINT(20) <CUSTOM_COL_OPTIONS> NULL, +b BIGINT <CUSTOM_COL_OPTIONS> NULL, +b0 BIGINT(0) <CUSTOM_COL_OPTIONS> NULL, +b1 BIGINT(1) <CUSTOM_COL_OPTIONS> NULL, +b20 BIGINT(20) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(11) # # # +i0 int(11) # # # +i1 int(1) # # # +i20 int(20) # # # +t tinyint(4) # # # +t0 tinyint(4) # # # +t1 tinyint(1) # # # +t20 tinyint(20) # # # +s smallint(6) # # # +s0 smallint(6) # # # +s1 smallint(1) # # # +s20 smallint(20) # # # +m mediumint(9) # # # +m0 mediumint(9) # # # +m1 mediumint(1) # # # +m20 mediumint(20) # # # +b bigint(20) # # # +b0 bigint(20) # # # +b1 bigint(1) # # # +b20 bigint(20) # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c INT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c int(11) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c INT <CUSTOM_COL_OPTIONS> NULL, +c1 INT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 INT <CUSTOM_COL_OPTIONS> NULL DEFAULT 2147483647 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c int(11) YES NULL +c1 int(11) YES NULL +c2 int(11) YES 2147483647 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYINT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(4) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c TINYINT <CUSTOM_COL_OPTIONS> NULL, +c1 TINYINT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 TINYINT <CUSTOM_COL_OPTIONS> NULL DEFAULT 127 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(4) YES NULL +c1 tinyint(4) YES NULL +c2 tinyint(4) YES 127 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c SMALLINT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c smallint(6) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c SMALLINT <CUSTOM_COL_OPTIONS> NULL, +c1 SMALLINT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 SMALLINT <CUSTOM_COL_OPTIONS> NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c smallint(6) YES NULL +c1 smallint(6) YES NULL +c2 smallint(6) YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMINT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumint(9) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c MEDIUMINT <CUSTOM_COL_OPTIONS> NULL, +c1 MEDIUMINT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 MEDIUMINT <CUSTOM_COL_OPTIONS> NULL DEFAULT 1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumint(9) YES NULL +c1 mediumint(9) YES NULL +c2 mediumint(9) YES 1 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BIGINT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bigint(20) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c BIGINT <CUSTOM_COL_OPTIONS> NULL, +c1 BIGINT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 BIGINT <CUSTOM_COL_OPTIONS> NULL DEFAULT 9223372036854775807 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bigint(20) YES NULL +c1 bigint(20) YES NULL +c2 bigint(20) YES 9223372036854775807 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# SET columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a SET('') <CUSTOM_COL_OPTIONS> NULL, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS> NULL, +c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +INSERT INTO t1 VALUES +('','test2,test3','01,34,44,,23'), +('',5,2), +(',','test4,test2',''); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +ALTER TABLE t1 ADD COLUMN e SET('a','A') <CUSTOM_COL_OPTIONS> NULL; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in SET +Note 1291 Column 'e' has duplicated value 'a' in SET +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +e set('a','A') # # # +ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS> NULL; +ERROR HY000: Too many strings for column f and SET +SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +a b c e + test2,test3 01,23,34,44 NULL + test2,test4 NULL +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c set('test1','test2','test3') YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL, +c1 SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL DEFAULT 'test2,test3' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c set('test1','test2','test3') YES NULL +c1 set('test1','test2','test3') YES NULL +c2 set('test1','test2','test3') YES test2,test3 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# TEXT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS> NULL, +t0 TEXT(0) <CUSTOM_COL_OPTIONS> NULL, +t1 TEXT(1) <CUSTOM_COL_OPTIONS> NULL, +t300 TEXT(300) <CUSTOM_COL_OPTIONS> NULL, +tm TEXT(65535) <CUSTOM_COL_OPTIONS> NULL, +t70k TEXT(70000) <CUSTOM_COL_OPTIONS> NULL, +t17m TEXT(17000000) <CUSTOM_COL_OPTIONS> NULL, +tt TINYTEXT <CUSTOM_COL_OPTIONS> NULL, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS> NULL, +l LONGTEXT <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t text # # # +t0 text # # # +t1 tinytext # # # +t300 text # # # +tm text # # # +t70k mediumtext # # # +t17m longtext # # # +tt tinytext # # # +m mediumtext # # # +l longtext # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) ); +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1265 Data truncated for column 't0' at row 1 +Warning 1265 Data truncated for column 't1' at row 1 +Warning 1265 Data truncated for column 't300' at row 1 +Warning 1265 Data truncated for column 'tm' at row 1 +Warning 1265 Data truncated for column 'tt' at row 1 +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296); +ERROR 42000: Display width out of range for 'ttt' (max = 4294967295) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TEXT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c text YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYTEXT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinytext YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMTEXT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumtext YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c LONGTEXT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c longtext YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_null.test b/mysql-test/suite/storage_engine/col_opt_null.test new file mode 100644 index 00000000000..29979d29dfd --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_null.test @@ -0,0 +1,208 @@ +# +# NULL column attribute +# + +let $extra_col_opts = NULL; + +--source have_engine.inc + +--echo # +--echo # BINARY columns +--echo # + +--source type_binary.inc +--let $col_definition = BINARY $default_col_opts +--let $col_default = 0 +--source col_null.inc + +--echo # +--echo # VARBINARY columns +--echo # + +--source type_varbinary.inc +--let $col_definition = VARBINARY(64) $default_col_opts +--let $col_default = 'test' +--source col_null.inc + +--echo # +--echo # BIT columns +--echo # + +--source type_bit.inc +--let $col_definition = BIT $default_col_opts +--let $col_default = 1 +--source col_null.inc + +--echo # +--echo # BLOB columns +--echo # + +--source type_blob.inc + +--let $col_definition = BLOB $default_col_opts +--source col_null.inc + +--let $col_definition = TINYBLOB $default_col_opts +--source col_null.inc + +--let $col_definition = MEDIUMBLOB $default_col_opts +--source col_null.inc + +--let $col_definition = LONGBLOB $default_col_opts +--source col_null.inc + +--echo # +--echo # BOOL columns +--echo # + +--source type_bool.inc +--let $col_definition = BOOL $default_col_opts +--let $col_default = '0' +--source col_null.inc + + +--echo # +--echo # CHAR columns +--echo # + +--source type_char.inc +--let $col_definition = CHAR $default_col_opts +--let $col_default = '_' +--source col_null.inc + +--echo # +--echo # VARCHAR columns +--echo # + + +--source type_varchar.inc +--let $col_definition = VARCHAR(64) $default_col_opts +--let $col_default = 'test default' +--source col_null.inc + + +--echo # +--echo # date and time columns +--echo # + +--source type_date_time.inc + +--let $col_definition = DATE $default_col_opts +--let $col_default = '2012-12-21' +--source col_null.inc + +--let $col_definition = DATETIME $default_col_opts +--let $col_default = '2012-12-21 12:21:12' +--source col_null.inc + +--let $col_definition = TIMESTAMP $default_col_opts +--let $col_default = '2012-12-21 12:21:12' +--source col_null.inc + +--let $col_definition = TIME $default_col_opts +--let $col_default = '12:21:12' +--source col_null.inc + +--let $col_definition = YEAR $default_col_opts +--let $col_default = '2012' +--source col_null.inc + +--let $col_definition = YEAR(2) $default_col_opts +--let $col_default = '12' +--source col_null.inc + + +--echo # +--echo # ENUM columns +--echo # + +--source type_enum.inc +--let $col_definition = ENUM('test1','test2','test3') $default_col_opts +--let $col_default = 'test2' +--source col_null.inc + +--echo # +--echo # Fixed point columns (NUMERIC, DECIMAL) +--echo # + +--source type_fixed.inc + +--let $col_definition = DECIMAL $default_col_opts +--let $col_default = 1.1 +--source col_null.inc + +--let $col_definition = NUMERIC $default_col_opts +--let $col_default = 0 +--source col_null.inc + +--echo # +--echo # Floating point columns (FLOAT, DOUBLE) +--echo # + +--source type_float.inc + +--let $col_definition = FLOAT $default_col_opts +--let $col_default = 1.1 +--source col_null.inc + +--let $col_definition = DOUBLE $default_col_opts +--let $col_default = 0 +--source col_null.inc + +--echo # +--echo # INT columns +--echo # + +--source type_int.inc + +--let $col_definition = INT $default_col_opts +--let $col_default = 2147483647 +--source col_null.inc + +--let $col_definition = TINYINT $default_col_opts +--let $col_default = 127 +--source col_null.inc + +--let $col_definition = SMALLINT $default_col_opts +--let $col_default = 0 +--source col_null.inc + +--let $col_definition = MEDIUMINT $default_col_opts +--let $col_default = 1 +--source col_null.inc + +--let $col_definition = BIGINT $default_col_opts +--let $col_default = 9223372036854775807 +--source col_null.inc + +--echo # +--echo # SET columns +--echo # + +--source type_set.inc +--let $col_definition = SET('test1','test2','test3') $default_col_opts +--let $col_default = 'test2,test3' +--source col_null.inc + + +--echo # +--echo # TEXT columns +--echo # + +--source type_text.inc + +--let $col_definition = TEXT $default_col_opts +--source col_null.inc + +--let $col_definition = TINYTEXT $default_col_opts +--source col_null.inc + +--let $col_definition = MEDIUMTEXT $default_col_opts +--source col_null.inc + +--let $col_definition = LONGTEXT $default_col_opts +--source col_null.inc + + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/col_opt_unsigned.result b/mysql-test/suite/storage_engine/col_opt_unsigned.result new file mode 100644 index 00000000000..a68aa48ee79 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_unsigned.result @@ -0,0 +1,697 @@ +# +# Fixed point columns (NUMERIC, DECIMAL) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL UNSIGNED <CUSTOM_COL_OPTIONS>, +d0 DECIMAL(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +d1_1 DECIMAL(1,1) UNSIGNED <CUSTOM_COL_OPTIONS>, +d10_2 DECIMAL(10,2) UNSIGNED <CUSTOM_COL_OPTIONS>, +d60_10 DECIMAL(60,10) UNSIGNED <CUSTOM_COL_OPTIONS>, +n NUMERIC UNSIGNED <CUSTOM_COL_OPTIONS>, +n0_0 NUMERIC(0,0) UNSIGNED <CUSTOM_COL_OPTIONS>, +n1 NUMERIC(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +n20_4 NUMERIC(20,4) UNSIGNED <CUSTOM_COL_OPTIONS>, +n65_4 NUMERIC(65,4) UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) unsigned # # # +d0 decimal(10,0) unsigned # # # +d1_1 decimal(1,1) unsigned # # # +d10_2 decimal(10,2) unsigned # # # +d60_10 decimal(60,10) unsigned # # # +n decimal(10,0) unsigned # # # +n0_0 decimal(10,0) unsigned # # # +n1 decimal(1,0) unsigned # # # +n20_4 decimal(20,4) unsigned # # # +n65_4 decimal(65,4) unsigned # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL UNSIGNED <CUSTOM_COL_OPTIONS>, +b NUMERIC UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a decimal(10,0) unsigned # # # # +b decimal(10,0) unsigned # # # # +INSERT INTO t1 (a,b) VALUES (1.0,-1.0); +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +INSERT INTO t1 (a,b) VALUES (-100,100); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b +0 100 +1 0 +DROP TABLE t1; +# +# Floating point columns (FLOAT, DOUBLE) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT UNSIGNED <CUSTOM_COL_OPTIONS>, +f0 FLOAT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +r1_1 REAL(1,1) UNSIGNED <CUSTOM_COL_OPTIONS>, +f23_0 FLOAT(23) UNSIGNED <CUSTOM_COL_OPTIONS>, +f20_3 FLOAT(20,3) UNSIGNED <CUSTOM_COL_OPTIONS>, +d DOUBLE UNSIGNED <CUSTOM_COL_OPTIONS>, +d1_0 DOUBLE(1,0) UNSIGNED <CUSTOM_COL_OPTIONS>, +d10_10 DOUBLE PRECISION (10,10) UNSIGNED <CUSTOM_COL_OPTIONS>, +d53 DOUBLE(53,0) UNSIGNED <CUSTOM_COL_OPTIONS>, +d53_10 DOUBLE(53,10) UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float unsigned # # # +f0 float unsigned # # # +r1_1 double(1,1) unsigned # # # +f23_0 float unsigned # # # +f20_3 float(20,3) unsigned # # # +d double unsigned # # # +d1_0 double(1,0) unsigned # # # +d10_10 double(10,10) unsigned # # # +d53 double(53,0) unsigned # # # +d53_10 double(53,10) unsigned # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 12345.1 +d 11111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 1234566789123456800 +d53_10 100000000000000000.0000000000 +f0 12345.1 +f20_3 56789.988 +f23_0 123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 1e38 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 0 +f 1e38 +f0 0 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 0 +d 11111111.111 +d 1e43 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 0 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 0 +f 1e38 +f 3.40282e38 +f0 0 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f20_3 0.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 0 +d 11111111.111 +d 1e43 +d 1e65 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 0 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 0 +f 1e38 +f 3.40282e38 +f 3.40282e38 +f0 0 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f0 3.40282e38 +f20_3 0.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +f23_0 3.40282e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE UNSIGNED <CUSTOM_COL_OPTIONS>, +b FLOAT UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a double unsigned # # # # +b float unsigned # # # # +INSERT INTO t1 (a,b) VALUES (1.0,-1.0); +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +INSERT INTO t1 (a,b) VALUES (-100,100); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b +0 100 +1 0 +DROP TABLE t1; +# +# INT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT UNSIGNED <CUSTOM_COL_OPTIONS>, +i0 INT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +i1 INT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +i20 INT(20) UNSIGNED <CUSTOM_COL_OPTIONS>, +t TINYINT UNSIGNED <CUSTOM_COL_OPTIONS>, +t0 TINYINT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +t1 TINYINT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +t20 TINYINT(20) UNSIGNED <CUSTOM_COL_OPTIONS>, +s SMALLINT UNSIGNED <CUSTOM_COL_OPTIONS>, +s0 SMALLINT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +s1 SMALLINT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +s20 SMALLINT(20) UNSIGNED <CUSTOM_COL_OPTIONS>, +m MEDIUMINT UNSIGNED <CUSTOM_COL_OPTIONS>, +m0 MEDIUMINT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +m1 MEDIUMINT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +m20 MEDIUMINT(20) UNSIGNED <CUSTOM_COL_OPTIONS>, +b BIGINT UNSIGNED <CUSTOM_COL_OPTIONS>, +b0 BIGINT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +b1 BIGINT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +b20 BIGINT(20) UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(10) unsigned # # # +i0 int(10) unsigned # # # +i1 int(1) unsigned # # # +i20 int(20) unsigned # # # +t tinyint(3) unsigned # # # +t0 tinyint(3) unsigned # # # +t1 tinyint(1) unsigned # # # +t20 tinyint(20) unsigned # # # +s smallint(5) unsigned # # # +s0 smallint(5) unsigned # # # +s1 smallint(1) unsigned # # # +s20 smallint(20) unsigned # # # +m mediumint(8) unsigned # # # +m0 mediumint(8) unsigned # # # +m1 mediumint(1) unsigned # # # +m20 mediumint(20) unsigned # # # +b bigint(20) unsigned # # # +b0 bigint(20) unsigned # # # +b1 bigint(1) unsigned # # # +b20 bigint(20) unsigned # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; +CREATE TABLE t1 (t TINYINT UNSIGNED <CUSTOM_COL_OPTIONS>, +s SMALLINT UNSIGNED <CUSTOM_COL_OPTIONS>, +m MEDIUMINT UNSIGNED <CUSTOM_COL_OPTIONS>, +i INT UNSIGNED <CUSTOM_COL_OPTIONS>, +b BIGINT UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t tinyint(3) unsigned # # # # +s smallint(5) unsigned # # # # +m mediumint(8) unsigned # # # # +i int(10) unsigned # # # # +b bigint(20) unsigned # # # # +INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615); +INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1); +Warnings: +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +SELECT * FROM t1; +t s m i b +0 0 0 0 0 +255 65535 16777215 4294967295 18446744073709551615 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_unsigned.test b/mysql-test/suite/storage_engine/col_opt_unsigned.test new file mode 100644 index 00000000000..e9d4566de7f --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_unsigned.test @@ -0,0 +1,95 @@ +# +# UNSIGNED column attribute +# + +let $extra_type_opts = UNSIGNED; + +--source have_engine.inc + +--echo # +--echo # Fixed point columns (NUMERIC, DECIMAL) +--echo # + +--source type_fixed.inc +let $create_definition = + a DECIMAL $col_opts, + b NUMERIC $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Fixed point types or UNSIGNED columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a,b) VALUES (1.0,-1.0); + INSERT INTO t1 (a,b) VALUES (-100,100); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # Floating point columns (FLOAT, DOUBLE) +--echo # + +--source type_float.inc +let $create_definition = + a DOUBLE $col_opts, + b FLOAT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Floating point types or UNSIGNED columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a,b) VALUES (1.0,-1.0); + INSERT INTO t1 (a,b) VALUES (-100,100); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # INT columns +--echo # + +--source type_int.inc +let $create_definition = + t TINYINT $col_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + i INT $col_opts, + b BIGINT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = INT types or UNSIGNED columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615); + INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; + +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/col_opt_zerofill.result b/mysql-test/suite/storage_engine/col_opt_zerofill.result new file mode 100644 index 00000000000..c2445c5bbc7 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_zerofill.result @@ -0,0 +1,679 @@ +# +# Fixed point columns (NUMERIC, DECIMAL) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL ZEROFILL <CUSTOM_COL_OPTIONS>, +d0 DECIMAL(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +d1_1 DECIMAL(1,1) ZEROFILL <CUSTOM_COL_OPTIONS>, +d10_2 DECIMAL(10,2) ZEROFILL <CUSTOM_COL_OPTIONS>, +d60_10 DECIMAL(60,10) ZEROFILL <CUSTOM_COL_OPTIONS>, +n NUMERIC ZEROFILL <CUSTOM_COL_OPTIONS>, +n0_0 NUMERIC(0,0) ZEROFILL <CUSTOM_COL_OPTIONS>, +n1 NUMERIC(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +n20_4 NUMERIC(20,4) ZEROFILL <CUSTOM_COL_OPTIONS>, +n65_4 NUMERIC(65,4) ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) unsigned zerofill # # # +d0 decimal(10,0) unsigned zerofill # # # +d1_1 decimal(1,1) unsigned zerofill # # # +d10_2 decimal(10,2) unsigned zerofill # # # +d60_10 decimal(60,10) unsigned zerofill # # # +n decimal(10,0) unsigned zerofill # # # +n0_0 decimal(10,0) unsigned zerofill # # # +n1 decimal(1,0) unsigned zerofill # # # +n20_4 decimal(20,4) unsigned zerofill # # # +n65_4 decimal(65,4) unsigned zerofill # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL ZEROFILL <CUSTOM_COL_OPTIONS>, +b NUMERIC ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a decimal(10,0) unsigned zerofill # # # # +b decimal(10,0) unsigned zerofill # # # # +INSERT INTO t1 (a,b) VALUES (1.1,1234); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a b +0000000001 0000001234 +DROP TABLE t1; +# +# Floating point columns (FLOAT, DOUBLE) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT ZEROFILL <CUSTOM_COL_OPTIONS>, +f0 FLOAT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +r1_1 REAL(1,1) ZEROFILL <CUSTOM_COL_OPTIONS>, +f23_0 FLOAT(23) ZEROFILL <CUSTOM_COL_OPTIONS>, +f20_3 FLOAT(20,3) ZEROFILL <CUSTOM_COL_OPTIONS>, +d DOUBLE ZEROFILL <CUSTOM_COL_OPTIONS>, +d1_0 DOUBLE(1,0) ZEROFILL <CUSTOM_COL_OPTIONS>, +d10_10 DOUBLE PRECISION (10,10) ZEROFILL <CUSTOM_COL_OPTIONS>, +d53 DOUBLE(53,0) ZEROFILL <CUSTOM_COL_OPTIONS>, +d53_10 DOUBLE(53,10) ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float unsigned zerofill # # # +f0 float unsigned zerofill # # # +r1_1 double(1,1) unsigned zerofill # # # +f23_0 float unsigned zerofill # # # +f20_3 float(20,3) unsigned zerofill # # # +d double unsigned zerofill # # # +d1_0 double(1,0) unsigned zerofill # # # +d10_10 double(10,10) unsigned zerofill # # # +d53 double(53,0) unsigned zerofill # # # +d53_10 double(53,10) unsigned zerofill # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 0000012345.1 +d 000000000011111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 00000000000000000000000000000000001234566789123456800 +d53_10 000000000000000000000000100000000000000000.0000000000 +f0 0000012345.1 +f20_3 0000000000056789.988 +f23_0 000123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 0000012345.1 +d 0000000000000000000000 +d 0000000000000000001e81 +d 000000000011111111.111 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000001234566789123456800 +d53 100000000000000000000000000000000000000000000000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 000000000000 +f 000000001e38 +f0 000000000000 +f0 000000001e38 +f0 0000012345.1 +f20_3 0000000000000000.000 +f20_3 0000000000056789.988 +f20_3 99999998430674940.000 +f23_0 000000000000 +f23_0 000000001e38 +f23_0 000123457000 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 0000012345.1 +d 0000000000000000000000 +d 0000000000000000000000 +d 0000000000000000001e81 +d 000000000011111111.111 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000001234566789123456800 +d53 100000000000000000000000000000000000000000000000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 000000000000 +f 000000000000 +f 000000001e38 +f0 000000000000 +f0 000000000000 +f0 000000001e38 +f0 0000012345.1 +f20_3 0000000000000000.000 +f20_3 0000000000000000.000 +f20_3 0000000000056789.988 +f20_3 99999998430674940.000 +f23_0 000000000000 +f23_0 000000000000 +f23_0 000000001e38 +f23_0 000123457000 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 0000012345.1 +d 0000000000000000000000 +d 0000000000000000000000 +d 0000000000000000001e43 +d 0000000000000000001e81 +d 000000000011111111.111 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000001234566789123456800 +d53 00000000010000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 000000000000 +f 000000000000 +f 000000001e38 +f 003.40282e38 +f0 000000000000 +f0 000000000000 +f0 000000001e38 +f0 0000012345.1 +f0 003.40282e38 +f20_3 0000000000000000.000 +f20_3 0000000000000000.000 +f20_3 0000000000056789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 000000000000 +f23_0 000000000000 +f23_0 000000001e38 +f23_0 000123457000 +f23_0 003.40282e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 0000012345.1 +d 0000000000000000000000 +d 0000000000000000000000 +d 0000000000000000001e43 +d 0000000000000000001e65 +d 0000000000000000001e81 +d 000000000011111111.111 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000001234566789123456800 +d53 00000000010000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 000000000000 +f 000000000000 +f 000000001e38 +f 003.40282e38 +f 003.40282e38 +f0 000000000000 +f0 000000000000 +f0 000000001e38 +f0 0000012345.1 +f0 003.40282e38 +f0 003.40282e38 +f20_3 0000000000000000.000 +f20_3 0000000000000000.000 +f20_3 0000000000056789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 000000000000 +f23_0 000000000000 +f23_0 000000001e38 +f23_0 000123457000 +f23_0 003.40282e38 +f23_0 003.40282e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE ZEROFILL <CUSTOM_COL_OPTIONS>, +b FLOAT ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a double unsigned zerofill # # # # +b float unsigned zerofill # # # # +INSERT INTO t1 (a,b) VALUES (1,1234.5); +SELECT * FROM t1; +a b +0000000000000000000001 0000001234.5 +DROP TABLE t1; +# +# INT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT ZEROFILL <CUSTOM_COL_OPTIONS>, +i0 INT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +i1 INT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +i20 INT(20) ZEROFILL <CUSTOM_COL_OPTIONS>, +t TINYINT ZEROFILL <CUSTOM_COL_OPTIONS>, +t0 TINYINT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +t1 TINYINT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +t20 TINYINT(20) ZEROFILL <CUSTOM_COL_OPTIONS>, +s SMALLINT ZEROFILL <CUSTOM_COL_OPTIONS>, +s0 SMALLINT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +s1 SMALLINT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +s20 SMALLINT(20) ZEROFILL <CUSTOM_COL_OPTIONS>, +m MEDIUMINT ZEROFILL <CUSTOM_COL_OPTIONS>, +m0 MEDIUMINT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +m1 MEDIUMINT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +m20 MEDIUMINT(20) ZEROFILL <CUSTOM_COL_OPTIONS>, +b BIGINT ZEROFILL <CUSTOM_COL_OPTIONS>, +b0 BIGINT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +b1 BIGINT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +b20 BIGINT(20) ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(10) unsigned zerofill # # # +i0 int(10) unsigned zerofill # # # +i1 int(1) unsigned zerofill # # # +i20 int(20) unsigned zerofill # # # +t tinyint(3) unsigned zerofill # # # +t0 tinyint(3) unsigned zerofill # # # +t1 tinyint(1) unsigned zerofill # # # +t20 tinyint(20) unsigned zerofill # # # +s smallint(5) unsigned zerofill # # # +s0 smallint(5) unsigned zerofill # # # +s1 smallint(1) unsigned zerofill # # # +s20 smallint(20) unsigned zerofill # # # +m mediumint(8) unsigned zerofill # # # +m0 mediumint(8) unsigned zerofill # # # +m1 mediumint(1) unsigned zerofill # # # +m20 mediumint(20) unsigned zerofill # # # +b bigint(20) unsigned zerofill # # # +b0 bigint(20) unsigned zerofill # # # +b1 bigint(1) unsigned zerofill # # # +b20 bigint(20) unsigned zerofill # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000001 0000000002 3 00000000000000000004 005 006 7 00000000000000000008 00009 00010 11 00000000000000000012 00000013 00000014 15 00000000000000000016 00000000000000000017 00000000000000000018 19 00000000000000000020 +2147483647 2147483647 2147483647 00000000002147483647 127 127 127 00000000000000000127 32767 32767 32767 00000000000000032767 08388607 08388607 8388607 00000000000008388607 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000001 0000000002 3 00000000000000000004 005 006 7 00000000000000000008 00009 00010 11 00000000000000000012 00000013 00000014 15 00000000000000000016 00000000000000000017 00000000000000000018 19 00000000000000000020 +2147483647 2147483647 2147483647 00000000002147483647 127 127 127 00000000000000000127 32767 32767 32767 00000000000000032767 08388607 08388607 8388607 00000000000008388607 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000001 0000000002 3 00000000000000000004 005 006 7 00000000000000000008 00009 00010 11 00000000000000000012 00000013 00000014 15 00000000000000000016 00000000000000000017 00000000000000000018 19 00000000000000000020 +2147483647 2147483647 2147483647 00000000002147483647 127 127 127 00000000000000000127 32767 32767 32767 00000000000000032767 08388607 08388607 8388607 00000000000008388607 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; +CREATE TABLE t1 (t TINYINT ZEROFILL <CUSTOM_COL_OPTIONS>, +s SMALLINT ZEROFILL <CUSTOM_COL_OPTIONS>, +m MEDIUMINT ZEROFILL <CUSTOM_COL_OPTIONS>, +i INT ZEROFILL <CUSTOM_COL_OPTIONS>, +b BIGINT ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t tinyint(3) unsigned zerofill # # # # +s smallint(5) unsigned zerofill # # # # +m mediumint(8) unsigned zerofill # # # # +i int(10) unsigned zerofill # # # # +b bigint(20) unsigned zerofill # # # # +INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0); +SELECT * FROM t1; +t s m i b +001 00010 00000100 0000001000 00000000000000000000 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_zerofill.test b/mysql-test/suite/storage_engine/col_opt_zerofill.test new file mode 100644 index 00000000000..83b7dcf28c1 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_zerofill.test @@ -0,0 +1,88 @@ +# +# ZEROFILL column attribute +# + +let $extra_type_opts = ZEROFILL; + +--source have_engine.inc + +--echo # +--echo # Fixed point columns (NUMERIC, DECIMAL) +--echo # + +--source type_fixed.inc +let $create_definition = + a DECIMAL $col_opts, + b NUMERIC $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Fixed point types or ZEROFILL columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a,b) VALUES (1.1,1234); + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # Floating point columns (FLOAT, DOUBLE) +--echo # + +--source type_float.inc +let $create_definition = + a DOUBLE $col_opts, + b FLOAT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Floating point types or ZEROFILL columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a,b) VALUES (1,1234.5); + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # INT columns +--echo # + +--source type_int.inc +let $create_definition = + t TINYINT $col_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + i INT $col_opts, + b BIGINT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = INT types or UNSIGNED columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0); + SELECT * FROM t1; + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/create_table.inc b/mysql-test/suite/storage_engine/create_table.inc new file mode 100644 index 00000000000..9a1cba5100a --- /dev/null +++ b/mysql-test/suite/storage_engine/create_table.inc @@ -0,0 +1,174 @@ +################################## +# +# This include file will be used for all CREATE TABLE statements in the suite. +# If you need to add additional steps or change the logic, copy the file +# to storage/<engine>/mysql-test/storage_engine/ folder and modify it there. +# +################## +# +# Parameters: +# +# --let $create_definition = <column names, types, indexes) # optional, default a $int_col, b $char_col (based on defaults) +# --let $table_name = <table name> # optional, default t1 +# --let $table_options = <table options> # optional, default based on define_engine.inc +# --let $partition_options = <partitioning definition> # optional, default none +# --let $as_select = <SELECT statement> # optional, default empty +# --let $error_codes = <expected error codes, as in --error> # optional, default 0 +# --let $if_not_exists = [0|1] # optional, default 0 (1 adds IF NOT EXISTS clause) +# --let $default_engine = [0|1] # optional, default 0 (with 1 will rely on default engine, no ENGINE=) +# --let $temporary = [0|1] # optional, default 0 (1 adds TEMPORARY) +# --let $disable_query_log = [0|1] # optional, default 0 (1 disables logging of CREATE) +# +# Usage examples: +# +# --source create_table.inc -- creates a default table +# +# --let $create_definition = a INT NOT NULL, b CHAR(1) PRIMARY KEY, INDEX(a) +# --let $table_options = AUTO_INCREMENT = 100 +# --let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +# --let $as_select = SELECT 1, 'a' +# --source create_table.inc +# +# Additionally, a test can define $extra_tbl_options. The difference with $table_options +# is that its value is persistent and will be used until it is unset explicitly, or +# until the test ends. The purpose of it is to allow one test to call another test, +# when the called test does not know about specific options the calling test might require, +# and thus cannot set them on per-create basis. + +--let $create_statement = CREATE + +if ($temporary) +{ + --let $create_statement = $create_statement TEMPORARY +} + +--let $create_statement = $create_statement TABLE + +if ($if_not_exists) +{ + --let $create_statement = $create_statement IF NOT EXISTS +} + +if (!$table_name) +{ + --let $table_name = t1 +} + +--let $create_statement = $create_statement $table_name + +if (!$create_definition) +{ + # If $create_definition is not defined, and AS SELECT is requested, + # we should not set $create_definition to the default value, + # because it might be inconsistent with the SELECT. + if (!$as_select) + { + --let $create_definition = a $int_col, b $char_col + } +} + +if ($create_definition) +{ + --let $create_statement = $create_statement ($create_definition) +} + +# If $default_engine is set, we will rely on the default storage engine + +if (!$default_engine) +{ + --let $create_statement = $create_statement ENGINE=$storage_engine +} + +# Default table options from define_engine.inc +--let $create_statement = $create_statement $default_tbl_opts + +# The calling script could request additional table options +if ($table_options) +{ + --let $create_statement = $create_statement $table_options +} + +# The difference between $extra_tbl_opts and $table_options +# is that its $extra_tbl_opts is persistent -- it will not be unset at the end of this file, +# and will be used until it is unset explicitly by the calling test, +# or until the test ends. The purpose of it is to allow one test to call another test, +# when the called test does not know about specific options the calling test might require, +# and thus cannot set them on per-create basis. + +if ($extra_tbl_opts) +{ + --let $create_statement = $create_statement $extra_tbl_opts +} + +if ($as_select) +{ + --let $create_statement = $create_statement AS $as_select +} + +if ($partition_options) +{ + --let $create_statement = $create_statement $partition_options +} + +# We now have the complete CREATE statement in $create_statement. +# If your CREATE statement should be composed differently, +# modify the logic above. + +##################### +# Here you can add logic needed BEFORE the main table creation +# (e.g. the table needs a base table, a reference table, etc.). +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + +if ($disable_query_log) +{ + --disable_query_log +} + +--source obfuscate.inc + +eval $create_statement; +--source strict_check_errors.inc + +# Make sure you don't add any statements between the main CREATE (above) +# and saving mysql_errno and mysql_errname (below) +# They are saved in case you want to add more logic after the main CREATE, +# because we need the result code of the table creation. +# Also, do not change $create_statement after it is executed! + +--let $my_errno = $mysql_errno +--let $my_errname = $mysql_errname + + +if ($disable_query_log) +{ + --enable_query_log +} + +##################### +# Here you can add logic needed AFTER the main table creation, +# e.g. triggers creation. +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + + +# Unset the parameters, we don't want them to be accidentally reused later +--let $create_definition = +--let $table_name = t1 +--let $table_options = +--let $partition_options = +--let $as_select = 0 +--let $error_codes = +--let $if_not_exists = 0 +--let $default_engine = 0 +--let $temporary = 0 +--let $disable_query_log = 0 + +# Restore the error codes of the main statement +--let $mysql_errno = $my_errno +--let $mysql_errname = $my_errname +# Make sure you don't add any SQL statements after restoring +# mysql_errno and mysql_errname (above) + diff --git a/mysql-test/suite/storage_engine/create_table.result b/mysql-test/suite/storage_engine/create_table.result new file mode 100644 index 00000000000..87bf37046ba --- /dev/null +++ b/mysql-test/suite/storage_engine/create_table.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +CREATE TABLE IF NOT EXISTS t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +Warnings: +Note 1050 Table 't1' already exists +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +CREATE TEMPORARY TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TEMPORARY TABLE `t2` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TEMPORARY TABLE t2; +DROP TABLE t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AS SELECT 1 UNION SELECT 2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `1` bigint(20) NOT NULL DEFAULT '0' +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +SELECT * FROM t1; +1 +1 +2 +DROP TABLE t1; +SET storage_engine = <STORAGE_ENGINE>; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +FLUSH LOGS; +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/storage_engine/create_table.test b/mysql-test/suite/storage_engine/create_table.test new file mode 100644 index 00000000000..2f8971d8b27 --- /dev/null +++ b/mysql-test/suite/storage_engine/create_table.test @@ -0,0 +1,107 @@ +# +# Basic CREATE TABLE statements +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +# Simple create table with minimal table options +# which are defined in have_engine.inc +# (default empty) plus ENGINE= + +--let $create_definition = a $int_col +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + + # IF NOT EXISTS + --let $if_not_exists = 1 + --let $create_definition = a $int_col + --source create_table.inc +} + +# CREATE .. LIKE + +CREATE TABLE t2 LIKE t1; +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE .. LIKE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t2; + + eval + CREATE TEMPORARY TABLE t2 LIKE t1; + if ($mysql_errname) + { + --let $functionality = Temporary tables + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --source mask_engine.inc + SHOW CREATE TABLE t2; + + DROP TEMPORARY TABLE t2; + } + DROP TABLE t2; +} +DROP TABLE IF EXISTS t1; + +# CREATE .. AS SELECT + +--let $as_select = SELECT 1 UNION SELECT 2 +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE .. AS SELECT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +# Use the engine as default + +--source mask_engine.inc +eval SET storage_engine = $storage_engine; + +--let $tbl_opts = $default_tbl_opts +--let $create_definition = a $int_col +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE or using the engine as default + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; +} + +# Just to add FLUSH LOGS into the mix while we are in the most common test +FLUSH LOGS; + +DROP TABLE IF EXISTS t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/define_engine.inc b/mysql-test/suite/storage_engine/define_engine.inc new file mode 100644 index 00000000000..33d1fc5c8bf --- /dev/null +++ b/mysql-test/suite/storage_engine/define_engine.inc @@ -0,0 +1,45 @@ +########################################### +# +# This is a template of the include file define_engine.inc which +# should be placed in storage/<engine>/mysql-test/storage_engine folder. +# +################################ +# +# The name of the engine under test must be defined in $ENGINE variable. +# You can set it either here (uncomment and edit) or in your environment. +# +# let $ENGINE =; +# +################################ +# +# The following three variables define specific options for columns and tables. +# Normally there should be none needed, but for some engines it can be different. +# If the engine requires specific column option for all or indexed columns, +# set them inside the comment, e.g. /*!NOT NULL*/. +# Do the same for table options if needed, e.g. /*!INSERT_METHOD=LAST*/ + +let $default_col_opts = /*!*/; +let $default_col_indexed_opts = /*!*/; +let $default_tbl_opts = /*!*/; + +# INDEX, UNIQUE INDEX, PRIMARY KEY, special index type - choose the fist that the engine allows, +# or set it to /*!*/ if none is supported + +let $default_index = /*!INDEX*/; + +# If the engine does not support the following types, replace them with the closest possible + +let $default_int_type = INT(11); +let $default_char_type = CHAR(8); + +################################ + +--disable_query_log +--disable_result_log + +# Here you can place your custom MTR code which needs to be executed before each test, +# e.g. creation of an additional schema or table, etc. +# The cleanup part should be defined in cleanup_engine.inc + +--enable_query_log +--enable_result_log diff --git a/mysql-test/suite/storage_engine/delete.result b/mysql-test/suite/storage_engine/delete.result new file mode 100644 index 00000000000..1d84516c86a --- /dev/null +++ b/mysql-test/suite/storage_engine/delete.result @@ -0,0 +1,77 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +DELETE FROM t1 WHERE b IN ('c'); +SELECT * FROM t1; +a b +1 a +1 a +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +DELETE FROM t1 WHERE a < 0 OR b = 'a'; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +5 e +5 e +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +SELECT * FROM t2; +c d +b 2 +b 2 +d 4 +e 5 +e 5 +foobar 10000 +foobar 10000 +DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +5 e +5 e +SELECT * FROM t2; +c d +foobar 10000 +foobar 10000 +DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c; +SELECT * FROM t1; +a b +2 b +2 b +4 d +5 e +5 e +SELECT * FROM t2; +c d +DELETE FROM t1; +SELECT * FROM t1; +a b +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/delete.test b/mysql-test/suite/storage_engine/delete.test new file mode 100644 index 00000000000..802093e2977 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete.test @@ -0,0 +1,68 @@ +# +# Basic DELETE statements. +# DELETE LOW_PRIORITY is covered in delete_low_prio test +# DELETE QUICK is covered in delete_quick test (syntax only) +# DELETE IGNORE is covered in delete_ignore test +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +# Single-table DELETE + +DELETE FROM t1 WHERE b IN ('c'); +if ($mysql_errname) +{ + --let $functionality = DELETE FROM + --source unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +DELETE FROM t1 WHERE a < 0 OR b = 'a'; +--sorted_result +SELECT * FROM t1; + +# ORDER BY and LIMIT +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +--sorted_result +SELECT * FROM t1; + +# Multi-table DELETE + +--let $create_definition = c $char_col, d $int_col +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +--sorted_result +SELECT * FROM t2; + +DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1; +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; + +DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c; +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; + +DELETE FROM t1; +--sorted_result +SELECT * FROM t1; + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/delete_ignore.result b/mysql-test/suite/storage_engine/delete_ignore.result new file mode 100644 index 00000000000..a15c338ea04 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_ignore.result @@ -0,0 +1,59 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +SELECT * FROM t1; +a b +1 a +1 a +10000 foobar +10000 foobar +2 b +2 b +3 c +3 c +4 d +4 d +5 e +5 e +SELECT * FROM t2; +c d +a 1 +a 1 +b 2 +b 2 +c 3 +c 3 +d 4 +d 4 +e 5 +e 5 +foobar 10000 +foobar 10000 +DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1; +SELECT * FROM t1; +a b +1 a +10000 foobar +10000 foobar +2 b +2 b +3 c +3 c +4 d +4 d +5 e +5 e +DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); +Warnings: +Warning 1242 Subquery returns more than 1 row +SELECT * FROM t1; +a b +1 a +SELECT * FROM t2; +c d +foobar 10000 +foobar 10000 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/delete_ignore.test b/mysql-test/suite/storage_engine/delete_ignore.test new file mode 100644 index 00000000000..fa98ec92029 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_ignore.test @@ -0,0 +1,44 @@ +# +# DELETE IGNORE +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +--let $create_definition = c $char_col, d $int_col +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; + +DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1; +if ($mysql_errname) +{ + --let $functionality = DELETE IGNORE FROM .. + --source unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/delete_low_prio.result b/mysql-test/suite/storage_engine/delete_low_prio.result new file mode 100644 index 00000000000..be334612a2b --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_low_prio.result @@ -0,0 +1,59 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +SET LOW_PRIORITY_UPDATES = 0; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 2; +SELECT SLEEP(1) FROM t1; +connection default; +DELETE FROM t1; +connect con2,localhost,root,,; +SET lock_wait_timeout = 3; +SELECT SLEEP(1) FROM t1; +SLEEP(1) +connection con1; +SLEEP(1) +0 +0 +connection default; +SELECT * FROM t1; +a b +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +connection con1; +SELECT SLEEP(1) FROM t1; +connection default; +DELETE LOW_PRIORITY FROM t1; +connection con2; +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection default; +SELECT * FROM t1; +a b +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +SET LOW_PRIORITY_UPDATES = 1; +connection con1; +SELECT SLEEP(1) FROM t1; +connection default; +DELETE FROM t1; +connection con2; +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection default; +SELECT * FROM t1; +a b +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/delete_low_prio.test b/mysql-test/suite/storage_engine/delete_low_prio.test new file mode 100644 index 00000000000..34677df5373 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_low_prio.test @@ -0,0 +1,162 @@ +# +# DELETE LOW_PRIORITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definiiton = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +# We will have 3 connections: +# con1 will start SELECT which should give us enough time; +# default will run DELETE +# con2 will then start another SELECT. +# With LOW_PRIORITY_UPDATES = 0, +# with standard DELETE we should see all rows in con1 resultset, +# but no rows in con2 resultset. +# With DELETE LOW_PRIORITY we should see all rows in both resultsets. +# Then we will set LOW_PRIORITY_UPDATES to 1. +# Then with standard DELETE we should see all rows in both resultsets. + +SET LOW_PRIORITY_UPDATES = 0; +SET lock_wait_timeout = 4; + +# Normal DELETE with low_priority_updates=0 + +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 2; +--send +SELECT SLEEP(1) FROM t1; + +--connection default +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = = 'User sleep'; +# We don't need to wait long, +# if the feature works, threads +# should show up in the processlist right away +let $wait_timeout = 2; +--source include/wait_show_condition.inc + +--send +DELETE FROM t1; + +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 3; + +let $field = Info; +let $condition = = 'DELETE FROM t1'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = DELETE or table locking + --source unexpected_result.inc +} +if ($found) +{ + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection default +--reap +--sorted_result +SELECT * FROM t1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + + +# DELETE LOW_PRIORITY + +--connection con1 +--send +SELECT SLEEP(1) FROM t1; + +--connection default +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +DELETE LOW_PRIORITY FROM t1; + +--connection con2 +let $field = Info; +let $condition = = 'DELETE LOW_PRIORITY FROM t1'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = DELETE LOW_PRIORITY or table locking + --source unexpected_result.inc +} +if ($found) +{ + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection default +--reap +--sorted_result +SELECT * FROM t1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + +SET LOW_PRIORITY_UPDATES = 1; + +# Normal DELETE with low_priority_updates=1 + +--connection con1 +--send +SELECT SLEEP(1) FROM t1; + +--connection default +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +DELETE FROM t1; + +--connection con2 +let $field = Info; +let $condition = = 'DELETE FROM t1'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if ($found) +{ + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection default +--reap +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--disconnect con2 + +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/delete_quick.result b/mysql-test/suite/storage_engine/delete_quick.result new file mode 100644 index 00000000000..30d4841b51f --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_quick.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX> (a), b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo'; +SELECT * FROM t1; +a b +2 b +3 c +4 d +5 e +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 SELECT b, a FROM t1; +SELECT * FROM t2; +c d +b 2 +c 3 +d 4 +e 5 +DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d; +SELECT * FROM t1; +a b +SELECT * FROM t2; +c d +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/delete_quick.test b/mysql-test/suite/storage_engine/delete_quick.test new file mode 100644 index 00000000000..3b37096de4f --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_quick.test @@ -0,0 +1,55 @@ +# +# DELETE QUICK syntax. +# For now we only check that the keyword is accepted, +# without actually checking whether the feature works. +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_indexed_col, $default_index (a), b $char_col +--source create_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) + { + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + + DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo'; + if ($mysql_errname) + { + --let $functionality = DELETE or DELETE QUICK + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --sorted_result + SELECT * FROM t1; + + --let $create_definition = c $char_col, d $int_col + --let $table_name = t2 + --source create_table.inc + INSERT INTO t2 SELECT b, a FROM t1; + --sorted_result + SELECT * FROM t2; + + DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d; + --sorted_result + SELECT * FROM t1; + --sorted_result + SELECT * FROM t2; + DROP TABLE t2; + } + DROP TABLE t1; +} + +# Cleanup + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/delete_with_keys.result b/mysql-test/suite/storage_engine/delete_with_keys.result new file mode 100644 index 00000000000..6622cc1fb64 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_with_keys.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); +DELETE FROM t1 WHERE b > 'y'; +DELETE FROM t1 WHERE a=2; +SELECT * FROM t1; +a b +1 a +3 c +4 d +5 e +6 x +7 y +DELETE FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); +DELETE FROM t1 WHERE b > 'y'; +DELETE FROM t1 WHERE a=2; +SELECT * FROM t1; +a b +1 a +3 c +4 d +5 e +6 x +7 y +DELETE FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <INT_COLUMN>, <CUSTOM_INDEX>(a), <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9); +DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; +SELECT * FROM t1; +a b c +1 2 3 +4 5 6 +7 8 9 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/delete_with_keys.test b/mysql-test/suite/storage_engine/delete_with_keys.test new file mode 100644 index 00000000000..274801b6d0e --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_with_keys.test @@ -0,0 +1,74 @@ +# +# DELETE statements for tables with keys +# +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col, b $char_indexed_col, $default_index (b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Index on a CHAR column + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); + DELETE FROM t1 WHERE b > 'y'; + if ($mysql_errname) + { + --let $functionality = DELETE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + DELETE FROM t1 WHERE a=2; + + --sorted_result + SELECT * FROM t1; + DELETE FROM t1; + } + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col PRIMARY KEY, b $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = PRIMARY KEY + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); + DELETE FROM t1 WHERE b > 'y'; + DELETE FROM t1 WHERE a=2; + + --sorted_result + SELECT * FROM t1; + DELETE FROM t1; + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col, b $int_col, c $int_indexed_col, $default_index(a), $default_index(b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multiple indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9); + DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/describe.result b/mysql-test/suite/storage_engine/describe.result new file mode 100644 index 00000000000..61c3d6bafd1 --- /dev/null +++ b/mysql-test/suite/storage_engine/describe.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS t1, t2, t3; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET utf8; +INSERT INTO t1 (a,b) VALUES (100,'foo'),(2, 'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET utf8; +INSERT INTO t2 (a,b) VALUES (1, 'bar'); +CREATE TABLE t3 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET utf8; +DESCRIBE t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b char(8) YES NULL +DESC t2 a; +Field Type Null Key Default Extra +a int(11) YES NULL +DESCRIBE t3 '%'; +Field Type Null Key Default Extra +a int(11) YES NULL +b char(8) YES NULL +DROP TABLE t1, t2, t3; diff --git a/mysql-test/suite/storage_engine/describe.test b/mysql-test/suite/storage_engine/describe.test new file mode 100644 index 00000000000..9f792469e83 --- /dev/null +++ b/mysql-test/suite/storage_engine/describe.test @@ -0,0 +1,50 @@ +# +# DESCRIBE statement +# +# Note: the output might well be different +# (depending on default values for the engine). +# Examine mismatch carefully and, if columns are shown +# with correct options, add an rdiff. +# If you create combinations (with different startup options), +# you might have to add an rdiff for each of them. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2, t3; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--let $table_options = CHARACTER SET utf8 +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CHARACTER SET + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (100,'foo'),(2, 'b'); + + --let $create_definition = a $int_col, b $char_col + --let $table_options = CHARACTER SET utf8 + --let $table_name = t2 + --source create_table.inc + + INSERT INTO t2 (a,b) VALUES (1, 'bar'); + + --let $create_definition = a $int_col, b $char_col + --let $table_name = t3 + --let $table_options = CHARACTER SET utf8 + --source create_table.inc + + DESCRIBE t1; + DESC t2 a; + DESCRIBE t3 '%'; + + DROP TABLE t1, t2, t3; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/disabled.def b/mysql-test/suite/storage_engine/disabled.def new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/mysql-test/suite/storage_engine/disabled.def diff --git a/mysql-test/suite/storage_engine/foreign_keys.result b/mysql-test/suite/storage_engine/foreign_keys.result new file mode 100644 index 00000000000..5374e78d9b1 --- /dev/null +++ b/mysql-test/suite/storage_engine/foreign_keys.result @@ -0,0 +1,71 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +FOREIGN KEY (a) REFERENCES t1(a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL, + KEY `a` (`a`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +INSERT INTO t1 (a,b) VALUES (1,'c'),(2,'d'); +INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); +UPDATE t2 SET a=a+1; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +UPDATE t1 SET a=3 WHERE a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +DELETE FROM t1 WHERE a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +DELETE FROM t2 WHERE a=2; +SELECT * FROM t1; +a b +1 c +2 d +SELECT * FROM t2; +a b +1 a +DROP TABLE t1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +DROP TABLE t2; +CREATE TABLE t2 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +FOREIGN KEY (a) REFERENCES t1(a) +ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL, + KEY `a` (`a`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE) +INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'a'); +INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(4,'e'),(3,'a'); +UPDATE t1 SET a=a+1; +SELECT * FROM t2; +a b +5 a +5 a +5 b +5 c +5 d +5 e +DELETE FROM t1 WHERE b='a' LIMIT 2; +SELECT * FROM t2; +a b +TRUNCATE TABLE t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/foreign_keys.test b/mysql-test/suite/storage_engine/foreign_keys.test new file mode 100644 index 00000000000..643ca8bf6b1 --- /dev/null +++ b/mysql-test/suite/storage_engine/foreign_keys.test @@ -0,0 +1,148 @@ +# +# Simple foreign keys setup +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; + +let $create_definition = + a $int_indexed_col, + b $char_col, + $default_index (a) +; +--source create_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + let $create_definition = + a $int_indexed_col, + b $char_col, + FOREIGN KEY (a) REFERENCES t1(a) + ; + --let $table_name = t2 + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --source mask_engine.inc + SHOW CREATE TABLE t2; + + --let $error_codes = ER_NO_REFERENCED_ROW_2 + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); + --source check_errors.inc + if ($mysql_errname != ER_NO_REFERENCED_ROW_2) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + INSERT INTO t1 (a,b) VALUES (1,'c'),(2,'d'); + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); + + --let $error_codes = ER_NO_REFERENCED_ROW_2 + UPDATE t2 SET a=a+1; + --source check_errors.inc + if ($mysql_errname != ER_NO_REFERENCED_ROW_2) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + + --let $error_codes = ER_ROW_IS_REFERENCED_2 + UPDATE t1 SET a=3 WHERE a=2; + --source check_errors.inc + + --let $error_codes = ER_ROW_IS_REFERENCED_2 + DELETE FROM t1 WHERE a=2; + --source check_errors.inc + if ($mysql_errname != ER_ROW_IS_REFERENCED_2) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + + DELETE FROM t2 WHERE a=2; + + --sorted_result + SELECT * FROM t1; + SELECT * FROM t2; + + --let $error_codes = ER_ROW_IS_REFERENCED + DROP TABLE t1; + --source check_errors.inc + if ($mysql_errname != ER_ROW_IS_REFERENCED) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + + DROP TABLE t2; + } + + let $create_definition = + a $int_indexed_col, + b $char_col, + FOREIGN KEY (a) REFERENCES t1(a) + ON DELETE CASCADE ON UPDATE CASCADE + ; + --let $table_name = t2 + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Foreign keys or ON DELETE|UPDATE CASCADE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --source mask_engine.inc + SHOW CREATE TABLE t2; + + --let $error_codes = ER_NO_REFERENCED_ROW_2 + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'); + --source check_errors.inc + INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'a'); + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(4,'e'),(3,'a'); + + UPDATE t1 SET a=a+1; + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + --sorted_result + SELECT * FROM t2; + + DELETE FROM t1 WHERE b='a' LIMIT 2; + if ($mysql_errname) + { + --let $functionality = DELETE + --source unexpected_result.inc + } + --sorted_result + SELECT * FROM t2; + + --let $error_codes = ER_TRUNCATE_ILLEGAL_FK + TRUNCATE TABLE t1; + --source check_errors.inc + if ($mysql_errname != ER_TRUNCATE_ILLEGAL_FK) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + + DROP TABLE t2; + } + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/fulltext_search.result b/mysql-test/suite/storage_engine/fulltext_search.result new file mode 100644 index 00000000000..4363d0aba25 --- /dev/null +++ b/mysql-test/suite/storage_engine/fulltext_search.result @@ -0,0 +1,132 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (v0 VARCHAR(64) <CUSTOM_COL_OPTIONS>, +v1 VARCHAR(16384) <CUSTOM_COL_OPTIONS>, +v2 TEXT <CUSTOM_COL_OPTIONS>, +FULLTEXT v1 (v1) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEXES IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 v1 1 v1 # # NULL NULL YES FULLTEXT +INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. +If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +For developers who want to code on MariaDB or MySQL +* Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. +o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! +o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. +* MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings +o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! +For MariaDB / MySQL end users +* MariaDB Crash Course by Ben Forta +o First MariaDB book! +o For people who want to learn SQL and the basics of MariaDB. +o Now shipping. Purchase at Amazon.com or your favorite bookseller. +* SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. +o Everything you wanted to know about the SQL 99 standard. Excellent reference book! +o Free to read in the Knowledgebase! +* MySQL (4th Edition) by Paul DuBois +o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. +* MySQL Cookbook by Paul DuBois +o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. +* High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. +o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', +'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: + + 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. + 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. + 3. With MariaDB everyone has access to the latest code. + 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. + 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. +The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' + ), ('text2','test1','test2'); +SELECT v0 FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +v0 +INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); +SELECT v0, MATCH(v1) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +v0 rating +INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); +SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); +v0 rating +text4 1.3705332279205322 +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); +v0 +text1 +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); +v0 +SELECT v0, MATCH(v1) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('database' WITH QUERY EXPANSION); +v0 rating +text1 178.11756896972656 +DROP TABLE t1; +CREATE TABLE t1 (v0 VARCHAR(64) <CUSTOM_COL_OPTIONS>, +v1 VARCHAR(16384) <CUSTOM_COL_OPTIONS>, +v2 TEXT <CUSTOM_COL_OPTIONS>, +FULLTEXT v1 (v1), +FULLTEXT v1_v2 (v1,v2) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEXES IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 v1 1 v1 # # NULL NULL YES FULLTEXT +t1 1 v1_v2 1 v1 # # NULL NULL YES FULLTEXT +t1 1 v1_v2 2 v2 # # NULL NULL YES FULLTEXT +INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. +If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +For developers who want to code on MariaDB or MySQL +* Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. +o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! +o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. +* MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings +o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! +For MariaDB / MySQL end users +* MariaDB Crash Course by Ben Forta +o First MariaDB book! +o For people who want to learn SQL and the basics of MariaDB. +o Now shipping. Purchase at Amazon.com or your favorite bookseller. +* SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. +o Everything you wanted to know about the SQL 99 standard. Excellent reference book! +o Free to read in the Knowledgebase! +* MySQL (4th Edition) by Paul DuBois +o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. +* MySQL Cookbook by Paul DuBois +o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. +* High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. +o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', +'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: + + 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. + 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. + 3. With MariaDB everyone has access to the latest code. + 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. + 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. +The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' + ), ('text2','test1','test2'); +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +v0 +INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); +SELECT v0, MATCH(v1,v2) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +v0 rating +text1 0.2809644043445587 +INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); +SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); +v0 rating +text4 1.3705332279205322 +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); +v0 +text1 +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); +v0 +SELECT v0, MATCH(v1,v2) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('database' WITH QUERY EXPANSION); +v0 rating +text1 190.56150817871094 +text4 1.1758291721343994 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/fulltext_search.test b/mysql-test/suite/storage_engine/fulltext_search.test new file mode 100644 index 00000000000..47857a17241 --- /dev/null +++ b/mysql-test/suite/storage_engine/fulltext_search.test @@ -0,0 +1,187 @@ +# +# Full-text indexes and search +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + v0 VARCHAR(64) $col_opts, + v1 VARCHAR(16384) $col_indexed_opts, + v2 TEXT $col_opts, + FULLTEXT v1 (v1) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = FULLTEXT indexes or VARCHAR|TEXT data types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # + SHOW INDEXES IN t1; + + INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', + + 'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: + + 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. + 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. + 3. With MariaDB everyone has access to the latest code. + 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. + 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. + + The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' + ), ('text2','test1','test2'); + + # 50% rule -- no result if the string is represented in at least 50% rows + SELECT v0 FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); + + # Adding a row to start getting results + INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); + SELECT v0, MATCH(v1) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); + + INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); + SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); + + # Boolean mode + + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); + + # Query expansion + + SELECT v0, MATCH(v1) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('database' WITH QUERY EXPANSION); + DROP TABLE t1; +} + + +let $create_definition = + v0 VARCHAR(64) $col_opts, + v1 VARCHAR(16384) $col_opts, + v2 TEXT $col_opts, + FULLTEXT v1 (v1), + FULLTEXT v1_v2 (v1,v2) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = FULLTEXT indexes or multiple keys or VARCHAR|TEXT data types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # + SHOW INDEXES IN t1; + + INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', + + 'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: + + 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. + 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. + 3. With MariaDB everyone has access to the latest code. + 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. + 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. + + The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' + ), ('text2','test1','test2'); + + # 50% rule -- no result if the string is represented in at least 50% rows + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); + + # Adding a row to start getting results + INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); + SELECT v0, MATCH(v1,v2) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); + + INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); + SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); + + # Boolean mode + + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); + + # Query expansion + + SELECT v0, MATCH(v1,v2) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('database' WITH QUERY EXPANSION); + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/handler.result b/mysql-test/suite/storage_engine/handler.result new file mode 100644 index 00000000000..be29b98cb78 --- /dev/null +++ b/mysql-test/suite/storage_engine/handler.result @@ -0,0 +1,77 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <CHAR_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES ('foobar',1000),('a',1),('bar',200),('foo',100); +HANDLER t1 OPEN AS h1; +HANDLER t1 READ FIRST; +ERROR 42S02: Unknown table 't1' in HANDLER +HANDLER h1 READ FIRST; +a b +foobar 1000 +HANDLER h1 READ NEXT; +a b +a 1 +HANDLER h1 READ FIRST WHERE a < 'foo'; +a b +a 1 +HANDLER h1 READ NEXT; +a b +bar 200 +HANDLER h1 READ NEXT; +a b +foo 100 +HANDLER h1 READ NEXT; +a b +HANDLER h1 READ FIRST LIMIT 2; +a b +foobar 1000 +a 1 +HANDLER h1 READ NEXT; +a b +bar 200 +HANDLER h1 READ NEXT WHERE b>500 LIMIT 2; +a b +HANDLER t1 OPEN; +HANDLER h1 READ FIRST WHERE b>500 LIMIT 5; +a b +foobar 1000 +HANDLER t1 READ NEXT; +a b +foobar 1000 +HANDLER h1 READ NEXT WHERE b<100; +a b +HANDLER t1 CLOSE; +HANDLER h1 READ FIRST; +a b +foobar 1000 +HANDLER t1 CLOSE; +ERROR 42S02: Unknown table 't1' in HANDLER +DROP TABLE t1; +HANDLER h1 CLOSE; +ERROR 42S02: Unknown table 'h1' in HANDLER +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (b,a) VALUES ('a',1),('b',200),('f',100),('b',101),('c',2); +HANDLER t1 OPEN AS h1; +HANDLER h1 READ a = (100); +a b +100 f +HANDLER h1 READ a <= (100) WHERE b < 'f'; +a b +2 c +HANDLER h1 READ a > (2) WHERE b IS NOT NULL LIMIT 2; +a b +100 f +101 b +HANDLER h1 READ a FIRST; +a b +1 a +HANDLER h1 READ a LAST; +a b +200 b +HANDLER h1 READ a PREV; +a b +101 b +HANDLER h1 READ a NEXT; +a b +200 b +HANDLER h1 CLOSE; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/handler.test b/mysql-test/suite/storage_engine/handler.test new file mode 100644 index 00000000000..200ab649636 --- /dev/null +++ b/mysql-test/suite/storage_engine/handler.test @@ -0,0 +1,81 @@ +# +# Basic HANDLER syntax +# +# HANDLER .. READ <index_name> is covered in handler_index test +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $char_col, b $int_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES ('foobar',1000),('a',1),('bar',200),('foo',100); + +HANDLER t1 OPEN AS h1; +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --let $error_codes = ER_UNKNOWN_TABLE + HANDLER t1 READ FIRST; + --source check_errors.inc + HANDLER h1 READ FIRST; + HANDLER h1 READ NEXT; + HANDLER h1 READ FIRST WHERE a < 'foo'; + HANDLER h1 READ NEXT; + HANDLER h1 READ NEXT; + HANDLER h1 READ NEXT; + HANDLER h1 READ FIRST LIMIT 2; + HANDLER h1 READ NEXT; + HANDLER h1 READ NEXT WHERE b>500 LIMIT 2; + HANDLER t1 OPEN; + HANDLER h1 READ FIRST WHERE b>500 LIMIT 5; + HANDLER t1 READ NEXT; + HANDLER h1 READ NEXT WHERE b<100; + HANDLER t1 CLOSE; + HANDLER h1 READ FIRST; + --let $error_codes = ER_UNKNOWN_TABLE + HANDLER t1 CLOSE; + --source check_errors.inc +} + +DROP TABLE t1; + +--let $error_codes = ER_UNKNOWN_TABLE +HANDLER h1 CLOSE; +--source check_errors.inc + +--let $continue = 1 +--source have_default_index.inc + +if ($have_default_index) +{ + --let $create_definition = a $int_indexed_col, b $char_col, $default_index (a) + --source create_table.inc + INSERT INTO t1 (b,a) VALUES ('a',1),('b',200),('f',100),('b',101),('c',2); + if ($mysql_errname) + { + --source unexpected_result.inc + } + HANDLER t1 OPEN AS h1; + if (!$mysql_errname) + { + HANDLER h1 READ a = (100); + HANDLER h1 READ a <= (100) WHERE b < 'f'; + HANDLER h1 READ a > (2) WHERE b IS NOT NULL LIMIT 2; + HANDLER h1 READ a FIRST; + HANDLER h1 READ a LAST; + HANDLER h1 READ a PREV; + HANDLER h1 READ a NEXT; + HANDLER h1 CLOSE; + } + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/have_default_index.inc b/mysql-test/suite/storage_engine/have_default_index.inc new file mode 100644 index 00000000000..fb5111c7180 --- /dev/null +++ b/mysql-test/suite/storage_engine/have_default_index.inc @@ -0,0 +1,20 @@ +# +# This include file either just prints the message, or skips the rest of the test +# Usage: +# --let $continue = 1; # optional +# --source have_default_index.inc +# + +--let $have_default_index = 1 +if ($default_index == '/*!*/ /*Custom index*/') +{ + if (!$continue) + { + --source cleanup_engine.inc + --skip # Configuration does not allow indexes. Check \$default_index value + } + --echo # According to the configuration, the engine does not allow indexes. Check \$default_index value + --let $have_default_index = 0 + --let $continue = 0 +} + diff --git a/mysql-test/suite/storage_engine/have_engine.inc b/mysql-test/suite/storage_engine/have_engine.inc new file mode 100644 index 00000000000..5a6f05f42af --- /dev/null +++ b/mysql-test/suite/storage_engine/have_engine.inc @@ -0,0 +1,127 @@ +########################################### +# +# This include file executes define_engine.inc which belongs to the storage engine +# and then checks and sets test options and parameters. +# +# The name of the engine under test must be defined in $ENGINE variable. +# You can define it either in define_engine.inc or in your environment. +# +################################ +# +# The following three variables define specific options for columns and tables. +# Normally there should be none needed, but for some engines it can be different. +# If the engine requires specific column option for all or indexed columns, +# set them inside the comment, e.g. /*!NOT NULL*/. +# Do the same for table options if needed, e.g. /*!INSERT_METHOD=LAST*/ + +let $default_col_opts = /*!*/; +let $default_col_indexed_opts = /*!*/; +let $default_tbl_opts = /*!*/; + +# INDEX, UNIQUE INDEX, PRIMARY KEY, special index type -- choose minimal that the engine allows, +# or set it to /*!*/ if none is supported + +let $default_index = /*!INDEX*/; + +# If the engine does not support these types, replace them with the closest possible + +let $default_int_type = INT(11); +let $default_char_type = CHAR(8); + +################################ +# +# Here the actual work starts +# define_engine.inc will set the ENGINE variable +# and possibly redefine some of default_* variables + +--source define_engine.inc + +if (!$ENGINE) +{ + --skip ERROR: Storage engine under test is not defined, export ENGINE env variable or set it in define_engine.inc +} + +# Check that the storage engine is loaded. Here we don't need to worry about the case, +# as I_S is case-insensitive. + +if (!`SELECT engine FROM INFORMATION_SCHEMA.ENGINES WHERE engine = '$ENGINE' AND support IN ('YES', 'DEFAULT', 'ENABLED')`) +{ + --skip The test requires $ENGINE engine +} + +# Further in tests we will use $storage_engine variable + +let $storage_engine = $ENGINE; + +# In case somebody removed comment tags in define_engine.inc +if (!$default_col_opts) +{ + let $default_col_opts = /*!*/; +} +if (!$default_col_indexed_opts) +{ + let $default_col_indexed_opts = /*!*/; +} +if (!$default_tbl_opts) +{ + let $default_tbl_opts = /*!*/; +} +if (!$default_index) +{ + let $default_index = /*!*/; +} + +# Adding a comment after default options helps later to mask the custom values in result output +let $default_index = $default_index /*Custom index*/; +let $default_col_opts = $default_col_opts /*Custom column options*/; +let $default_col_indexed_opts = $default_col_indexed_opts /*Custom indexed column options*/; +let $default_tbl_opts = $default_tbl_opts /*Custom table options*/; + + +# Finally, set some variables which will make our life easier later. +# For many tests, we need a simple INT or CHAR column, but with +# (optional) column attributes which the engine might require. +# Also, a test might be called by another test, and the calling test +# might need additional attributes. So, here we are collecting them all together. +# Example: +# CSV engine requires all columns to be NOT NULL, so its define_engine.inc file will contain +# let $default_col_opts = /*!NOT NULL*/; +# Then, we have test1.test which calls have_engine.inc. +# If it's executed directly, it will have $int_col = 'INT(11) NOT NULL' for CSV and 'INT(11)' for MyISAM. +# Another test, test2.test might set $extra_type_opts = UNSIGNED and/or $extra_col_opts = NULL +# and call test1.test. +# If both are set, test1.test will be executed for MyISAM with 'INT(11) UNSIGNED NULL', +# and for CSV INT(11) UNSIGNED NOT NULL NULL (and will fail because CSV does not support nullable columns) + +let $col_opts = $default_col_opts; +let $col_indexed_opts = $default_col_indexed_opts; + +if ($extra_col_opts) +{ + let $col_opts = $col_opts $extra_col_opts; + let $col_indexed_opts = $col_indexed_opts $extra_col_opts; +} + +if ($extra_type_opts) +{ + let $col_opts = $extra_type_opts $col_opts; + let $col_indexed_opts = $extra_type_opts $col_indexed_opts; +} + +let $int_col = $default_int_type $col_opts; +let $int_indexed_col = $default_int_type $col_indexed_opts; + +let $char_col = $default_char_type $col_opts; +let $char_indexed_col = $default_char_type $col_indexed_opts; + + + +if (`SELECT @@global.log_bin = 'ON' AND @@global.binlog_format = 'STATEMENT'`) +{ + --disable_query_log + CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT'); + --enable_query_log +} + +--disable_abort_on_error + diff --git a/mysql-test/suite/storage_engine/index.inc b/mysql-test/suite/storage_engine/index.inc new file mode 100644 index 00000000000..ac7632fb2b4 --- /dev/null +++ b/mysql-test/suite/storage_engine/index.inc @@ -0,0 +1,194 @@ +# +# Basic syntax related to indexes: +# unique and non-unique keys, +# single- and multi-column keys, +# index option COMMENT. +# +# See other index* tests for operations +# which are less likely to be supported +# +# PRIMARY KEY syntax is covered in index_primary test. +# Index types BTREE|HASH -- in index_type_btree|hash tests. +# SPATIAL -- in type_spatial_indexes test. +# FULLTEXT -- in fulltext_search test. +# KEY_BLOCK_SIZE -- in index_key_block_size test. +# +# Usage to call the test from another test: +# +# A calling test may define $index_type, in which case +# USING clause will be added to the syntax. +# + +let $using_index_type = ; +if ($index_type) +{ + let $using_index_type = USING $index_type; +} + +--source have_engine.inc + +--let $continue = 1 +--source have_default_index.inc + +if ($have_default_index) +{ + + let $create_definition = + a $int_indexed_col, + b $char_col, + $default_index $using_index_type (a) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + # Cardinality is not the exact science, so here and further + # we'll be masking it + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + DROP TABLE t1; + } + + let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index a_b $using_index_type (a,b) COMMENT 'a_b index' + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Multi-part indexes + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + DROP TABLE t1; + } + + + let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index $using_index_type (a), + $default_index $using_index_type (b) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Multiple indexes + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + DROP TABLE t1; + } + + let $create_definition = + a $int_indexed_col, + b $char_col, + UNIQUE INDEX $using_index_type (a) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Unique indexes + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'c'); + --source check_errors.inc + + DROP TABLE t1; + } + + + # + # ALTER TABLE + # + + --let $create_definition = a $int_indexed_col, b $char_col + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Column options + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + INSERT INTO t1 (a,b) VALUES (100,'z'); + + --let $alter_definition = ADD $default_index (a) $using_index_type COMMENT 'simple index on a' + --source alter_table.inc + if ($mysql_errname) + { + --let $functionality = ALTER TABLE .. ADD INDEX + --let $my_last_stmt = $alter_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW INDEX FROM t1; + --let $alter_definition = DROP KEY a + --source alter_table.inc + } + DROP TABLE t1; + } + + let $create_definition = + a $int_indexed_col, + b $char_col, + UNIQUE INDEX $using_index_type (a) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Unique indexes + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'c'); + --source check_errors.inc + + --let $alter_definition = DROP INDEX a + --source alter_table.inc + if ($mysql_errname) + { + --let $functionality = ALTER TABLE .. DROP INDEX + --let $my_last_stmt = $alter_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + INSERT INTO t1 (a,b) VALUES (1,'c'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + --let $alter_definition = ADD UNIQUE INDEX a(a) $using_index_type + --source alter_table.inc + } + DROP TABLE t1; + } +} + diff --git a/mysql-test/suite/storage_engine/index.result b/mysql-test/suite/storage_engine/index.result new file mode 100644 index 00000000000..baf9a4d4da2 --- /dev/null +++ b/mysql-test/suite/storage_engine/index.result @@ -0,0 +1,67 @@ +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b (a,b) COMMENT 'a_b index' + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a_b 1 a # # NULL NULL # BTREE a_b index +t1 1 a_b 2 b # # NULL NULL # BTREE a_b index +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a), +<CUSTOM_INDEX> (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE +t1 1 b 1 b # # NULL NULL # BTREE +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # BTREE +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'z'); +ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) COMMENT 'simple index on a'; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE simple index on a +ALTER TABLE t1 DROP KEY a; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # BTREE +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +ALTER TABLE t1 DROP INDEX a; +INSERT INTO t1 (a,b) VALUES (1,'c'); +ALTER TABLE t1 ADD UNIQUE INDEX a(a) ; +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index.test b/mysql-test/suite/storage_engine/index.test new file mode 100644 index 00000000000..0dba3d1b299 --- /dev/null +++ b/mysql-test/suite/storage_engine/index.test @@ -0,0 +1,23 @@ +# +# Basic syntax related to indexes: +# unique and non-unique keys, +# single- and multi-column keys, +# index option COMMENT. +# +# See other index* tests for operations +# which are less likely to be supported +# +# PRIMARY KEY syntax is covered in index_primary test. +# Index types BTREE|HASH -- in index_type_btree|hash tests. +# SPATIAL -- in type_spatial_indexes test. +# FULLTEXT -- in fulltext_search test. +# KEY_BLOCK_SIZE -- in index_key_block_size test. +# + +--source have_engine.inc +--source have_default_index.inc + +--source index.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_enable_disable.result b/mysql-test/suite/storage_engine/index_enable_disable.result new file mode 100644 index 00000000000..e7bb9cf3939 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_enable_disable.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (10); +INSERT INTO t1 (a) VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9), +(21),(22),(23),(24),(25),(26),(27),(28),(29); +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL # Using index +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL YES BTREE +ALTER TABLE t1 DISABLE KEYS; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL YES BTREE disabled +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 19 Using filesort +INSERT INTO t1 (a) VALUES +(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +ALTER TABLE t1 ENABLE KEYS; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL YES BTREE +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL # Using index +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, UNIQUE INDEX(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9), +(21),(22),(23),(24),(25),(26),(27),(28),(29); +ALTER TABLE t1 DISABLE KEYS; +INSERT INTO t1 (a) VALUES (29); +ERROR 23000: Duplicate entry '29' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL YES BTREE +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL # Using index +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_enable_disable.test b/mysql-test/suite/storage_engine/index_enable_disable.test new file mode 100644 index 00000000000..4f0297ea2f0 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_enable_disable.test @@ -0,0 +1,88 @@ +# +# ENABLE KEYS / DISABLE KEYS +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +--let $create_definition = a $int_indexed_col, $default_index(a) +--source create_table.inc +INSERT INTO t1 (a) VALUES (10); + +INSERT INTO t1 (a) VALUES + (1),(2),(3),(4),(5),(6),(7),(8),(9), + (21),(22),(23),(24),(25),(26),(27),(28),(29); +# Plan should use the index. +# Masking the `rows` column as the value might vary a bit +--replace_column 9 # +EXPLAIN SELECT a FROM t1 ORDER BY a; + +--replace_column 6 # 7 # +SHOW INDEX IN t1; + +--let $alter_definition = DISABLE KEYS +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER .. DISABLE KEYS + --source unexpected_result.inc +} + +# Now comment should say 'disabled' +--replace_column 6 # 7 # +SHOW INDEX IN t1; + +# And the plan should not use the index +EXPLAIN SELECT a FROM t1 ORDER BY a; +INSERT INTO t1 (a) VALUES + (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); + +# The index should be back active +--let $alter_definition = ENABLE KEYS +--source alter_table.inc +--replace_column 6 # 7 # +SHOW INDEX IN t1; +--replace_column 9 # +EXPLAIN SELECT a FROM t1 ORDER BY a; + +DROP TABLE t1; + +--let $create_definition = a $int_indexed_col, UNIQUE INDEX(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES + (1),(2),(3),(4),(5),(6),(7),(8),(9), + (21),(22),(23),(24),(25),(26),(27),(28),(29); + + # For unique indexes DISABLE KEYS has no effect + + --let $alter_definition = DISABLE KEYS + --source alter_table.inc + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a) VALUES (29); + --source check_errors.inc + --replace_column 6 # 7 # + SHOW INDEX IN t1; + --replace_column 9 # + EXPLAIN SELECT a FROM t1 ORDER BY a; + + DROP TABLE t1; +} + +# Cleanup + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_key_block_size.result b/mysql-test/suite/storage_engine/index_key_block_size.result new file mode 100644 index 00000000000..0e00f02e922 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_key_block_size.result @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a) KEY_BLOCK_SIZE=8 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> ind1(b ASC) KEY_BLOCK_SIZE=0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 ind1 1 b # # NULL NULL # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 ind2 1 b # # 1 NULL # # big key_block_size value +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b(a,b) KEY_BLOCK_SIZE=8192 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a_b 1 a # # NULL NULL # # +t1 1 a_b 2 b # # NULL NULL # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'z'); +ALTER TABLE t1 ADD <CUSTOM_INDEX>(a) KEY_BLOCK_SIZE 8192; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_key_block_size.test b/mysql-test/suite/storage_engine/index_key_block_size.test new file mode 100644 index 00000000000..21304f0380e --- /dev/null +++ b/mysql-test/suite/storage_engine/index_key_block_size.test @@ -0,0 +1,125 @@ +# +# KEY_BLOCK_SIZE index option. +# +# The results are likely to be different +# depending on the engine +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + a $int_indexed_col, + b $char_col, + $default_index (a) KEY_BLOCK_SIZE=8 +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + # Cardinality is not the exact science, so here and further + # we'll be masking it + --replace_column 6 # 7 # 10 # 11 # + SHOW KEYS IN t1; + + DROP TABLE t1; +} + + +let $create_definition = + a $int_col, + b $char_indexed_col, + $default_index ind1(b ASC) KEY_BLOCK_SIZE=0 +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Indexes on CHAR columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + DROP TABLE t1; +} + +let $create_definition = + a $int_col, + b $char_indexed_col, + UNIQUE INDEX ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value' +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys on char columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + DROP TABLE t1; +} + +let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index a_b(a,b) KEY_BLOCK_SIZE=8192 +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ +--replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + DROP TABLE t1; +} + +# +# ALTER TABLE +# + +let $create_definition = + a $int_indexed_col, + b $char_col +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (100,'z'); + + --let $alter_definition = ADD $default_index(a) KEY_BLOCK_SIZE 8192 + --source alter_table.inc + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX FROM t1; + + DROP TABLE t1; +} + + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_primary.result b/mysql-test/suite/storage_engine/index_primary.result new file mode 100644 index 00000000000..04b114f385e --- /dev/null +++ b/mysql-test/suite/storage_engine/index_primary.result @@ -0,0 +1,53 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, +b <CHAR_COLUMN> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, +b <CHAR_COLUMN> PRIMARY KEY +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR 42000: Multiple primary key defined +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +PRIMARY KEY (a,b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +t1 0 PRIMARY 2 b # # NULL NULL # # +INSERT INTO t1 (a,b) VALUES (1,'a'),(1,'b'),(2,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'b'); +ERROR 23000: Duplicate entry '1-b' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> KEY, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +t1 1 b 1 b # # NULL NULL # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN> PRIMARY KEY +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 b # # NULL NULL # # +ALTER TABLE t1 DROP INDEX `PRIMARY`; +ALTER TABLE t1 ADD CONSTRAINT PRIMARY KEY pk (a); +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +ALTER TABLE t1 DROP PRIMARY KEY; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_primary.test b/mysql-test/suite/storage_engine/index_primary.test new file mode 100644 index 00000000000..55671d99e46 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_primary.test @@ -0,0 +1,136 @@ +# +# Basic syntax related to primary keys +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + a $int_indexed_col PRIMARY KEY, + b $char_col +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = PRIMARY KEY + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW KEYS IN t1; + + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'c'); + --source check_errors.inc + + DROP TABLE t1; +} + +--let $error_codes = ER_MULTIPLE_PRI_KEY +let $create_definition = + a $int_indexed_col PRIMARY KEY, + b $char_indexed_col PRIMARY KEY +; +--source create_table.inc +if ($mysql_errname != ER_MULTIPLE_PRI_KEY) +{ + --let $my_last_stmt = $create_statement + --let $functionality = PRIMARY KEY + --source unexpected_result.inc +} + +let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + PRIMARY KEY (a,b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + INSERT INTO t1 (a,b) VALUES (1,'a'),(1,'b'),(2,'a'),(2,'b'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'b'); + --source check_errors.inc + DROP TABLE t1; +} + + +--let $continue = 1 +--source have_default_index.inc +if ($have_default_index) +{ + # KEY in a column definition means PK! + let $create_definition = + a $int_indexed_col KEY, + b $char_indexed_col, + $default_index (b) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Multiple keys or PK or keys on CHAR columns + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + DROP TABLE t1; + } +} + +let $create_definition = + a $int_indexed_col, + b $char_indexed_col PRIMARY KEY +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + --let $alter_definition = DROP INDEX `PRIMARY` + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $alter_definition = ADD CONSTRAINT PRIMARY KEY pk (a) + --source alter_table.inc + --source mask_engine.inc + --replace_column 6 # 7 # 10 # 11 # + SHOW KEYS IN t1; + --let $alter_definition = DROP PRIMARY KEY + --source alter_table.inc + } + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_type_btree.result b/mysql-test/suite/storage_engine/index_type_btree.result new file mode 100644 index 00000000000..e0b3ac546f2 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_type_btree.result @@ -0,0 +1,67 @@ +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> USING BTREE (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b USING BTREE (a,b) COMMENT 'a_b index' + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a_b 1 a # # NULL NULL # BTREE a_b index +t1 1 a_b 2 b # # NULL NULL # BTREE a_b index +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> USING BTREE (a), +<CUSTOM_INDEX> USING BTREE (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE +t1 1 b 1 b # # NULL NULL # BTREE +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX USING BTREE (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # BTREE +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'z'); +ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) USING BTREE COMMENT 'simple index on a'; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE simple index on a +ALTER TABLE t1 DROP KEY a; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX USING BTREE (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # BTREE +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +ALTER TABLE t1 DROP INDEX a; +INSERT INTO t1 (a,b) VALUES (1,'c'); +ALTER TABLE t1 ADD UNIQUE INDEX a(a) USING BTREE; +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_type_btree.test b/mysql-test/suite/storage_engine/index_type_btree.test new file mode 100644 index 00000000000..c521221820e --- /dev/null +++ b/mysql-test/suite/storage_engine/index_type_btree.test @@ -0,0 +1,12 @@ +# +# Index type BTREE +# + +--source have_engine.inc + +let $index_type = BTREE; + +--source index.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_type_hash.result b/mysql-test/suite/storage_engine/index_type_hash.result new file mode 100644 index 00000000000..f26663418bf --- /dev/null +++ b/mysql-test/suite/storage_engine/index_type_hash.result @@ -0,0 +1,67 @@ +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> USING HASH (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # HASH +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b USING HASH (a,b) COMMENT 'a_b index' + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a_b 1 a # # NULL NULL # HASH a_b index +t1 1 a_b 2 b # # NULL NULL # HASH a_b index +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> USING HASH (a), +<CUSTOM_INDEX> USING HASH (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # HASH +t1 1 b 1 b # # NULL NULL # HASH +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX USING HASH (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # HASH +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'z'); +ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) USING HASH COMMENT 'simple index on a'; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # HASH simple index on a +ALTER TABLE t1 DROP KEY a; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX USING HASH (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # HASH +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +ALTER TABLE t1 DROP INDEX a; +INSERT INTO t1 (a,b) VALUES (1,'c'); +ALTER TABLE t1 ADD UNIQUE INDEX a(a) USING HASH; +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_type_hash.test b/mysql-test/suite/storage_engine/index_type_hash.test new file mode 100644 index 00000000000..c63f41c6344 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_type_hash.test @@ -0,0 +1,12 @@ +# +# Index type HASH +# + +--source have_engine.inc + +let $index_type = HASH; + +--source index.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert.result b/mysql-test/suite/storage_engine/insert.result new file mode 100644 index 00000000000..a07a6e8d9a4 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert.result @@ -0,0 +1,149 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 VALUES (100,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +SELECT * FROM t1; +a b +1 a +100 foobar +2 b +3 c +4 d +5 e +INSERT t1 VALUE (10,'foo'),(11,'abc'); +SELECT * FROM t1; +a b +1 a +10 foo +100 foobar +11 abc +2 b +3 c +4 d +5 e +INSERT INTO t1 (b,a) VALUES ('test',0); +SELECT * FROM t1; +a b +0 test +1 a +10 foo +100 foobar +11 abc +2 b +3 c +4 d +5 e +INSERT INTO t1 VALUES (DEFAULT,DEFAULT); +SELECT * FROM t1; +a b +0 test +1 a +10 foo +100 foobar +11 abc +2 b +3 c +4 d +5 e +NULL NULL +INSERT t1 (a) VALUE (10),(20); +SELECT * FROM t1; +a b +0 test +1 a +10 NULL +10 foo +100 foobar +11 abc +2 b +20 NULL +3 c +4 d +5 e +NULL NULL +INSERT INTO t1 SET a = 11, b = 'f'; +SELECT * FROM t1; +a b +0 test +1 a +10 NULL +10 foo +100 foobar +11 abc +11 f +2 b +20 NULL +3 c +4 d +5 e +NULL NULL +INSERT t1 SET b = DEFAULT; +SELECT * FROM t1; +a b +0 test +1 a +10 NULL +10 foo +100 foobar +11 abc +11 f +2 b +20 NULL +3 c +4 d +5 e +NULL NULL +NULL NULL +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 SELECT * FROM t1; +INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo'; +SELECT * FROM t1; +a b +0 test +1 a +10 NULL +10 NULL +10 foo +100 foobar +11 abc +11 f +2 b +20 NULL +3 c +4 d +5 e +NULL NULL +NULL NULL +INSERT t1 SELECT * FROM t1; +SELECT * FROM t1; +a b +0 test +0 test +1 a +1 a +10 NULL +10 NULL +10 NULL +10 NULL +10 foo +10 foo +100 foobar +100 foobar +11 abc +11 abc +11 f +11 f +2 b +2 b +20 NULL +20 NULL +3 c +3 c +4 d +4 d +5 e +5 e +NULL NULL +NULL NULL +NULL NULL +NULL NULL +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/insert.test b/mysql-test/suite/storage_engine/insert.test new file mode 100644 index 00000000000..d9076219eb0 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert.test @@ -0,0 +1,78 @@ +# +# Basic INSERT statements +# +# LOW_PRIORITY|HIGH_PRIORITY are covered in insert_high_low_prio test +# DELAYED is covered in insert_delayed test +# IGNORE and ON DUPLICATE KEY UPDATE are covered in insert_with_keys test + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--source create_table.inc + +# INSERT [INTO] .. VALUES|VALUE .. + +INSERT INTO t1 VALUES (100,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +if ($mysql_errname) +{ + --let $functionality = INSERT + --source unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +INSERT t1 VALUE (10,'foo'),(11,'abc'); +--sorted_result +SELECT * FROM t1; + +INSERT INTO t1 (b,a) VALUES ('test',0); +--sorted_result +SELECT * FROM t1; + +INSERT INTO t1 VALUES (DEFAULT,DEFAULT); +--sorted_result +SELECT * FROM t1; + +INSERT t1 (a) VALUE (10),(20); +--sorted_result +SELECT * FROM t1; + +# INSERT [INTO] .. SET + +INSERT INTO t1 SET a = 11, b = 'f'; +--sorted_result +SELECT * FROM t1; + +INSERT t1 SET b = DEFAULT; +--sorted_result +SELECT * FROM t1; + + +# INSERT .. SELECT + +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 SELECT * FROM t1; +if ($mysql_errname) +{ + --let $functionality = INSERT .. SELECT + --source unexpected_result.inc +} + + +INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo'; +--sorted_result +SELECT * FROM t1; + +INSERT t1 SELECT * FROM t1; +--sorted_result +SELECT * FROM t1; + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert_delayed.result b/mysql-test/suite/storage_engine/insert_delayed.result new file mode 100644 index 00000000000..98e149bdf96 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_delayed.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +LOCK TABLE t1 READ; +connect con0,localhost,root,,; +SET lock_wait_timeout = 1; +INSERT DELAYED INTO t1 (a,b) VALUES (3,'c'); +INSERT DELAYED INTO t1 SET a=4, b='d'; +INSERT DELAYED INTO t1 SELECT 5, 'e'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +disconnect con0; +connection default; +SELECT * FROM t1; +a b +1 f +2 b +UNLOCK TABLES; +FLUSH TABLES; +SELECT * FROM t1; +a b +1 f +2 b +3 c +4 d +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_delayed.test b/mysql-test/suite/storage_engine/insert_delayed.test new file mode 100644 index 00000000000..7c3c4eec768 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_delayed.test @@ -0,0 +1,62 @@ +# +# INSERT DELAYED +# + +--source have_engine.inc + +if (`SELECT @@log_bin AND @@binlog_format IN ('statement','mixed')`) +{ + --source cleanup_engine.inc + --skip # INSERT DELAYED does not work with binlog format STATEMENT or MIXED +} + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +LOCK TABLE t1 READ; +if ($mysql_errname) +{ + --let $functionality = LOCK TABLE .. READ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --connect (con0,localhost,root,,) + SET lock_wait_timeout = 1; + INSERT DELAYED INTO t1 (a,b) VALUES (3,'c'); + if ($mysql_errname) + { + --let $functionality = INSERT DELAYED + --source unexpected_result.inc + } + INSERT DELAYED INTO t1 SET a=4, b='d'; + # DELAYED is ignored with INSERT .. SELECT + --let $error_codes = ER_LOCK_WAIT_TIMEOUT + INSERT DELAYED INTO t1 SELECT 5, 'e'; + --source check_errors.inc + + --disconnect con0 + --connection default + SELECT * FROM t1; +} +UNLOCK TABLES; +FLUSH TABLES; +SELECT * FROM t1; + +# Cleanup +DROP TABLE t1; + +let $wait_timeout = 30; +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert_high_prio.result b/mysql-test/suite/storage_engine/insert_high_prio.result new file mode 100644 index 00000000000..66378564ff7 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_high_prio.result @@ -0,0 +1,64 @@ +DROP TABLE IF EXISTS t1; +SET @low_prio_updates = @@global.low_priority_updates; +SET @concur_insert = @@global.concurrent_insert; +SET GLOBAL concurrent_insert = NEVER; +connect con0,localhost,root,,; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 4; +connect con2,localhost,root,,; +SET lock_wait_timeout = 4; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +SET GLOBAL LOW_PRIORITY_UPDATES = 1; +connection con1; +SELECT SLEEP(1) FROM t1; +connection con0; +INSERT INTO t1 (a,b) VALUES (3,'z'); +connection con2; +# Should return only 2 rows +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection con0; +SELECT * FROM t1; +a b +1 f +2 b +3 z +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +connection con1; +SELECT SLEEP(1) FROM t1; +connection con0; +INSERT HIGH_PRIORITY INTO t1 (a,b) VALUES (3,'z'); +connection con2; +# Should return 3 rows +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection con0; +SELECT * FROM t1; +a b +1 f +2 b +3 z +disconnect con1; +disconnect con2; +disconnect con0; +connection default; +SET GLOBAL low_priority_updates = @low_prio_updates; +SET GLOBAL concurrent_insert = @concur_insert; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_high_prio.test b/mysql-test/suite/storage_engine/insert_high_prio.test new file mode 100644 index 00000000000..819e996d468 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_high_prio.test @@ -0,0 +1,143 @@ +# +# INSERT HIGH_PRIOIRITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# We will be changing the GLOBAL value of low_priority_updates +# due to bug#64892 +# (Session-level low_priority_updates does not work for INSERT) +SET @low_prio_updates = @@global.low_priority_updates; + +# Concurrent insert might interfere +# with HIGH|LOW_PRIORITY logic +SET @concur_insert = @@global.concurrent_insert; +SET GLOBAL concurrent_insert = NEVER; + +# We will have 3 connections: +# con1 will start SELECT which should give us enough time; +# con0 will run INSERT +# con2 will then start another SELECT. +# With standard INSERT and low_priority_updates=1 +# we should see only old rows in both resultsets, +# while with INSERT HIGH_PRIORITY we should see new rows in con2 resultset. + +--connect (con0,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 4; + + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +# Normal INSERT with low_priority_updates=1 +# should work like INSERT LOW_PRIORITY + +SET GLOBAL LOW_PRIORITY_UPDATES = 1; + +--connection con1 +--send +SELECT SLEEP(1) FROM t1; + +--connection con0 +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +INSERT INTO t1 (a,b) VALUES (3,'z'); + +--connection con2 +let $condition = = 'Waiting for table level lock'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = @@low_priority_updates or INSERT or table locking + --source unexpected_result.inc +} +if ($found) +{ + --echo # Should return only 2 rows + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection con0 +--reap +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +# INSERT HIGH_PRIORITY should override low_priority_updates=1 + +--connection con1 +--send +SELECT SLEEP(1) FROM t1; + +--connection con0 +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +INSERT HIGH_PRIORITY INTO t1 (a,b) VALUES (3,'z'); + +--connection con2 +let $condition = = 'Waiting for table level lock'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = @@low_priority_updates or INSERT HIGH_PRIORITY or table locking + --source unexpected_result.inc +} +if ($found) +{ + --echo # Should return 3 rows + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection con0 +--reap +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--disconnect con2 +--disconnect con0 +let $wait_timeout = 30; + +--connection default + +SET GLOBAL low_priority_updates = @low_prio_updates; +SET GLOBAL concurrent_insert = @concur_insert; + +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert_low_prio.result b/mysql-test/suite/storage_engine/insert_low_prio.result new file mode 100644 index 00000000000..561b6296380 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_low_prio.result @@ -0,0 +1,39 @@ +DROP TABLE IF EXISTS t1; +SET @low_prio_updates = @@global.low_priority_updates; +SET @concur_insert = @@global.concurrent_insert; +SET GLOBAL concurrent_insert = NEVER; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +connect con0,localhost,root,,; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 4; +connect con2,localhost,root,,; +SET lock_wait_timeout = 4; +connection con1; +SELECT SLEEP(1) FROM t1; +connection con0; +INSERT LOW_PRIORITY INTO t1 (a,b) VALUES (3,'z'); +connection con2; +# Should return only 2 rows +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection con0; +SELECT * FROM t1; +a b +1 f +2 b +3 z +disconnect con0; +disconnect con1; +disconnect con2; +connection default; +SET GLOBAL low_priority_updates = @low_prio_updates; +SET GLOBAL concurrent_insert = @concur_insert; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_low_prio.test b/mysql-test/suite/storage_engine/insert_low_prio.test new file mode 100644 index 00000000000..30f47833162 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_low_prio.test @@ -0,0 +1,95 @@ +# +# INSERT LOW_PRIORITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# We will be changing the GLOBAL value of low_priority_updates +# due to bug#64892 +# (Session-level low_priority_updates does not work for INSERT) +SET @low_prio_updates = @@global.low_priority_updates; + +# Concurrent insert might interfere +# with HIGH|LOW_PRIORITY logic +SET @concur_insert = @@global.concurrent_insert; +SET GLOBAL concurrent_insert = NEVER; + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +# We will have 3 connections: +# con1 will start SELECT which should give us enough time; +# con0 will run INSERT +# con2 will then start another SELECT. +# With INSERT LOW_PRIORITY we should see only old rows in both resultsets. + +--connect (con0,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 4; + +--connection con1 + +--send +SELECT SLEEP(1) FROM t1; + +--connection con0 +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = = 'User sleep'; +# We don't need to wait long, +# thread should show up in the processlist right away +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +INSERT LOW_PRIORITY INTO t1 (a,b) VALUES (3,'z'); + +--connection con2 + +let $condition = = 'Waiting for table level lock'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition + --let $functionality = INSERT LOW_PRIORITY or table locking + --source unexpected_result.inc +} +if ($found) +{ + --echo # Should return only 2 rows + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection con0 +--reap +--sorted_result +SELECT * FROM t1; + +--disconnect con0 +--disconnect con1 +--disconnect con2 +--connection default + +SET GLOBAL low_priority_updates = @low_prio_updates; +SET GLOBAL concurrent_insert = @concur_insert; + +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert_with_keys.result b/mysql-test/suite/storage_engine/insert_with_keys.result new file mode 100644 index 00000000000..175e7eeb2c7 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_with_keys.result @@ -0,0 +1,148 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); +INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); +SELECT * FROM t1; +a b +0 +1 a +1 a +100 a +12345 z +2 b +29 n +3 a +3 c +30 m +4 d +5 e +6 f +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); +INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); +ERROR 23000: Duplicate entry '3' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (0,''); +SELECT * FROM t1; +a b +0 +1 a +100 a +2 b +29 n +3 c +30 m +4 d +5 e +6 f +INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10; +SELECT * FROM t1; +a b +0 +1 a +100 a +12345 z +13 c +14 d +2 b +29 n +30 m +5 e +6 f +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); +INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); +INSERT INTO t1 (a,b) VALUES (100,'b'), (2,'c'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +ERROR 23000: Duplicate entry '1-a' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +SELECT * FROM t1; +a b +1 a +100 a +100 b +2 b +2 c +29 n +3 c +30 m +4 d +5 e +6 f +INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a); +SELECT * FROM t1; +a b +100 a +100 b +2 a +2 b +2 c +24690 z +29 n +3 c +30 m +4 d +5 e +6 f +INSERT INTO t1 (a,b) VALUES (101,'x'),(101,'x'); +ERROR 23000: Duplicate entry '101-x' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); +INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); +ERROR 23000: Duplicate entry '3' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (0,''); +SELECT * FROM t1; +a b +0 +1 a +100 a +2 b +29 n +3 c +30 m +4 d +5 e +6 f +INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b); +SELECT * FROM t1; +a b +0 +1 aa +100 a +12345 zz +2 b +29 n +3 c +30 m +4 d +5 e +6 f +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_with_keys.test b/mysql-test/suite/storage_engine/insert_with_keys.test new file mode 100644 index 00000000000..1959b55c707 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_with_keys.test @@ -0,0 +1,143 @@ +# +# INSERT statements for tables with keys +# +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col, b $char_indexed_col, $default_index(b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Indexes on CHAR columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); + INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col, b $char_col, UNIQUE INDEX(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); + INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + --source check_errors.inc + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); + --source check_errors.inc + INSERT INTO t1 (a,b) VALUES (0,''); + --sorted_result + SELECT * FROM t1; + + INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + if ($mysql_errname) + { + --source unexpected_result.inc + } + INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10; + if ($mysql_errname) + { + --source unexpected_result.inc + } + + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col, b $char_indexed_col, UNIQUE INDEX(a,b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Multi-part indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); + INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); + INSERT INTO t1 (a,b) VALUES (100,'b'), (2,'c'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + --source check_errors.inc + --sorted_result + SELECT * FROM t1; + + INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a); + --sorted_result + SELECT * FROM t1; + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (101,'x'),(101,'x'); + --source check_errors.inc + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col PRIMARY KEY, b $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Primary keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); + INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + --source check_errors.inc + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); + --source check_errors.inc + INSERT INTO t1 (a,b) VALUES (0,''); + --sorted_result + SELECT * FROM t1; + + INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + if ($mysql_errname) + { + --source unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b); + if ($mysql_errname) + { + --source unexpected_result.inc + } + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/loaddata.result b/mysql-test/suite/storage_engine/loaddata.result new file mode 100644 index 00000000000..85608cdc32a --- /dev/null +++ b/mysql-test/suite/storage_engine/loaddata.result @@ -0,0 +1,68 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +FIELDS TERMINATED BY ','; +SELECT * FROM t1; +a b +1 foo +2 bar +3 +4 abc +LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +CHARACTER SET utf8 COLUMNS TERMINATED BY ',' + ESCAPED BY '/'; +SELECT * FROM t1; +a b +1 foo +1 foo +2 bar +2 bar +3 +3 +4 abc +4 abc +LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +FIELDS TERMINATED BY ';' + OPTIONALLY ENCLOSED BY '''' + LINES STARTING BY 'prefix:' +IGNORE 2 LINES +(a,b); +Warnings: +Warning 1262 Row 2 was truncated; it contained more data than there were input columns +SELECT * FROM t1; +a b +0 +1 foo +1 foo +100 foo +2 bar +2 bar +3 +3 +4 abc +4 abc +7 test +LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +FIELDS TERMINATED BY ';' + (a) SET b='loaded'; +Warnings: +Warning 1262 Row 1 was truncated; it contained more data than there were input columns +Warning 1262 Row 2 was truncated; it contained more data than there were input columns +Warning 1262 Row 3 was truncated; it contained more data than there were input columns +SELECT * FROM t1; +a b +0 +0 loaded +1 foo +1 foo +100 foo +102 loaded +2 bar +2 bar +3 +3 +4 abc +4 abc +5 loaded +7 test +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/loaddata.test b/mysql-test/suite/storage_engine/loaddata.test new file mode 100644 index 00000000000..c413184af00 --- /dev/null +++ b/mysql-test/suite/storage_engine/loaddata.test @@ -0,0 +1,88 @@ +# +# Basic LOAD DATA statements +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc + +let $datadir = `SELECT @@datadir`; + +--write_file $datadir/se_loaddata.dat +1,foo, +2,bar, +3,, +4,abc, +EOF + +--replace_result $datadir <DATADIR> +eval +LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + FIELDS TERMINATED BY ','; +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --sorted_result + SELECT * FROM t1; + + --replace_result $datadir <DATADIR> + eval + LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + CHARACTER SET utf8 COLUMNS TERMINATED BY ',' + ESCAPED BY '/'; + --sorted_result + SELECT * FROM t1; + + --remove_file $datadir/se_loaddata.dat + --write_file $datadir/se_loaddata.dat +prefix:5;'foo'; +prefix:6;''; +prefix:100;foo; +prefix:7;'test';suffix +101;abc; +102;'z'; +prefix:0;; +EOF + + --replace_result $datadir <DATADIR> + eval + LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + FIELDS TERMINATED BY ';' + OPTIONALLY ENCLOSED BY '''' + LINES STARTING BY 'prefix:' + IGNORE 2 LINES + (a,b); + + --sorted_result + SELECT * FROM t1; + + --remove_file $datadir/se_loaddata.dat + --write_file $datadir/se_loaddata.dat +5;YYY; +102;'zzz'; +0;'test'; +EOF + + --replace_result $datadir <DATADIR> + eval + LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + FIELDS TERMINATED BY ';' + (a) SET b='loaded'; + + --sorted_result + SELECT * FROM t1; +} + +# Cleanup +--remove_file $datadir/se_loaddata.dat +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/lock.result b/mysql-test/suite/storage_engine/lock.result new file mode 100644 index 00000000000..73573381110 --- /dev/null +++ b/mysql-test/suite/storage_engine/lock.result @@ -0,0 +1,111 @@ +connect con1,localhost,root,,; +SET lock_wait_timeout=1; +connection default; +DROP TABLE IF EXISTS t1, t2, t3; +CREATE TABLE t1 (id <INT_COLUMN>, id2 <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (id,id2) VALUES (1,1),(1,2),(1,3); +LOCK TABLE t1 LOW_PRIORITY WRITE; +SELECT id2,COUNT(DISTINCT id) FROM t1 GROUP BY id2; +id2 COUNT(DISTINCT id) +1 1 +2 1 +3 1 +UPDATE t1 SET id=-1 WHERE id=1; +connection con1; +SELECT * FROM t1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +LOCK TABLE t1 READ; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +LOCK TABLE t1 READ; +UPDATE t1 SET id=1 WHERE id=1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +connection con1; +SELECT COUNT(DISTINCT id) FROM t1; +COUNT(DISTINCT id) +1 +UPDATE t1 SET id=2 WHERE id=2; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +LOCK TABLE t1 WRITE; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +LOCK TABLE t1 READ; +UNLOCK TABLES; +connection default; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR HY000: Table 't2' was not locked with LOCK TABLES +CREATE TEMPORARY TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +DROP TABLE IF EXISTS t2; +UNLOCK TABLES; +CREATE TABLE t2 (id <INT_COLUMN>, id2 <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLE t1 WRITE, t2 WRITE; +INSERT INTO t2 SELECT * FROM t1; +UPDATE t1 SET id=1 WHERE id=-1; +DROP TABLE t1,t2; +CREATE TABLE t1 (i1 <INT_COLUMN>, nr <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (nr <INT_COLUMN>, nm <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (nr,nm) VALUES (1,3); +INSERT INTO t2 (nr,nm) VALUES (2,4); +lock tables t1 write, t2 read; +INSERT INTO t1 (i1,nr) SELECT 1, nr FROM t2 WHERE nm=3; +INSERT INTO t1 (i1,nr) SELECT 2, nr FROM t2 WHERE nm=4; +UNLOCK TABLES; +LOCK TABLES t1 WRITE; +INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1; +ERROR HY000: Table 't1' was not locked with LOCK TABLES +UNLOCK TABLES; +LOCK TABLES t1 WRITE, t1 AS t1_alias READ; +INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1 AS t1_alias; +DROP TABLE t1,t2; +ERROR HY000: Table 't2' was not locked with LOCK TABLES +UNLOCK TABLES; +DROP TABLE t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t3 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +DROP TABLE t2, t3, t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t3 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t1 AS t4 READ; +ALTER TABLE t2 ADD COLUMN c2 <INT_COLUMN>; +DROP TABLE t1, t2, t3; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLE t1 READ, t2 READ; +FLUSH TABLE t1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +FLUSH TABLES; +ERROR HY000: Table 't2' was locked with a READ lock and can't be updated +FLUSH TABLES t1, t2 WITH READ LOCK; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +UNLOCK TABLES; +FLUSH TABLES t1, t2 WITH READ LOCK; +connection con1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +UNLOCK TABLES; +FLUSH TABLES WITH READ LOCK; +connection con1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +UNLOCK TABLES; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT; +DROP TABLE t1, t2; +ERROR HY000: Can't execute the query because you have a conflicting read lock +UNLOCK TABLES; +DROP TABLE t1, t2; +disconnect con1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLE t1 WRITE, t2 WRITE; +CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +FLUSH TABLE t1; +DROP TEMPORARY TABLE t1; +SELECT * FROM t1; +a b +UNLOCK TABLES; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/lock.test b/mysql-test/suite/storage_engine/lock.test new file mode 100644 index 00000000000..16872bdaa7d --- /dev/null +++ b/mysql-test/suite/storage_engine/lock.test @@ -0,0 +1,244 @@ +# Standard table locking: +# LOCK TABLE .. READ +# LOCK TABLE .. [LOW_PRIORITY] WRITE +# UNLOCK TABLES +# +# and global locking: +# FLUSH TABLES [..] WITH READ LOCK +# +# +--source have_engine.inc + +--enable_connect_log + +# Save the initial number of concurrent sessions. +--source include/count_sessions.inc + +connect (con1,localhost,root,,); +SET lock_wait_timeout=1; + +connection default; + +--disable_warnings +DROP TABLE IF EXISTS t1, t2, t3; +--enable_warnings + +--let $create_definition = id $int_col, id2 $int_col +--source create_table.inc + +INSERT INTO t1 (id,id2) VALUES (1,1),(1,2),(1,3); + +# LOW_PRIORITY has no effect, but is still syntactically correct +LOCK TABLE t1 LOW_PRIORITY WRITE; +SELECT id2,COUNT(DISTINCT id) FROM t1 GROUP BY id2; + +UPDATE t1 SET id=-1 WHERE id=1; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source unexpected_result.inc +} + +connection con1; +# With WRITE lock held by connection 'default', +# nobody else can access the table +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +SELECT * FROM t1; +--source check_errors.inc +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +LOCK TABLE t1 READ; +--source check_errors.inc + +connection default; +LOCK TABLE t1 READ; +--let $error_codes = ER_TABLE_NOT_LOCKED_FOR_WRITE +UPDATE t1 SET id=1 WHERE id=1; +--source check_errors.inc +if ($mysql_errname != ER_TABLE_NOT_LOCKED_FOR_WRITE) +{ + --let $functonality = UPDATE or locking + --source unexpected_result.inc +} + +connection con1; +# With READ lock held by connection 'default', +# it should be possible to read from the table +# or acquire another READ lock, +# but not update it or acquire WRITE lock +SELECT COUNT(DISTINCT id) FROM t1; +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET id=2 WHERE id=2; +--source check_errors.inc +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +LOCK TABLE t1 WRITE; +--source check_errors.inc +LOCK TABLE t1 READ; +UNLOCK TABLES; + + +--connection default + +--let $error_codes = ER_TABLE_NOT_LOCKED +--let $table_name = t2 +--source create_table.inc + +--let $table_name = t2 +--let $temporary = 1 +--source create_table.inc + +DROP TABLE IF EXISTS t2; + +UNLOCK TABLES; + +--let $table_name = t2 +--let $create_definition = id $int_col, id2 $int_col +--source create_table.inc +LOCK TABLE t1 WRITE, t2 WRITE; +INSERT INTO t2 SELECT * FROM t1; +UPDATE t1 SET id=1 WHERE id=-1; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source unexpected_result.inc +} +DROP TABLE t1,t2; + +# +# INSERT ... SELECT with lock tables +# + +--let $create_definition = i1 $int_col, nr $int_col +--source create_table.inc + +--let $table_name = t2 +--let $create_definition = nr $int_col, nm $int_col +--source create_table.inc + +INSERT INTO t2 (nr,nm) VALUES (1,3); +INSERT INTO t2 (nr,nm) VALUES (2,4); + +lock tables t1 write, t2 read; +INSERT INTO t1 (i1,nr) SELECT 1, nr FROM t2 WHERE nm=3; +INSERT INTO t1 (i1,nr) SELECT 2, nr FROM t2 WHERE nm=4; +UNLOCK TABLES; + +LOCK TABLES t1 WRITE; +--let $error_codes = ER_TABLE_NOT_LOCKED +INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1; +--source check_errors.inc +UNLOCK TABLES; +LOCK TABLES t1 WRITE, t1 AS t1_alias READ; +INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1 AS t1_alias; +--let $error_codes = ER_TABLE_NOT_LOCKED +DROP TABLE t1,t2; +--source check_errors.inc +UNLOCK TABLES; +DROP TABLE t1,t2; + +# +# Check that a dropped table is removed from a lock + +--source create_table.inc +--let $table_name = t2 +--source create_table.inc +--let $table_name = t3 +--source create_table.inc +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +# This removes one table after the other from the lock. +DROP TABLE t2, t3, t1; +# +# Check that a lock merge works +--source create_table.inc +--let $table_name = t2 +--source create_table.inc +--let $table_name = t3 +--source create_table.inc +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t1 AS t4 READ; + +--let $alter_definition = ADD COLUMN c2 $int_col +--let $table_name = t2 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} + +DROP TABLE t1, t2, t3; + +# FLUSH TABLES is not permitted when there is an active LOCK TABLES .. READ, +# FLUSH TABLES .. WITH READ LOCK should be used instead +# (and for other connections the table is locked) + +--source create_table.inc +--let $table_name = t2 +--source create_table.inc + +LOCK TABLE t1 READ, t2 READ; +--let $error_codes = ER_TABLE_NOT_LOCKED_FOR_WRITE +FLUSH TABLE t1; +--source check_errors.inc +--let $error_codes = ER_TABLE_NOT_LOCKED_FOR_WRITE +FLUSH TABLES; +--source check_errors.inc +--let $error_codes = ER_LOCK_OR_ACTIVE_TRANSACTION +FLUSH TABLES t1, t2 WITH READ LOCK; +--source check_errors.inc +UNLOCK TABLES; + +FLUSH TABLES t1, t2 WITH READ LOCK; + +--connection con1 +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--source check_errors.inc + +--connection default +UNLOCK TABLES; + +# Global lock + +FLUSH TABLES WITH READ LOCK; + +--connection con1 +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--source check_errors.inc + +--connection default +UNLOCK TABLES; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT; +--let $error_codes = ER_CANT_UPDATE_WITH_READLOCK +DROP TABLE t1, t2; +--source check_errors.inc +UNLOCK TABLES; +DROP TABLE t1, t2; + +--disconnect con1 + +# +# Ensure that FLUSH TABLES doesn't substitute a base locked table +# with a temporary one. +# + +--source create_table.inc +--let $table_name = t2 +--source create_table.inc +LOCK TABLE t1 WRITE, t2 WRITE; + +--let $temporary = 1 +--source create_table.inc +FLUSH TABLE t1; +DROP TEMPORARY TABLE t1; +SELECT * FROM t1; +UNLOCK TABLES; +DROP TABLE t1, t2; + +# Check that all connections opened by test cases in this file are really +# gone so execution of other tests won't be affected by their presence. +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/lock_concurrent.result b/mysql-test/suite/storage_engine/lock_concurrent.result new file mode 100644 index 00000000000..65ab3e86fde --- /dev/null +++ b/mysql-test/suite/storage_engine/lock_concurrent.result @@ -0,0 +1,12 @@ +SET lock_wait_timeout = 1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +SET lock_wait_timeout = 1; +LOCK TABLES t1 READ LOCAL; +UNLOCK TABLES; +UNLOCK TABLES; +LOCK TABLES t1 READ LOCAL; +LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +UNLOCK TABLES; +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/lock_concurrent.test b/mysql-test/suite/storage_engine/lock_concurrent.test new file mode 100644 index 00000000000..b75ccf0dd9f --- /dev/null +++ b/mysql-test/suite/storage_engine/lock_concurrent.test @@ -0,0 +1,52 @@ +# +# READ LOCAL / WRITE CONCURRENT locks. +# This test is separate from the main lock.test +# because the feature is likely to be unsupported. +# + +--source have_engine.inc + +--source include/count_sessions.inc + +SET lock_wait_timeout = 1; + +--let $create_definition = a $int_col +--source create_table.inc + +LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; + +connect (con1,localhost,root,,); +SET lock_wait_timeout = 1; + +# If this statement fails with ER_LOCK_WAIT_TIMEOUT, +# most likely the engine does not support LOCK .. WRITE CONCURRENT +LOCK TABLES t1 READ LOCAL; +if ($mysql_errname) +{ + --let $functionality = LOCK .. WRITE CONCURRENT + --source unexpected_result.inc +} + +UNLOCK TABLES; + +connection default; +UNLOCK TABLES; + +connection con1; +LOCK TABLES t1 READ LOCAL; + +connection default; +LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +UNLOCK TABLES; + +connection con1; +UNLOCK TABLES; +disconnect con1; + +connection default; +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/mask_engine.inc b/mysql-test/suite/storage_engine/mask_engine.inc new file mode 100644 index 00000000000..3c00af39825 --- /dev/null +++ b/mysql-test/suite/storage_engine/mask_engine.inc @@ -0,0 +1,14 @@ +# +# This include file just replaces the storage engine under test by the generic string <STORAGE_ENGINE> +# in the next statement. More masks can be added by defining $add_regex, e.g. +# let $add_regex = /$data_dir/<DATA_DIR>/ /$index_dir/<INDEX_DIR>/ +# + +--let $regex = /$storage_engine/<STORAGE_ENGINE>/i +if ($add_regex) +{ + --let $regex = $regex $add_regex +} +--let $add_regex = +--replace_regex $regex + diff --git a/mysql-test/suite/storage_engine/misc.result b/mysql-test/suite/storage_engine/misc.result new file mode 100644 index 00000000000..591f172d796 --- /dev/null +++ b/mysql-test/suite/storage_engine/misc.result @@ -0,0 +1,79 @@ +INSERT INTO mysql.event ( +db, +name, +body, +definer, +interval_value, +interval_field, +originator, +character_set_client, +collation_connection, +db_collation, +body_utf8) +values ( +database(), +"ev1", +"select 1", +user(), +100, +"SECOND_MICROSECOND", +1, +'utf8', +'utf8_general_ci', +'utf8_general_ci', +'select 1'); +SHOW EVENTS; +ERROR 42000: This version of MariaDB doesn't yet support 'MICROSECOND' +DROP EVENT ev1; +SELECT TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME +FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE ORDER BY TABLE_NAME; +TABLE_NAME COLUMN_NAME REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME +columns_priv Column_name NULL NULL +columns_priv Db NULL NULL +columns_priv Host NULL NULL +columns_priv Table_name NULL NULL +columns_priv User NULL NULL +db Db NULL NULL +db Host NULL NULL +db User NULL NULL +event db NULL NULL +event name NULL NULL +func name NULL NULL +help_category help_category_id NULL NULL +help_category name NULL NULL +help_keyword help_keyword_id NULL NULL +help_keyword name NULL NULL +help_relation help_keyword_id NULL NULL +help_relation help_topic_id NULL NULL +help_topic help_topic_id NULL NULL +help_topic name NULL NULL +host Db NULL NULL +host Host NULL NULL +ndb_binlog_index epoch NULL NULL +plugin name NULL NULL +proc db NULL NULL +proc name NULL NULL +proc type NULL NULL +procs_priv Db NULL NULL +procs_priv Host NULL NULL +procs_priv Routine_name NULL NULL +procs_priv Routine_type NULL NULL +procs_priv User NULL NULL +proxies_priv Host NULL NULL +proxies_priv Proxied_host NULL NULL +proxies_priv Proxied_user NULL NULL +proxies_priv User NULL NULL +servers Server_name NULL NULL +tables_priv Db NULL NULL +tables_priv Host NULL NULL +tables_priv Table_name NULL NULL +tables_priv User NULL NULL +time_zone Time_zone_id NULL NULL +time_zone_leap_second Transition_time NULL NULL +time_zone_name Name NULL NULL +time_zone_transition Time_zone_id NULL NULL +time_zone_transition Transition_time NULL NULL +time_zone_transition_type Time_zone_id NULL NULL +time_zone_transition_type Transition_type_id NULL NULL +user Host NULL NULL +user User NULL NULL diff --git a/mysql-test/suite/storage_engine/misc.test b/mysql-test/suite/storage_engine/misc.test new file mode 100644 index 00000000000..9357ea5767a --- /dev/null +++ b/mysql-test/suite/storage_engine/misc.test @@ -0,0 +1,47 @@ +# +# Different statements not related to an engine, +# but added to provide function coverage for handler.cc and handler.h. +# The test can be disabled or removed later. +# + +# hits get_error_message(int, String*) + +--source have_engine.inc + +INSERT INTO mysql.event ( + db, + name, + body, + definer, + interval_value, + interval_field, + originator, + character_set_client, + collation_connection, + db_collation, + body_utf8) +values ( + database(), + "ev1", + "select 1", + user(), + 100, + "SECOND_MICROSECOND", + 1, + 'utf8', + 'utf8_general_ci', + 'utf8_general_ci', + 'select 1'); + +--let $error_codes = ER_NOT_SUPPORTED_YET +SHOW EVENTS; +--source check_errors.inc +DROP EVENT ev1; + +# hits get_foreign_key_list(THD*, List<st_foreign_key_info>*) +--sorted_result +SELECT TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME +FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE ORDER BY TABLE_NAME; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/my.cnf b/mysql-test/suite/storage_engine/my.cnf new file mode 100644 index 00000000000..e83954c469d --- /dev/null +++ b/mysql-test/suite/storage_engine/my.cnf @@ -0,0 +1,7 @@ +!include include/default_my.cnf + +[server] +sql-mode=NO_ENGINE_SUBSTITUTION +binlog-format=row +log-bin=master-bin + diff --git a/mysql-test/suite/storage_engine/obfuscate.inc b/mysql-test/suite/storage_engine/obfuscate.inc new file mode 100644 index 00000000000..96c9e5a2956 --- /dev/null +++ b/mysql-test/suite/storage_engine/obfuscate.inc @@ -0,0 +1,4 @@ +let $storage_engine_search_string = ENGINE=$storage_engine; + +--replace_result ' ' ' ' ' ,' ',' ' )' ')' '( ' '(' $default_tbl_opts <CUSTOM_TABLE_OPTIONS> $int_indexed_col <INT_COLUMN> $char_indexed_col <CHAR_COLUMN> $int_col <INT_COLUMN> $char_col <CHAR_COLUMN> $default_col_indexed_opts <CUSTOM_COL_OPTIONS> $default_col_opts <CUSTOM_COL_OPTIONS> $storage_engine_search_string ENGINE=<STORAGE_ENGINE> $default_index <CUSTOM_INDEX> + diff --git a/mysql-test/suite/storage_engine/optimize_table.inc b/mysql-test/suite/storage_engine/optimize_table.inc new file mode 100644 index 00000000000..acf80de3cea --- /dev/null +++ b/mysql-test/suite/storage_engine/optimize_table.inc @@ -0,0 +1,42 @@ +# +# OPTIMIZE TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support OPTIMIZE. +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--let $table_name = t2 +--source create_table.inc + +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +OPTIMIZE TABLE t1; +INSERT INTO t2 (a,b) VALUES (4,'d'); +OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; +INSERT INTO t2 (a,b) VALUES (5,'e'); +INSERT INTO t1 (a,b) VALUES (6,'f'); +OPTIMIZE LOCAL TABLE t1, t2; +OPTIMIZE TABLE t1, t2; + +DROP TABLE t1, t2; + +# OPTIMIZE on a table with index + +--let $continue = 1 +--source have_default_index.inc +if ($have_default_index) +{ + --let $create_definition = a $int_indexed_col, b $char_col, $default_index (a) + --source create_table.inc + INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); + OPTIMIZE TABLE t1; + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/optimize_table.result b/mysql-test/suite/storage_engine/optimize_table.result new file mode 100644 index 00000000000..4bb0bd296bc --- /dev/null +++ b/mysql-test/suite/storage_engine/optimize_table.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; +Table Op Msg_type Msg_text +test.t2 optimize status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +INSERT INTO t1 (a,b) VALUES (6,'f'); +OPTIMIZE LOCAL TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize status OK +test.t2 optimize status OK +OPTIMIZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +test.t2 optimize status Table is already up to date +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/optimize_table.test b/mysql-test/suite/storage_engine/optimize_table.test new file mode 100644 index 00000000000..a32a2c846a5 --- /dev/null +++ b/mysql-test/suite/storage_engine/optimize_table.test @@ -0,0 +1,14 @@ +# +# OPTIMIZE TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support OPTIMIZE. +# + +--source have_engine.inc + +--source optimize_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/alter_table.result b/mysql-test/suite/storage_engine/parts/alter_table.result new file mode 100644 index 00000000000..d94fd3d5d14 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/alter_table.result @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES (1),(2),(2),(3),(4); +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p3 # # # # # # # +ALTER TABLE t1 COALESCE PARTITION 1; +EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +ALTER TABLE t1 REORGANIZE PARTITION; +EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +ALTER TABLE t1 REBUILD PARTITION p0; +EXPLAIN PARTiTIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +ALTER TABLE t1 REMOVE PARTITIONING; +EXPLAIN PARTiTIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 NULL # # # # # # # +ALTER TABLE t1 PARTITION BY LIST(a) (PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (101,102)); +ERROR HY000: Table has no partition for value 4 +ALTER TABLE t1 PARTITION BY LIST(a) (PARTITION p0 VALUES IN (1,2,3,4), PARTITION p1 VALUES IN (101,102)); +INSERT INTO t1 (a) VALUES (50); +ERROR HY000: Table has no partition for value 50 +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (50,51)); +INSERT INTO t1 (a) VALUES (50); +ALTER TABLE t1 DROP PARTITION p1; +ALTER TABLE t1 REORGANIZE PARTITION p0, p2 INTO (PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (4), PARTITION p2 VALUES IN (50,51), PARTITION p3 VALUES IN (101,102)); +EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( +PARTITION abc VALUES IN (1,2,3), +PARTITION def VALUES IN (100,101,102) +); +ALTER TABLE t1 DROP PARTITION abc; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/alter_table.test b/mysql-test/suite/storage_engine/parts/alter_table.test new file mode 100644 index 00000000000..48f1f3f7d96 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/alter_table.test @@ -0,0 +1,107 @@ +# +# Basic ALTER TABLE statements related to partitioning +# + +--source include/have_partition.inc +--source ../have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col +--let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES (1),(2),(2),(3),(4); + + --let $alter_definition = ADD PARTITION PARTITIONS 2 + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source ../unexpected_result.inc + } + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; + + --let $alter_definition = COALESCE PARTITION 1 + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; + + --let $alter_definition = REORGANIZE PARTITION + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; + + --let $alter_definition = REBUILD PARTITION p0 + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1; + + --let $alter_definition = REMOVE PARTITIONING + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1; + + --let $error_codes = ER_NO_PARTITION_FOR_GIVEN_VALUE + --let $alter_definition = PARTITION BY LIST(a) ( PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (101,102) ) + --source ../alter_table.inc + if ($mysql_errname != ER_NO_PARTITION_FOR_GIVEN_VALUE) + { + --let $my_last_stmt = $alter_statement + --let $my_functionality = ALTER TABLE or INSERT + --source ../unexpected_result.inc + } + + --let $alter_definition = PARTITION BY LIST(a) ( PARTITION p0 VALUES IN (1,2,3,4), PARTITION p1 VALUES IN (101,102) ) + --source ../alter_table.inc + + --let $error_codes = ER_NO_PARTITION_FOR_GIVEN_VALUE + INSERT INTO t1 (a) VALUES (50); + --source ../check_errors.inc + --let $alter_definition = ADD PARTITION ( PARTITION p2 VALUES IN (50,51) ) + --source ../alter_table.inc + INSERT INTO t1 (a) VALUES (50); + + --let $alter_definition = DROP PARTITION p1 + --source ../alter_table.inc + --let $alter_definition = REORGANIZE PARTITION p0, p2 INTO ( PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (4), PARTITION p2 VALUES IN (50,51), PARTITION p3 VALUES IN (101,102) ) + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; + DROP TABLE t1; +} + + +--let $create_definition = a $int_col, b $int_col +let $partition_options = PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( + PARTITION abc VALUES IN (1,2,3), + PARTITION def VALUES IN (100,101,102) +); +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or subpartitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + --let $alter_definition = DROP PARTITION abc + --source ../alter_table.inc + + DROP TABLE t1; +} + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/analyze_table.result b/mysql-test/suite/storage_engine/parts/analyze_table.result new file mode 100644 index 00000000000..8cd210e4965 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/analyze_table.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (a,b) SELECT a,b FROM t1; +INSERT INTO t1 (a,b) VALUES (3,'c'); +ALTER TABLE t1 ANALYZE PARTITION p0; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t2 (a,b) VALUES (4,'d'), (1000,'e'); +ALTER TABLE t1 ANALYZE PARTITION LOCAL ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1 (a,b) VALUES (5,'f'),(50,'g'); +ALTER TABLE t1 ANALYZE PARTITION NO_WRITE_TO_BINLOG p1,p0; +Table Op Msg_type Msg_text +test.t1 analyze status OK +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (3,'c'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +ANALYZE NO_WRITE_TO_BINLOG TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +INSERT INTO t1 (a,b) VALUES (5,'e'); +INSERT INTO t2 (a,b) VALUES (6,'f'); +ANALYZE LOCAL TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES (1),(2),(4),(7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1 (a) VALUES (8),(10),(11),(12); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/analyze_table.test b/mysql-test/suite/storage_engine/parts/analyze_table.test new file mode 100644 index 00000000000..2ff8fff1a03 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/analyze_table.test @@ -0,0 +1,61 @@ +# +# ANALYZE TABLE for partitioned tables and ANALYZE PARTITION +# +--source include/have_partition.inc +--source ../have_engine.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + let $partiton_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN MAXVALUE + ); + --let $table_name = t2 + --source ../create_table.inc + + INSERT INTO t2 (a,b) SELECT a,b FROM t1; + + INSERT INTO t1 (a,b) VALUES (3,'c'); + + --let $alter_definition = ANALYZE PARTITION p0 + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE .. ANALYZE PARTITION + --source unexpected_result.inc + } + + INSERT INTO t2 (a,b) VALUES (4,'d'), (1000,'e'); + + --let $alter_definition = ANALYZE PARTITION LOCAL ALL + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (5,'f'),(50,'g'); + + --let $alter_definition = ANALYZE PARTITION NO_WRITE_TO_BINLOG p1,p0 + --source ../alter_table.inc + + DROP TABLE t1, t2; +} + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../analyze_table.inc +let $extra_tbl_opts =; + + +--source ../cleanup_engine.inc diff --git a/mysql-test/suite/storage_engine/parts/check_table.result b/mysql-test/suite/storage_engine/parts/check_table.result new file mode 100644 index 00000000000..6bd8d68e419 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/check_table.result @@ -0,0 +1,104 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +PARTITION p0 VALUES LESS THAN (100), +PARTITION p1 VALUES LESS THAN MAXVALUE +); +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +ALTER TABLE t1 CHECK PARTITION p0; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +ALTER TABLE t1 CHECK PARTITION p0, p1 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t2 (a,b) VALUES (10000,'e'); +ALTER TABLE t2 CHECK PARTITION p0 QUICK; +Table Op Msg_type Msg_text +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (6,'f'); +ALTER TABLE t1 CHECK PARTITION p1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t2 (a,b) VALUES (8,'h'); +ALTER TABLE t2 CHECK PARTITION p1 MEDIUM; +Table Op Msg_type Msg_text +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (9,'i'); +ALTER TABLE t1 CHECK PARTITION ALL EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (11,'k'); +ALTER TABLE t1 CHECK PARTITION p0 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +CHECK TABLE t1, t2 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +CHECK TABLE t2 QUICK; +Table Op Msg_type Msg_text +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (6,'f'); +CHECK TABLE t1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (7,'g'); +INSERT INTO t2 (a,b) VALUES (8,'h'); +CHECK TABLE t2, t1 MEDIUM; +Table Op Msg_type Msg_text +test.t2 check status OK +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (9,'i'); +INSERT INTO t2 (a,b) VALUES (10,'j'); +CHECK TABLE t1, t2 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (11,'k'); +CHECK TABLE t1 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES (1),(2),(5); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (6),(8),(12); +CHECK TABLE t1 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (13),(15),(16); +CHECK TABLE t1 QUICK; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (17),(120),(132); +CHECK TABLE t1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (801),(900),(7714); +CHECK TABLE t1 MEDIUM; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (8760),(10023),(12000); +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (13345),(24456),(78302),(143028); +CHECK TABLE t1 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/check_table.test b/mysql-test/suite/storage_engine/parts/check_table.test new file mode 100644 index 00000000000..9a42620393f --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/check_table.test @@ -0,0 +1,82 @@ +# +# CHECK TABLE for partitioned tables and ANALYZE PARTITION +# + +--source include/have_partition.inc +--source ../have_engine.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + + let $partition_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN MAXVALUE + ); + --let $table_name = t2 + --source ../create_table.inc + + INSERT INTO t2 (a,b) SELECT a, b FROM t1; + + let $alter_definition = CHECK PARTITION p0; + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE .. CHECK PARTITION + --source ../unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (3,'c'); + + let $alter_definition = CHECK PARTITION p0, p1 FOR UPGRADE; + --source ../alter_table.inc + + INSERT INTO t2 (a,b) VALUES (10000,'e'); + + let $alter_definition = CHECK PARTITION p0 QUICK; + let $table_name = t2; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (6,'f'); + + let $alter_definition = CHECK PARTITION p1 FAST; + --source ../alter_table.inc + + INSERT INTO t2 (a,b) VALUES (8,'h'); + + let $alter_definition = CHECK PARTITION p1 MEDIUM; + let $table_name = t2; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (9,'i'); + + let $alter_definition = CHECK PARTITION ALL EXTENDED; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (11,'k'); + + let $alter_definition = CHECK PARTITION p0 CHANGED; + --source ../alter_table.inc + + DROP TABLE t1, t2; +} + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../check_table.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/checksum_table.result b/mysql-test/suite/storage_engine/parts/checksum_table.result new file mode 100644 index 00000000000..666cb7f25a9 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/checksum_table.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=0 PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=0 PARTITION BY HASH(a) PARTITIONS 2; +CHECKSUM TABLE t1; +Table Checksum +test.t1 4272806499 +CHECKSUM TABLE t2, t1; +Table Checksum +test.t2 0 +test.t1 4272806499 +CHECKSUM TABLE t1, t2 QUICK; +Table Checksum +test.t1 NULL +test.t2 NULL +CHECKSUM TABLE t1, t2 EXTENDED; +Table Checksum +test.t1 4272806499 +test.t2 0 +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1 PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1 PARTITION BY HASH(a) PARTITIONS 2; +CHECKSUM TABLE t1; +Table Checksum +test.t1 0 +CHECKSUM TABLE t2, t1; +Table Checksum +test.t2 0 +test.t1 0 +CHECKSUM TABLE t1, t2 QUICK; +Table Checksum +test.t1 0 +test.t2 0 +CHECKSUM TABLE t1, t2 EXTENDED; +Table Checksum +test.t1 4272806499 +test.t2 0 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/parts/checksum_table.test b/mysql-test/suite/storage_engine/parts/checksum_table.test new file mode 100644 index 00000000000..eff70e3cadf --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/checksum_table.test @@ -0,0 +1,13 @@ +# +# CHECKSUM TABLE for partitioned tables +# + +--source include/have_partition.inc +--source ../have_engine.inc + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../checksum_table.inc +--source ../checksum_table_live.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/create_table.result b/mysql-test/suite/storage_engine/parts/create_table.result new file mode 100644 index 00000000000..945ed2312c0 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/create_table.result @@ -0,0 +1,91 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES (1),(2),(3),(2); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY KEY(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES ('a'),('b'),('c'); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 'b'; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY KEY(a) PARTITIONS 2; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +INSERT INTO t1 (a) VALUES (1),(2),(3),(5); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a IN (1,3); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY KEY() PARTITIONS 2; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +INSERT INTO t1 (a) VALUES (1),(200),(3),(2); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +PARTITION p0 VALUES LESS THAN (10), +PARTITION p1 VALUES LESS THAN (1000) +); +INSERT INTO t1 (a) VALUES (1),(2),(400); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +INSERT INTO t1 (a) VALUES (10000); +ERROR HY000: Table has no partition for value 10000 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) ( +PARTITION abc VALUES IN (1,2,3), +PARTITION def VALUES IN (100,101,102) +); +INSERT INTO t1 (a) VALUES (1),(101),(1); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 abc,def # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL # # # # # # # +INSERT INTO t1 (a) VALUES (50); +ERROR HY000: Table has no partition for value 50 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( +PARTITION abc VALUES IN (1,2,3), +PARTITION def VALUES IN (100,101,102) +); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +INSERT INTO t1 (a,b) VALUES (1,1),(101,2),(1,3); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 abc_abcsp0,def_defsp0 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL # # # # # # # +SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, SUBPARTITION_NAME, PARTITION_METHOD, SUBPARTITION_METHOD +FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1'; +TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_METHOD SUBPARTITION_METHOD +test t1 abc abcsp0 LIST HASH +test t1 def defsp0 LIST HASH +SELECT * FROM INFORMATION_SCHEMA.PARTITIONS; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/create_table.test b/mysql-test/suite/storage_engine/parts/create_table.test new file mode 100644 index 00000000000..69ab51f7281 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/create_table.test @@ -0,0 +1,179 @@ +# +# Basic CREATE TABLE .. PARTITION statements +# + +--source include/have_partition.inc +--source ../have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = a $int_col; +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES (1),(2),(3),(2); + # We are only interested in partition information + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; + + DROP TABLE t1; +} + +let $create_definition = a $char_col; +let $partition_options = PARTITION BY KEY(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or CHAR types + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES ('a'),('b'),('c'); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 'b'; + DROP TABLE t1; +} + +--let $continue = 1 +--source ../have_default_index.inc +if ($have_default_index) +{ + let $create_definition = a $int_indexed_col, $default_index (a); + let $partition_options = PARTITION BY KEY(a) PARTITIONS 2; + --source ../create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or indexes + --source ../unexpected_result.inc + } + if (!$mysql_errname) + { + --source ../mask_engine.inc + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + INSERT INTO t1 (a) VALUES (1),(2),(3),(5); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a IN (1,3); + DROP TABLE t1; + } +} + +let $create_definition = a $int_indexed_col PRIMARY KEY; +let $partition_options = PARTITION BY KEY() PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = PK + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a) VALUES (1),(200),(3),(2); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; + DROP TABLE t1; +} + + +let $create_definition = a $int_col; +let $partition_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (10), + PARTITION p1 VALUES LESS THAN (1000) +); +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES (1),(2),(400); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 2; + + --let $error_codes = ER_NO_PARTITION_FOR_GIVEN_VALUE + INSERT INTO t1 (a) VALUES (10000); + --source ../check_errors.inc + DROP TABLE t1; + + let $create_definition = a $int_col; + let $partition_options = PARTITION BY LIST(a) ( + PARTITION abc VALUES IN (1,2,3), + PARTITION def VALUES IN (100,101,102) + ); + --source ../create_table.inc + + INSERT INTO t1 (a) VALUES (1),(101),(1); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; + --let $error_codes = ER_NO_PARTITION_FOR_GIVEN_VALUE + INSERT INTO t1 (a) VALUES (50); + --source ../check_errors.inc + DROP TABLE t1; +} + +let $create_definition = a $int_col, b $int_col; +let partition_options = PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( + PARTITION abc VALUES IN (1,2,3), + PARTITION def VALUES IN (100,101,102) +); +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or subpartitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b) VALUES (1,1),(101,2),(1,3); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; + + --sorted_result + SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, SUBPARTITION_NAME, PARTITION_METHOD, SUBPARTITION_METHOD + FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1'; + # This is just to hit some more handler functions while we are here + --disable_result_log + SELECT * FROM INFORMATION_SCHEMA.PARTITIONS; + --enable_result_log + + DROP TABLE t1; +} +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/my.cnf b/mysql-test/suite/storage_engine/parts/my.cnf new file mode 100644 index 00000000000..d61663106b2 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/my.cnf @@ -0,0 +1,9 @@ +!include include/default_my.cnf + +[server] +sql-mode=NO_ENGINE_SUBSTITUTION +binlog-format=row +log-bin=master-bin +partition + + diff --git a/mysql-test/suite/storage_engine/parts/optimize_table.result b/mysql-test/suite/storage_engine/parts/optimize_table.result new file mode 100644 index 00000000000..da165bc1520 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/optimize_table.result @@ -0,0 +1,54 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +PARTITION p0 VALUES LESS THAN (100), +PARTITION p1 VALUES LESS THAN MAXVALUE +); +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +ALTER TABLE t1 OPTIMIZE PARTITION p1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +ALTER TABLE t2 OPTIMIZE PARTITION p0 NO_WRITE_TO_BINLOG; +Table Op Msg_type Msg_text +test.t2 optimize status OK +INSERT INTO t1 (a,b) VALUES (6,'f'); +ALTER TABLE t1 OPTIMIZE PARTITION ALL LOCAL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +ALTER TABLE t2 OPTIMIZE PARTITION p1,p0; +Table Op Msg_type Msg_text +test.t2 optimize status OK +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; +Table Op Msg_type Msg_text +test.t2 optimize status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +INSERT INTO t1 (a,b) VALUES (6,'f'); +OPTIMIZE LOCAL TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize status OK +test.t2 optimize status OK +OPTIMIZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize status OK +test.t2 optimize status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/optimize_table.test b/mysql-test/suite/storage_engine/parts/optimize_table.test new file mode 100644 index 00000000000..8c136933d60 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/optimize_table.test @@ -0,0 +1,69 @@ +# +# OPTIMIZE TABLE with partitions and OPTIMIZE PARTITIONS +# + +--source include/have_partition.inc +--source ../have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + + let $table_name = t2; + let $partition_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN MAXVALUE + ); + --source ../create_table.inc + + INSERT INTO t2 (a,b) SELECT a, b FROM t1; + + INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); + + let $alter_definition = OPTIMIZE PARTITION p1; + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE .. OPTIMIZE PARTITION + --source ../unexpected_result.inc + } + + INSERT INTO t2 (a,b) VALUES (4,'d'); + + let $table_name = t2; + let $alter_definition = OPTIMIZE PARTITION p0 NO_WRITE_TO_BINLOG; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (6,'f'); + + let $alter_definition = OPTIMIZE PARTITION ALL LOCAL; + --source ../alter_table.inc + + INSERT INTO t2 (a,b) VALUES (5,'e'); + + let $table_name = t2; + let $alter_definition = OPTIMIZE PARTITION p1,p0; + --source ../alter_table.inc + + DROP TABLE t1, t2; +} + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../optimize_table.inc + + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/repair_table.result b/mysql-test/suite/storage_engine/parts/repair_table.result new file mode 100644 index 00000000000..b156df6d7dc --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/repair_table.result @@ -0,0 +1,236 @@ +call mtr.add_suppression("Table '.*t1.*' is marked as crashed and should be repaired"); +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +PARTITION p0 VALUES LESS THAN (100), +PARTITION p1 VALUES LESS THAN MAXVALUE +); +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +ALTER TABLE t1 REPAIR PARTITION p0; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 VALUES (3,'c'); +ALTER TABLE t1 REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +ALTER TABLE t2 REPAIR PARTITION LOCAL p1; +Table Op Msg_type Msg_text +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +ALTER TABLE t1 REPAIR PARTITION LOCAL ALL EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 VALUES (10,'j'); +ALTER TABLE t1 REPAIR PARTITION p1 QUICK USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t2 (a,b) VALUES (12,'l'); +ALTER TABLE t2 REPAIR PARTITION NO_WRITE_TO_BINLOG ALL QUICK EXTENDED USE_FRM; +Table Op Msg_type Msg_text +test.t2 repair status OK +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +REPAIR LOCAL TABLE t2; +Table Op Msg_type Msg_text +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +INSERT INTO t2 (a,b) VALUES (9,'i'); +REPAIR LOCAL TABLE t2, t1 EXTENDED; +Table Op Msg_type Msg_text +test.t2 repair status OK +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (10,'j'); +INSERT INTO t2 (a,b) VALUES (11,'k'); +REPAIR TABLE t1, t2 QUICK USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (12,'l'); +INSERT INTO t2 (a,b) VALUES (13,'m'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +FLUSH TABLE t1; +INSERT INTO t1 (a,b) VALUES (14,'n'); +ERROR HY000: Failed to read from the .par file +# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +# If you got a difference in error message, just add it to rdiff file +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check Error Failed to read from the .par file +test.t1 check Error Incorrect information in file: './test/t1.frm' +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Failed to read from the .par file +# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +# If you got a difference in error message, just add it to rdiff file +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair Error Failed to read from the .par file +test.t1 repair Error Incorrect information in file: './test/t1.frm' +test.t1 repair error Corrupt +DROP TABLE t1, t2; +call mtr.add_suppression("Got an error from thread_id=.*"); +call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); +call mtr.add_suppression(" '\..test.t1'"); +call mtr.add_suppression("Couldn't repair table: test.t1"); +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (10,'j'); +REPAIR TABLE t1 USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair status OK +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1#P#p0.MYD +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Size of datafile is: 26 Should be: 39 +test.t1 check error Partition p0 returned error +test.t1 check error Corrupt +SELECT * FROM t1; +a b +8 h +10 j +7 g +15 o +Warnings: +Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 3 to 2 +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1#P#p0.MYI +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check warning Size of datafile is: 39 Should be: 26 +test.t1 check error Record-count is not ok; is 3 Should be: 2 +test.t1 check warning Found 3 key parts. Should be: 2 +test.t1 check error Partition p0 returned error +test.t1 check error Corrupt +SELECT * FROM t1; +a b +8 h +10 j +14 n +7 g +15 o +15 o +Warnings: +Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 2 to 3 +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1#P#p1.MYD +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Size of datafile is: 39 Should be: 52 +test.t1 check error Partition p1 returned error +test.t1 check error Corrupt +SELECT * FROM t1; +a b +8 h +10 j +14 n +14 n +7 g +15 o +15 o +Warnings: +Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 4 to 3 +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1#P#p1.MYI +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check warning Size of datafile is: 52 Should be: 39 +test.t1 check error Record-count is not ok; is 4 Should be: 3 +test.t1 check warning Found 4 key parts. Should be: 3 +test.t1 check error Partition p1 returned error +test.t1 check error Corrupt +SELECT * FROM t1; +a b +8 h +10 j +14 n +14 n +14 n +7 g +15 o +15 o +15 o +Warnings: +Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 3 to 4 +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1.par +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT * FROM t1; +a b +8 h +10 j +14 n +14 n +14 n +14 n +7 g +15 o +15 o +15 o +15 o +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/repair_table.test b/mysql-test/suite/storage_engine/parts/repair_table.test new file mode 100644 index 00000000000..f77b2ef8de4 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/repair_table.test @@ -0,0 +1,78 @@ +# +# REPAIR TABLE for partitioned tables and REPAIR PARTITION +# + +--source include/have_partition.inc +--source ../have_engine.inc + +call mtr.add_suppression("Table '.*t1.*' is marked as crashed and should be repaired"); + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + + let $table_name = t2; + let $partition_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN MAXVALUE + ); + --source ../create_table.inc + + INSERT INTO t2 (a,b) SELECT a, b FROM t1; + + let $alter_definition = REPAIR PARTITION p0; + --source ../alter_table.inc + + INSERT INTO t1 VALUES (3,'c'); + + let $alter_definition = REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1; + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source ../unexpected_result.inc + } + + INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); + + let $table_name = t2; + let $alter_definition = REPAIR PARTITION LOCAL p1; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + + let $alter_definition = REPAIR PARTITION LOCAL ALL EXTENDED; + --source ../alter_table.inc + + INSERT INTO t1 VALUES (10,'j'); + + let $alter_definition = REPAIR PARTITION p1 QUICK USE_FRM; + --source ../alter_table.inc + + INSERT INTO t2 (a,b) VALUES (12,'l'); + + let $table_name = t2; + let $alter_definition = REPAIR PARTITION NO_WRITE_TO_BINLOG ALL QUICK EXTENDED USE_FRM; + --source ../alter_table.inc + + DROP TABLE t1, t2; +} + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../repair_table.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/truncate_table.result b/mysql-test/suite/storage_engine/parts/truncate_table.result new file mode 100644 index 00000000000..e46f4c97de5 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/truncate_table.result @@ -0,0 +1,68 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +TRUNCATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); +TRUNCATE TABLE t1; +SELECT * FROM t1; +a b +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `c` char(8) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +PARTITIONS 2 */ +INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `c` char(8) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +PARTITIONS 2 */ +TRUNCATE TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `c` char(8) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +PARTITIONS 2 */ +INSERT INTO t1 (c) VALUES ('d'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `c` char(8) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +PARTITIONS 2 */ +SELECT * FROM t1; +a c +1 d +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +ALTER TABLE t1 TRUNCATE PARTITION p0; +SELECT * FROM t1; +a b +1 a +101 g +3 c +EXPLAIN PARTITIONS SELECT * FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # +INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); +ALTER TABLE t1 TRUNCATE PARTITION ALL; +SELECT * FROM t1; +a b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/truncate_table.test b/mysql-test/suite/storage_engine/parts/truncate_table.test new file mode 100644 index 00000000000..20f316d5297 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/truncate_table.test @@ -0,0 +1,111 @@ +# +# TRUNCATE TABLE with partitions and TRUNCATE PARTITION +# + +--source include/have_partition.inc +--source ../have_engine.inc + +# A part of the standard TRUNCATE test + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Truncate partitioned table + +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + TRUNCATE TABLE t1; + if ($mysql_errname) + { + --let $functionality = TRUNCATE TABLE + --source ../unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); + TRUNCATE TABLE t1; + SELECT * FROM t1; + + DROP TABLE t1; +} + + +# Truncate resets auto-increment value on the table + +let $create_definition = a $int_indexed_col KEY AUTO_INCREMENT, c $char_col; +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc + +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or PK or auto-increment + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + --source ../mask_engine.inc + SHOW CREATE TABLE t1; + INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); + --source ../mask_engine.inc + SHOW CREATE TABLE t1; + TRUNCATE TABLE t1; + --source ../mask_engine.inc + SHOW CREATE TABLE t1; + INSERT INTO t1 (c) VALUES ('d'); + --source ../mask_engine.inc + SHOW CREATE TABLE t1; + SELECT * FROM t1; + DROP TABLE t1; +} + + +# Truncate partitions + +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + + let $alter_definition = TRUNCATE PARTITION p0; + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source ../unexpected_result.inc + } + + --sorted_result + SELECT * FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # + EXPLAIN PARTITIONS SELECT * FROM t1; + + INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); + + let $alter_definition = TRUNCATE PARTITION ALL; + --source ../alter_table.inc + + SELECT * FROM t1; + + DROP TABLE t1; +} + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/repair_table.inc b/mysql-test/suite/storage_engine/repair_table.inc new file mode 100644 index 00000000000..83d2f02e20a --- /dev/null +++ b/mysql-test/suite/storage_engine/repair_table.inc @@ -0,0 +1,155 @@ +# +# REPAIR TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support REPAIR. +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--let $table_name = t2 +--source create_table.inc + +REPAIR TABLE t1; +if ($mysql_errname) +{ + --source unexpected_result.inc +} +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2; +INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +REPAIR LOCAL TABLE t2; +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +INSERT INTO t2 (a,b) VALUES (9,'i'); +REPAIR LOCAL TABLE t2, t1 EXTENDED; +INSERT INTO t1 (a,b) VALUES (10,'j'); +INSERT INTO t2 (a,b) VALUES (11,'k'); +REPAIR TABLE t1, t2 QUICK USE_FRM; +INSERT INTO t1 (a,b) VALUES (12,'l'); +INSERT INTO t2 (a,b) VALUES (13,'m'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM; +FLUSH TABLE t1; + +let my_datadir = `SELECT @@datadir`; + +# Now we'll override all table files except for frm. +# Some engines are more enduring to table files corruption +# than others, so the result of the following INSERT and REPAIR +# will be different for different engines + +--perl +@files = glob "$ENV{my_datadir}/test/t1.*"; +foreach (@files) +{ + next if /.frm$/; + rename($_,"$_.save"); + open(FILE,">$_") || print "Could not open $_\n" && exit; + print FILE ""; + close(FILE); +} +EOF + +# We don't worry so much about the INSERT or SELECT result, +# it's REPAIR that we are after. +# The preceding INSERT, however, helps to trigger +# a bit more internals +--let $error_codes = 0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY +INSERT INTO t1 (a,b) VALUES (14,'n'); +--source check_errors.inc +CHECK TABLE t1; +--let $error_codes = 0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY +SELECT * FROM t1; +--source check_errors.inc +--enable_warnings +REPAIR TABLE t1; + +--perl +@files = glob "$ENV{my_datadir}/test/t1.*.save"; +foreach (@files) +{ + $nm = $_; + $nm =~ s/\.save$//; + rename($_,$nm); +} +EOF + +DROP TABLE t1, t2; + +--let $continue = 1 +--source have_default_index.inc + +if ($have_default_index) +{ + call mtr.add_suppression("Got an error from thread_id=.*"); + call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); + call mtr.add_suppression(" '\..test.t1'"); + call mtr.add_suppression("Couldn't repair table: test.t1"); + + --let $create_definition = a $int_indexed_col, b $char_col, $default_index (a) + --source create_table.inc + REPAIR TABLE t1; + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + REPAIR TABLE t1 EXTENDED; + INSERT INTO t1 (a,b) VALUES (10,'j'); + REPAIR TABLE t1 USE_FRM; + + # We will take files one by one (except for frm file), + # save the file, update the table, then restore the file + # and check the table. + # Results here can be very different depending on the engine. + + let $my_errno = 0; + + --list_files $my_datadir/test + + while (!$my_errno) + { + --error 0,1 + --perl + use File::Copy; + @files = glob "$ENV{my_datadir}/test/t1*"; + foreach (@files) + { + next if /.(?:frm|save|done)$/; + next if -e "$_.done"; + copy($_,"$_.save"); + exit 0; + } + # No more files + exit 1; + EOF + let $my_errno = $errno; + if (!$my_errno) + { + --let $error_codes = 0,144 + INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); + --source check_errors.inc + FLUSH TABLE t1; + --replace_result $my_datadir <DATADIR> + --perl + use File::Copy; + @files = glob "$ENV{my_datadir}/test/t1*.save"; + $nm = $files[0]; + $nm =~ s/\.save$//; + print "Restoring $nm\n"; + copy($files[0],"$nm.done"); + rename($files[0],$nm); + EOF + CHECK TABLE t1; + --let $error_codes = 0,ER_NOT_KEYFILE,144 + SELECT * FROM t1; + --source check_errors.inc + } + } + DROP TABLE t1; +} + +--remove_files_wildcard $my_datadir/test t1* + + diff --git a/mysql-test/suite/storage_engine/repair_table.result b/mysql-test/suite/storage_engine/repair_table.result new file mode 100644 index 00000000000..f1af943fd7b --- /dev/null +++ b/mysql-test/suite/storage_engine/repair_table.result @@ -0,0 +1,106 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +REPAIR LOCAL TABLE t2; +Table Op Msg_type Msg_text +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +INSERT INTO t2 (a,b) VALUES (9,'i'); +REPAIR LOCAL TABLE t2, t1 EXTENDED; +Table Op Msg_type Msg_text +test.t2 repair status OK +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (10,'j'); +INSERT INTO t2 (a,b) VALUES (11,'k'); +REPAIR TABLE t1, t2 QUICK USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 6 +test.t1 repair status OK +test.t2 repair warning Number of rows changed from 0 to 5 +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (12,'l'); +INSERT INTO t2 (a,b) VALUES (13,'m'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 7 +test.t1 repair status OK +test.t2 repair warning Number of rows changed from 0 to 6 +test.t2 repair status OK +FLUSH TABLE t1; +INSERT INTO t1 (a,b) VALUES (14,'n'); +ERROR HY000: Incorrect file format 't1' +# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +# If you got a difference in error message, just add it to rdiff file +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check Error Incorrect file format 't1' +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Incorrect file format 't1' +# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +# If you got a difference in error message, just add it to rdiff file +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair Error Incorrect file format 't1' +test.t1 repair error Corrupt +DROP TABLE t1, t2; +call mtr.add_suppression("Got an error from thread_id=.*"); +call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); +call mtr.add_suppression(" '\..test.t1'"); +call mtr.add_suppression("Couldn't repair table: test.t1"); +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (10,'j'); +REPAIR TABLE t1 USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 3 +test.t1 repair status OK +t1.MYD +t1.MYI +t1.frm +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1.MYD +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Size of datafile is: 39 Should be: 65 +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1.MYI +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check warning Table is marked as crashed and last repair failed +test.t1 check error Size of datafile is: 39 Should be: 65 +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/repair_table.test b/mysql-test/suite/storage_engine/repair_table.test new file mode 100644 index 00000000000..5e3068b0970 --- /dev/null +++ b/mysql-test/suite/storage_engine/repair_table.test @@ -0,0 +1,14 @@ +# +# REPAIR TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support REPAIR. +# + +--source have_engine.inc + +--source repair_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/replace.result b/mysql-test/suite/storage_engine/replace.result new file mode 100644 index 00000000000..c8fbca8f534 --- /dev/null +++ b/mysql-test/suite/storage_engine/replace.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +SELECT * FROM t1; +a b +1 a +2 b +3 c +4 d +5 e +REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo'); +SELECT * FROM t1; +a b +1 a +10 foo +10 foo +2 b +3 c +4 d +5 e +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t1 (a,b) VALUES (2,'d'); +ERROR 23000: Duplicate entry '2' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +REPLACE INTO t1 (a,b) VALUES (2,'d'); +SELECT * FROM t1; +a b +1 a +2 d +3 c +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, PRIMARY KEY (b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t1 (a,b) VALUES (4,'b'); +ERROR 23000: Duplicate entry 'b' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +REPLACE INTO t1 (a,b) VALUES (4,'b'); +SELECT * FROM t1; +a b +1 a +3 c +4 b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/replace.test b/mysql-test/suite/storage_engine/replace.test new file mode 100644 index 00000000000..368ed62a300 --- /dev/null +++ b/mysql-test/suite/storage_engine/replace.test @@ -0,0 +1,67 @@ +# +# Basic REPLACE statements +# +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc + +# When there is no duplicate key, REPLACE should work as INSERT + +REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +--sorted_result +SELECT * FROM t1; + +REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo'); +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--let $create_definition = a $int_indexed_col, b $char_col, UNIQUE INDEX (a) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (2,'d'); + --source check_errors.inc + REPLACE INTO t1 (a,b) VALUES (2,'d'); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--let $create_definition = a $int_col, b $char_indexed_col, PRIMARY KEY (b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Primary keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (4,'b'); + --source check_errors.inc + REPLACE INTO t1 (a,b) VALUES (4,'b'); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/se-innodb.out b/mysql-test/suite/storage_engine/se-innodb.out new file mode 100644 index 00000000000..406e5066132 --- /dev/null +++ b/mysql-test/suite/storage_engine/se-innodb.out @@ -0,0 +1 @@ +Can't open perl script "./mtr": No such file or directory diff --git a/mysql-test/suite/storage_engine/select.result b/mysql-test/suite/storage_engine/select.result new file mode 100644 index 00000000000..d2331f4d869 --- /dev/null +++ b/mysql-test/suite/storage_engine/select.result @@ -0,0 +1,390 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'foobar'),(1,'z'),(200,'bar'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +INSERT INTO t1 (a,b) SELECT a, b FROM t2; +SELECT * FROM t1; +a b +1 z +1 z +100 foobar +100 foobar +200 bar +200 bar +SELECT DISTINCT a FROM t1; +a +1 +100 +200 +SELECT ALL b, a FROM t1; +b a +bar 200 +bar 200 +foobar 100 +foobar 100 +z 1 +z 1 +SELECT STRAIGHT_JOIN SQL_CACHE t1.* FROM t2, t1 WHERE t1.a <> t2.a; +a b +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +SELECT SQL_SMALL_RESULT SQL_NO_CACHE t1.a FROM t1, t2; +a +1 +1 +1 +1 +1 +1 +100 +100 +100 +100 +100 +100 +200 +200 +200 +200 +200 +200 +SELECT SQL_BIG_RESULT SQL_CALC_FOUND_ROWS DISTINCT(t2.a) +FROM t1 t1_1, t2, t1 t1_2; +a +1 +100 +200 +SELECT FOUND_ROWS(); +FOUND_ROWS() +3 +SET GLOBAL query_cache_size = 1024*1024; +SELECT SQL_CACHE * FROM t1, t2; +a b a b +1 z 1 z +1 z 1 z +1 z 100 foobar +1 z 100 foobar +1 z 200 bar +1 z 200 bar +100 foobar 1 z +100 foobar 1 z +100 foobar 100 foobar +100 foobar 100 foobar +100 foobar 200 bar +100 foobar 200 bar +200 bar 1 z +200 bar 1 z +200 bar 100 foobar +200 bar 100 foobar +200 bar 200 bar +200 bar 200 bar +SET GLOBAL query_cache_size = 0; +SELECT a+10 AS field1, CONCAT(b,':',b) AS field2 FROM t1 +WHERE b > 'b' AND a IS NOT NULL +GROUP BY 2 DESC, field1 ASC +HAVING field1 < 1000 +ORDER BY field2, 1 DESC, field1*2 +LIMIT 5 OFFSET 1 ROWS EXAMINED 100000; +field1 field2 +11 z:z +110 foobar:foobar +SELECT SUM(a), MAX(a), b FROM t1 GROUP BY b WITH ROLLUP; +SUM(a) MAX(a) b +2 1 z +200 100 foobar +400 200 bar +602 200 NULL +SELECT * FROM t2 WHERE a>0 PROCEDURE ANALYSE(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t2.a 1 200 1 3 0 0 100.3333 81.2418 ENUM('1','100','200') NOT NULL +test.t2.b bar z 1 6 0 0 3.3333 NULL ENUM('bar','foobar','z') NOT NULL +SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a +INTO OUTFILE '<DATADIR>/select.out' +CHARACTER SET utf8 +FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ''''; +200,'bar' +200,'bar' +100,'foobar' +100,'foobar' +1,'z' +1,'z' +SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a +INTO DUMPFILE '<DATADIR>/select.dump'; +ERROR 42000: Result consisted of more than one row +SELECT t1.*, t2.* FROM t1, t2 ORDER BY t2.b, t1.a, t2.a, t1.b LIMIT 1 +INTO DUMPFILE '<DATADIR>/select.dump'; +1z200bar +SELECT MIN(a), MAX(a) FROM t1 INTO @min, @max; +SELECT @min, @max; +@min @max +1 200 +SELECT t1_1.*, t2.* FROM t2, t1 AS t1_1, t1 AS t1_2 +WHERE t1_1.a = t1_2.a AND t2.a = t1_1.a; +a b a b +1 z 1 z +1 z 1 z +1 z 1 z +1 z 1 z +100 foobar 100 foobar +100 foobar 100 foobar +100 foobar 100 foobar +100 foobar 100 foobar +200 bar 200 bar +200 bar 200 bar +200 bar 200 bar +200 bar 200 bar +SELECT alias1.* FROM ( SELECT * FROM t1 ) alias1, t2 WHERE t2.a IN (100,200); +a b +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +SELECT t1.a FROM { OJ t1 LEFT OUTER JOIN t2 ON t1.a = t2.a+10 }; +a +1 +1 +100 +100 +200 +200 +SELECT t1.* FROM t2 INNER JOIN t1; +a b +1 z +1 z +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +200 bar +200 bar +SELECT t1_2.* FROM t1 t1_1 CROSS JOIN t1 t1_2 ON t1_1.b = t1_2.b; +a b +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 WHERE t1.b > t2.b; +a b +1 bar +1 bar +1 foobar +1 foobar +100 bar +100 bar +SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 ON t1.b > t2.b ORDER BY t1.a, t2.b; +a b +1 bar +1 bar +1 foobar +1 foobar +100 bar +100 bar +SELECT t2.* FROM t1 LEFT JOIN t2 USING (a) ORDER BY t2.a, t2.b LIMIT 1; +a b +1 z +SELECT t2.* FROM t2 LEFT OUTER JOIN t1 ON t1.a = t2.a WHERE t1.a IS NOT NULL; +a b +1 z +1 z +100 foobar +100 foobar +200 bar +200 bar +SELECT SUM(t2.a) FROM t1 RIGHT JOIN t2 ON t2.b = t1.b; +SUM(t2.a) +602 +SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a); +MIN(t2.a) +1 +SELECT alias.b FROM t1 NATURAL JOIN ( SELECT * FROM t1 ) alias WHERE b > ''; +b +bar +bar +bar +bar +foobar +foobar +foobar +foobar +z +z +z +z +SELECT t2.b FROM ( SELECT * FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL; +b +bar +bar +foobar +foobar +z +z +SELECT t1.*, t2.* FROM t1 NATURAL LEFT OUTER JOIN t2; +a b a b +1 z 1 z +1 z 1 z +100 foobar 100 foobar +100 foobar 100 foobar +200 bar 200 bar +200 bar 200 bar +SELECT t2_2.* FROM t2 t2_1 NATURAL RIGHT JOIN t2 t2_2 WHERE t2_1.a IN ( SELECT a FROM t1 ); +a b +1 z +100 foobar +200 bar +SELECT t1_2.b FROM t1 t1_1 NATURAL RIGHT OUTER JOIN t1 t1_2 INNER JOIN t2; +b +bar +bar +bar +bar +bar +bar +bar +bar +bar +bar +bar +bar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +z +z +z +z +z +z +z +z +z +z +z +z +SELECT ( SELECT MIN(a) FROM ( SELECT * FROM t1 ) alias1 ) AS min_a FROM t2; +min_a +1 +1 +1 +SELECT * FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 ); +a b +1 z +SELECT * FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 ); +a b +200 bar +SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FROM t2 WHERE a = t1_outer.a ); +a b +1 z +1 z +100 foobar +100 foobar +200 bar +200 bar +SELECT * FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 ); +a b +100 foobar +200 bar +SELECT * FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' ); +a b +1 z +100 foobar +SELECT * FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 ); +a b +1 z +1 z +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE t2.b > t1.b ); +a b +100 foobar +100 foobar +200 bar +200 bar +SELECT t1.* FROM t1, t2 ORDER BY ( SELECT b FROM t1 WHERE a IS NULL ORDER BY b LIMIT 1 ) DESC; +a b +1 z +1 z +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +200 bar +200 bar +SELECT a, b FROM t1 HAVING a IN ( SELECT a FROM t2 WHERE b = t1.b ); +a b +1 z +1 z +100 foobar +100 foobar +200 bar +200 bar +SELECT * FROM t1 UNION SELECT * FROM t2 UNION DISTINCT SELECT * FROM t1; +a b +1 z +100 foobar +200 bar +SELECT * FROM t1 UNION SELECT * FROM t2 UNION ALL SELECT * FROM t1; +a b +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/select.test b/mysql-test/suite/storage_engine/select.test new file mode 100644 index 00000000000..528fa64cfb2 --- /dev/null +++ b/mysql-test/suite/storage_engine/select.test @@ -0,0 +1,210 @@ +# +# Basic SELECT statements +# +# HIGH_PRIORITY is covered in select_high_prio test +# FOR UPDATE - in trx/select_for_update test +# LOCK IN SHARE MODE - in trx/select_lock_in_share_mode test +# index hints - in type_*_indexes tests +# +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (100,'foobar'),(1,'z'),(200,'bar'); + +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +INSERT INTO t1 (a,b) SELECT a, b FROM t2; + +--sorted_result +SELECT * FROM t1; + +# Modifiers + +--sorted_result +SELECT DISTINCT a FROM t1; + +--sorted_result +SELECT ALL b, a FROM t1; + +# Optimizer and cache directives should not have any visible effect here, +# but we will add them for completness + +--sorted_result +SELECT STRAIGHT_JOIN SQL_CACHE t1.* FROM t2, t1 WHERE t1.a <> t2.a; + +--sorted_result +SELECT SQL_SMALL_RESULT SQL_NO_CACHE t1.a FROM t1, t2; + +--sorted_result +SELECT SQL_BIG_RESULT SQL_CALC_FOUND_ROWS DISTINCT(t2.a) + FROM t1 t1_1, t2, t1 t1_2; +SELECT FOUND_ROWS(); + +let $query_cache = `SELECT @@query_cache_size`; +SET GLOBAL query_cache_size = 1024*1024; +--sorted_result +SELECT SQL_CACHE * FROM t1, t2; +eval SET GLOBAL query_cache_size = $query_cache; + +# Combination of main clauses + +--sorted_result +SELECT a+10 AS field1, CONCAT(b,':',b) AS field2 FROM t1 +WHERE b > 'b' AND a IS NOT NULL +GROUP BY 2 DESC, field1 ASC +HAVING field1 < 1000 +ORDER BY field2, 1 DESC, field1*2 +LIMIT 5 OFFSET 1 ROWS EXAMINED 100000; + +# ROLLUP +--sorted_result +SELECT SUM(a), MAX(a), b FROM t1 GROUP BY b WITH ROLLUP; + +# Procedure + +--sorted_result +SELECT * FROM t2 WHERE a>0 PROCEDURE ANALYSE(); + +# SELECT INTO +let $datadir = `SELECT @@datadir`; + +--replace_result $datadir <DATADIR> +eval +SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a + INTO OUTFILE '$datadir/select.out' + CHARACTER SET utf8 + FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ''''; +--cat_file $datadir/select.out +--remove_file $datadir/select.out + +--replace_result $datadir <DATADIR> +--let $error_codes = ER_TOO_MANY_ROWS +eval +SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a + INTO DUMPFILE '$datadir/select.dump'; +--source check_errors.inc +--remove_file $datadir/select.dump +--replace_result $datadir <DATADIR> +eval +SELECT t1.*, t2.* FROM t1, t2 ORDER BY t2.b, t1.a, t2.a, t1.b LIMIT 1 + INTO DUMPFILE '$datadir/select.dump'; + +--cat_file $datadir/select.dump +--echo +--remove_file $datadir/select.dump + +SELECT MIN(a), MAX(a) FROM t1 INTO @min, @max; +SELECT @min, @max; + +# Joins + +--sorted_result +SELECT t1_1.*, t2.* FROM t2, t1 AS t1_1, t1 AS t1_2 + WHERE t1_1.a = t1_2.a AND t2.a = t1_1.a; + +--sorted_result +SELECT alias1.* FROM ( SELECT * FROM t1 ) alias1, t2 WHERE t2.a IN (100,200); + +--sorted_result +SELECT t1.a FROM { OJ t1 LEFT OUTER JOIN t2 ON t1.a = t2.a+10 }; + +--sorted_result +SELECT t1.* FROM t2 INNER JOIN t1; + +--sorted_result +SELECT t1_2.* FROM t1 t1_1 CROSS JOIN t1 t1_2 ON t1_1.b = t1_2.b; + +--sorted_result +SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 WHERE t1.b > t2.b; + +SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 ON t1.b > t2.b ORDER BY t1.a, t2.b; + +SELECT t2.* FROM t1 LEFT JOIN t2 USING (a) ORDER BY t2.a, t2.b LIMIT 1; + +--sorted_result +SELECT t2.* FROM t2 LEFT OUTER JOIN t1 ON t1.a = t2.a WHERE t1.a IS NOT NULL; + +SELECT SUM(t2.a) FROM t1 RIGHT JOIN t2 ON t2.b = t1.b; + +SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a); + +--sorted_result +SELECT alias.b FROM t1 NATURAL JOIN ( SELECT * FROM t1 ) alias WHERE b > ''; + +--sorted_result +SELECT t2.b FROM ( SELECT * FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL; + +--sorted_result +SELECT t1.*, t2.* FROM t1 NATURAL LEFT OUTER JOIN t2; + +--sorted_result +SELECT t2_2.* FROM t2 t2_1 NATURAL RIGHT JOIN t2 t2_2 WHERE t2_1.a IN ( SELECT a FROM t1 ); + +--sorted_result +SELECT t1_2.b FROM t1 t1_1 NATURAL RIGHT OUTER JOIN t1 t1_2 INNER JOIN t2; + +# Subquery as scalar operand, subquery in the FROM clause + +--sorted_result +SELECT ( SELECT MIN(a) FROM ( SELECT * FROM t1 ) alias1 ) AS min_a FROM t2; + +# Comparison using subqueries + +--sorted_result +SELECT * FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 ); + +--sorted_result +SELECT * FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 ); + +# Subquery with IN, correlated subquery + +--sorted_result +SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FROM t2 WHERE a = t1_outer.a ); + +# Subquery with ANY, ALL + +--sorted_result +SELECT * FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 ); + +--sorted_result +SELECT * FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' ); + +# Row subqueries + +--sorted_result +SELECT * FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 ); + +# Subquery with EXISTS + +--sorted_result +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE t2.b > t1.b ); + +# Subquery in ORDER BY + +--sorted_result +SELECT t1.* FROM t1, t2 ORDER BY ( SELECT b FROM t1 WHERE a IS NULL ORDER BY b LIMIT 1 ) DESC; + +# Subquery in HAVING + +--sorted_result +SELECT a, b FROM t1 HAVING a IN ( SELECT a FROM t2 WHERE b = t1.b ); + +# Union + +--sorted_result +SELECT * FROM t1 UNION SELECT * FROM t2 UNION DISTINCT SELECT * FROM t1; + +--sorted_result +SELECT * FROM t1 UNION SELECT * FROM t2 UNION ALL SELECT * FROM t1; + + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/select_high_prio.result b/mysql-test/suite/storage_engine/select_high_prio.result new file mode 100644 index 00000000000..b3b70df3731 --- /dev/null +++ b/mysql-test/suite/storage_engine/select_high_prio.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS t1; +connect con0,localhost,root,,; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 4; +connect con2,localhost,root,,; +SET lock_wait_timeout = 4; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +connection con1; +LOCK TABLE t1 READ; +connection con0; +UPDATE t1 SET b = CONCAT(b,b); +connection con2; +SELECT * FROM t1; +connection con1; +UNLOCK TABLES; +connection con0; +connection con2; +# Should return the new data +a b +1 ff +2 bb +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +connection con1; +LOCK TABLE t1 READ; +connection con0; +UPDATE t1 SET b = CONCAT(b,b,b); +connection con2; +SET lock_wait_timeout = 1; +# Should return old data +SELECT HIGH_PRIORITY * FROM t1; +a b +1 f +2 b +connection con1; +UNLOCK TABLES; +connection con0; +disconnect con1; +disconnect con2; +disconnect con0; +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/select_high_prio.test b/mysql-test/suite/storage_engine/select_high_prio.test new file mode 100644 index 00000000000..385752e8d4e --- /dev/null +++ b/mysql-test/suite/storage_engine/select_high_prio.test @@ -0,0 +1,139 @@ +# +# SELECT HIGH_PRIOIRITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# We will have 3 connections: +# con1 will lock a table in READ mode +# con0 will run UPDATE (and will wait on the lock) +# con2 will start another SELECT +# con1 will then unlock the table +# +# With standard SELECT we should see updated rows in the 2nd result set, +# while with SELECT HIGH_PRIORITY we should still see only old rows in con2 resultset +# (and it shouldn't wait till the table is unlocked and UPDATE is executed). + +--connect (con0,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 4; + + +# Part 1: Standard SELECT +# should be executed after the UPDATE + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +--connection con1 +LOCK TABLE t1 READ; + +--connection con0 +--send +UPDATE t1 SET b = CONCAT(b,b); + +--connection con2 +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = LIKE 'Waiting for table%'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +SELECT * FROM t1; + +--connection con1 +let $show_statement = SHOW PROCESSLIST; +let $field = Info; +let $condition = = 'SELECT * FROM t1'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = Table locking or UPDATE + --source unexpected_result.inc +} + +UNLOCK TABLES; + +--connection con0 +--reap +if ($mysql_errname) +{ + --let $my_last_stmt = UPDATE t1 SET b = CONCAT(b,b) + --let $functionality = UPDATE + --source unexpected_result.inc +} + +--connection con2 +--echo # Should return the new data +--sorted_result +--reap + +DROP TABLE t1; + + +# Part 2: SELECT HIGH_PRIORITY +# should be executed before the UPDATE + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +--connection con1 +LOCK TABLE t1 READ; + +--connection con0 +--send +UPDATE t1 SET b = CONCAT(b,b,b); + +--connection con2 +let $condition = LIKE 'Waiting for table%'; +let $field = State; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +SET lock_wait_timeout = 1; +--echo # Should return old data +--sorted_result +SELECT HIGH_PRIORITY * FROM t1; +if ($mysql_errname) +{ + --let $functionality = SELECT HIGH_PRIORITY + --source unexpected_result.inc +} + +--connection con1 +UNLOCK TABLES; + +--connection con0 +--reap +if ($mysql_errname) +{ + --let $my_last_stmt = UPDATE t1 SET b = CONCAT(b,b,b) + --let $functionality = UPDATE + --source unexpected_result.inc +} + +--disconnect con1 +--disconnect con2 +--disconnect con0 +let $wait_timeout = 30; + +--connection default + +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/show_engine.result b/mysql-test/suite/storage_engine/show_engine.result new file mode 100644 index 00000000000..ab8c6b8f428 --- /dev/null +++ b/mysql-test/suite/storage_engine/show_engine.result @@ -0,0 +1,11 @@ +# For most engines SHOW ENGINE .. STATUS produces an empty result, +# so the default result file is empty; but returning a value here is not an error. +# The Status column is masked, because it is likely to contain some +# volatile data (timestamps, memory info, etc.) +SHOW ENGINE <STORAGE_ENGINE> STATUS; +Type Name Status +<STORAGE_ENGINE> ### Engine status, can be long and changeable ### +# For SHOW MUTEX even the number of lines is volatile, so the result logging is disabled, +# the test only checks that the command does not produce any errors +SHOW ENGINE <STORAGE_ENGINE> MUTEX; +SHOW ENGINE ALL MUTEX; diff --git a/mysql-test/suite/storage_engine/show_engine.test b/mysql-test/suite/storage_engine/show_engine.test new file mode 100644 index 00000000000..dca0c6b35c7 --- /dev/null +++ b/mysql-test/suite/storage_engine/show_engine.test @@ -0,0 +1,31 @@ +# +# SHOW ENGINE STATUS command +# +# The result might be empty, in which case the test will require rdiff, +# as it is optimistically expects some output from the command +# + +--source have_engine.inc + +--echo # For most engines SHOW ENGINE .. STATUS produces an empty result, +--echo # so the default result file is empty; but returning a value here is not an error. +--echo # The Status column is masked, because it is likely to contain some +--echo # volatile data (timestamps, memory info, etc.) + +--source mask_engine.inc +--replace_column 3 '### Engine status, can be long and changeable ###' +eval +SHOW ENGINE $storage_engine STATUS; + +--echo # For SHOW MUTEX even the number of lines is volatile, so the result logging is disabled, +--echo # the test only checks that the command does not produce any errors +--disable_result_log +--source mask_engine.inc +eval +SHOW ENGINE $storage_engine MUTEX; +--source mask_engine.inc +SHOW ENGINE ALL MUTEX; +--enable_result_log + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/show_table_status.result b/mysql-test/suite/storage_engine/show_table_status.result new file mode 100644 index 00000000000..98de48f816b --- /dev/null +++ b/mysql-test/suite/storage_engine/show_table_status.result @@ -0,0 +1,62 @@ +DROP TABLE IF EXISTS t1, t2, t3; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'a'),(2,'foo'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (a,b) VALUES (1,'bar'); +CREATE TABLE t3 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET utf8; +SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' ); +Name t1 +Engine <STORAGE_ENGINE> +Version 10 +Row_format ### +Rows 2 +Avg_row_length ### +Data_length ### +Max_data_length ### +Index_length ### +Data_free ### +Auto_increment NULL +Create_time ### +Update_time ### +Check_time NULL +Collation latin1_swedish_ci +Checksum NULL +Create_options +Comment +Name t2 +Engine <STORAGE_ENGINE> +Version 10 +Row_format ### +Rows 1 +Avg_row_length ### +Data_length ### +Max_data_length ### +Index_length ### +Data_free ### +Auto_increment NULL +Create_time ### +Update_time ### +Check_time NULL +Collation latin1_swedish_ci +Checksum NULL +Create_options +Comment +Name t3 +Engine <STORAGE_ENGINE> +Version 10 +Row_format ### +Rows 0 +Avg_row_length ### +Data_length ### +Max_data_length ### +Index_length ### +Data_free ### +Auto_increment NULL +Create_time ### +Update_time ### +Check_time NULL +Collation utf8_general_ci +Checksum NULL +Create_options +Comment +DROP TABLE t1, t2, t3; diff --git a/mysql-test/suite/storage_engine/show_table_status.test b/mysql-test/suite/storage_engine/show_table_status.test new file mode 100644 index 00000000000..469d7e33a20 --- /dev/null +++ b/mysql-test/suite/storage_engine/show_table_status.test @@ -0,0 +1,30 @@ +# +# SHOW TABLE STATUS statement +# +# Note: the output might be different if even with such tiny tables +# the number of rows is approximate. In this case rdiff will be needed +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2, t3; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (100,'a'),(2,'foo'); + +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 (a,b) VALUES (1,'bar'); + +--let $table_name = t3 +--let $table_options = CHARACTER SET utf8 +--source create_table.inc + +--replace_column 2 <STORAGE_ENGINE> 4 ### 6 ### 7 ### 8 ### 9 ### 10 ### 12 ### 13 ### +--query_vertical SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' ) +DROP TABLE t1, t2, t3; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/strict_check_errors.inc b/mysql-test/suite/storage_engine/strict_check_errors.inc new file mode 100644 index 00000000000..f28fccb0169 --- /dev/null +++ b/mysql-test/suite/storage_engine/strict_check_errors.inc @@ -0,0 +1,23 @@ +# +# Since we run tests in disable_abort_on_error mode, we cannot use --error command, +# and need to check the result manually. +# Usage in a test: +# --let $error_codes = <comma-separated list> # optional, default '' +# --let $mysql_errname = <error name> # optional, default current $mysql_errname (from the last SQL command) +# --let $mysql_errno = <error code> # optional, default current $mysql_errno (from the last SQL command) +# +# The difference between strict_check_errors.inc and check_errors.inc is only +# that they will produce different messages when there is a list of acceptable error codes (more than one), +# and the statement finished with one of them. + +# If a list contained more than one error, it could be on one of two reasons: +# first, we do not care which code it is, as long as it is one of the listed errors. +# In this case we will suggest to add an rdiff file if the message differs. +# Second, check_errors might be called from a generalized include file or test, +# which runs with different parameters and thus might produce different results for the same statement. +# Then, the message will be stricter, as the difference with the result file is actually a problem +# which needs to be checked at least. + +--let $strict_check = 1 +--source check_errors.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_ai.result b/mysql-test/suite/storage_engine/tbl_opt_ai.result new file mode 100644 index 00000000000..d83e446bede --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_ai.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AUTO_INCREMENT=10; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 +ALTER TABLE t1 AUTO_INCREMENT=100; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=100 DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_ai.test b/mysql-test/suite/storage_engine/tbl_opt_ai.test new file mode 100644 index 00000000000..e0d26cd46b0 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_ai.test @@ -0,0 +1,35 @@ +# +# Check whether AUTO_INCREMENT option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col +--let $table_options = AUTO_INCREMENT=10 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = AUTO_INCREMENT=100 +--source alter_table.inc +if ($mysql_errname) +{ + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.result b/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.result new file mode 100644 index 00000000000..39debfcc8d1 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AVG_ROW_LENGTH=300; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=300 +ALTER TABLE t1 AVG_ROW_LENGTH=30000000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=30000000 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.test b/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.test new file mode 100644 index 00000000000..2ddde478511 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.test @@ -0,0 +1,35 @@ +# +# Check whether AVG_ROW_LENGTH option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = AVG_ROW_LENGTH=300 +--source create_table.inc + +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = AVG_ROW_LENGTH=30000000 +--source alter_table.inc +if ($mysql_errname) +{ + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_checksum.result b/mysql-test/suite/storage_engine/tbl_opt_checksum.result new file mode 100644 index 00000000000..3f86eb08df3 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_checksum.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CHECKSUM=1 +ALTER TABLE t1 CHECKSUM=0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_checksum.test b/mysql-test/suite/storage_engine/tbl_opt_checksum.test new file mode 100644 index 00000000000..04d8cf9d9c6 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_checksum.test @@ -0,0 +1,30 @@ +# +# Check whether CHECKSUM option is supported +# in CREATE and ALTER TABLE. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = CHECKSUM=1 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CHECKSUM=0 +--source alter_table.inc +if ($mysql_errname) +{ + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_connection.result b/mysql-test/suite/storage_engine/tbl_opt_connection.result new file mode 100644 index 00000000000..e382613f32c --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_connection.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS t1; +CREATE DATABASE test_remote; +CREATE SERVER test_connection FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote'); +CREATE SERVER test_connection2 FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote'); +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CONNECTION='test_connection'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CONNECTION='test_connection' +ALTER TABLE t1 CONNECTION='test_connection2'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CONNECTION='test_connection2' +DROP TABLE t1; +DROP SERVER test_connection; +DROP SERVER test_connection2; +DROP DATABASE test_remote; diff --git a/mysql-test/suite/storage_engine/tbl_opt_connection.test b/mysql-test/suite/storage_engine/tbl_opt_connection.test new file mode 100644 index 00000000000..df92df7e308 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_connection.test @@ -0,0 +1,52 @@ +# +# Check whether CONNECTION option is supported +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE DATABASE test_remote; +CREATE SERVER test_connection FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote'); +CREATE SERVER test_connection2 FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote'); + +--let $table_options = CONNECTION='test_connection' +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + --let $alter_definition = CONNECTION='test_connection2' + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + --source mask_engine.inc + SHOW CREATE TABLE t1; + + DROP TABLE t1; +} + +DROP SERVER test_connection; +DROP SERVER test_connection2; +DROP DATABASE test_remote; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result new file mode 100644 index 00000000000..b8c5e75c88c --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>' +Warnings: +Warning 1618 <INDEX DIRECTORY> option ignored +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>' +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test new file mode 100644 index 00000000000..fa7a27eb8af --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test @@ -0,0 +1,51 @@ +# +# Check whether DATA DIRECTORY and INDEX DIRECTORY +# are supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the options +# have any real effect on the table, only +# that they are accepted +# + +--source have_engine.inc + +--let $data_dir = $MYSQLTEST_VARDIR/storage_engine_data_dir/ +--let $index_dir = $MYSQLTEST_VARDIR/storage_engine_index_dir/ +--mkdir $data_dir +--mkdir $index_dir + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = DATA DIRECTORY = '$data_dir' INDEX DIRECTORY = '$index_dir' +# We cannot mask the folders name here, but we can switch off query logging +--let $disable_query_log = 1 +--source create_table.inc + +--source mask_engine.inc +--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR> +SHOW CREATE TABLE t1; + +--let $alter_definition = INDEX DIRECTORY = '$data_dir' +--disable_query_log +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--enable_query_log +--source mask_engine.inc +--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR> +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + +--rmdir $data_dir +--rmdir $index_dir + + diff --git a/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.result b/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.result new file mode 100644 index 00000000000..170f7b782a8 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> DELAY_KEY_WRITE=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 +ALTER TABLE t1 DELAY_KEY_WRITE=0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.test b/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.test new file mode 100644 index 00000000000..724cd9e0566 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.test @@ -0,0 +1,35 @@ +# +# Check whether DELAY_KEY_WRITE option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = DELAY_KEY_WRITE=1 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = DELAY_KEY_WRITE=0 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_insert_method.result b/mysql-test/suite/storage_engine/tbl_opt_insert_method.result new file mode 100644 index 00000000000..e538c821c78 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_insert_method.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> INSERT_METHOD=FIRST; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST +ALTER TABLE t1 INSERT_METHOD=NO; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_insert_method.test b/mysql-test/suite/storage_engine/tbl_opt_insert_method.test new file mode 100644 index 00000000000..29378e7445b --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_insert_method.test @@ -0,0 +1,35 @@ +# +# Check whether INSERT_METHOD option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = INSERT_METHOD=FIRST +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = INSERT_METHOD=NO +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_key_block_size.result b/mysql-test/suite/storage_engine/tbl_opt_key_block_size.result new file mode 100644 index 00000000000..f76fdb0caab --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_key_block_size.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> KEY_BLOCK_SIZE=8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8 +ALTER TABLE t1 KEY_BLOCK_SIZE=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_key_block_size.test b/mysql-test/suite/storage_engine/tbl_opt_key_block_size.test new file mode 100644 index 00000000000..9c9109a90af --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_key_block_size.test @@ -0,0 +1,35 @@ +# +# Check whether KEY_BLOCK_SIZE option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = KEY_BLOCK_SIZE=8 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = KEY_BLOCK_SIZE=1 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_max_rows.result b/mysql-test/suite/storage_engine/tbl_opt_max_rows.result new file mode 100644 index 00000000000..977cf53acd6 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_max_rows.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> MAX_ROWS=10000000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MAX_ROWS=10000000 +ALTER TABLE t1 MAX_ROWS=30000000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MAX_ROWS=30000000 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_max_rows.test b/mysql-test/suite/storage_engine/tbl_opt_max_rows.test new file mode 100644 index 00000000000..cbf9ad934db --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_max_rows.test @@ -0,0 +1,35 @@ +# +# Check whether MAX_ROWS option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = MAX_ROWS=10000000 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MAX_ROWS=30000000 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_min_rows.result b/mysql-test/suite/storage_engine/tbl_opt_min_rows.result new file mode 100644 index 00000000000..0407d6b6425 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_min_rows.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> MIN_ROWS=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MIN_ROWS=1 +ALTER TABLE t1 MIN_ROWS=10000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MIN_ROWS=10000 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_min_rows.test b/mysql-test/suite/storage_engine/tbl_opt_min_rows.test new file mode 100644 index 00000000000..75b6e7b14d1 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_min_rows.test @@ -0,0 +1,35 @@ +# +# Check whether MIN_ROWS option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = MIN_ROWS=1 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MIN_ROWS=10000 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_pack_keys.result b/mysql-test/suite/storage_engine/tbl_opt_pack_keys.result new file mode 100644 index 00000000000..1f56c035442 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_pack_keys.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PACK_KEYS=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 PACK_KEYS=1 +ALTER TABLE t1 PACK_KEYS=0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 PACK_KEYS=0 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_pack_keys.test b/mysql-test/suite/storage_engine/tbl_opt_pack_keys.test new file mode 100644 index 00000000000..f0d9387fe08 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_pack_keys.test @@ -0,0 +1,35 @@ +# +# Check whether PACK KEYS option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = PACK_KEYS=1 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = PACK_KEYS=0 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_password.result b/mysql-test/suite/storage_engine/tbl_opt_password.result new file mode 100644 index 00000000000..43c409dac14 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_password.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PASSWORD='password'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 PASSWORD='new_password'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_password.test b/mysql-test/suite/storage_engine/tbl_opt_password.test new file mode 100644 index 00000000000..471295e54e4 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_password.test @@ -0,0 +1,40 @@ +# +# Check whether PASSWORD option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# +# This option is not supported by any known engines, +# that's why the result file does not contain it; +# but it's syntactically acceptable. +# + + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = PASSWORD='password' +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = PASSWORD='new_password' +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_row_format.result b/mysql-test/suite/storage_engine/tbl_opt_row_format.result new file mode 100644 index 00000000000..5f1cf713bb6 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_row_format.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> ROW_FORMAT=FIXED; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_row_format.test b/mysql-test/suite/storage_engine/tbl_opt_row_format.test new file mode 100644 index 00000000000..d6347551da0 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_row_format.test @@ -0,0 +1,35 @@ +# +# Check whether ROW_FORMAT option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = ROW_FORMAT=FIXED +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = ROW_FORMAT=DYNAMIC +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_union.result b/mysql-test/suite/storage_engine/tbl_opt_union.result new file mode 100644 index 00000000000..81521eff8a2 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_union.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS t1, child1, child2; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> UNION(child1); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`) +ALTER TABLE t1 UNION = (child1,child2); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`,`child2`) +DROP TABLE t1, child1, child2; diff --git a/mysql-test/suite/storage_engine/tbl_opt_union.test b/mysql-test/suite/storage_engine/tbl_opt_union.test new file mode 100644 index 00000000000..fa134ab8344 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_union.test @@ -0,0 +1,41 @@ +# +# Check whether UNION option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, child1, child2; +--enable_warnings + +--disable_query_log +eval CREATE TABLE child1 (a $int_col) ENGINE=MyISAM; +eval CREATE TABLE child2 (a $int_col) ENGINE=MyISAM; +--enable_query_log + +--let $table_options = UNION(child1) +--let $create_definition = a $int_col +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = UNION = (child1,child2) +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1, child1, child2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_standard_opts.result b/mysql-test/suite/storage_engine/tbl_standard_opts.result new file mode 100644 index 00000000000..b4b183aacb2 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_standard_opts.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> DEFAULT CHARACTER SET = utf8 +COLLATE = utf8_general_ci +COMMENT = 'standard table options' +; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 COMMENT='standard table options' +ALTER TABLE t1 COMMENT = 'table altered'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 COMMENT='table altered' +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=utf8 COMMENT='table altered' +ALTER TABLE t1 ENGINE=<STORAGE_ENGINE>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 COMMENT='table altered' +ALTER TABLE t1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COMMENT='table altered' +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_standard_opts.test b/mysql-test/suite/storage_engine/tbl_standard_opts.test new file mode 100644 index 00000000000..7e723788cd7 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_standard_opts.test @@ -0,0 +1,60 @@ +# +# Standard options in CREATE and ALTER TABLE +# +# Note: the test does not check whether the options +# have any real effect on the table, only +# that they are accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Create table with standard options + +let $table_options = + DEFAULT CHARACTER SET = utf8 + COLLATE = utf8_general_ci + COMMENT = 'standard table options' +; +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + + +# Alter comment + +--let $alter_definition = COMMENT = 'table altered' +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +# Alter ENGINE value + +--let $alter_definition = ENGINE=MEMORY +--source alter_table.inc +SHOW CREATE TABLE t1; +--let $alter_definition = ENGINE=$storage_engine +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +# Alter character set and collation + +--let $alter_definition = CHARACTER SET = latin1 COLLATE = latin1_swedish_ci +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_temporary.result b/mysql-test/suite/storage_engine/tbl_temporary.result new file mode 100644 index 00000000000..b81fa0a788b --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_temporary.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR(1)) ENGINE=MyISAM; +CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TEMPORARY TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TEMPORARY TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_temporary.test b/mysql-test/suite/storage_engine/tbl_temporary.test new file mode 100644 index 00000000000..963238c37a5 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_temporary.test @@ -0,0 +1,32 @@ +# +# The test checks whether a temporary table +# can be created with the engine under test. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# This is a base table which we want to mask +CREATE TABLE t1 (c CHAR(1)) ENGINE=MyISAM; + +--let $temporary = 1 +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Temporary tables + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + + DROP TEMPORARY TABLE t1; + DROP TABLE t1; +} +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/truncate_table.result b/mysql-test/suite/storage_engine/truncate_table.result new file mode 100644 index 00000000000..0a774c4b8dd --- /dev/null +++ b/mysql-test/suite/storage_engine/truncate_table.result @@ -0,0 +1,41 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +TRUNCATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); +TRUNCATE TABLE t1; +SELECT * FROM t1; +a b +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 1 # # # # # # # +INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 4 # # # # # # # +TRUNCATE TABLE t1; +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 1 # # # # # # # +INSERT INTO t1 (c) VALUES ('d'); +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 2 # # # # # # # +SELECT * FROM t1; +a c +1 d +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +HANDLER t1 OPEN AS h1; +HANDLER h1 READ FIRST; +a b +1 a +TRUNCATE TABLE t1; +HANDLER h1 READ NEXT; +ERROR 42S02: Unknown table 'h1' in HANDLER +HANDLER t1 OPEN AS h2; +HANDLER h2 READ FIRST; +a b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/truncate_table.test b/mysql-test/suite/storage_engine/truncate_table.test new file mode 100644 index 00000000000..c84fba143b7 --- /dev/null +++ b/mysql-test/suite/storage_engine/truncate_table.test @@ -0,0 +1,81 @@ +# +# TRUNCATE TABLE +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc +TRUNCATE TABLE t1; +if ($mysql_errname) +{ + --let $functionality = TRUNCATE TABLE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); + TRUNCATE TABLE t1; + SELECT * FROM t1; +} +DROP TABLE t1; + + +# Truncate resets auto-increment value on the table + +--let $create_definition = a $int_indexed_col KEY AUTO_INCREMENT, c $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = PK or AUTO_INCREMENT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS LIKE 't1'; + + INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS LIKE 't1'; + + TRUNCATE TABLE t1; + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS LIKE 't1'; + + INSERT INTO t1 (c) VALUES ('d'); + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS LIKE 't1'; + + SELECT * FROM t1; + DROP TABLE t1; +} + +# Truncate closes handlers + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +HANDLER t1 OPEN AS h1; +if ($mysql_errname) +{ + --let $functionality = HANDLER + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + HANDLER h1 READ FIRST; + TRUNCATE TABLE t1; + --let $error_codes = ER_UNKNOWN_TABLE + HANDLER h1 READ NEXT; + --source check_errors.inc + HANDLER t1 OPEN AS h2; + HANDLER h2 READ FIRST; +} +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result new file mode 100644 index 00000000000..a52f18fc623 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +INSERT INTO t1 (a) VALUES (1); +connection con1; +# If consistent read works on this isolation level (REPEATABLE READ), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +a +COMMIT; +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.test b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.test new file mode 100644 index 00000000000..e44e260e1d4 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.test @@ -0,0 +1,9 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = REPEATABLE READ; + +--source consistent_snapshot.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result new file mode 100644 index 00000000000..8d75ea075a2 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +INSERT INTO t1 (a) VALUES (1); +connection con1; +# If consistent read works on this isolation level (SERIALIZABLE), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +a +COMMIT; +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.test b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.test new file mode 100644 index 00000000000..9d516066927 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.test @@ -0,0 +1,9 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = SERIALIZABLE; + +--source consistent_snapshot.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc b/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc new file mode 100644 index 00000000000..8dc9d6c4bb1 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc @@ -0,0 +1,50 @@ +# +# TRANSACTION WITH CONSISTENT SNAPSHOT +# + +--source ../have_engine.inc + +--enable_connect_log + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +connection con1; + +let $create_definition = a $int_col; +--source ../create_table.inc + +eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation; + +# While a consistent snapshot transaction is executed, +# no external inserts should be visible to the transaction. +# But it should only work this way for REPEATABLE-READ and SERIALIZABLE + +START TRANSACTION WITH CONSISTENT SNAPSHOT; + +connection con2; +INSERT INTO t1 (a) VALUES (1); +if ($mysql_errname) +{ + --echo # INSERT finished with error $mysql_errname +} + +connection con1; +--echo # If consistent read works on this isolation level ($trx_isolation), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +COMMIT; + +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + diff --git a/mysql-test/suite/storage_engine/trx/delete.result b/mysql-test/suite/storage_engine/trx/delete.result new file mode 100644 index 00000000000..827877a7e30 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/delete.result @@ -0,0 +1,72 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +BEGIN; +DELETE FROM t1 WHERE b IN ('c'); +SELECT * FROM t1; +a b +1 a +1 a +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +6 f +6 f +7 g +7 g +8 h +8 h +DELETE FROM t1 WHERE a < 0 OR b = 'a'; +COMMIT; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +6 f +6 f +7 g +7 g +8 h +8 h +BEGIN; +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SAVEPOINT spt1; +DELETE FROM t1; +RELEASE SAVEPOINT spt1; +ROLLBACK; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +6 f +6 f +7 g +7 g +8 h +8 h +BEGIN; +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SAVEPOINT spt1; +DELETE FROM t1; +INSERT INTO t1 (a,b) VALUES (1,'a'); +ROLLBACK TO SAVEPOINT spt1; +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/delete.test b/mysql-test/suite/storage_engine/trx/delete.test new file mode 100644 index 00000000000..0898eebb49a --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/delete.test @@ -0,0 +1,51 @@ +# +# Transactional DELETE +# + +--source ../have_engine.inc +--source support_transactions.inc +--source support_savepoints.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source ../create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +BEGIN; +DELETE FROM t1 WHERE b IN ('c'); +if ($mysql_errname) +{ + --let $functionality = DELETE + --source ../unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; +DELETE FROM t1 WHERE a < 0 OR b = 'a'; +COMMIT; +--sorted_result +SELECT * FROM t1; + +BEGIN; +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SAVEPOINT spt1; +DELETE FROM t1; +RELEASE SAVEPOINT spt1; +ROLLBACK; +--sorted_result +SELECT * FROM t1; + +BEGIN; +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SAVEPOINT spt1; +DELETE FROM t1; +INSERT INTO t1 (a,b) VALUES (1,'a'); +ROLLBACK TO SAVEPOINT spt1; +COMMIT; + +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/insert.result b/mysql-test/suite/storage_engine/trx/insert.result new file mode 100644 index 00000000000..986d63b2a07 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/insert.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +BEGIN; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo'); +INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc'); +COMMIT; +SELECT * FROM t1; +a b +1 a +10 foo +100 foo +11 abc +2 b +3 c +4 d +5 e +BEGIN; +INSERT INTO t1 (b,a) VALUES ('test',0); +SAVEPOINT spt1; +INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); +RELEASE SAVEPOINT spt1; +INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); +ROLLBACK; +SELECT * FROM t1; +a b +1 a +10 foo +100 foo +11 abc +2 b +3 c +4 d +5 e +BEGIN; +INSERT t1 (a) VALUE (10),(20); +SAVEPOINT spt1; +INSERT INTO t1 SET a = 11, b = 'f'; +INSERT t1 SET b = DEFAULT; +ROLLBACK TO SAVEPOINT spt1; +INSERT INTO t1 (b,a) VALUES ('test1',10); +COMMIT; +SELECT * FROM t1; +a b +1 a +10 NULL +10 foo +10 test1 +100 foo +11 abc +2 b +20 NULL +3 c +4 d +5 e +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/insert.test b/mysql-test/suite/storage_engine/trx/insert.test new file mode 100644 index 00000000000..c458f90b1bb --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/insert.test @@ -0,0 +1,44 @@ +# +# Transactional INSERT +# +--source ../have_engine.inc +--source support_transactions.inc +--source support_savepoints.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source ../create_table.inc +BEGIN; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo'); +INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc'); +COMMIT; +--sorted_result +SELECT * FROM t1; + +BEGIN; +INSERT INTO t1 (b,a) VALUES ('test',0); +SAVEPOINT spt1; +INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); +RELEASE SAVEPOINT spt1; +INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); +ROLLBACK; +--sorted_result +SELECT * FROM t1; + +BEGIN; +INSERT t1 (a) VALUE (10),(20); +SAVEPOINT spt1; +INSERT INTO t1 SET a = 11, b = 'f'; +INSERT t1 SET b = DEFAULT; +ROLLBACK TO SAVEPOINT spt1; +INSERT INTO t1 (b,a) VALUES ('test1',10); +COMMIT; +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/level_read_committed.result b/mysql-test/suite/storage_engine/trx/level_read_committed.result new file mode 100644 index 00000000000..12c0c2f42a8 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_read_committed.result @@ -0,0 +1,91 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +START TRANSACTION; +SELECT * FROM t1; +a +connection con2; +BEGIN; +INSERT INTO t1 (a) VALUES(1); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +connection con2; +INSERT INTO t1 (a) VALUES (2); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+100 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +connection con2; +SELECT * FROM t1; +a +1 +2 +COMMIT; +SELECT * FROM t1; +a +1 +2 +connection con1; +SELECT * FROM t1; +a +1 +2 +INSERT INTO t1 (a) SELECT a+200 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +1 +2 +201 +202 +COMMIT; +SELECT * FROM t1; +a +1 +2 +201 +202 +connection con2; +SELECT * FROM t1; +a +1 +2 +201 +202 +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +INSERT INTO t1 (a) VALUES (1); +connection con1; +# If consistent read works on this isolation level (READ COMMITTED), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +a +1 +COMMIT; +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_read_committed.test b/mysql-test/suite/storage_engine/trx/level_read_committed.test new file mode 100644 index 00000000000..77bd562c433 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_read_committed.test @@ -0,0 +1,10 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = READ COMMITTED; + +--source transaction_isolation.inc +--source consistent_snapshot.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result new file mode 100644 index 00000000000..2bf93768b00 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result @@ -0,0 +1,116 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +START TRANSACTION; +SELECT * FROM t1; +a +connection con2; +BEGIN; +INSERT INTO t1 (a) VALUES(1); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +1 +connection con2; +INSERT INTO t1 (a) VALUES (2); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +1 +2 +INSERT INTO t1 (a) SELECT a+100 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +1 +101 +102 +2 +connection con2; +SELECT * FROM t1; +a +1 +101 +102 +2 +COMMIT; +SELECT * FROM t1; +a +1 +101 +102 +2 +connection con1; +SELECT * FROM t1; +a +1 +101 +102 +2 +INSERT INTO t1 (a) SELECT a+200 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +1 +101 +102 +2 +201 +202 +301 +302 +COMMIT; +SELECT * FROM t1; +a +1 +101 +102 +2 +201 +202 +301 +302 +connection con2; +SELECT * FROM t1; +a +1 +101 +102 +2 +201 +202 +301 +302 +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +INSERT INTO t1 (a) VALUES (1); +connection con1; +# If consistent read works on this isolation level (READ UNCOMMITTED), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +a +1 +COMMIT; +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_read_uncommitted.test b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.test new file mode 100644 index 00000000000..48310fc22be --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.test @@ -0,0 +1,9 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = READ UNCOMMITTED; +--source transaction_isolation.inc +--source consistent_snapshot.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/level_repeatable_read.result b/mysql-test/suite/storage_engine/trx/level_repeatable_read.result new file mode 100644 index 00000000000..82324c16801 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_repeatable_read.result @@ -0,0 +1,69 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +START TRANSACTION; +SELECT * FROM t1; +a +connection con2; +BEGIN; +INSERT INTO t1 (a) VALUES(1); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +connection con2; +INSERT INTO t1 (a) VALUES (2); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+100 FROM t1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +connection con2; +SELECT * FROM t1; +a +1 +2 +COMMIT; +SELECT * FROM t1; +a +1 +2 +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+200 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +201 +202 +COMMIT; +SELECT * FROM t1; +a +1 +2 +201 +202 +connection con2; +SELECT * FROM t1; +a +1 +2 +201 +202 +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_repeatable_read.test b/mysql-test/suite/storage_engine/trx/level_repeatable_read.test new file mode 100644 index 00000000000..cb33d1093b5 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_repeatable_read.test @@ -0,0 +1,8 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = REPEATABLE READ; +--source transaction_isolation.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/level_serializable.result b/mysql-test/suite/storage_engine/trx/level_serializable.result new file mode 100644 index 00000000000..0f990dfbf77 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_serializable.result @@ -0,0 +1,56 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +START TRANSACTION; +SELECT * FROM t1; +a +connection con2; +BEGIN; +INSERT INTO t1 (a) VALUES(1); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +connection con2; +INSERT INTO t1 (a) VALUES (2); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+100 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +connection con2; +SELECT * FROM t1; +a +COMMIT; +SELECT * FROM t1; +a +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+200 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +COMMIT; +SELECT * FROM t1; +a +connection con2; +SELECT * FROM t1; +a +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_serializable.test b/mysql-test/suite/storage_engine/trx/level_serializable.test new file mode 100644 index 00000000000..4372b48905d --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_serializable.test @@ -0,0 +1,8 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = SERIALIZABLE; +--source transaction_isolation.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/my.cnf b/mysql-test/suite/storage_engine/trx/my.cnf new file mode 100644 index 00000000000..e83954c469d --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/my.cnf @@ -0,0 +1,7 @@ +!include include/default_my.cnf + +[server] +sql-mode=NO_ENGINE_SUBSTITUTION +binlog-format=row +log-bin=master-bin + diff --git a/mysql-test/suite/storage_engine/trx/select_for_update.result b/mysql-test/suite/storage_engine/trx/select_for_update.result new file mode 100644 index 00000000000..8b0de87de05 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/select_for_update.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); +connect con1,localhost,root,,; +BEGIN; +SELECT * FROM t1 WHERE b='a' FOR UPDATE; +a b +1 a +3 a +connection default; +SET lock_wait_timeout = 1; +SELECT * FROM t1 WHERE b='a'; +a b +1 a +3 a +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +UPDATE t1 SET b='c' WHERE b='a'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection con1; +COMMIT; +SELECT * FROM t1; +a b +1 a +2 b +3 a +disconnect con1; +connection default; +UPDATE t1 SET b='c' WHERE b='a'; +SELECT * FROM t1; +a b +1 c +2 b +3 c +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/select_for_update.test b/mysql-test/suite/storage_engine/trx/select_for_update.test new file mode 100644 index 00000000000..93ccc1915df --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/select_for_update.test @@ -0,0 +1,87 @@ +# +# SELECT .. FOR UPDATE +# +# If the engine has its own lock timeouts, +# it makes sense to set them to minimum to decrease +# the duration of the test. + +--source ../have_engine.inc +--source support_transactions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--enable_connect_log + +--source include/count_sessions.inc + +--source ../create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); + +--connect (con1,localhost,root,,) +BEGIN; +--sorted_result +SELECT * FROM t1 WHERE b='a' FOR UPDATE; +if ($mysql_errname) +{ + --let $functionality = SELECT .. FOR UPDATE + --source ../unexpected_result.inc +} + +--connection default +SET lock_wait_timeout = 1; + +# Should still be able to select + +--sorted_result +SELECT * FROM t1 WHERE b='a'; +if ($mysql_errname) +{ + --let $functionality = SELECT .. FOR UPDATE or locking + --source ../unexpected_result.inc +} + +# ... but not with LOCK IN SHARE MODE + +--sorted_result +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +--source ../check_errors.inc +if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) +{ + --let $functionality = SELECT .. FOR UPDATE or LOCK IN SHARE MODE + --source ../unexpected_result.inc +} + +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET b='c' WHERE b='a'; +--source ../check_errors.inc +if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) +{ + --let $functionality = UPDATE or SELECT .. FOR UPDATE + --source ../unexpected_result.inc +} + +--connection con1 +COMMIT; +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--connection default +# Now it can be updated all right +UPDATE t1 SET b='c' WHERE b='a'; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source ../unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result new file mode 100644 index 00000000000..00610a03bd8 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); +connect con1,localhost,root,,; +BEGIN; +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +a b +1 a +3 a +connection default; +SET lock_wait_timeout = 1; +SELECT * FROM t1 WHERE b='a'; +a b +1 a +3 a +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +a b +1 a +3 a +UPDATE t1 SET b='c' WHERE b='a'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection con1; +COMMIT; +SELECT * FROM t1; +a b +1 a +2 b +3 a +disconnect con1; +connection default; +UPDATE t1 SET b='c' WHERE b='a'; +SELECT * FROM t1; +a b +1 c +2 b +3 c +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test new file mode 100644 index 00000000000..a50c86403e9 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test @@ -0,0 +1,82 @@ +# +# SELECT .. LOCK IN SHARE MODE +# +# If the engine has its own lock timeouts, +# it makes sense to set them to minimum to decrease +# the duration of the test. + +--source ../have_engine.inc +--source support_transactions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--enable_connect_log + +--source include/count_sessions.inc + +--source ../create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); + +--connect (con1,localhost,root,,) +BEGIN; +--sorted_result +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +if ($mysql_errname) +{ + --let $functionality = LOCK IN SHARE MODE + --source ../unexpected_result.inc +} + +--connection default +SET lock_wait_timeout = 1; + +# Should still be able to select + +--sorted_result +SELECT * FROM t1 WHERE b='a'; +if ($mysql_errname) +{ + --let $functionality = LOCK IN SHARE MODE + --source ../unexpected_result.inc +} +--sorted_result +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +if ($mysql_errname) +{ + --let $functionality = LOCK IN SHARE MODE + --source ../unexpected_result.inc +} + +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET b='c' WHERE b='a'; +--source ../check_errors.inc +if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) +{ + --let $functionality = LOCK IN SHARE MODE or UPDATE + --source ../unexpected_result.inc +} + +--connection con1 +COMMIT; +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--connection default +# Now it can be updated all right +UPDATE t1 SET b='c' WHERE b='a'; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source ../unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/support_savepoints.inc b/mysql-test/suite/storage_engine/trx/support_savepoints.inc new file mode 100644 index 00000000000..36dbfce26b2 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/support_savepoints.inc @@ -0,0 +1,10 @@ +if (!`SELECT savepoints='YES' FROM INFORMATION_SCHEMA.ENGINES WHERE engine = '$storage_engine'`) +{ + --echo # -- WARNING ---------------------------------------------------------------- + --echo # According to I_S.ENGINES, $storage_engine does not support savepoints. + --echo # If it is true, the test will most likely fail; you can + --echo # either create an rdiff file (recommended), or add the test to disabled.def. + --echo # If savepoints should be supported, check the data in Information Schema. + --echo # --------------------------------------------------------------------------- +} + diff --git a/mysql-test/suite/storage_engine/trx/support_transactions.inc b/mysql-test/suite/storage_engine/trx/support_transactions.inc new file mode 100644 index 00000000000..ff1224c5a3d --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/support_transactions.inc @@ -0,0 +1,10 @@ +if (!`SELECT transactions='YES' FROM INFORMATION_SCHEMA.ENGINES WHERE engine = '$storage_engine'`) +{ + --echo # -- WARNING ---------------------------------------------------------------- + --echo # According to I_S.ENGINES, $storage_engine does not support transactions. + --echo # If it is true, the test will most likely fail; you can + --echo # either create an rdiff file, or add the test to disabled.def. + --echo # If transactions should be supported, check the data in Information Schema. + --echo # --------------------------------------------------------------------------- +} + diff --git a/mysql-test/suite/storage_engine/trx/support_xa.inc b/mysql-test/suite/storage_engine/trx/support_xa.inc new file mode 100644 index 00000000000..d51fc48aaa9 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/support_xa.inc @@ -0,0 +1,12 @@ +--let $support_xa = 1 +if (!`SELECT xa='YES' FROM INFORMATION_SCHEMA.ENGINES WHERE engine = '$storage_engine'`) +{ + --echo # -- WARNING ---------------------------------------------------------------- + --echo # According to I_S.ENGINES, $storage_engine does not support XA. + --echo # If it is true, the test will most likely fail; you can + --echo # either create an rdiff file, or add the test to disabled.def. + --echo # If XA should be supported, check the data in Information Schema. + --echo # --------------------------------------------------------------------------- + --let $support_xa = 0 +} + diff --git a/mysql-test/suite/storage_engine/trx/transaction_isolation.inc b/mysql-test/suite/storage_engine/trx/transaction_isolation.inc new file mode 100644 index 00000000000..c81071d99b6 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/transaction_isolation.inc @@ -0,0 +1,99 @@ +# +# Basic check for transaction isolation. +# The results should be different depending on the isolation level. +# For some isolation levels, some statements will end with a timeout. +# If the engine has its own timeout parameters, reduce them to minimum, +# otherwise the test will take very long. +# If the timeout value is greater than the testcase-timeout the test is run with, +# it might fail due to the testcase timeout. +# + +--source ../have_engine.inc + +--enable_connect_log + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +connect (con1,localhost,root,,); +eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation; +connect (con2,localhost,root,,); +eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation; + +connection con1; + +let $create_definition = a $int_col; +--source ../create_table.inc + +START TRANSACTION; +--sorted_result +SELECT * FROM t1; # First snapshot + +connection con2; + +BEGIN; +--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a) VALUES(1); +--source ../strict_check_errors.inc + +connection con1; +--sorted_result +SELECT * FROM t1; # Second snapshot + +connection con2; +--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a) VALUES (2); +--source ../strict_check_errors.inc + +connection con1; +--sorted_result +SELECT * FROM t1; # Third snapshot + +--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a) SELECT a+100 FROM t1; +--source ../strict_check_errors.inc + +--sorted_result +SELECT * FROM t1; + +connection con2; +--sorted_result +SELECT * FROM t1; # Inside the transaction +COMMIT; +--sorted_result +SELECT * FROM t1; # Outside the transaction + +connection con1; +--sorted_result +SELECT * FROM t1; # Inside the transaction + +# Note: INSERT .. SELECT might be tricky, for example for InnoDB +# even with REPEATABLE-READ it works as if it is executed with READ COMMITTED. +# The test will have a 'logical' result for repeatable read, even although +# we currently don't have an engine which works this way. + +--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a) SELECT a+200 FROM t1; +--source ../strict_check_errors.inc + +--sorted_result +SELECT * FROM t1; +COMMIT; +--sorted_result +SELECT * FROM t1; # Outside the transaction + +connection con2; +--sorted_result +SELECT * FROM t1; # After both transactions have committed + +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + diff --git a/mysql-test/suite/storage_engine/trx/update.result b/mysql-test/suite/storage_engine/trx/update.result new file mode 100644 index 00000000000..e609bfcbc23 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/update.result @@ -0,0 +1,48 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +BEGIN; +UPDATE t1 SET a=a+100; +UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100; +COMMIT; +SELECT * FROM t1; +a b +10050 NULL +10050 NULL +51 NULL +51 NULL +52 NULL +52 NULL +53 NULL +53 NULL +54 NULL +54 NULL +55 NULL +55 NULL +BEGIN; +UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3; +UPDATE t1 SET b = ''; +ROLLBACK; +BEGIN; +UPDATE t1 SET b = 'update2' WHERE a <= 100; +SAVEPOINT spt1; +UPDATE t1 SET b = ''; +ROLLBACK TO SAVEPOINT spt1; +UPDATE t1 SET b = 'upd' WHERE a = 10050; +COMMIT; +SELECT * FROM t1; +a b +10050 upd +10050 upd +51 update2 +51 update2 +52 update2 +52 update2 +53 update2 +53 update2 +54 update2 +54 update2 +55 update2 +55 update2 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/update.test b/mysql-test/suite/storage_engine/trx/update.test new file mode 100644 index 00000000000..df65e244528 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/update.test @@ -0,0 +1,50 @@ +# +# Transactional UPDATE +# + +--source ../have_engine.inc +--source support_transactions.inc +--source support_savepoints.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source ../create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +BEGIN; +UPDATE t1 SET a=a+100; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100; + COMMIT; + --sorted_result + SELECT * FROM t1; + + BEGIN; + UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3; + UPDATE t1 SET b = ''; + ROLLBACK; + + BEGIN; + UPDATE t1 SET b = 'update2' WHERE a <= 100; + SAVEPOINT spt1; + UPDATE t1 SET b = ''; + ROLLBACK TO SAVEPOINT spt1; + UPDATE t1 SET b = 'upd' WHERE a = 10050; + COMMIT; + --sorted_result + SELECT * FROM t1; +} + +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/xa.result b/mysql-test/suite/storage_engine/trx/xa.result new file mode 100644 index 00000000000..3e2cb43a11c --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/xa.result @@ -0,0 +1,96 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +connection con2; +XA START 'xa1'; +INSERT INTO t1 (a) VALUES (1); +connection con1; +SELECT * FROM t1; +a +connection con2; +INSERT INTO t1 (a) VALUES (2); +XA END 'xa1'; +connection con1; +SELECT * FROM t1; +a +connection con2; +XA PREPARE 'xa1'; +connection con1; +SELECT * FROM t1; +a +connection con2; +XA RECOVER; +formatID gtrid_length bqual_length data +1 3 0 xa1 +XA COMMIT 'xa1'; +connection con1; +SELECT * FROM t1; +a +1 +2 +connection con2; +XA START 'xa2'; +INSERT INTO t1 (a) VALUES (3); +connection con1; +SELECT * FROM t1; +a +1 +2 +connection con2; +INSERT INTO t1 (a) VALUES (4); +XA END 'xa2'; +connection con1; +SELECT * FROM t1; +a +1 +2 +connection con2; +XA COMMIT 'xa2' ONE PHASE; +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +connection con2; +XA START 'xa3'; +INSERT INTO t1 (a) VALUES (5); +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +connection con2; +INSERT INTO t1 (a) VALUES (6); +XA END 'xa3'; +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +connection con2; +XA PREPARE 'xa3'; +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +connection con2; +XA ROLLBACK 'xa3'; +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/xa.test b/mysql-test/suite/storage_engine/trx/xa.test new file mode 100644 index 00000000000..c64ba7cd27b --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/xa.test @@ -0,0 +1,118 @@ +# +# Basic XA transactions syntax +# + +--source ../have_engine.inc +--source support_xa.inc + +--enable_connect_log + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--connect (con1,localhost,root,,) +--connect (con2,localhost,root,,) + +--connection con1 +--let $create_definition = a $int_col +--source ../create_table.inc + +--connection con2 + +# Two-phase COMMIT + +XA START 'xa1'; +INSERT INTO t1 (a) VALUES (1); + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +INSERT INTO t1 (a) VALUES (2); +XA END 'xa1'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA PREPARE 'xa1'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA RECOVER; +XA COMMIT 'xa1'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +# One-phase COMMIT + +--connection con2 +XA START 'xa2'; +INSERT INTO t1 (a) VALUES (3); + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +INSERT INTO t1 (a) VALUES (4); +XA END 'xa2'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA COMMIT 'xa2' ONE PHASE; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +# Rollback + +--connection con2 +XA START 'xa3'; +INSERT INTO t1 (a) VALUES (5); + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +INSERT INTO t1 (a) VALUES (6); +XA END 'xa3'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA PREPARE 'xa3'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA ROLLBACK 'xa3'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/xa_recovery.result b/mysql-test/suite/storage_engine/trx/xa_recovery.result new file mode 100644 index 00000000000..e14e9a0bf1a --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/xa_recovery.result @@ -0,0 +1,29 @@ +call mtr.add_suppression("Found 2 prepared XA transactions"); +FLUSH TABLES; +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +XA START 'xa1'; +INSERT INTO t1 (a) VALUES (1),(2); +XA END 'xa1'; +XA PREPARE 'xa1'; +connection con2; +XA START 'xa2'; +INSERT INTO t1 (a) VALUES (3); +INSERT INTO t1 (a) VALUES (4); +XA END 'xa2'; +XA PREPARE 'xa2'; +connection default; +XA RECOVER; +formatID gtrid_length bqual_length data +1 3 0 xa1 +1 3 0 xa2 +XA ROLLBACK 'xa1'; +XA COMMIT 'xa2'; +SELECT * FROM t1; +a +3 +4 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/xa_recovery.test b/mysql-test/suite/storage_engine/trx/xa_recovery.test new file mode 100644 index 00000000000..d7ac2e782d1 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/xa_recovery.test @@ -0,0 +1,71 @@ +# +# Server restart with uncommitted XA transactions +# + +--source ../have_engine.inc +--source support_xa.inc + +# Before we start, we want to restart the server gracefully, +# so GCOV information and everything else is properly stored + +--enable_reconnect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF +--shutdown_server 60 +--source include/wait_until_connected_again.inc + + +call mtr.add_suppression("Found 2 prepared XA transactions"); +if (!$support_xa) +{ + --disable_query_log + call mtr.add_suppression("Table '.*t1' is marked as crashed and should be repaired"); + call mtr.add_suppression("Checking table: '.*t1'"); + --enable_query_log +} + +--enable_connect_log + +# Close all unused tables to prevent unrelated corruption +FLUSH TABLES; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--connect (con1,localhost,root,,) +--connect (con2,localhost,root,,) + +--connection con1 +--let $create_definition = a $int_col +--source ../create_table.inc + +XA START 'xa1'; +INSERT INTO t1 (a) VALUES (1),(2); +XA END 'xa1'; +XA PREPARE 'xa1'; + +--connection con2 +XA START 'xa2'; +INSERT INTO t1 (a) VALUES (3); +INSERT INTO t1 (a) VALUES (4); +XA END 'xa2'; +XA PREPARE 'xa2'; + +--connection default +--enable_reconnect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF +--shutdown_server 0 +--source include/wait_until_disconnected.inc +--source include/wait_until_connected_again.inc +XA RECOVER; +XA ROLLBACK 'xa1'; +XA COMMIT 'xa2'; +SELECT * FROM t1; +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_binary.inc b/mysql-test/suite/storage_engine/type_binary.inc new file mode 100644 index 00000000000..812a1cc9527 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary.inc @@ -0,0 +1,52 @@ +# +# BINARY column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + b BINARY $col_opts, + b0 BINARY(0) $col_opts, + b1 BINARY(1) $col_opts, + b20 BINARY(20) $col_opts, + b255 BINARY(255) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + # Valid values + + INSERT INTO t1 VALUES ('','','','',''); + INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); + + --sorted_result + SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; + + # Invalid values + + INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); + INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; + + --sorted_result + SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; + + --let $error_codes = ER_TOO_BIG_FIELDLENGTH + --let $alter_definition = ADD COLUMN b257 BINARY(257) $col_opts + --source alter_table.inc + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_binary.result b/mysql-test/suite/storage_engine/type_binary.result new file mode 100644 index 00000000000..455dbb57a7e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary.result @@ -0,0 +1,62 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b0 BINARY(0) <CUSTOM_COL_OPTIONS>, +b1 BINARY(1) <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS>, +b255 BINARY(255) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b0' at row 2 +Warning 1265 Data truncated for column 'b1' at row 2 +Warning 1265 Data truncated for column 'b20' at row 2 +Warning 1265 Data truncated for column 'b255' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 +Warning 1265 Data truncated for column 'b0' at row 3 +Warning 1265 Data truncated for column 'b1' at row 3 +Warning 1265 Data truncated for column 'b20' at row 3 +Warning 1265 Data truncated for column 'b255' at row 3 +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +43 43 4372656174696E6720616E2061727469636C6520 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +61 61 6161616161616161616161616161616161616161 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +78 78 7878787878787878787878787878787878787878 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +ALTER TABLE t1 ADD COLUMN b257 BINARY(257) <CUSTOM_COL_OPTIONS>; +ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_binary.test b/mysql-test/suite/storage_engine/type_binary.test new file mode 100644 index 00000000000..7820e3ab1d2 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary.test @@ -0,0 +1,10 @@ +# +# BINARY column types +# + +--source have_engine.inc + +--source type_binary.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_binary_indexes.result b/mysql-test/suite/storage_engine/type_binary_indexes.result new file mode 100644 index 00000000000..6f828aed100 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary_indexes.result @@ -0,0 +1,126 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS>, +v16 VARBINARY(16) <CUSTOM_COL_OPTIONS>, +v128 VARBINARY(128) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> b20 (b20) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 b20 # # NULL NULL # # +INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +SELECT HEX(b20) FROM t1 ORDER BY b20; +HEX(b20) +6368617231000000000000000000000000000000 +6368617232000000000000000000000000000000 +6368617233000000000000000000000000000000 +6368617234000000000000000000000000000000 +DROP TABLE t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS> PRIMARY KEY, +v16 VARBINARY(16) <CUSTOM_COL_OPTIONS>, +v128 VARBINARY(128) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 b20 # # NULL NULL # # +INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT HEX(b20) FROM t1 ORDER BY b20; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT HEX(b20) FROM t1 ORDER BY b20; +HEX(b20) +6368617231000000000000000000000000000000 +6368617232000000000000000000000000000000 +6368617233000000000000000000000000000000 +6368617234000000000000000000000000000000 +EXPLAIN SELECT HEX(b20) FROM t1 IGNORE INDEX (PRIMARY) ORDER BY b20 DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT HEX(b20) FROM t1 ORDER BY b20 DESC; +HEX(b20) +6368617234000000000000000000000000000000 +6368617233000000000000000000000000000000 +6368617232000000000000000000000000000000 +6368617231000000000000000000000000000000 +DROP TABLE t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS>, +v16 VARBINARY(16) <CUSTOM_COL_OPTIONS>, +v128 VARBINARY(128) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX b_v (b,v128) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 b_v 1 b # # NULL NULL # # +t1 0 b_v 2 v128 # # NULL NULL # # +INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT HEX(b), HEX(v128) FROM t1 WHERE b != 'a' AND v128 > 'varchar'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_v # # # # +SELECT HEX(b), HEX(v128) FROM t1 WHERE b != 'a' AND v128 > 'varchar'; +HEX(b) HEX(v128) +62 766172636861723162 +63 766172636861723362 +EXPLAIN SELECT HEX(b), HEX(v128) FROM t1 USE INDEX (b_v) WHERE b != 'a' AND v128 > 'varchar'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_v # # # # +SELECT HEX(b), HEX(v128) FROM t1 USE INDEX (b_v) WHERE b != 'a' AND v128 > 'varchar'; +HEX(b) HEX(v128) +62 766172636861723162 +63 766172636861723362 +EXPLAIN SELECT HEX(v128), COUNT(*) FROM t1 GROUP BY HEX(v128); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_v # # # # +SELECT HEX(v128), COUNT(*) FROM t1 GROUP BY HEX(v128); +HEX(v128) COUNT(*) +766172636861723162 2 +766172636861723262 1 +766172636861723362 1 +DROP TABLE t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS>, +v16 VARBINARY(16) <CUSTOM_COL_OPTIONS>, +v128 VARBINARY(128) <CUSTOM_COL_OPTIONS>, +INDEX (v16(10)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 v16 1 v16 # # 10 NULL # # +INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'),('d','char5','varchar4a','varchar3b'),('e','char6','varchar2a','varchar3b'); +INSERT INTO t1 SELECT * FROM t1; +EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 WHERE v16 LIKE 'varchar%'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT HEX(SUBSTRING(v16,7,3)) FROM t1 WHERE v16 LIKE 'varchar%'; +HEX(SUBSTRING(v16,7,3)) +723161 +723161 +723161 +723161 +723261 +723261 +723261 +723261 +723361 +723361 +723461 +723461 +EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 FORCE INDEX (v16) WHERE v16 LIKE 'varchar%'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # v16 # # # # +SELECT HEX(SUBSTRING(v16,7,3)) FROM t1 FORCE INDEX (v16) WHERE v16 LIKE 'varchar%'; +HEX(SUBSTRING(v16,7,3)) +723161 +723161 +723161 +723161 +723261 +723261 +723261 +723261 +723361 +723361 +723461 +723461 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_binary_indexes.test b/mysql-test/suite/storage_engine/type_binary_indexes.test new file mode 100644 index 00000000000..24b16aa5175 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary_indexes.test @@ -0,0 +1,149 @@ +# +# BINARY and VARBINARY columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as set in define_engine.inc + +let $create_definition = + b BINARY $col_opts, + b20 BINARY(20) $col_indexed_opts, + v16 VARBINARY(16) $col_opts, + v128 VARBINARY(128) $col_opts, + $default_index b20 (b20) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY or VARBINARY types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + SELECT HEX(b20) FROM t1 ORDER BY b20; + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + b BINARY $col_opts, + b20 BINARY(20) $col_indexed_opts PRIMARY KEY, + v16 VARBINARY(16) $col_opts, + v128 VARBINARY(128) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY or VARBINARY types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b20) FROM t1 ORDER BY b20; + SELECT HEX(b20) FROM t1 ORDER BY b20; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b20) FROM t1 IGNORE INDEX (PRIMARY) ORDER BY b20 DESC; + SELECT HEX(b20) FROM t1 ORDER BY b20 DESC; + + DROP TABLE t1; +} + +let $create_definition = + b BINARY $col_indexed_opts, + b20 BINARY(20) $col_opts, + v16 VARBINARY(16) $col_opts, + v128 VARBINARY(128) $col_indexed_opts, + UNIQUE INDEX b_v (b,v128) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY or VARBINARY types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b), HEX(v128) FROM t1 WHERE b != 'a' AND v128 > 'varchar'; + --sorted_result + SELECT HEX(b), HEX(v128) FROM t1 WHERE b != 'a' AND v128 > 'varchar'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b), HEX(v128) FROM t1 USE INDEX (b_v) WHERE b != 'a' AND v128 > 'varchar'; + --sorted_result + SELECT HEX(b), HEX(v128) FROM t1 USE INDEX (b_v) WHERE b != 'a' AND v128 > 'varchar'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(v128), COUNT(*) FROM t1 GROUP BY HEX(v128); + --sorted_result + SELECT HEX(v128), COUNT(*) FROM t1 GROUP BY HEX(v128); + + DROP TABLE t1; +} + +let $create_definition = + b BINARY $col_opts, + b20 BINARY(20) $col_opts, + v16 VARBINARY(16) $col_indexed_opts, + v128 VARBINARY(128) $col_opts, + INDEX (v16(10)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY or VARBINARY types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'),('d','char5','varchar4a','varchar3b'),('e','char6','varchar2a','varchar3b'); + INSERT INTO t1 SELECT * FROM t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 WHERE v16 LIKE 'varchar%'; + --sorted_result + SELECT HEX(SUBSTRING(v16,7,3)) FROM t1 WHERE v16 LIKE 'varchar%'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 FORCE INDEX (v16) WHERE v16 LIKE 'varchar%'; + --sorted_result + SELECT HEX(SUBSTRING(v16,7,3)) FROM t1 FORCE INDEX (v16) WHERE v16 LIKE 'varchar%'; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_bit.inc b/mysql-test/suite/storage_engine/type_bit.inc new file mode 100644 index 00000000000..1a232305e1c --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit.inc @@ -0,0 +1,76 @@ +# +# BIT column type +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Valid values + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_opts, + c BIT(64) $col_opts, + d BIT(1) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + --let $alter_definition = DROP COLUMN d + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $alter_definition = ADD COLUMN d BIT(0) $col_opts + --source alter_table.inc + + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + } + + INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); + --sorted_result + SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; + + INSERT INTO t1 VALUES (1,0,-1,0); + --sorted_result + SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; + + INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); + --sorted_result + SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); + + # Out of range values + # (should produce warnings) + + INSERT INTO t1 VALUES (0x10,0,0,1); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $create_definition = a BIT(65) $col_opts + --source create_table.inc +} + + diff --git a/mysql-test/suite/storage_engine/type_bit.result b/mysql-test/suite/storage_engine/type_bit.result new file mode 100644 index 00000000000..69b9ac53d76 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(64) <CUSTOM_COL_OPTIONS>, +d BIT(1) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN d BIT(0) <CUSTOM_COL_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; +BIN(a) HEX(b) c+0 +0 FFFFF 18446744073709551615 +INSERT INTO t1 VALUES (1,0,-1,0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; +a+0 b+0 c+0 +0 1048575 18446744073709551615 +1 0 18446744073709551615 +INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); +a+0 b+0 c+0 +1 0 18446744073709551615 +1 102 255 +INSERT INTO t1 VALUES (0x10,0,0,1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b c d +INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +SELECT * FROM t1; +a b c d +DROP TABLE t1; +CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR 42000: Display width out of range for 'a' (max = 64) diff --git a/mysql-test/suite/storage_engine/type_bit.test b/mysql-test/suite/storage_engine/type_bit.test new file mode 100644 index 00000000000..1670a633f57 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit.test @@ -0,0 +1,10 @@ +# +# BIT column type +# + +--source have_engine.inc + +--source type_bit.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_bit_indexes.result b/mysql-test/suite/storage_engine/type_bit_indexes.result new file mode 100644 index 00000000000..af8ddf7d6c9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit_indexes.result @@ -0,0 +1,132 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> b (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 b # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +SELECT b+0 FROM t1 ORDER BY b; +b+0 +11 +12 +13 +16 +100 +101 +256 +1000 +65535 +1048575 +DROP TABLE t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS> PRIMARY KEY, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 b # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +EXPLAIN SELECT b+0 FROM t1 ORDER BY b; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT b+0 FROM t1 ORDER BY b; +b+0 +11 +12 +13 +16 +100 +101 +256 +1000 +65535 +1048575 +DROP TABLE t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX b_c (b,c) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 b_c 1 b # # NULL NULL # # +t1 0 b_c 2 c # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +EXPLAIN SELECT HEX(b+c) FROM t1 WHERE c > 1 OR HEX(b) < 0xFFFFFF; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_c # # # # +SELECT HEX(b+c) FROM t1 WHERE c > 1 OR HEX(b) < 0xFFFFFF; +HEX(b+c) +10 +10000FFFE +12E +17 +19 +1B +7D1 +BAA +C9 +FFFFF +DROP TABLE t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS>, +INDEX(a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +EXPLAIN SELECT DISTINCT a+0 FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # a # # # # +SELECT DISTINCT a+0 FROM t1 ORDER BY a; +a+0 +0 +1 +DROP TABLE t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX (d) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 d 1 d # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +EXPLAIN SELECT d FROM t1 WHERE d BETWEEN 1 AND 10000; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d # # # # +SELECT d+0 FROM t1 WHERE d BETWEEN 1 AND 10000; +d+0 +1 +1002 +102 +13 +14 +15 +202 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_bit_indexes.test b/mysql-test/suite/storage_engine/type_bit_indexes.test new file mode 100644 index 00000000000..df88d50b5d9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit_indexes.test @@ -0,0 +1,175 @@ +# +# BIT columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_indexed_opts, + c BIT(32) $col_opts, + d BIT(64) $col_opts, + $default_index b (b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + SELECT b+0 FROM t1 ORDER BY b; + + DROP TABLE t1; +} + + +# PK, UNIQUE KEY, KEY + + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_indexed_opts PRIMARY KEY, + c BIT(32) $col_opts, + d BIT(64) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT b+0 FROM t1 ORDER BY b; + SELECT b+0 FROM t1 ORDER BY b; + + DROP TABLE t1; +} + + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_indexed_opts, + c BIT(32) $col_indexed_opts, + d BIT(64) $col_opts, +UNIQUE INDEX b_c (b,c) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b+c) FROM t1 WHERE c > 1 OR HEX(b) < 0xFFFFFF; + --sorted_result + SELECT HEX(b+c) FROM t1 WHERE c > 1 OR HEX(b) < 0xFFFFFF; + + DROP TABLE t1; +} + +let $create_definition = + a BIT $col_indexed_opts, + b BIT(20) $col_opts, + c BIT(32) $col_opts, + d BIT(64) $col_opts, +INDEX(a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT a+0 FROM t1 ORDER BY a; + SELECT DISTINCT a+0 FROM t1 ORDER BY a; + + DROP TABLE t1; +} + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_opts, + c BIT(32) $col_opts, + d BIT(64) $col_indexed_opts, +UNIQUE INDEX (d) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d FROM t1 WHERE d BETWEEN 1 AND 10000; + --sorted_result + SELECT d+0 FROM t1 WHERE d BETWEEN 1 AND 10000; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_blob.inc b/mysql-test/suite/storage_engine/type_blob.inc new file mode 100644 index 00000000000..93a52fc9971 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob.inc @@ -0,0 +1,65 @@ +# +# BLOB column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + b BLOB $col_opts, + b0 BLOB(0) $col_opts, + b1 BLOB(1) $col_opts, + b300 BLOB(300) $col_opts, + bm BLOB(65535) $col_opts, + b70k BLOB(70000) $col_opts, + b17m BLOB(17000000) $col_opts, + t TINYBLOB $col_opts, + m MEDIUMBLOB $col_opts, + l LONGBLOB $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Valid values + # (cannot get MAX for all columns due to max_allowed_packet limitations) + + INSERT INTO t1 VALUES + ('','','','','','','','','',''), + ('a','b','c','d','e','f','g','h','i','j'), + ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), + ( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) ); + + --sorted_result + SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; + + # Invalid values (produce warnings, except for mediumblob and longblob columns for which the values are within limits) + + INSERT INTO t1 VALUES + ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); + + --sorted_result + SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $alter_definition = ADD COLUMN bbb BLOB(4294967296) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_DISPLAYWIDTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_blob.result b/mysql-test/suite/storage_engine/type_blob.result new file mode 100644 index 00000000000..a93391f749a --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob.result @@ -0,0 +1,54 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +b0 BLOB(0) <CUSTOM_COL_OPTIONS>, +b1 BLOB(1) <CUSTOM_COL_OPTIONS>, +b300 BLOB(300) <CUSTOM_COL_OPTIONS>, +bm BLOB(65535) <CUSTOM_COL_OPTIONS>, +b70k BLOB(70000) <CUSTOM_COL_OPTIONS>, +b17m BLOB(17000000) <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b blob # # # +b0 blob # # # +b1 tinyblob # # # +b300 blob # # # +bm blob # # # +b70k mediumblob # # # +b17m longblob # # # +t tinyblob # # # +m mediumblob # # # +l longblob # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) ); +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b300' at row 1 +Warning 1265 Data truncated for column 'bm' at row 1 +Warning 1265 Data truncated for column 't' at row 1 +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296); +ERROR 42000: Display width out of range for 'bbb' (max = 4294967295) +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_blob.test b/mysql-test/suite/storage_engine/type_blob.test new file mode 100644 index 00000000000..2f8ae88372e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob.test @@ -0,0 +1,10 @@ +# +# BLOB column types +# + +--source have_engine.inc + +--source type_blob.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_blob_indexes.result b/mysql-test/suite/storage_engine/type_blob_indexes.result new file mode 100644 index 00000000000..8e732e153b9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob_indexes.result @@ -0,0 +1,152 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> b (b(32)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 b # # 32 NULL # # +INSERT INTO t1 (b,t,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; +f + + +SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; +f + + +DROP TABLE t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS>, +PRIMARY KEY b (b(32)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 b # # 32 NULL # # +INSERT INTO t1 (b,t,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; +f + + +EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; +f + + +DROP TABLE t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX l_t (l(256),t(64)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 l_t 1 l # # 256 NULL # # +t1 0 l_t 2 t # # 64 NULL # # +INSERT INTO t1 (b,t,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # l_t # # # # # +SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; +SUBSTRING(t,64) SUBSTRING(l,256) + + +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + + +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + + + +EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # l_t # # # # # +SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; +SUBSTRING(t,64) SUBSTRING(l,256) + + +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + + +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + + + +DROP TABLE t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS>, +INDEX (m(128)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 m 1 m # # 128 NULL # # +INSERT INTO t1 (b,t,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # m # # # # +SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; +f +EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # m # # # # +SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC; +f +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_blob_indexes.test b/mysql-test/suite/storage_engine/type_blob_indexes.test new file mode 100644 index 00000000000..7a3e09939bf --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob_indexes.test @@ -0,0 +1,188 @@ +# +# BLOB columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + b BLOB $col_indexed_opts, + t TINYBLOB $col_opts, + m MEDIUMBLOB $col_opts, + l LONGBLOB $col_opts, + $default_index b (b(32)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,t,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + (HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; + + DROP TABLE t1; +} + + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + b BLOB $col_indexed_opts, + t TINYBLOB $col_opts, + m MEDIUMBLOB $col_opts, + l LONGBLOB $col_opts, + PRIMARY KEY b (b(32)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,t,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + (HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; + + DROP TABLE t1; +} + +let $create_definition = + b BLOB $col_opts, + t TINYBLOB $col_indexed_opts, + m MEDIUMBLOB $col_opts, + l LONGBLOB $col_indexed_opts, + UNIQUE INDEX l_t (l(256),t(64)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types or unique indexes or multi-part indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,t,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + (HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + # Here we are getting possible key l_t, but not the final key + --replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; + SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; + + --replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; + SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; + DROP TABLE t1; + +} + +let $create_definition = + b BLOB $col_opts, + t TINYBLOB $col_opts, + m MEDIUMBLOB $col_indexed_opts, + l LONGBLOB $col_opts, + INDEX (m(128)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types or non-unique indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,t,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + (HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; + SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC; + SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_bool.inc b/mysql-test/suite/storage_engine/type_bool.inc new file mode 100644 index 00000000000..ae7d0043c49 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bool.inc @@ -0,0 +1,81 @@ +# +# BOOLEAN column type +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + b1 BOOL $col_opts, + b2 BOOLEAN $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BOOLEAN types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Valid values + + INSERT INTO t1 VALUES (1,TRUE); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (FALSE,0); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (2,3); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (-1,-2); + --sorted_result + SELECT * FROM t1; + + --sorted_result + SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; + + --sorted_result + SELECT * FROM t1 WHERE b1 = TRUE; + + --sorted_result + SELECT * FROM t1 WHERE b2 = FALSE; + + # Invalid values + + INSERT INTO t1 VALUES ('a','b'); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (128,-129); + --sorted_result + SELECT * FROM t1; + + # This is why we don't have zerofill and unsigned tests + # for boolean columns: + --let $error_codes = ER_PARSE_ERROR + --let $alter_definition = ADD COLUMN b3 BOOLEAN UNSIGNED + --source alter_table.inc + if ($mysql_errname != ER_PARSE_ERROR) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + --let $error_codes = ER_PARSE_ERROR + --let $alter_definition = ADD COLUMN b3 BOOL ZEROFILL + --source alter_table.inc + + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/type_bool.result b/mysql-test/suite/storage_engine/type_bool.result new file mode 100644 index 00000000000..89beaa11a16 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bool.result @@ -0,0 +1,70 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b1 BOOL <CUSTOM_COL_OPTIONS>, +b2 BOOLEAN <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b1 tinyint(1) # # # +b2 tinyint(1) # # # +INSERT INTO t1 VALUES (1,TRUE); +SELECT * FROM t1; +b1 b2 +1 1 +INSERT INTO t1 VALUES (FALSE,0); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +INSERT INTO t1 VALUES (2,3); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (-1,-2); +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +1 1 +2 3 +SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; +a b +false false +true true +true true +true true +SELECT * FROM t1 WHERE b1 = TRUE; +b1 b2 +1 1 +SELECT * FROM t1 WHERE b2 = FALSE; +b1 b2 +0 0 +INSERT INTO t1 VALUES ('a','b'); +Warnings: +Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 +Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (128,-129); +Warnings: +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +127 -128 +2 3 +ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNSIGNED' at line 1 +ALTER TABLE t1 ADD COLUMN b3 BOOL ZEROFILL; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ZEROFILL' at line 1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_bool.test b/mysql-test/suite/storage_engine/type_bool.test new file mode 100644 index 00000000000..40ef56769e9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bool.test @@ -0,0 +1,10 @@ +# +# BOOLEAN column type +# + +--source have_engine.inc + +--source type_bool.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_char.inc b/mysql-test/suite/storage_engine/type_char.inc new file mode 100644 index 00000000000..8484fc23b10 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char.inc @@ -0,0 +1,59 @@ +# +# CHAR column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + c CHAR $col_opts, + c0 CHAR(0) $col_opts, + c1 CHAR(1) $col_opts, + c20 CHAR(20) $col_opts, + c255 CHAR(255) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Valid values + + INSERT INTO t1 VALUES ('','','','',''); + INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); + + --sorted_result + SELECT * FROM t1; + + # Invalid values + + INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); + INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; + + --sorted_result + SELECT * FROM t1; + + --sorted_result + SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; + + --let $error_codes = ER_TOO_BIG_FIELDLENGTH + --let $alter_definition = ADD COLUMN c257 CHAR(257) $col_opts + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_FIELDLENGTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/type_char.result b/mysql-test/suite/storage_engine/type_char.result new file mode 100644 index 00000000000..61d3cf2419d --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char.result @@ -0,0 +1,56 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c0 CHAR(0) <CUSTOM_COL_OPTIONS>, +c1 CHAR(1) <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +c255 CHAR(255) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) # # # +c0 char(0) # # # +c1 char(1) # # # +c20 char(20) # # # +c255 char(255) # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT * FROM t1; +c c0 c1 c20 c255 + +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'c0' at row 1 +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c20' at row 1 +Warning 1265 Data truncated for column 'c255' at row 1 +INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 +SELECT * FROM t1; +c c0 c1 c20 c255 + + +C C Creating an article Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b +a a aaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +x x xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; +c20 REPEAT('a',LENGTH(c20)) COUNT(*) + 2 +Creating an article aaaaaaaaaaaaaaaaaaa 1 +aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa 1 +abcdefghi klmnopqrst aaaaaaaaaaaaaaaaaaaa 1 +xxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaaaaa 1 +ALTER TABLE t1 ADD COLUMN c257 CHAR(257) <CUSTOM_COL_OPTIONS>; +ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_char.test b/mysql-test/suite/storage_engine/type_char.test new file mode 100644 index 00000000000..ef552f47060 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char.test @@ -0,0 +1,10 @@ +# +# CHAR column types +# + +--source have_engine.inc + +--source type_char.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_char_indexes.result b/mysql-test/suite/storage_engine/type_char_indexes.result new file mode 100644 index 00000000000..f02fcef3ef0 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char_indexes.result @@ -0,0 +1,144 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> c20 (c20) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 c20 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +SELECT c20 FROM t1 ORDER BY c20; +c20 +char1 +char2 +char3 +char4 +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> v16 (v16) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 v16 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char1','varchar3a','varchar1b'),('c','char4','varchar4a','varchar4b'); +SELECT v16 FROM t1 ORDER BY v16; +v16 +varchar1a +varchar2a +varchar3a +varchar4a +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS> PRIMARY KEY, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 c20 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT c20 FROM t1 ORDER BY c20; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c20 FROM t1 ORDER BY c20; +c20 +char1 +char2 +char3 +char4 +EXPLAIN SELECT c20 FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY c20; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c20 FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY c20; +c20 +char1 +char2 +char3 +char4 +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX c_v (c,v128) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 c_v 1 c # # NULL NULL # # +t1 0 c_v 2 v128 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT c, v128 FROM t1 WHERE c != 'a' AND v128 > 'varchar'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # c_v # # # # +SELECT c, v128 FROM t1 WHERE c != 'a' AND v128 > 'varchar'; +c v128 +b varchar1b +c varchar3b +EXPLAIN SELECT v128, COUNT(*) FROM t1 GROUP BY v128; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # c_v # # # # +SELECT v128, COUNT(*) FROM t1 GROUP BY v128; +v128 COUNT(*) +varchar1b 2 +varchar2b 1 +varchar3b 1 +EXPLAIN SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # c_v # # # # +SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128; +v128 COUNT(*) +varchar1b 2 +varchar2b 1 +varchar3b 1 +SET SESSION optimizer_switch = 'engine_condition_pushdown=on'; +EXPLAIN SELECT * FROM t1 WHERE c > 'a'; +id select_type table type possible_keys key key_len ref rows Extra +# # # range c_v c_v # # # Using index condition +SELECT * FROM t1 WHERE c > 'a'; +c c20 v16 v128 +b char3 varchar1a varchar1b +c char4 varchar3a varchar3b +SET SESSION optimizer_switch = @@global.optimizer_switch; +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS>, +INDEX (v16) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 v16 1 v16 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT SUBSTRING(v16,0,3) FROM t1 WHERE v16 LIKE 'varchar%'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # v16 # # # # +SELECT SUBSTRING(v16,7,3) FROM t1 WHERE v16 LIKE 'varchar%'; +SUBSTRING(v16,7,3) +r1a +r1a +r2a +r3a +EXPLAIN SELECT SUBSTRING(v16,0,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT SUBSTRING(v16,7,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; +SUBSTRING(v16,7,3) +r1a +r1a +r2a +r3a +EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; +id select_type table type possible_keys key key_len ref rows Extra +# # # range # v16 # # # # +SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; +c c20 v16 v128 +a char1 varchar1a varchar1b +b char3 varchar1a varchar1b +c char4 varchar3a varchar3b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_char_indexes.test b/mysql-test/suite/storage_engine/type_char_indexes.test new file mode 100644 index 00000000000..582800eabba --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char_indexes.test @@ -0,0 +1,186 @@ +# +# CHAR and VARCHAR columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as set in define_engine.inc + +let $create_definition = + c CHAR $col_opts, + c20 CHAR(20) $col_indexed_opts, + v16 VARCHAR(16) $col_opts, + v128 VARCHAR(128) $col_opts, + $default_index c20 (c20) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + SELECT c20 FROM t1 ORDER BY c20; + + DROP TABLE t1; +} + +let $create_definition = + c CHAR $col_opts, + c20 CHAR(20) $col_opts, + v16 VARCHAR(16) $col_indexed_opts, + v128 VARCHAR(128) $col_opts, + $default_index v16 (v16) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char1','varchar3a','varchar1b'),('c','char4','varchar4a','varchar4b'); + + SELECT v16 FROM t1 ORDER BY v16; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + c CHAR $col_opts, + c20 CHAR(20) $col_indexed_opts PRIMARY KEY, + v16 VARCHAR(16) $col_opts, + v128 VARCHAR(128) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c20 FROM t1 ORDER BY c20; + SELECT c20 FROM t1 ORDER BY c20; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c20 FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY c20; + SELECT c20 FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY c20; + + DROP TABLE t1; +} + +let $create_definition = + c CHAR $col_indexed_opts, + c20 CHAR(20) $col_opts, + v16 VARCHAR(16) $col_opts, + v128 VARCHAR(128) $col_indexed_opts, + UNIQUE INDEX c_v (c,v128) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c, v128 FROM t1 WHERE c != 'a' AND v128 > 'varchar'; + --sorted_result + SELECT c, v128 FROM t1 WHERE c != 'a' AND v128 > 'varchar'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT v128, COUNT(*) FROM t1 GROUP BY v128; + --sorted_result + SELECT v128, COUNT(*) FROM t1 GROUP BY v128; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128; + --sorted_result + SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128; + + SET SESSION optimizer_switch = 'engine_condition_pushdown=on'; + --replace_column 1 # 2 # 3 # 7 # 8 # 9 # + EXPLAIN SELECT * FROM t1 WHERE c > 'a'; + --sorted_result + SELECT * FROM t1 WHERE c > 'a'; + SET SESSION optimizer_switch = @@global.optimizer_switch; + + DROP TABLE t1; +} + +let $create_definition = + c CHAR $col_opts, + c20 CHAR(20) $col_opts, + v16 VARCHAR(16) $col_indexed_opts, + v128 VARCHAR(128) $col_opts, + INDEX (v16) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or non-unique indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(v16,0,3) FROM t1 WHERE v16 LIKE 'varchar%'; + --sorted_result + SELECT SUBSTRING(v16,7,3) FROM t1 WHERE v16 LIKE 'varchar%'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(v16,0,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; + --sorted_result + SELECT SUBSTRING(v16,7,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; + + --replace_column 1 # 2 # 3 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; + --sorted_result + SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_date_time.inc b/mysql-test/suite/storage_engine/type_date_time.inc new file mode 100644 index 00000000000..d0b953984be --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time.inc @@ -0,0 +1,55 @@ +# +# Date and time column types +# (DATE, DATETIME, TIMESTAMP, TIME, YEAR) +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_opts, + y4 YEAR(4) $col_opts, + y2 YEAR(2) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + SET @tm = '2012-04-09 05:27:00'; + + # Valid values + # '1970-01-01 00:00:01' + INSERT INTO t1 VALUES + ('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), + ('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), + ('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); + + --sorted_result + SELECT * FROM t1; + + # Invalid values + + INSERT INTO t1 VALUES + ('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); + + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/type_date_time.result b/mysql-test/suite/storage_engine/type_date_time.result new file mode 100644 index 00000000000..ba3a888562e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time.result @@ -0,0 +1,48 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +y4 YEAR(4) <CUSTOM_COL_OPTIONS>, +y2 YEAR(2) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d date # # # +dt datetime # # # +ts timestamp # # # on update CURRENT_TIMESTAMP +t time # # # +y year(4) # # # +y4 year(4) # # # +y2 year(2) # # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 VALUES +('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), +('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), +('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +INSERT INTO t1 VALUES +('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'dt' at row 1 +Warning 1265 Data truncated for column 'ts' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'y4' at row 1 +Warning 1264 Out of range value for column 'y2' at row 1 +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_date_time.test b/mysql-test/suite/storage_engine/type_date_time.test new file mode 100644 index 00000000000..7f6c325ec3e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time.test @@ -0,0 +1,11 @@ +# +# Date and time column types +# (DATE, DATETIME, TIMESTAMP, TIME, YEAR) +# + +--source have_engine.inc + +--source type_date_time.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_date_time_indexes.result b/mysql-test/suite/storage_engine/type_date_time_indexes.result new file mode 100644 index 00000000000..f259aea2cc4 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time_indexes.result @@ -0,0 +1,278 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> d (d) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 d # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-22', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT d FROM t1 ORDER BY d LIMIT 3; +d +2011-03-31 +2012-01-12 +2012-01-22 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> dt (dt) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 dt # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT dt FROM t1 ORDER BY dt LIMIT 3; +dt +2010-11-22 11:43:14 +2010-11-22 12:33:54 +2011-08-27 21:33:56 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> ts (ts) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 ts # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT ts FROM t1 ORDER BY ts LIMIT 3; +ts +1997-01-31 11:54:01 +1999-03-30 19:11:08 +1999-04-30 19:11:08 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> t (t) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 t # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT t FROM t1 ORDER BY t LIMIT 3; +t +00:12:32 +00:12:33 +05:27:00 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> y (y) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 y # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT y FROM t1 ORDER BY y LIMIT 3; +y +1994 +1998 +1999 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS> PRIMARY KEY, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 dt # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +EXPLAIN SELECT dt FROM t1 ORDER BY dt LIMIT 3; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT dt FROM t1 ORDER BY dt LIMIT 3; +dt +2010-11-22 11:43:14 +2010-11-22 12:33:54 +2011-08-27 21:33:56 +EXPLAIN SELECT dt FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY dt LIMIT 3; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT dt FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY dt LIMIT 3; +dt +2010-11-22 11:43:14 +2010-11-22 12:33:54 +2011-08-27 21:33:56 +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-11', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'); +ERROR 23000: Duplicate entry '2010-11-22 12:33:54' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +INDEX (ts) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 ts 1 ts # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +EXPLAIN SELECT ts FROM t1 WHERE ts > NOW(); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # ts # # # # +SELECT ts FROM t1 WHERE ts > NOW(); +ts +EXPLAIN SELECT ts FROM t1 USE INDEX () WHERE ts > NOW(); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT ts FROM t1 USE INDEX () WHERE ts > NOW(); +ts +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX d_t (d,t) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 d_t 1 d # # NULL NULL # # +t1 0 d_t 2 t # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +EXPLAIN SELECT d, t FROM t1 WHERE CONCAT(d,' ',t) != CURRENT_DATE(); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d_t # # # # +SELECT d, t FROM t1 WHERE CONCAT(d,' ',t) != CURRENT_DATE(); +d t +2011-03-31 22:04:10 +2012-01-12 00:12:32 +2012-01-12 00:12:33 +2012-03-13 12:10:00 +2012-03-31 12:00:00 +2012-04-09 05:27:00 +EXPLAIN SELECT d, t FROM t1 IGNORE INDEX (d_t) WHERE CONCAT(d,' ',t) != CURRENT_DATE(); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT d, t FROM t1 IGNORE INDEX (d_t) WHERE CONCAT(d,' ',t) != CURRENT_DATE(); +d t +2011-03-31 22:04:10 +2012-01-12 00:12:32 +2012-01-12 00:12:33 +2012-03-13 12:10:00 +2012-03-31 12:00:00 +2012-04-09 05:27:00 +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:53', '2011-11-14 21:45:55', '00:12:33', '2000'); +ERROR 23000: Duplicate entry '2012-01-12-00:12:33' for key 'd_t' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +INDEX (y,t) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 y 1 y # # NULL NULL # # +t1 1 y 2 t # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +EXPLAIN SELECT y, COUNT(*) FROM t1 GROUP BY y; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # y # # # # +SELECT y, COUNT(*) FROM t1 GROUP BY y; +y COUNT(*) +1994 1 +1998 1 +1999 1 +2000 1 +2001 1 +2012 1 +EXPLAIN SELECT y, COUNT(*) FROM t1 USE INDEX FOR GROUP BY () GROUP BY y; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # y # # # # +SELECT y, COUNT(*) FROM t1 USE INDEX FOR GROUP BY () GROUP BY y; +y COUNT(*) +1994 1 +1998 1 +1999 1 +2000 1 +2001 1 +2012 1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_date_time_indexes.test b/mysql-test/suite/storage_engine/type_date_time_indexes.test new file mode 100644 index 00000000000..bb06432f079 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time_indexes.test @@ -0,0 +1,366 @@ +# +# Date and time columns with indexes +# (DATE, DATETIME, TIMESTAMP, TIME, YEAR) +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + d DATE $col_indexed_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_opts, + $default_index d (d) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-22', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT d FROM t1 ORDER BY d LIMIT 3; + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_indexed_opts, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_opts, + $default_index dt (dt) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT dt FROM t1 ORDER BY dt LIMIT 3; + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_indexed_opts, + t TIME $col_opts, + y YEAR $col_opts, + $default_index ts (ts) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT ts FROM t1 ORDER BY ts LIMIT 3; + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_indexed_opts, + y YEAR $col_opts, + $default_index t (t) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT t FROM t1 ORDER BY t LIMIT 3; + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_indexed_opts, + $default_index y (y) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT y FROM t1 ORDER BY y LIMIT 3; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_indexed_opts PRIMARY KEY, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT dt FROM t1 ORDER BY dt LIMIT 3; + SELECT dt FROM t1 ORDER BY dt LIMIT 3; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT dt FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY dt LIMIT 3; + SELECT dt FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY dt LIMIT 3; + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-11', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'); + --source check_errors.inc + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_indexed_opts, + t TIME $col_opts, + y YEAR $col_opts, + INDEX (ts) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT ts FROM t1 WHERE ts > NOW(); + --sorted_result + SELECT ts FROM t1 WHERE ts > NOW(); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT ts FROM t1 USE INDEX () WHERE ts > NOW(); + --sorted_result + SELECT ts FROM t1 USE INDEX () WHERE ts > NOW(); + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_indexed_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_indexed_opts, + y YEAR $col_opts, + UNIQUE INDEX d_t (d,t) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d, t FROM t1 WHERE CONCAT(d,' ',t) != CURRENT_DATE(); + --sorted_result + SELECT d, t FROM t1 WHERE CONCAT(d,' ',t) != CURRENT_DATE(); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d, t FROM t1 IGNORE INDEX (d_t) WHERE CONCAT(d,' ',t) != CURRENT_DATE(); + --sorted_result + SELECT d, t FROM t1 IGNORE INDEX (d_t) WHERE CONCAT(d,' ',t) != CURRENT_DATE(); + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:53', '2011-11-14 21:45:55', '00:12:33', '2000'); + --source check_errors.inc + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_indexed_opts, + y YEAR $col_indexed_opts, + INDEX (y,t) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or non-unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT y, COUNT(*) FROM t1 GROUP BY y; + --sorted_result + SELECT y, COUNT(*) FROM t1 GROUP BY y; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT y, COUNT(*) FROM t1 USE INDEX FOR GROUP BY () GROUP BY y; + --sorted_result + SELECT y, COUNT(*) FROM t1 USE INDEX FOR GROUP BY () GROUP BY y; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_enum.inc b/mysql-test/suite/storage_engine/type_enum.inc new file mode 100644 index 00000000000..6b9b83fc52e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum.inc @@ -0,0 +1,69 @@ +# +# ENUM column type +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Valid values. +# We cannot test the maximum of 65,536 here, +# because mysqltest has the standard limit of MAX_QUERY=256K; +# but we can at least try 257 + +let $create_definition = + a ENUM('') $col_opts, + b ENUM('test1','test2','test3','test4','test5') $col_opts, + c ENUM('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM type + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 VALUES ('','test2','4'),('',5,2); + --sorted_result + SELECT * FROM t1; + + # Out of range values + # (should produce warnings) + + INSERT INTO t1 VALUES (0,'test6',-1); + --sorted_result + SELECT * FROM t1; + + # Non-unique values in enum + # (should produce a warning) + --let $alter_definition = ADD COLUMN e ENUM('a','A') $col_opts + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 VALUES ('','test3','75','A'); + --sorted_result + SELECT * FROM t1; + + # Simple comparison + + --sorted_result + SELECT * FROM t1 WHERE b='test2' OR a != ''; + + DROP TABLE t1; +} + + + diff --git a/mysql-test/suite/storage_engine/type_enum.result b/mysql-test/suite/storage_engine/type_enum.result new file mode 100644 index 00000000000..920aa5c7807 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum.result @@ -0,0 +1,46 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a ENUM('') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +INSERT INTO t1 VALUES ('','test2','4'),('',5,2); +SELECT * FROM t1; +a b c + test2 4 + test5 2 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + + test2 4 + test5 2 +ALTER TABLE t1 ADD COLUMN e ENUM('a','A') <CUSTOM_COL_OPTIONS>; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in ENUM +Note 1291 Column 'e' has duplicated value 'a' in ENUM +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +e enum('a','A') # # # +INSERT INTO t1 VALUES ('','test3','75','A'); +SELECT * FROM t1; +a b c e + NULL + test2 4 NULL + test3 75 a + test5 2 NULL +SELECT * FROM t1 WHERE b='test2' OR a != ''; +a b c e + test2 4 NULL +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_enum.test b/mysql-test/suite/storage_engine/type_enum.test new file mode 100644 index 00000000000..3476e8a0e9f --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum.test @@ -0,0 +1,10 @@ +# +# ENUM column type +# + +--source have_engine.inc + +--source type_enum.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_enum_indexes.result b/mysql-test/suite/storage_engine/type_enum_indexes.result new file mode 100644 index 00000000000..f8af1aed103 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum_indexes.result @@ -0,0 +1,108 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> a (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES +('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), +('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 a # # NULL NULL # # +SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; +a +Africa +Africa +Antarctica +DROP TABLE t1; +CREATE TABLE t1 (a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') <CUSTOM_COL_OPTIONS>, +UNIQUE KEY a_b (a,b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES +('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), +('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a_b 1 a # # NULL NULL # # +t1 0 a_b 2 b # # NULL NULL # # +EXPLAIN SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # a_b # # # # +SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; +a +Africa +Africa +Antarctica +EXPLAIN SELECT a FROM t1 FORCE INDEX (a_b) WHERE b > 'test2' ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # a_b # # # # +SELECT a FROM t1 FORCE INDEX (a_b) WHERE b > 'test2' ORDER BY a; +a +Africa +Africa +Antarctica +DROP TABLE t1; +CREATE TABLE t1 (a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') <CUSTOM_COL_OPTIONS> PRIMARY KEY +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES +('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), +('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 c # # NULL NULL # # +EXPLAIN SELECT c FROM t1 WHERE c BETWEEN '1d' AND '6u'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c FROM t1 WHERE c BETWEEN '1d' AND '6u'; +c +1d +1j +4z +5a +5b +EXPLAIN SELECT c FROM t1 USE INDEX () WHERE c BETWEEN '1d' AND '6u'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT c FROM t1 USE INDEX () WHERE c BETWEEN '1d' AND '6u'; +c +1d +1j +4z +5a +5b +DROP TABLE t1; +CREATE TABLE t1 (a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') <CUSTOM_COL_OPTIONS>, +INDEX(b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES +('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), +('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 b 1 b # # NULL NULL # # +EXPLAIN SELECT DISTINCT b FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b # # # # +SELECT DISTINCT b FROM t1; +b +test1 +test2 +test3 +test4 +EXPLAIN SELECT DISTINCT b FROM t1 IGNORE INDEX (b); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT DISTINCT b FROM t1 IGNORE INDEX (b); +b +test1 +test2 +test3 +test4 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_enum_indexes.test b/mysql-test/suite/storage_engine/type_enum_indexes.test new file mode 100644 index 00000000000..ba20197c3a9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum_indexes.test @@ -0,0 +1,146 @@ +# +# ENUM columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as set in define_engine.inc + +let $create_definition = + a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') $col_indexed_opts, + b ENUM('test1','test2','test3','test4','test5') $col_opts, + c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') $col_opts, + $default_index a (a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES + ('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), + ('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); + + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') $col_indexed_opts, + b ENUM('test1','test2','test3','test4','test5') $col_indexed_opts, + c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') $col_opts, + UNIQUE KEY a_b (a,b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES + ('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), + ('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); + + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; + SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT a FROM t1 FORCE INDEX (a_b) WHERE b > 'test2' ORDER BY a; + SELECT a FROM t1 FORCE INDEX (a_b) WHERE b > 'test2' ORDER BY a; + + DROP TABLE t1; +} + +let $create_definition = + a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') $col_opts, + b ENUM('test1','test2','test3','test4','test5') $col_opts, + c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') $col_indexed_opts PRIMARY KEY +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES + ('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), + ('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); + + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c FROM t1 WHERE c BETWEEN '1d' AND '6u'; + --sorted_result + SELECT c FROM t1 WHERE c BETWEEN '1d' AND '6u'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c FROM t1 USE INDEX () WHERE c BETWEEN '1d' AND '6u'; + --sorted_result + SELECT c FROM t1 USE INDEX () WHERE c BETWEEN '1d' AND '6u'; + + DROP TABLE t1; +} + +let $create_definition = + a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') $col_opts, + b ENUM('test1','test2','test3','test4','test5') $col_indexed_opts, + c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') $col_opts, + INDEX(b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES + ('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), + ('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); + + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT b FROM t1; + --sorted_result + SELECT DISTINCT b FROM t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT b FROM t1 IGNORE INDEX (b); + --sorted_result + SELECT DISTINCT b FROM t1 IGNORE INDEX (b); + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_fixed.inc b/mysql-test/suite/storage_engine/type_fixed.inc new file mode 100644 index 00000000000..6765fb575bc --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed.inc @@ -0,0 +1,89 @@ +# +# Fixed point types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + d DECIMAL $col_opts, + d0 DECIMAL(0) $col_opts, + d1_1 DECIMAL(1,1) $col_opts, + d10_2 DECIMAL(10,2) $col_opts, + d60_10 DECIMAL(60,10) $col_opts, + n NUMERIC $col_opts, + n0_0 NUMERIC(0,0) $col_opts, + n1 NUMERIC(1) $col_opts, + n20_4 NUMERIC(20,4) $col_opts, + n65_4 NUMERIC(65,4) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Always valid values + + INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); + INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); + + --sorted_result + SELECT * FROM t1; + + # Values which can be valid or not, + # depending on whether columns are SIGNED or UNSIGNED + # (if not valid should produce warnings) + + INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); + INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); + + --sorted_result + SELECT * FROM t1; + + --sorted_result + SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; + + # Invalid values + + INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); + + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); + --sorted_result + SELECT * FROM t1; + + --let $error_codes = ER_TOO_BIG_PRECISION + --let $alter_definition = ADD COLUMN n66 NUMERIC(66) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_PRECISION) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + --let $error_codes = ER_TOO_BIG_PRECISION + --let $alter_definition = ADD COLUMN n66_6 DECIMAL(66,6) + --source alter_table.inc + --let $error_codes = ER_TOO_BIG_SCALE + --let $alter_definition = ADD COLUMN n66_66 DECIMAL(66,66) + --source alter_table.inc + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_fixed.result b/mysql-test/suite/storage_engine/type_fixed.result new file mode 100644 index 00000000000..2c1566538db --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed.result @@ -0,0 +1,116 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL <CUSTOM_COL_OPTIONS>, +d0 DECIMAL(0) <CUSTOM_COL_OPTIONS>, +d1_1 DECIMAL(1,1) <CUSTOM_COL_OPTIONS>, +d10_2 DECIMAL(10,2) <CUSTOM_COL_OPTIONS>, +d60_10 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n NUMERIC <CUSTOM_COL_OPTIONS>, +n0_0 NUMERIC(0,0) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC(1) <CUSTOM_COL_OPTIONS>, +n20_4 NUMERIC(20,4) <CUSTOM_COL_OPTIONS>, +n65_4 NUMERIC(65,4) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) # # # +d0 decimal(10,0) # # # +d1_1 decimal(1,1) # # # +d10_2 decimal(10,2) # # # +d60_10 decimal(60,10) # # # +n decimal(10,0) # # # +n0_0 decimal(10,0) # # # +n1 decimal(1,0) # # # +n20_4 decimal(20,4) # # # +n65_4 decimal(65,4) # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_fixed.test b/mysql-test/suite/storage_engine/type_fixed.test new file mode 100644 index 00000000000..30b0f44d713 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed.test @@ -0,0 +1,10 @@ +# +# Fixed point types +# + +--source have_engine.inc + +--source type_fixed.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_fixed_indexes.result b/mysql-test/suite/storage_engine/type_fixed_indexes.result new file mode 100644 index 00000000000..b1fe27cf735 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed_indexes.result @@ -0,0 +1,148 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d1 DECIMAL(10,2) <CUSTOM_COL_OPTIONS>, +d2 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC <CUSTOM_COL_OPTIONS>, +n2 NUMERIC(65,4) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> d1 (d1) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 d1 # # NULL NULL # # +INSERT INTO t1 (d1,d2,n1,n2) VALUES +(10.22,60.12345,123456,14.3456), +(10.0,60.12345,123456,14), +(11.14,15,123456,13), +(100,100,1,2), +(0,0,0,0), +(4540424564.23,3343303441.0,12,13), +(15,17,23,100000); +Warnings: +Warning 1264 Out of range value for column 'd1' at row 6 +SELECT d1 FROM t1 ORDER BY d1 DESC; +d1 +99999999.99 +100.00 +15.00 +11.14 +10.22 +10.00 +0.00 +DROP TABLE t1; +CREATE TABLE t1 (d1 DECIMAL(10,2) <CUSTOM_COL_OPTIONS> PRIMARY KEY, +d2 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC <CUSTOM_COL_OPTIONS>, +n2 NUMERIC(65,4) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 d1 # # NULL NULL # # +INSERT INTO t1 (d1,d2,n1,n2) VALUES +(10.22,60.12345,123456,14.3456), +(10.0,60.12345,123456,14), +(11.14,15,123456,13), +(100,100,1,2), +(0,0,0,0), +(4540424564.23,3343303441.0,12,13), +(15,17,23,100000); +Warnings: +Warning 1264 Out of range value for column 'd1' at row 6 +EXPLAIN SELECT d1 FROM t1 ORDER BY d1 DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT d1 FROM t1 ORDER BY d1 DESC; +d1 +99999999.99 +100.00 +15.00 +11.14 +10.22 +10.00 +0.00 +EXPLAIN SELECT d1 FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY d1 DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT d1 FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY d1 DESC; +d1 +99999999.99 +100.00 +15.00 +11.14 +10.22 +10.00 +0.00 +DROP TABLE t1; +CREATE TABLE t1 (d1 DECIMAL(10,2) <CUSTOM_COL_OPTIONS>, +d2 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC <CUSTOM_COL_OPTIONS>, +n2 NUMERIC(65,4) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX n1_n2 (n1,n2) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 n1_n2 1 n1 # # NULL NULL # # +t1 0 n1_n2 2 n2 # # NULL NULL # # +INSERT INTO t1 (d1,d2,n1,n2) VALUES +(10.22,60.12345,123456,14.3456), +(10.0,60.12345,123456,14), +(11.14,15,123456,13), +(100,100,1,2), +(0,0,0,0), +(4540424564.23,3343303441.0,12,13), +(15,17,23,100000); +Warnings: +Warning 1264 Out of range value for column 'd1' at row 6 +EXPLAIN SELECT DISTINCT n1+n2 FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # n1_n2 # # # # +SELECT DISTINCT n1+n2 FROM t1; +n1+n2 +0.0000 +100023.0000 +123469.0000 +123470.0000 +123470.3456 +25.0000 +3.0000 +DROP TABLE t1; +CREATE TABLE t1 (d1 DECIMAL(10,2) <CUSTOM_COL_OPTIONS>, +d2 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC <CUSTOM_COL_OPTIONS>, +n2 NUMERIC(65,4) <CUSTOM_COL_OPTIONS>, +INDEX (d2) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 d2 1 d2 # # NULL NULL # # +INSERT INTO t1 (d1,d2,n1,n2) VALUES +(10.22,60.12345,123456,14.3456), +(10.0,60.12345,123456,14), +(11.14,15,123456,13), +(100,100,1,2), +(0,0,0,0), +(4540424564.23,3343303441.0,12,13), +(15,17,23,100000); +Warnings: +Warning 1264 Out of range value for column 'd1' at row 6 +EXPLAIN SELECT d2, COUNT(*) FROM t1 GROUP BY d2; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d2 # # # # +SELECT d2, COUNT(*) FROM t1 GROUP BY d2; +d2 COUNT(*) +0.0000000000 1 +100.0000000000 1 +15.0000000000 1 +17.0000000000 1 +3343303441.0000000000 1 +60.1234500000 2 +EXPLAIN SELECT d2, COUNT(*) FROM t1 IGNORE INDEX FOR GROUP BY (d2) GROUP BY d2; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d2 # # # # +SELECT d2, COUNT(*) FROM t1 IGNORE INDEX FOR GROUP BY (d2) GROUP BY d2; +d2 COUNT(*) +0.0000000000 1 +100.0000000000 1 +15.0000000000 1 +17.0000000000 1 +3343303441.0000000000 1 +60.1234500000 2 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_fixed_indexes.test b/mysql-test/suite/storage_engine/type_fixed_indexes.test new file mode 100644 index 00000000000..0d3e825c1b0 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed_indexes.test @@ -0,0 +1,167 @@ +# +# Fixed point columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + d1 DECIMAL(10,2) $col_indexed_opts, + d2 DECIMAL(60,10) $col_opts, + n1 NUMERIC $col_opts, + n2 NUMERIC(65,4) $col_opts, + $default_index d1 (d1) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (d1,d2,n1,n2) VALUES + (10.22,60.12345,123456,14.3456), + (10.0,60.12345,123456,14), + (11.14,15,123456,13), + (100,100,1,2), + (0,0,0,0), + (4540424564.23,3343303441.0,12,13), + (15,17,23,100000); + + SELECT d1 FROM t1 ORDER BY d1 DESC; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + d1 DECIMAL(10,2) $col_indexed_opts PRIMARY KEY, + d2 DECIMAL(60,10) $col_opts, + n1 NUMERIC $col_opts, + n2 NUMERIC(65,4) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (d1,d2,n1,n2) VALUES + (10.22,60.12345,123456,14.3456), + (10.0,60.12345,123456,14), + (11.14,15,123456,13), + (100,100,1,2), + (0,0,0,0), + (4540424564.23,3343303441.0,12,13), + (15,17,23,100000); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d1 FROM t1 ORDER BY d1 DESC; + SELECT d1 FROM t1 ORDER BY d1 DESC; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d1 FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY d1 DESC; + SELECT d1 FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY d1 DESC; + + DROP TABLE t1; +} + +let $create_definition = + d1 DECIMAL(10,2) $col_opts, + d2 DECIMAL(60,10) $col_opts, + n1 NUMERIC $col_indexed_opts, + n2 NUMERIC(65,4) $col_indexed_opts, + UNIQUE INDEX n1_n2 (n1,n2) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (d1,d2,n1,n2) VALUES + (10.22,60.12345,123456,14.3456), + (10.0,60.12345,123456,14), + (11.14,15,123456,13), + (100,100,1,2), + (0,0,0,0), + (4540424564.23,3343303441.0,12,13), + (15,17,23,100000); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT n1+n2 FROM t1; + --sorted_result + SELECT DISTINCT n1+n2 FROM t1; + + DROP TABLE t1; +} + +let $create_definition = + d1 DECIMAL(10,2) $col_opts, + d2 DECIMAL(60,10) $col_indexed_opts, + n1 NUMERIC $col_opts, + n2 NUMERIC(65,4) $col_opts, + INDEX (d2) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (d1,d2,n1,n2) VALUES + (10.22,60.12345,123456,14.3456), + (10.0,60.12345,123456,14), + (11.14,15,123456,13), + (100,100,1,2), + (0,0,0,0), + (4540424564.23,3343303441.0,12,13), + (15,17,23,100000); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d2, COUNT(*) FROM t1 GROUP BY d2; + --sorted_result + SELECT d2, COUNT(*) FROM t1 GROUP BY d2; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d2, COUNT(*) FROM t1 IGNORE INDEX FOR GROUP BY (d2) GROUP BY d2; + --sorted_result + SELECT d2, COUNT(*) FROM t1 IGNORE INDEX FOR GROUP BY (d2) GROUP BY d2; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_float.inc b/mysql-test/suite/storage_engine/type_float.inc new file mode 100644 index 00000000000..7e355f01e0d --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float.inc @@ -0,0 +1,111 @@ +# +# Float types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + f FLOAT $col_opts, + f0 FLOAT(0) $col_opts, + r1_1 REAL(1,1) $col_opts, + f23_0 FLOAT(23) $col_opts, + f20_3 FLOAT(20,3) $col_opts, + d DOUBLE $col_opts, + d1_0 DOUBLE(1,0) $col_opts, + d10_10 DOUBLE PRECISION (10,10) $col_opts, + d53 DOUBLE(53,0) $col_opts, + d53_10 DOUBLE(53,10) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Always valid values + + INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); + + --sorted_result + --query_vertical SELECT * FROM t1 + + INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 VALUES ( + 99999999999999999999999999999999999999, + 99999999999999999999999999999999999999.9999999999999999, + 0.9, + 99999999999999999999999999999999999999.9, + 99999999999999999.999, + 999999999999999999999999999999999999999999999999999999999999999999999999999999999, + 9, + 0.9999999999, + 1999999999999999999999999999999999999999999999999999999, + 19999999999999999999999999999999999999999999.9999999999 + ); + + --sorted_result + --query_vertical SELECT * FROM t1 + + # Values which can be valid or not, + # depending on whether columns are SIGNED or UNSIGNED + # (if not valid should produce warnings) + + INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); + + --sorted_result + --query_vertical SELECT * FROM t1 + + --sorted_result + --query_vertical SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1 + + # Invalid values + + INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; + + --sorted_result + --query_vertical SELECT * FROM t1 + + INSERT INTO t1 VALUES ( + 999999999999999999999999999999999999999, + 999999999999999999999999999999999999999.9999999999999999, + 1.9, + 999999999999999999999999999999999999999.9, + 999999999999999999.999, + 9999999999999999999999999999999999999999999999999999999999999999999999999999999999, + 99, + 1.9999999999, + 1999999999999999999999999999999999999999999999999999999, + 19999999999999999999999999999999999999999999.9999999999 + ); + + --sorted_result + --query_vertical SELECT * FROM t1 + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $alter_definition = ADD COLUMN d0_0 DOUBLE(0,0) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_DISPLAYWIDTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + --let $error_codes = ER_TOO_BIG_PRECISION + --let $alter_definition = ADD COLUMN n66_6 DECIMAL(256,1) + --source alter_table.inc + --let $error_codes = ER_TOO_BIG_SCALE + --let $alter_definition = ADD COLUMN n66_66 DECIMAL(40,35) + --source alter_table.inc + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_float.result b/mysql-test/suite/storage_engine/type_float.result new file mode 100644 index 00000000000..1f863505430 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float.result @@ -0,0 +1,286 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +f0 FLOAT(0) <CUSTOM_COL_OPTIONS>, +r1_1 REAL(1,1) <CUSTOM_COL_OPTIONS>, +f23_0 FLOAT(23) <CUSTOM_COL_OPTIONS>, +f20_3 FLOAT(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +d1_0 DOUBLE(1,0) <CUSTOM_COL_OPTIONS>, +d10_10 DOUBLE PRECISION (10,10) <CUSTOM_COL_OPTIONS>, +d53 DOUBLE(53,0) <CUSTOM_COL_OPTIONS>, +d53_10 DOUBLE(53,10) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float # # # +f0 float # # # +r1_1 double(1,1) # # # +f23_0 float # # # +f20_3 float(20,3) # # # +d double # # # +d1_0 double(1,0) # # # +d10_10 double(10,10) # # # +d53 double(53,0) # # # +d53_10 double(53,10) # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 12345.1 +d 11111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 1234566789123456800 +d53_10 100000000000000000.0000000000 +f0 12345.1 +f20_3 56789.988 +f23_0 123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 1e38 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e65 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_float.test b/mysql-test/suite/storage_engine/type_float.test new file mode 100644 index 00000000000..eb197542962 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float.test @@ -0,0 +1,10 @@ +# +# Float types +# + +--source have_engine.inc + +--source type_float.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_float_indexes.result b/mysql-test/suite/storage_engine/type_float_indexes.result new file mode 100644 index 00000000000..905c9da40da --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float_indexes.result @@ -0,0 +1,146 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> f (f) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 f # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +SELECT f FROM t1 ORDER BY f; +f +-1 +0 +1.2345 +17.5843 +4644 +DROP TABLE t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS> PRIMARY KEY, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 f # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +EXPLAIN SELECT f FROM t1 ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT f FROM t1 ORDER BY f; +f +-1 +0 +1.2345 +17.5843 +4644 +EXPLAIN SELECT f FROM t1 IGNORE INDEX (PRIMARY) ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT f FROM t1 IGNORE INDEX (PRIMARY) ORDER BY f; +f +-1 +0 +1.2345 +17.5843 +4644 +ALTER TABLE t1 DROP PRIMARY KEY; +ALTER TABLE t1 ADD UNIQUE KEY(d); +EXPLAIN SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d # # # # +SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; +d +1.2345 +466664.999 +29229114 +DROP TABLE t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS>, +UNIQUE KEY r_dp (r,dp) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 r_dp 1 r # # NULL NULL # # +t1 0 r_dp 2 dp # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +EXPLAIN SELECT r, dp FROM t1 WHERE r > 0 or dp > 0; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # r_dp # # # # +SELECT r, dp FROM t1 WHERE r > 0 or dp > 0; +r dp +1422.220 0.5000000000 +1422.220 1234567.8900000000 +4953453454.440 1111111.2300000000 +DROP TABLE t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS>, +UNIQUE KEY(d) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 d 1 d # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +EXPLAIN SELECT DISTINCT d FROM t1 ORDER BY d; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d # # # # +SELECT DISTINCT d FROM t1 ORDER BY d; +d +-1 +0 +1.2345 +466664.999 +29229114 +DROP TABLE t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS>, +KEY(d) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 d 1 d # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +EXPLAIN SELECT DISTINCT d FROM t1 ORDER BY d; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d # # # # +SELECT DISTINCT d FROM t1 ORDER BY d; +d +-1 +0 +1.2345 +466664.999 +29229114 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_float_indexes.test b/mysql-test/suite/storage_engine/type_float_indexes.test new file mode 100644 index 00000000000..0f1afc600a1 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float_indexes.test @@ -0,0 +1,203 @@ +# +# Float type columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as set in define_engine.inc + +let $create_definition = + f FLOAT $col_indexed_opts, + r REAL(20,3) $col_opts, + d DOUBLE $col_opts, + dp DOUBLE PRECISION (64,10) $col_opts, + $default_index f (f) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + SELECT f FROM t1 ORDER BY f; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + f FLOAT $col_indexed_opts PRIMARY KEY, + r REAL(20,3) $col_opts, + d DOUBLE $col_opts, + dp DOUBLE PRECISION (64,10) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT f FROM t1 ORDER BY f; + SELECT f FROM t1 ORDER BY f; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT f FROM t1 IGNORE INDEX (PRIMARY) ORDER BY f; + SELECT f FROM t1 IGNORE INDEX (PRIMARY) ORDER BY f; + + + --let $alter_definition = DROP PRIMARY KEY + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $alter_definition = ADD UNIQUE KEY(d) + --source alter_table.inc + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; + SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; + } + DROP TABLE t1; +} + +let $create_definition = + f FLOAT $col_opts, + r REAL(20,3) $col_indexed_opts, + d DOUBLE $col_opts, + dp DOUBLE PRECISION (64,10) $col_indexed_opts, + UNIQUE KEY r_dp (r,dp) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT r, dp FROM t1 WHERE r > 0 or dp > 0; + --sorted_result + SELECT r, dp FROM t1 WHERE r > 0 or dp > 0; + + DROP TABLE t1; +} + +let $create_definition = + f FLOAT $col_opts, + r REAL(20,3) $col_opts, + d DOUBLE $col_indexed_opts, + dp DOUBLE PRECISION (64,10) $col_opts, + UNIQUE KEY(d) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT d FROM t1 ORDER BY d; + SELECT DISTINCT d FROM t1 ORDER BY d; + + DROP TABLE t1; +} + + +let $create_definition = + f FLOAT $col_opts, + r REAL(20,3) $col_opts, + d DOUBLE $col_indexed_opts, + dp DOUBLE PRECISION (64,10) $col_opts, + KEY(d) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT d FROM t1 ORDER BY d; + SELECT DISTINCT d FROM t1 ORDER BY d; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_int.inc b/mysql-test/suite/storage_engine/type_int.inc new file mode 100644 index 00000000000..5aaea78fcd5 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int.inc @@ -0,0 +1,84 @@ +# +# INT column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + i INT $col_opts, + i0 INT(0) $col_opts, + i1 INT(1) $col_opts, + i20 INT(20) $col_opts, + t TINYINT $col_opts, + t0 TINYINT(0) $col_opts, + t1 TINYINT(1) $col_opts, + t20 TINYINT(20) $col_opts, + s SMALLINT $col_opts, + s0 SMALLINT(0) $col_opts, + s1 SMALLINT(1) $col_opts, + s20 SMALLINT(20) $col_opts, + m MEDIUMINT $col_opts, + m0 MEDIUMINT(0) $col_opts, + m1 MEDIUMINT(1) $col_opts, + m20 MEDIUMINT(20) $col_opts, + b BIGINT $col_opts, + b0 BIGINT(0) $col_opts, + b1 BIGINT(1) $col_opts, + b20 BIGINT(20) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Always valid values + + INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); + INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); + --sorted_result + SELECT * FROM t1; + + # Values which can be valid or not, + # depending on whether columns are SIGNED or UNSIGNED + # (if not valid should produce warnings) + + INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); + INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); + + --sorted_result + SELECT * FROM t1; + + # Invalid values + + INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); + + INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); + + INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); + + --sorted_result + SELECT * FROM t1; + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $alter_definition = ADD COLUMN i257 INT(257) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_DISPLAYWIDTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_int.result b/mysql-test/suite/storage_engine/type_int.result new file mode 100644 index 00000000000..47f4ebad93a --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int.result @@ -0,0 +1,209 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS>, +i0 INT(0) <CUSTOM_COL_OPTIONS>, +i1 INT(1) <CUSTOM_COL_OPTIONS>, +i20 INT(20) <CUSTOM_COL_OPTIONS>, +t TINYINT <CUSTOM_COL_OPTIONS>, +t0 TINYINT(0) <CUSTOM_COL_OPTIONS>, +t1 TINYINT(1) <CUSTOM_COL_OPTIONS>, +t20 TINYINT(20) <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +s0 SMALLINT(0) <CUSTOM_COL_OPTIONS>, +s1 SMALLINT(1) <CUSTOM_COL_OPTIONS>, +s20 SMALLINT(20) <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +m0 MEDIUMINT(0) <CUSTOM_COL_OPTIONS>, +m1 MEDIUMINT(1) <CUSTOM_COL_OPTIONS>, +m20 MEDIUMINT(20) <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS>, +b0 BIGINT(0) <CUSTOM_COL_OPTIONS>, +b1 BIGINT(1) <CUSTOM_COL_OPTIONS>, +b20 BIGINT(20) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(11) # # # +i0 int(11) # # # +i1 int(1) # # # +i20 int(20) # # # +t tinyint(4) # # # +t0 tinyint(4) # # # +t1 tinyint(1) # # # +t20 tinyint(20) # # # +s smallint(6) # # # +s0 smallint(6) # # # +s1 smallint(1) # # # +s20 smallint(20) # # # +m mediumint(9) # # # +m0 mediumint(9) # # # +m1 mediumint(1) # # # +m20 mediumint(20) # # # +b bigint(20) # # # +b0 bigint(20) # # # +b1 bigint(1) # # # +b20 bigint(20) # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_int.test b/mysql-test/suite/storage_engine/type_int.test new file mode 100644 index 00000000000..1e1ca36854b --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int.test @@ -0,0 +1,10 @@ +# +# INT column types +# + +--source have_engine.inc + +--source type_int.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_int_indexes.result b/mysql-test/suite/storage_engine/type_int_indexes.result new file mode 100644 index 00000000000..aa82d6b9c4e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int_indexes.result @@ -0,0 +1,133 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS>, +t TINYINT <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> i (i) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 i # # NULL NULL # # +INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); +SELECT i FROM t1 ORDER BY i; +i +1 +2 +3 +5 +10 +11 +12 +101 +1000 +10001 +DROP TABLE t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS> PRIMARY KEY, +t TINYINT <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); +EXPLAIN SELECT i FROM t1 ORDER BY i; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # Using index +SELECT i FROM t1 ORDER BY i; +i +1 +2 +3 +5 +10 +11 +12 +101 +1000 +10001 +ALTER TABLE t1 DROP PRIMARY KEY; +ALTER TABLE t1 ADD PRIMARY KEY (i,t); +INSERT INTO t1 (i,t,s,m,b) VALUES (1,3,2,4,5); +EXPLAIN SELECT i, t FROM t1 ORDER BY i, t; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # Using index +SELECT i, t FROM t1 ORDER BY i, t; +i t +1 2 +1 3 +2 3 +3 4 +5 100 +10 11 +11 12 +12 13 +101 102 +1000 100 +10001 103 +DROP TABLE t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS>, +t TINYINT <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS>, +INDEX s_m (s,m) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); +EXPLAIN SELECT s, m FROM t1 WHERE s != 10 AND m != 1; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # s_m # # # Using where; Using index +SELECT s, m FROM t1 WHERE s != 10 AND m != 1; +s m +10000 1000000 +10000 1000000 +10002 10003 +103 104 +12 13 +13 14 +14 15 +3 4 +4 5 +5 6 +DROP TABLE t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS>, +t TINYINT <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS>, +UNIQUE KEY b_t (b,t) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); +SELECT b+t FROM t1 WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; +b+t +9 +11 +25 +27 +29 +207 +10107 +100000000000000100 +1000000000000000100 +SELECT b+t FROM t1 FORCE INDEX (b_t) WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; +b+t +9 +11 +25 +27 +29 +207 +10107 +100000000000000100 +1000000000000000100 +SELECT b+t FROM t1 IGNORE INDEX (b_t) WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; +b+t +9 +11 +25 +27 +29 +207 +10107 +100000000000000100 +1000000000000000100 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_int_indexes.test b/mysql-test/suite/storage_engine/type_int_indexes.test new file mode 100644 index 00000000000..f8270c91ae3 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int_indexes.test @@ -0,0 +1,146 @@ +# +# INT column types with indexes +# + +--source have_engine.inc +--source have_default_index.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + i INT $col_indexed_opts, + t TINYINT $col_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + b BIGINT $col_opts, + $default_index i (i) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types or indexes on them + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); + + SELECT i FROM t1 ORDER BY i; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + i INT $col_indexed_opts PRIMARY KEY, + t TINYINT $col_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + b BIGINT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # + EXPLAIN SELECT i FROM t1 ORDER BY i; + SELECT i FROM t1 ORDER BY i; + + --let $alter_definition = DROP PRIMARY KEY + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $alter_definition = ADD PRIMARY KEY (i,t) + --source alter_table.inc + + INSERT INTO t1 (i,t,s,m,b) VALUES (1,3,2,4,5); + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # + EXPLAIN SELECT i, t FROM t1 ORDER BY i, t; + SELECT i, t FROM t1 ORDER BY i, t; + } + + DROP TABLE t1; +} + +let $create_definition = + i INT $col_opts, + t TINYINT $col_opts, + s SMALLINT $col_indexed_opts, + m MEDIUMINT $col_indexed_opts, + b BIGINT $col_opts, + INDEX s_m (s,m) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types or non-unique indexes or multi-part indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # + EXPLAIN SELECT s, m FROM t1 WHERE s != 10 AND m != 1; + --sorted_result + SELECT s, m FROM t1 WHERE s != 10 AND m != 1; + + DROP TABLE t1; +} + +let $create_definition = + i INT $col_opts, + t TINYINT $col_indexed_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + b BIGINT $col_indexed_opts, + UNIQUE KEY b_t (b,t) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); + + # This query should use the index b_t, we just don't want to run EXPLAIN + # (to avoid mismatches due to different subquery-related plans) + SELECT b+t FROM t1 WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; + SELECT b+t FROM t1 FORCE INDEX (b_t) WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; + SELECT b+t FROM t1 IGNORE INDEX (b_t) WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_set.inc b/mysql-test/suite/storage_engine/type_set.inc new file mode 100644 index 00000000000..b4844b00ec7 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set.inc @@ -0,0 +1,69 @@ +# +# SET column type +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Valid values. + +let $create_definition = + a SET('') $col_opts, + b SET('test1','test2','test3','test4','test5') $col_opts, + c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 VALUES + ('','test2,test3','01,34,44,,23'), + ('',5,2), + (',','test4,test2',''); + --sorted_result + SELECT * FROM t1; + + # Out of range values + # (should produce warnings) + + INSERT INTO t1 VALUES (0,'test6',-1); + --sorted_result + SELECT * FROM t1; + + # Non-unique values in set + # (should produce a warning) + --let $alter_definition = ADD COLUMN e SET('a','A') $col_opts + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + --let $error_codes = ER_TOO_BIG_SET + --let $alter_definition = ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') $col_opts + --source alter_table.inc + } + + # Simple comparison + + --sorted_result + SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_set.result b/mysql-test/suite/storage_engine/type_set.result new file mode 100644 index 00000000000..210b07748bc --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set.result @@ -0,0 +1,48 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a SET('') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +INSERT INTO t1 VALUES +('','test2,test3','01,34,44,,23'), +('',5,2), +(',','test4,test2',''); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +ALTER TABLE t1 ADD COLUMN e SET('a','A') <CUSTOM_COL_OPTIONS>; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in SET +Note 1291 Column 'e' has duplicated value 'a' in SET +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +e set('a','A') # # # +ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS>; +ERROR HY000: Too many strings for column f and SET +SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +a b c e + test2,test3 01,23,34,44 NULL + test2,test4 NULL +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_set.test b/mysql-test/suite/storage_engine/type_set.test new file mode 100644 index 00000000000..7313ccaf7fe --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set.test @@ -0,0 +1,10 @@ +# +# SET column type +# + +--source have_engine.inc + +--source type_set.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_set_indexes.result b/mysql-test/suite/storage_engine/type_set_indexes.result new file mode 100644 index 00000000000..871202d7b97 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set_indexes.result @@ -0,0 +1,137 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','22','23','33','34','39','40','44','50','63','64') <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> c (c) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 c # # NULL NULL # # +INSERT INTO t1 (a,b,c) VALUES +('','test2,test3','01,34,44,23'), +('',5,2), +('N.America,Asia','test4,test2',''), +('Africa,Europe,Asia','test2,test3','01'), +('Antarctica','test3','34,44'), +('Asia','test5','50'), +('Europe,S.America','test1,','39'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 7 +SELECT c FROM t1 ORDER BY c; +c + +01 +22 +39 +34,44 +01,23,34,44 +50 +DROP TABLE t1; +CREATE TABLE t1 (a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','22','23','33','34','39','40','44','50','63','64') <CUSTOM_COL_OPTIONS> PRIMARY KEY +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 c # # NULL NULL # # +INSERT INTO t1 (a,b,c) VALUES +('','test2,test3','01,34,44,23'), +('',5,2), +('N.America,Asia','test4,test2',''), +('Africa,Europe,Asia','test2,test3','01'), +('Antarctica','test3','34,44'), +('Asia','test5','50'), +('Europe,S.America','test1,','39'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 7 +EXPLAIN SELECT c FROM t1 ORDER BY c; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c FROM t1 ORDER BY c; +c + +01 +22 +39 +34,44 +01,23,34,44 +50 +EXPLAIN SELECT c FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY c; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY c; +c + +01 +22 +39 +34,44 +01,23,34,44 +50 +INSERT INTO t1 (a,b,c) VALUES ('Antarctica','test3','02'); +ERROR 23000: Duplicate entry '22' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b,c) VALUES ('','test1','34,44'); +ERROR 23000: Duplicate entry '34,44' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','22','23','33','34','39','40','44','50','63','64') <CUSTOM_COL_OPTIONS>, +INDEX(a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +INSERT INTO t1 (a,b,c) VALUES +('','test2,test3','01,34,44,23'), +('',5,2), +('N.America,Asia','test4,test2',''), +('Africa,Europe,Asia','test2,test3','01'), +('Antarctica','test3','34,44'), +('Asia','test5','50'), +('Europe,S.America','test1,','39'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 7 +EXPLAIN SELECT a FROM t1 WHERE FIND_IN_SET('Europe',a) > 0; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # a # # # # +SELECT a FROM t1 WHERE FIND_IN_SET('Europe',a) > 0; +a +Africa,Europe,Asia +S.America,Europe +DROP TABLE t1; +CREATE TABLE t1 (a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','22','23','33','34','39','40','44','50','63','64') <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX b_a (b,a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 b_a 1 b # # NULL NULL # # +t1 0 b_a 2 a # # NULL NULL # # +INSERT INTO t1 (a,b,c) VALUES +('','test2,test3','01,34,44,23'), +('',5,2), +('N.America,Asia','test4,test2',''), +('Africa,Europe,Asia','test2,test3','01'), +('Antarctica','test3','34,44'), +('Asia','test5','50'), +('Europe,S.America','test1,','39'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 7 +EXPLAIN SELECT DISTINCT a, b FROM t1 ORDER BY b DESC, a; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_a # # # # +SELECT DISTINCT a, b FROM t1 ORDER BY b DESC, a; +a b + test1,test3 + test2,test3 +Africa,Europe,Asia test2,test3 +Antarctica test3 +Asia test5 +N.America,Asia test2,test4 +S.America,Europe test1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_set_indexes.test b/mysql-test/suite/storage_engine/type_set_indexes.test new file mode 100644 index 00000000000..3223c957cea --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set_indexes.test @@ -0,0 +1,167 @@ +# +# SET columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as configured in define_engine.inc + +let $create_definition = + a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') $col_opts, + b SET('test1','test2','test3','test4','test5') $col_opts, + c SET('01','22','23','33','34','39','40','44','50','63','64') $col_indexed_opts, + $default_index c (c) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types or indexes on them + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c) VALUES + ('','test2,test3','01,34,44,23'), + ('',5,2), + ('N.America,Asia','test4,test2',''), + ('Africa,Europe,Asia','test2,test3','01'), + ('Antarctica','test3','34,44'), + ('Asia','test5','50'), + ('Europe,S.America','test1,','39'); + + SELECT c FROM t1 ORDER BY c; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + + +let $create_definition = + a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') $col_opts, + b SET('test1','test2','test3','test4','test5') $col_opts, + c SET('01','22','23','33','34','39','40','44','50','63','64') $col_indexed_opts PRIMARY KEY +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c) VALUES + ('','test2,test3','01,34,44,23'), + ('',5,2), + ('N.America,Asia','test4,test2',''), + ('Africa,Europe,Asia','test2,test3','01'), + ('Antarctica','test3','34,44'), + ('Asia','test5','50'), + ('Europe,S.America','test1,','39'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c FROM t1 ORDER BY c; + SELECT c FROM t1 ORDER BY c; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY c; + SELECT c FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY c; + + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b,c) VALUES ('Antarctica','test3','02'); + --source check_errors.inc + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b,c) VALUES ('','test1','34,44'); + --source check_errors.inc + + DROP TABLE t1; +} + +let $create_definition = + a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') $col_indexed_opts, + b SET('test1','test2','test3','test4','test5') $col_opts, + c SET('01','22','23','33','34','39','40','44','50','63','64') $col_opts, + INDEX(a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c) VALUES + ('','test2,test3','01,34,44,23'), + ('',5,2), + ('N.America,Asia','test4,test2',''), + ('Africa,Europe,Asia','test2,test3','01'), + ('Antarctica','test3','34,44'), + ('Asia','test5','50'), + ('Europe,S.America','test1,','39'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT a FROM t1 WHERE FIND_IN_SET('Europe',a) > 0; + --sorted_result + SELECT a FROM t1 WHERE FIND_IN_SET('Europe',a) > 0; + + DROP TABLE t1; +} + +let $create_definition = + a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') $col_indexed_opts, + b SET('test1','test2','test3','test4','test5') $col_indexed_opts, + c SET('01','22','23','33','34','39','40','44','50','63','64') $col_opts, + UNIQUE INDEX b_a (b,a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c) VALUES + ('','test2,test3','01,34,44,23'), + ('',5,2), + ('N.America,Asia','test4,test2',''), + ('Africa,Europe,Asia','test2,test3','01'), + ('Antarctica','test3','34,44'), + ('Asia','test5','50'), + ('Europe,S.America','test1,','39'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT a, b FROM t1 ORDER BY b DESC, a; + --sorted_result + SELECT DISTINCT a, b FROM t1 ORDER BY b DESC, a; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_spatial.inc b/mysql-test/suite/storage_engine/type_spatial.inc new file mode 100644 index 00000000000..5195f779bcc --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial.inc @@ -0,0 +1,738 @@ +# +# Spatial objects +# + +# +# A calling test can initialize $index variable, +# which can be SPATIAL, or INDEX, or UNIQUE INDEX; +# Logic for creating tables with spatial and non-spatial indexes is different +# + +--disable_warnings +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +--enable_warnings + +--disable_warnings +DROP DATABASE IF EXISTS gis_ogs; +--enable_warnings + +CREATE DATABASE gis_ogs; + + +if ($index=='') +{ + --let $table_name = gis_point + --let $create_definition = fid $int_col, g POINT + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Geometry types + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $table_name = gis_line + --let $create_definition = fid $int_col, g LINESTRING + --source create_table.inc + --let $table_name = gis_polygon + --let $create_definition = fid $int_col, g POLYGON + --source create_table.inc + --let $table_name = gis_multi_point + --let $create_definition = fid $int_col, g MULTIPOINT + --source create_table.inc + --let $table_name = gis_multi_line + --let $create_definition = fid $int_col, g MULTILINESTRING + --source create_table.inc + --let $table_name = gis_multi_polygon + --let $create_definition = fid $int_col, g MULTIPOLYGON + --source create_table.inc + --let $table_name = gis_geometrycollection + --let $create_definition = fid $int_col, g GEOMETRYCOLLECTION + --source create_table.inc + --let $table_name = gis_geometry + --let $create_definition = fid $int_col, g GEOMETRY + --source create_table.inc + + USE gis_ogs; + + --let $table_name = lakes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + shore POLYGON; + --source create_table.inc + + --let $table_name = road_segments + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + aliases CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerline LINESTRING; + --source create_table.inc + + --let $table_name = divided_routes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerlines MULTILINESTRING; + --source create_table.inc + + --let $table_name = forests + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary MULTIPOLYGON; + --source create_table.inc + + --let $table_name = bridges + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT; + --source create_table.inc + + --let $table_name = streams + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + centerline LINESTRING; + --source create_table.inc + + --let $table_name = buildings + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT, + footprint POLYGON; + --source create_table.inc + + --let $table_name = ponds + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + type CHAR(64) $col_opts, + shores MULTIPOLYGON; + --source create_table.inc + + --let $table_name = named_places + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary POLYGON; + --source create_table.inc + + --let $table_name = map_neatlines + let $create_definition = + fid INT $col_opts, + neatline POLYGON; + --source create_table.inc + } +} + +if ($index == 'SPATIAL') +{ + --let $table_name = gis_point + --let $create_definition = fid $int_col, g POINT NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Geometry types or spatial indexes + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $table_name = gis_line + --let $create_definition = fid $int_col, g LINESTRING NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_polygon + --let $create_definition = fid $int_col, g POLYGON NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_multi_point + --let $create_definition = fid $int_col, g MULTIPOINT NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_multi_line + --let $create_definition = fid $int_col, g MULTILINESTRING NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_multi_polygon + --let $create_definition = fid $int_col, g MULTIPOLYGON NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_geometrycollection + --let $create_definition = fid $int_col, g GEOMETRYCOLLECTION NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_geometry + --let $create_definition = fid $int_col, g GEOMETRY NOT NULL + --source create_table.inc + + USE gis_ogs; + + --let $table_name = lakes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + shore POLYGON NOT NULL, SPATIAL INDEX s(shore); + --source create_table.inc + + --let $table_name = road_segments + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + aliases CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline); + --source create_table.inc + + --let $table_name = divided_routes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerlines MULTILINESTRING NOT NULL, SPATIAL INDEX c(centerlines); + --source create_table.inc + + --let $table_name = forests + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary MULTIPOLYGON NOT NULL, SPATIAL INDEX b(boundary); + --source create_table.inc + + --let $table_name = bridges + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT NOT NULL, SPATIAL INDEX p(position); + --source create_table.inc + + --let $table_name = streams + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline); + --source create_table.inc + + --let $table_name = buildings + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT NOT NULL, + footprint POLYGON NOT NULL, SPATIAL INDEX p(position), SPATIAL INDEX f(footprint); + --source create_table.inc + + --let $table_name = ponds + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + type CHAR(64) $col_opts, + shores MULTIPOLYGON NOT NULL, SPATIAL INDEX s(shores); + --source create_table.inc + + --let $table_name = named_places + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary POLYGON NOT NULL, SPATIAL INDEX b(boundary); + --source create_table.inc + + --let $table_name = map_neatlines + let $create_definition = + fid INT $col_opts, + neatline POLYGON NOT NULL, SPATIAL INDEX n(neatline); + --source create_table.inc + } + let $index =; +} + +if ($index) +{ + --let $table_name = gis_point + --let $create_definition = fid $int_col, g POINT, $index g(g(128)) + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Geometry types or indexes on them + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $table_name = gis_line + --let $create_definition = fid $int_col, g LINESTRING, $index g(g(256)) + --source create_table.inc + --let $table_name = gis_polygon + --let $create_definition = fid $int_col, g POLYGON, $index g(g(512)) + --source create_table.inc + --let $table_name = gis_multi_point + --let $create_definition = fid $int_col, g MULTIPOINT, $index g(g(128)) + --source create_table.inc + --let $table_name = gis_multi_line + --let $create_definition = fid $int_col, g MULTILINESTRING, $index g(g(256)) + --source create_table.inc + --let $table_name = gis_multi_polygon + --let $create_definition = fid $int_col, g MULTIPOLYGON + --source create_table.inc + --let $table_name = gis_geometrycollection + --let $create_definition = fid $int_col, g GEOMETRYCOLLECTION + --source create_table.inc + --let $table_name = gis_geometry + --let $create_definition = fid $int_col, g GEOMETRY + --source create_table.inc + + USE gis_ogs; + + --let $table_name = lakes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + shore POLYGON $spatial_col_opts, $index s(shore(64)); + --source create_table.inc + + --let $table_name = road_segments + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + aliases CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerline LINESTRING $spatial_col_opts, $index c(centerline(128)); + --source create_table.inc + + --let $table_name = divided_routes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerlines MULTILINESTRING $spatial_col_opts, $index c(centerlines(512)); + --source create_table.inc + + --let $table_name = forests + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary MULTIPOLYGON $spatial_col_opts, $index b(boundary(128)); + --source create_table.inc + + --let $table_name = bridges + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT $spatial_col_opts, $index p(`position`(64)); + --source create_table.inc + + --let $table_name = streams + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + centerline LINESTRING $spatial_col_opts, $index c(centerline(256)); + --source create_table.inc + + --let $table_name = buildings + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT $spatial_col_opts, + footprint POLYGON $spatial_col_opts, $index p(`position`(64)), $index f(footprint(128)); + --source create_table.inc + + --let $table_name = ponds + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + type CHAR(64) $col_opts, + shores MULTIPOLYGON $spatial_col_opts, $index s(shores(256)); + --source create_table.inc + + --let $table_name = named_places + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary POLYGON $spatial_col_opts, $index b(boundary(512)); + --source create_table.inc + + --let $table_name = map_neatlines + let $create_definition = + fid INT $col_opts, + neatline POLYGON $spatial_col_opts, $index n(neatline(700)); + --source create_table.inc + } +} + +if (!$mysql_errname) +{ + USE test; + + SHOW FIELDS FROM gis_point; + SHOW FIELDS FROM gis_line; + SHOW FIELDS FROM gis_polygon; + SHOW FIELDS FROM gis_multi_point; + SHOW FIELDS FROM gis_multi_line; + SHOW FIELDS FROM gis_multi_polygon; + SHOW FIELDS FROM gis_geometrycollection; + SHOW FIELDS FROM gis_geometry; + + INSERT INTO gis_point VALUES + (101, PointFromText('POINT(10 10)')), + (102, PointFromText('POINT(20 10)')), + (103, PointFromText('POINT(20 20)')), + (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); + + INSERT INTO gis_line VALUES + (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), + (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), + (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); + + INSERT INTO gis_polygon VALUES + (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), + (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), + (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); + + INSERT INTO gis_multi_point VALUES + (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), + (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), + (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); + + INSERT INTO gis_multi_line VALUES + (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), + (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), + (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); + + INSERT INTO gis_multi_polygon VALUES + (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), + (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), + (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); + + INSERT INTO gis_geometrycollection VALUES + (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), + (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), + (122, GeomFromText('GeometryCollection()')), + (123, GeomFromText('GeometryCollection EMPTY')); + + INSERT into gis_geometry SELECT * FROM gis_point; + INSERT into gis_geometry SELECT * FROM gis_line; + INSERT into gis_geometry SELECT * FROM gis_polygon; + INSERT into gis_geometry SELECT * FROM gis_multi_point; + INSERT into gis_geometry SELECT * FROM gis_multi_line; + INSERT into gis_geometry SELECT * FROM gis_multi_polygon; + INSERT into gis_geometry SELECT * FROM gis_geometrycollection; + + SELECT fid, AsText(g) FROM gis_point; + SELECT fid, AsText(g) FROM gis_line; + SELECT fid, AsText(g) FROM gis_polygon; + SELECT fid, AsText(g) FROM gis_multi_point; + SELECT fid, AsText(g) FROM gis_multi_line; + SELECT fid, AsText(g) FROM gis_multi_polygon; + SELECT fid, AsText(g) FROM gis_geometrycollection; + SELECT fid, AsText(g) FROM gis_geometry; + + SELECT fid, Dimension(g) FROM gis_geometry; + SELECT fid, GeometryType(g) FROM gis_geometry; + SELECT fid, IsEmpty(g) FROM gis_geometry; + SELECT fid, AsText(Envelope(g)) FROM gis_geometry; + + SELECT fid, X(g) FROM gis_point; + SELECT fid, Y(g) FROM gis_point; + + SELECT fid, AsText(StartPoint(g)) FROM gis_line; + SELECT fid, AsText(EndPoint(g)) FROM gis_line; + SELECT fid, GLength(g) FROM gis_line; + SELECT fid, NumPoints(g) FROM gis_line; + SELECT fid, AsText(PointN(g, 2)) FROM gis_line; + SELECT fid, IsClosed(g) FROM gis_line; + + SELECT fid, AsText(Centroid(g)) FROM gis_polygon; + SELECT fid, Area(g) FROM gis_polygon; + SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; + SELECT fid, NumInteriorRings(g) FROM gis_polygon; + SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; + + SELECT fid, IsClosed(g) FROM gis_multi_line; + + SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; + SELECT fid, Area(g) FROM gis_multi_polygon; + + SELECT fid, NumGeometries(g) from gis_multi_point; + SELECT fid, NumGeometries(g) from gis_multi_line; + SELECT fid, NumGeometries(g) from gis_multi_polygon; + SELECT fid, NumGeometries(g) from gis_geometrycollection; + + SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; + SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; + SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; + SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; + SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; + + SELECT g1.fid as first, g2.fid as second, + Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, + Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, + Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r + FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; + + DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; + + + USE gis_ogs; + + --echo # Lakes + INSERT INTO lakes VALUES ( + 101, 'BLUE LAKE', + PolyFromText( + 'POLYGON( + (52 18,66 23,73 9,48 6,52 18), + (59 18,67 18,67 13,59 13,59 18) + )', + 101)); + + --echo # Road Segments + + INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, + LineFromText( + 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); + + INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, + LineFromText( + 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); + + INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, + LineFromText( + 'LINESTRING( 70 38, 72 48 )' ,101)); + + INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, + LineFromText( + 'LINESTRING( 70 38, 84 42 )' ,101)); + + INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, + 1, + LineFromText( + 'LINESTRING( 28 26, 28 0 )',101)); + + --echo # DividedRoutes + + INSERT INTO divided_routes VALUES(119, 'Route 75', 4, + MLineFromText( + 'MULTILINESTRING((10 48,10 21,10 0), + (16 0,16 23,16 48))', 101)); + + --echo # Forests + + INSERT INTO forests VALUES(109, 'Green Forest', + MPolyFromText( + 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), + (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', + 101)); + + --echo # Bridges + + INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( + 'POINT( 44 31 )', 101)); + + --echo # Streams + + INSERT INTO streams VALUES(111, 'Cam Stream', + LineFromText( + 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); + + INSERT INTO streams VALUES(112, NULL, + LineFromText( + 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); + + --echo # Buildings + + INSERT INTO buildings VALUES(113, '123 Main Street', + PointFromText( + 'POINT( 52 30 )', 101), + PolyFromText( + 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); + + INSERT INTO buildings VALUES(114, '215 Main Street', + PointFromText( + 'POINT( 64 33 )', 101), + PolyFromText( + 'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); + + + --echo # Ponds + + INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', + MPolyFromText( + 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), + ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); + + --echo # Named Places + + INSERT INTO named_places VALUES(117, 'Ashton', + PolyFromText( + 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); + + INSERT INTO named_places VALUES(118, 'Goose Island', + PolyFromText( + 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); + + --echo # Map Neatlines + + INSERT INTO map_neatlines VALUES(115, + PolyFromText( + 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); + + SELECT Dimension(shore) + FROM lakes + WHERE name = 'Blue Lake'; + + SELECT GeometryType(centerlines) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT AsText(boundary) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT SRID(boundary) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT IsEmpty(centerline) + FROM road_segments + WHERE name = 'Route 5' + AND aliases = 'Main Street'; + + SELECT AsText(Envelope(boundary)) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT X(position) + FROM bridges + WHERE name = 'Cam Bridge'; + + SELECT Y(position) + FROM bridges + WHERE name = 'Cam Bridge'; + + SELECT AsText(StartPoint(centerline)) + FROM road_segments + WHERE fid = 102; + + SELECT AsText(EndPoint(centerline)) + FROM road_segments + WHERE fid = 102; + + SELECT GLength(centerline) + FROM road_segments + WHERE fid = 106; + + SELECT NumPoints(centerline) + FROM road_segments + WHERE fid = 102; + + SELECT AsText(PointN(centerline, 1)) + FROM road_segments + WHERE fid = 102; + + SELECT AsText(Centroid(boundary)) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT Area(boundary) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT AsText(ExteriorRing(shore)) + FROM lakes + WHERE name = 'Blue Lake'; + + SELECT NumInteriorRings(shore) + FROM lakes + WHERE name = 'Blue Lake'; + + SELECT AsText(InteriorRingN(shore, 1)) + FROM lakes + WHERE name = 'Blue Lake'; + + SELECT NumGeometries(centerlines) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT AsText(GeometryN(centerlines, 2)) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT IsClosed(centerlines) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT GLength(centerlines) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT AsText(Centroid(shores)) + FROM ponds + WHERE fid = 120; + + SELECT Area(shores) + FROM ponds + WHERE fid = 120; + + SELECT ST_Equals(boundary, + PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT ST_Disjoint(centerlines, boundary) + FROM divided_routes, named_places + WHERE divided_routes.name = 'Route 75' + AND named_places.name = 'Ashton'; + + SELECT ST_Touches(centerline, shore) + FROM streams, lakes + WHERE streams.name = 'Cam Stream' + AND lakes.name = 'Blue Lake'; + + SELECT Crosses(road_segments.centerline, divided_routes.centerlines) + FROM road_segments, divided_routes + WHERE road_segments.fid = 102 + AND divided_routes.name = 'Route 75'; + + SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) + FROM road_segments, divided_routes + WHERE road_segments.fid = 102 + AND divided_routes.name = 'Route 75'; + + SELECT ST_Contains(forests.boundary, named_places.boundary) + FROM forests, named_places + WHERE forests.name = 'Green Forest' + AND named_places.name = 'Ashton'; + + SELECT ST_Distance(position, boundary) + FROM bridges, named_places + WHERE bridges.name = 'Cam Bridge' + AND named_places.name = 'Ashton'; + + SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) + FROM named_places, forests + WHERE named_places.name = 'Ashton' + AND forests.name = 'Green Forest'; + + SELECT AsText(ST_Union(shore, boundary)) + FROM lakes, named_places + WHERE lakes.name = 'Blue Lake' + AND named_places.name = 'Goose Island'; + + SELECT AsText(ST_SymDifference(shore, boundary)) + FROM lakes, named_places + WHERE lakes.name = 'Blue Lake' + AND named_places.name = 'Ashton'; + + SELECT count(*) + FROM buildings, bridges + WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; + +} + +DROP DATABASE gis_ogs; +USE test; + + diff --git a/mysql-test/suite/storage_engine/type_spatial.result b/mysql-test/suite/storage_engine/type_spatial.result new file mode 100644 index 00000000000..c6b856ab8b0 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial.result @@ -0,0 +1,700 @@ +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP DATABASE IF EXISTS gis_ogs; +CREATE DATABASE gis_ogs; +CREATE TABLE gis_point (fid <INT_COLUMN>, g POINT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE gis_ogs; +CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +shore POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerline LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerlines MULTILINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +centerline LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT, +footprint POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +type CHAR(64) <CUSTOM_COL_OPTIONS>, +shores MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +neatline POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE test; +SHOW FIELDS FROM gis_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g point YES NULL +SHOW FIELDS FROM gis_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g linestring YES NULL +SHOW FIELDS FROM gis_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g polygon YES NULL +SHOW FIELDS FROM gis_multi_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipoint YES NULL +SHOW FIELDS FROM gis_multi_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multilinestring YES NULL +SHOW FIELDS FROM gis_multi_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipolygon YES NULL +SHOW FIELDS FROM gis_geometrycollection; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometrycollection YES NULL +SHOW FIELDS FROM gis_geometry; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometry YES NULL +INSERT INTO gis_point VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +INSERT INTO gis_line VALUES +(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +INSERT INTO gis_polygon VALUES +(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +INSERT INTO gis_multi_point VALUES +(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +INSERT INTO gis_multi_line VALUES +(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +INSERT INTO gis_multi_polygon VALUES +(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +INSERT INTO gis_geometrycollection VALUES +(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +(122, GeomFromText('GeometryCollection()')), +(123, GeomFromText('GeometryCollection EMPTY')); +INSERT into gis_geometry SELECT * FROM gis_point; +INSERT into gis_geometry SELECT * FROM gis_line; +INSERT into gis_geometry SELECT * FROM gis_polygon; +INSERT into gis_geometry SELECT * FROM gis_multi_point; +INSERT into gis_geometry SELECT * FROM gis_multi_line; +INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +SELECT fid, AsText(g) FROM gis_point; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +SELECT fid, AsText(g) FROM gis_line; +fid AsText(g) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +SELECT fid, AsText(g) FROM gis_polygon; +fid AsText(g) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +SELECT fid, AsText(g) FROM gis_multi_point; +fid AsText(g) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +SELECT fid, AsText(g) FROM gis_multi_line; +fid AsText(g) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +SELECT fid, AsText(g) FROM gis_multi_polygon; +fid AsText(g) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +SELECT fid, AsText(g) FROM gis_geometrycollection; +fid AsText(g) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, AsText(g) FROM gis_geometry; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, Dimension(g) FROM gis_geometry; +fid Dimension(g) +101 0 +102 0 +103 0 +104 0 +105 1 +106 1 +107 1 +108 2 +109 2 +110 2 +111 0 +112 0 +113 0 +114 1 +115 1 +116 1 +117 2 +118 2 +119 2 +120 1 +121 1 +122 0 +123 0 +SELECT fid, GeometryType(g) FROM gis_geometry; +fid GeometryType(g) +101 POINT +102 POINT +103 POINT +104 POINT +105 LINESTRING +106 LINESTRING +107 LINESTRING +108 POLYGON +109 POLYGON +110 POLYGON +111 MULTIPOINT +112 MULTIPOINT +113 MULTIPOINT +114 MULTILINESTRING +115 MULTILINESTRING +116 MULTILINESTRING +117 MULTIPOLYGON +118 MULTIPOLYGON +119 MULTIPOLYGON +120 GEOMETRYCOLLECTION +121 GEOMETRYCOLLECTION +122 GEOMETRYCOLLECTION +123 GEOMETRYCOLLECTION +SELECT fid, IsEmpty(g) FROM gis_geometry; +fid IsEmpty(g) +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +fid AsText(Envelope(g)) +101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, X(g) FROM gis_point; +fid X(g) +101 10 +102 20 +103 20 +104 10 +SELECT fid, Y(g) FROM gis_point; +fid Y(g) +101 10 +102 10 +103 20 +104 20 +SELECT fid, AsText(StartPoint(g)) FROM gis_line; +fid AsText(StartPoint(g)) +105 POINT(0 0) +106 POINT(10 10) +107 POINT(10 10) +SELECT fid, AsText(EndPoint(g)) FROM gis_line; +fid AsText(EndPoint(g)) +105 POINT(10 0) +106 POINT(10 10) +107 POINT(40 10) +SELECT fid, GLength(g) FROM gis_line; +fid GLength(g) +105 24.14213562373095 +106 40 +107 30 +SELECT fid, NumPoints(g) FROM gis_line; +fid NumPoints(g) +105 3 +106 5 +107 2 +SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +fid AsText(PointN(g, 2)) +105 POINT(0 10) +106 POINT(20 10) +107 POINT(40 10) +SELECT fid, IsClosed(g) FROM gis_line; +fid IsClosed(g) +105 0 +106 1 +107 0 +SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +fid AsText(Centroid(g)) +108 POINT(15 15) +109 POINT(25.416666666666668 25.416666666666668) +110 POINT(20 10) +SELECT fid, Area(g) FROM gis_polygon; +fid Area(g) +108 100 +109 2400 +110 450 +SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +fid AsText(ExteriorRing(g)) +108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +110 LINESTRING(0 0,30 0,30 30,0 0) +SELECT fid, NumInteriorRings(g) FROM gis_polygon; +fid NumInteriorRings(g) +108 0 +109 1 +110 0 +SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +fid AsText(InteriorRingN(g, 1)) +108 NULL +109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +110 NULL +SELECT fid, IsClosed(g) FROM gis_multi_line; +fid IsClosed(g) +114 0 +115 0 +116 0 +SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +fid AsText(Centroid(g)) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) +119 POINT(2 2) +SELECT fid, Area(g) FROM gis_multi_polygon; +fid Area(g) +117 1684.5 +118 1684.5 +119 4.5 +SELECT fid, NumGeometries(g) from gis_multi_point; +fid NumGeometries(g) +111 4 +112 4 +113 2 +SELECT fid, NumGeometries(g) from gis_multi_line; +fid NumGeometries(g) +114 2 +115 1 +116 2 +SELECT fid, NumGeometries(g) from gis_multi_polygon; +fid NumGeometries(g) +117 2 +118 2 +119 1 +SELECT fid, NumGeometries(g) from gis_geometrycollection; +fid NumGeometries(g) +120 2 +121 2 +122 0 +123 0 +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +fid AsText(GeometryN(g, 2)) +111 POINT(10 10) +112 POINT(11 11) +113 POINT(4 10) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +fid AsText(GeometryN(g, 2)) +114 LINESTRING(16 0,16 23,16 48) +115 NULL +116 LINESTRING(2 5,5 8,21 7) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +fid AsText(GeometryN(g, 2)) +117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +119 NULL +SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +fid AsText(GeometryN(g, 2)) +120 LINESTRING(0 0,10 10) +121 LINESTRING(3 6,7 9) +122 NULL +123 NULL +SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +fid AsText(GeometryN(g, 1)) +120 POINT(0 0) +121 POINT(44 6) +122 NULL +123 NULL +SELECT g1.fid as first, g2.fid as second, +Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +first second w c o e d t i r +120 120 1 1 0 1 0 1 1 0 +120 121 0 0 1 0 0 0 1 0 +120 122 0 1 NULL 0 NULL 0 NULL 0 +120 123 0 1 NULL 0 NULL 0 NULL 0 +121 120 0 0 1 0 0 0 1 0 +121 121 1 1 0 1 0 1 1 0 +121 122 0 1 NULL 0 NULL 0 NULL 0 +121 123 0 1 NULL 0 NULL 0 NULL 0 +122 120 1 0 NULL 0 NULL 0 NULL 0 +122 121 1 0 NULL 0 NULL 0 NULL 0 +122 122 1 1 NULL 1 NULL 0 NULL 0 +122 123 1 1 NULL 1 NULL 0 NULL 0 +123 120 1 0 NULL 0 NULL 0 NULL 0 +123 121 1 0 NULL 0 NULL 0 NULL 0 +123 122 1 1 NULL 1 NULL 0 NULL 0 +123 123 1 1 NULL 1 NULL 0 NULL 0 +DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +USE gis_ogs; +# Lakes +INSERT INTO lakes VALUES ( +101, 'BLUE LAKE', +PolyFromText( +'POLYGON( + (52 18,66 23,73 9,48 6,52 18), + (59 18,67 18,67 13,59 13,59 18) + )', +101)); +# Road Segments +INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +LineFromText( +'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 70 38, 72 48 )' ,101)); +INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +LineFromText( +'LINESTRING( 70 38, 84 42 )' ,101)); +INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +1, +LineFromText( +'LINESTRING( 28 26, 28 0 )',101)); +# DividedRoutes +INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +MLineFromText( +'MULTILINESTRING((10 48,10 21,10 0), + (16 0,16 23,16 48))', 101)); +# Forests +INSERT INTO forests VALUES(109, 'Green Forest', +MPolyFromText( +'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), + (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +101)); +# Bridges +INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +'POINT( 44 31 )', 101)); +# Streams +INSERT INTO streams VALUES(111, 'Cam Stream', +LineFromText( +'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +INSERT INTO streams VALUES(112, NULL, +LineFromText( +'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +# Buildings +INSERT INTO buildings VALUES(113, '123 Main Street', +PointFromText( +'POINT( 52 30 )', 101), +PolyFromText( +'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +INSERT INTO buildings VALUES(114, '215 Main Street', +PointFromText( +'POINT( 64 33 )', 101), +PolyFromText( +'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +# Ponds +INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +MPolyFromText( +'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), + ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +# Named Places +INSERT INTO named_places VALUES(117, 'Ashton', +PolyFromText( +'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +INSERT INTO named_places VALUES(118, 'Goose Island', +PolyFromText( +'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +# Map Neatlines +INSERT INTO map_neatlines VALUES(115, +PolyFromText( +'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +SELECT Dimension(shore) +FROM lakes +WHERE name = 'Blue Lake'; +Dimension(shore) +2 +SELECT GeometryType(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GeometryType(centerlines) +MULTILINESTRING +SELECT AsText(boundary) +FROM named_places +WHERE name = 'Goose Island'; +AsText(boundary) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(PolyFromWKB(AsBinary(boundary),101)) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT SRID(boundary) +FROM named_places +WHERE name = 'Goose Island'; +SRID(boundary) +101 +SELECT IsEmpty(centerline) +FROM road_segments +WHERE name = 'Route 5' +AND aliases = 'Main Street'; +IsEmpty(centerline) +0 +SELECT AsText(Envelope(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Envelope(boundary)) +POLYGON((59 13,67 13,67 18,59 18,59 13)) +SELECT X(position) +FROM bridges +WHERE name = 'Cam Bridge'; +X(position) +44 +SELECT Y(position) +FROM bridges +WHERE name = 'Cam Bridge'; +Y(position) +31 +SELECT AsText(StartPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(StartPoint(centerline)) +POINT(0 18) +SELECT AsText(EndPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(EndPoint(centerline)) +POINT(44 31) +SELECT GLength(centerline) +FROM road_segments +WHERE fid = 106; +GLength(centerline) +26 +SELECT NumPoints(centerline) +FROM road_segments +WHERE fid = 102; +NumPoints(centerline) +5 +SELECT AsText(PointN(centerline, 1)) +FROM road_segments +WHERE fid = 102; +AsText(PointN(centerline, 1)) +POINT(0 18) +SELECT AsText(Centroid(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Centroid(boundary)) +POINT(63 15.5) +SELECT Area(boundary) +FROM named_places +WHERE name = 'Goose Island'; +Area(boundary) +40 +SELECT AsText(ExteriorRing(shore)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(ExteriorRing(shore)) +LINESTRING(52 18,66 23,73 9,48 6,52 18) +SELECT NumInteriorRings(shore) +FROM lakes +WHERE name = 'Blue Lake'; +NumInteriorRings(shore) +1 +SELECT AsText(InteriorRingN(shore, 1)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(InteriorRingN(shore, 1)) +LINESTRING(59 18,67 18,67 13,59 13,59 18) +SELECT NumGeometries(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +NumGeometries(centerlines) +2 +SELECT AsText(GeometryN(centerlines, 2)) +FROM divided_routes +WHERE name = 'Route 75'; +AsText(GeometryN(centerlines, 2)) +LINESTRING(16 0,16 23,16 48) +SELECT IsClosed(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +IsClosed(centerlines) +0 +SELECT GLength(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GLength(centerlines) +96 +SELECT AsText(Centroid(shores)) +FROM ponds +WHERE fid = 120; +AsText(Centroid(shores)) +POINT(25 42) +SELECT Area(shores) +FROM ponds +WHERE fid = 120; +Area(shores) +8 +SELECT ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +FROM named_places +WHERE name = 'Goose Island'; +ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +1 +SELECT ST_Disjoint(centerlines, boundary) +FROM divided_routes, named_places +WHERE divided_routes.name = 'Route 75' +AND named_places.name = 'Ashton'; +ST_Disjoint(centerlines, boundary) +1 +SELECT ST_Touches(centerline, shore) +FROM streams, lakes +WHERE streams.name = 'Cam Stream' +AND lakes.name = 'Blue Lake'; +ST_Touches(centerline, shore) +1 +SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +Crosses(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +ST_Intersects(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Contains(forests.boundary, named_places.boundary) +FROM forests, named_places +WHERE forests.name = 'Green Forest' +AND named_places.name = 'Ashton'; +ST_Contains(forests.boundary, named_places.boundary) +0 +SELECT ST_Distance(position, boundary) +FROM bridges, named_places +WHERE bridges.name = 'Cam Bridge' +AND named_places.name = 'Ashton'; +ST_Distance(position, boundary) +12 +SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +FROM named_places, forests +WHERE named_places.name = 'Ashton' +AND forests.name = 'Green Forest'; +AsText(ST_Difference(named_places.boundary, forests.boundary)) +POLYGON((56 34,62 48,84 48,84 42,56 34)) +SELECT AsText(ST_Union(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Goose Island'; +AsText(ST_Union(shore, boundary)) +POLYGON((48 6,52 18,66 23,73 9,48 6)) +SELECT AsText(ST_SymDifference(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Ashton'; +AsText(ST_SymDifference(shore, boundary)) +MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +SELECT count(*) +FROM buildings, bridges +WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +count(*) +1 +DROP DATABASE gis_ogs; +USE test; diff --git a/mysql-test/suite/storage_engine/type_spatial.test b/mysql-test/suite/storage_engine/type_spatial.test new file mode 100644 index 00000000000..e71805c5516 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial.test @@ -0,0 +1,10 @@ +# +# Spatial objects +# + +--source have_engine.inc + +--source type_spatial.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_spatial_indexes.result b/mysql-test/suite/storage_engine/type_spatial_indexes.result new file mode 100644 index 00000000000..a3c2a4d4e75 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial_indexes.result @@ -0,0 +1,1400 @@ +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP DATABASE IF EXISTS gis_ogs; +CREATE DATABASE gis_ogs; +CREATE TABLE gis_point (fid <INT_COLUMN>, g POINT, <CUSTOM_INDEX> g(g(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING, <CUSTOM_INDEX> g(g(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON, <CUSTOM_INDEX> g(g(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT, <CUSTOM_INDEX> g(g(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING, <CUSTOM_INDEX> g(g(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE gis_ogs; +CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +shore POLYGON, <CUSTOM_INDEX> s(shore(64))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerline LINESTRING, <CUSTOM_INDEX> c(centerline(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerlines MULTILINESTRING, <CUSTOM_INDEX> c(centerlines(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary MULTIPOLYGON, <CUSTOM_INDEX> b(boundary(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT, <CUSTOM_INDEX> p(`position`(64))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +centerline LINESTRING, <CUSTOM_INDEX> c(centerline(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT, +footprint POLYGON, <CUSTOM_INDEX> p(`position`(64)), <CUSTOM_INDEX> f(footprint(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +type CHAR(64) <CUSTOM_COL_OPTIONS>, +shores MULTIPOLYGON, <CUSTOM_INDEX> s(shores(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary POLYGON, <CUSTOM_INDEX> b(boundary(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +neatline POLYGON, <CUSTOM_INDEX> n(neatline(700))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE test; +SHOW FIELDS FROM gis_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g point YES MUL NULL +SHOW FIELDS FROM gis_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g linestring YES MUL NULL +SHOW FIELDS FROM gis_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g polygon YES MUL NULL +SHOW FIELDS FROM gis_multi_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipoint YES MUL NULL +SHOW FIELDS FROM gis_multi_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multilinestring YES MUL NULL +SHOW FIELDS FROM gis_multi_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipolygon YES NULL +SHOW FIELDS FROM gis_geometrycollection; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometrycollection YES NULL +SHOW FIELDS FROM gis_geometry; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometry YES NULL +INSERT INTO gis_point VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +INSERT INTO gis_line VALUES +(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +INSERT INTO gis_polygon VALUES +(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +INSERT INTO gis_multi_point VALUES +(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +INSERT INTO gis_multi_line VALUES +(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +INSERT INTO gis_multi_polygon VALUES +(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +INSERT INTO gis_geometrycollection VALUES +(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +(122, GeomFromText('GeometryCollection()')), +(123, GeomFromText('GeometryCollection EMPTY')); +INSERT into gis_geometry SELECT * FROM gis_point; +INSERT into gis_geometry SELECT * FROM gis_line; +INSERT into gis_geometry SELECT * FROM gis_polygon; +INSERT into gis_geometry SELECT * FROM gis_multi_point; +INSERT into gis_geometry SELECT * FROM gis_multi_line; +INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +SELECT fid, AsText(g) FROM gis_point; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +SELECT fid, AsText(g) FROM gis_line; +fid AsText(g) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +SELECT fid, AsText(g) FROM gis_polygon; +fid AsText(g) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +SELECT fid, AsText(g) FROM gis_multi_point; +fid AsText(g) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +SELECT fid, AsText(g) FROM gis_multi_line; +fid AsText(g) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +SELECT fid, AsText(g) FROM gis_multi_polygon; +fid AsText(g) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +SELECT fid, AsText(g) FROM gis_geometrycollection; +fid AsText(g) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, AsText(g) FROM gis_geometry; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, Dimension(g) FROM gis_geometry; +fid Dimension(g) +101 0 +102 0 +103 0 +104 0 +105 1 +106 1 +107 1 +108 2 +109 2 +110 2 +111 0 +112 0 +113 0 +114 1 +115 1 +116 1 +117 2 +118 2 +119 2 +120 1 +121 1 +122 0 +123 0 +SELECT fid, GeometryType(g) FROM gis_geometry; +fid GeometryType(g) +101 POINT +102 POINT +103 POINT +104 POINT +105 LINESTRING +106 LINESTRING +107 LINESTRING +108 POLYGON +109 POLYGON +110 POLYGON +111 MULTIPOINT +112 MULTIPOINT +113 MULTIPOINT +114 MULTILINESTRING +115 MULTILINESTRING +116 MULTILINESTRING +117 MULTIPOLYGON +118 MULTIPOLYGON +119 MULTIPOLYGON +120 GEOMETRYCOLLECTION +121 GEOMETRYCOLLECTION +122 GEOMETRYCOLLECTION +123 GEOMETRYCOLLECTION +SELECT fid, IsEmpty(g) FROM gis_geometry; +fid IsEmpty(g) +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +fid AsText(Envelope(g)) +101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, X(g) FROM gis_point; +fid X(g) +101 10 +102 20 +103 20 +104 10 +SELECT fid, Y(g) FROM gis_point; +fid Y(g) +101 10 +102 10 +103 20 +104 20 +SELECT fid, AsText(StartPoint(g)) FROM gis_line; +fid AsText(StartPoint(g)) +105 POINT(0 0) +106 POINT(10 10) +107 POINT(10 10) +SELECT fid, AsText(EndPoint(g)) FROM gis_line; +fid AsText(EndPoint(g)) +105 POINT(10 0) +106 POINT(10 10) +107 POINT(40 10) +SELECT fid, GLength(g) FROM gis_line; +fid GLength(g) +105 24.14213562373095 +106 40 +107 30 +SELECT fid, NumPoints(g) FROM gis_line; +fid NumPoints(g) +105 3 +106 5 +107 2 +SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +fid AsText(PointN(g, 2)) +105 POINT(0 10) +106 POINT(20 10) +107 POINT(40 10) +SELECT fid, IsClosed(g) FROM gis_line; +fid IsClosed(g) +105 0 +106 1 +107 0 +SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +fid AsText(Centroid(g)) +108 POINT(15 15) +109 POINT(25.416666666666668 25.416666666666668) +110 POINT(20 10) +SELECT fid, Area(g) FROM gis_polygon; +fid Area(g) +108 100 +109 2400 +110 450 +SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +fid AsText(ExteriorRing(g)) +108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +110 LINESTRING(0 0,30 0,30 30,0 0) +SELECT fid, NumInteriorRings(g) FROM gis_polygon; +fid NumInteriorRings(g) +108 0 +109 1 +110 0 +SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +fid AsText(InteriorRingN(g, 1)) +108 NULL +109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +110 NULL +SELECT fid, IsClosed(g) FROM gis_multi_line; +fid IsClosed(g) +114 0 +115 0 +116 0 +SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +fid AsText(Centroid(g)) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) +119 POINT(2 2) +SELECT fid, Area(g) FROM gis_multi_polygon; +fid Area(g) +117 1684.5 +118 1684.5 +119 4.5 +SELECT fid, NumGeometries(g) from gis_multi_point; +fid NumGeometries(g) +111 4 +112 4 +113 2 +SELECT fid, NumGeometries(g) from gis_multi_line; +fid NumGeometries(g) +114 2 +115 1 +116 2 +SELECT fid, NumGeometries(g) from gis_multi_polygon; +fid NumGeometries(g) +117 2 +118 2 +119 1 +SELECT fid, NumGeometries(g) from gis_geometrycollection; +fid NumGeometries(g) +120 2 +121 2 +122 0 +123 0 +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +fid AsText(GeometryN(g, 2)) +111 POINT(10 10) +112 POINT(11 11) +113 POINT(4 10) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +fid AsText(GeometryN(g, 2)) +114 LINESTRING(16 0,16 23,16 48) +115 NULL +116 LINESTRING(2 5,5 8,21 7) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +fid AsText(GeometryN(g, 2)) +117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +119 NULL +SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +fid AsText(GeometryN(g, 2)) +120 LINESTRING(0 0,10 10) +121 LINESTRING(3 6,7 9) +122 NULL +123 NULL +SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +fid AsText(GeometryN(g, 1)) +120 POINT(0 0) +121 POINT(44 6) +122 NULL +123 NULL +SELECT g1.fid as first, g2.fid as second, +Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +first second w c o e d t i r +120 120 1 1 0 1 0 1 1 0 +120 121 0 0 1 0 0 0 1 0 +120 122 0 1 NULL 0 NULL 0 NULL 0 +120 123 0 1 NULL 0 NULL 0 NULL 0 +121 120 0 0 1 0 0 0 1 0 +121 121 1 1 0 1 0 1 1 0 +121 122 0 1 NULL 0 NULL 0 NULL 0 +121 123 0 1 NULL 0 NULL 0 NULL 0 +122 120 1 0 NULL 0 NULL 0 NULL 0 +122 121 1 0 NULL 0 NULL 0 NULL 0 +122 122 1 1 NULL 1 NULL 0 NULL 0 +122 123 1 1 NULL 1 NULL 0 NULL 0 +123 120 1 0 NULL 0 NULL 0 NULL 0 +123 121 1 0 NULL 0 NULL 0 NULL 0 +123 122 1 1 NULL 1 NULL 0 NULL 0 +123 123 1 1 NULL 1 NULL 0 NULL 0 +DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +USE gis_ogs; +# Lakes +INSERT INTO lakes VALUES ( +101, 'BLUE LAKE', +PolyFromText( +'POLYGON( + (52 18,66 23,73 9,48 6,52 18), + (59 18,67 18,67 13,59 13,59 18) + )', +101)); +# Road Segments +INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +LineFromText( +'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 70 38, 72 48 )' ,101)); +INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +LineFromText( +'LINESTRING( 70 38, 84 42 )' ,101)); +INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +1, +LineFromText( +'LINESTRING( 28 26, 28 0 )',101)); +# DividedRoutes +INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +MLineFromText( +'MULTILINESTRING((10 48,10 21,10 0), + (16 0,16 23,16 48))', 101)); +# Forests +INSERT INTO forests VALUES(109, 'Green Forest', +MPolyFromText( +'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), + (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +101)); +# Bridges +INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +'POINT( 44 31 )', 101)); +# Streams +INSERT INTO streams VALUES(111, 'Cam Stream', +LineFromText( +'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +INSERT INTO streams VALUES(112, NULL, +LineFromText( +'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +# Buildings +INSERT INTO buildings VALUES(113, '123 Main Street', +PointFromText( +'POINT( 52 30 )', 101), +PolyFromText( +'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +INSERT INTO buildings VALUES(114, '215 Main Street', +PointFromText( +'POINT( 64 33 )', 101), +PolyFromText( +'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +# Ponds +INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +MPolyFromText( +'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), + ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +# Named Places +INSERT INTO named_places VALUES(117, 'Ashton', +PolyFromText( +'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +INSERT INTO named_places VALUES(118, 'Goose Island', +PolyFromText( +'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +# Map Neatlines +INSERT INTO map_neatlines VALUES(115, +PolyFromText( +'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +SELECT Dimension(shore) +FROM lakes +WHERE name = 'Blue Lake'; +Dimension(shore) +2 +SELECT GeometryType(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GeometryType(centerlines) +MULTILINESTRING +SELECT AsText(boundary) +FROM named_places +WHERE name = 'Goose Island'; +AsText(boundary) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(PolyFromWKB(AsBinary(boundary),101)) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT SRID(boundary) +FROM named_places +WHERE name = 'Goose Island'; +SRID(boundary) +101 +SELECT IsEmpty(centerline) +FROM road_segments +WHERE name = 'Route 5' +AND aliases = 'Main Street'; +IsEmpty(centerline) +0 +SELECT AsText(Envelope(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Envelope(boundary)) +POLYGON((59 13,67 13,67 18,59 18,59 13)) +SELECT X(position) +FROM bridges +WHERE name = 'Cam Bridge'; +X(position) +44 +SELECT Y(position) +FROM bridges +WHERE name = 'Cam Bridge'; +Y(position) +31 +SELECT AsText(StartPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(StartPoint(centerline)) +POINT(0 18) +SELECT AsText(EndPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(EndPoint(centerline)) +POINT(44 31) +SELECT GLength(centerline) +FROM road_segments +WHERE fid = 106; +GLength(centerline) +26 +SELECT NumPoints(centerline) +FROM road_segments +WHERE fid = 102; +NumPoints(centerline) +5 +SELECT AsText(PointN(centerline, 1)) +FROM road_segments +WHERE fid = 102; +AsText(PointN(centerline, 1)) +POINT(0 18) +SELECT AsText(Centroid(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Centroid(boundary)) +POINT(63 15.5) +SELECT Area(boundary) +FROM named_places +WHERE name = 'Goose Island'; +Area(boundary) +40 +SELECT AsText(ExteriorRing(shore)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(ExteriorRing(shore)) +LINESTRING(52 18,66 23,73 9,48 6,52 18) +SELECT NumInteriorRings(shore) +FROM lakes +WHERE name = 'Blue Lake'; +NumInteriorRings(shore) +1 +SELECT AsText(InteriorRingN(shore, 1)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(InteriorRingN(shore, 1)) +LINESTRING(59 18,67 18,67 13,59 13,59 18) +SELECT NumGeometries(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +NumGeometries(centerlines) +2 +SELECT AsText(GeometryN(centerlines, 2)) +FROM divided_routes +WHERE name = 'Route 75'; +AsText(GeometryN(centerlines, 2)) +LINESTRING(16 0,16 23,16 48) +SELECT IsClosed(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +IsClosed(centerlines) +0 +SELECT GLength(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GLength(centerlines) +96 +SELECT AsText(Centroid(shores)) +FROM ponds +WHERE fid = 120; +AsText(Centroid(shores)) +POINT(25 42) +SELECT Area(shores) +FROM ponds +WHERE fid = 120; +Area(shores) +8 +SELECT ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +FROM named_places +WHERE name = 'Goose Island'; +ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +1 +SELECT ST_Disjoint(centerlines, boundary) +FROM divided_routes, named_places +WHERE divided_routes.name = 'Route 75' +AND named_places.name = 'Ashton'; +ST_Disjoint(centerlines, boundary) +1 +SELECT ST_Touches(centerline, shore) +FROM streams, lakes +WHERE streams.name = 'Cam Stream' +AND lakes.name = 'Blue Lake'; +ST_Touches(centerline, shore) +1 +SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +Crosses(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +ST_Intersects(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Contains(forests.boundary, named_places.boundary) +FROM forests, named_places +WHERE forests.name = 'Green Forest' +AND named_places.name = 'Ashton'; +ST_Contains(forests.boundary, named_places.boundary) +0 +SELECT ST_Distance(position, boundary) +FROM bridges, named_places +WHERE bridges.name = 'Cam Bridge' +AND named_places.name = 'Ashton'; +ST_Distance(position, boundary) +12 +SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +FROM named_places, forests +WHERE named_places.name = 'Ashton' +AND forests.name = 'Green Forest'; +AsText(ST_Difference(named_places.boundary, forests.boundary)) +POLYGON((56 34,62 48,84 48,84 42,56 34)) +SELECT AsText(ST_Union(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Goose Island'; +AsText(ST_Union(shore, boundary)) +POLYGON((48 6,52 18,66 23,73 9,48 6)) +SELECT AsText(ST_SymDifference(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Ashton'; +AsText(ST_SymDifference(shore, boundary)) +MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +SELECT count(*) +FROM buildings, bridges +WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +count(*) +1 +DROP DATABASE gis_ogs; +USE test; +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP DATABASE IF EXISTS gis_ogs; +CREATE DATABASE gis_ogs; +CREATE TABLE gis_point (fid <INT_COLUMN>, g POINT NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE gis_ogs; +CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +shore POLYGON NOT NULL, SPATIAL INDEX s(shore)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerlines MULTILINESTRING NOT NULL, SPATIAL INDEX c(centerlines)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary MULTIPOLYGON NOT NULL, SPATIAL INDEX b(boundary)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT NOT NULL, SPATIAL INDEX p(position)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT NOT NULL, +footprint POLYGON NOT NULL, SPATIAL INDEX p(position), SPATIAL INDEX f(footprint)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +type CHAR(64) <CUSTOM_COL_OPTIONS>, +shores MULTIPOLYGON NOT NULL, SPATIAL INDEX s(shores)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary POLYGON NOT NULL, SPATIAL INDEX b(boundary)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +neatline POLYGON NOT NULL, SPATIAL INDEX n(neatline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE test; +SHOW FIELDS FROM gis_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g point NO MUL NULL +SHOW FIELDS FROM gis_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g linestring NO MUL NULL +SHOW FIELDS FROM gis_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g polygon NO MUL NULL +SHOW FIELDS FROM gis_multi_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipoint NO MUL NULL +SHOW FIELDS FROM gis_multi_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multilinestring NO MUL NULL +SHOW FIELDS FROM gis_multi_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipolygon NO MUL NULL +SHOW FIELDS FROM gis_geometrycollection; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometrycollection NO MUL NULL +SHOW FIELDS FROM gis_geometry; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometry NO NULL +INSERT INTO gis_point VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +INSERT INTO gis_line VALUES +(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +INSERT INTO gis_polygon VALUES +(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +INSERT INTO gis_multi_point VALUES +(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +INSERT INTO gis_multi_line VALUES +(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +INSERT INTO gis_multi_polygon VALUES +(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +INSERT INTO gis_geometrycollection VALUES +(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +(122, GeomFromText('GeometryCollection()')), +(123, GeomFromText('GeometryCollection EMPTY')); +INSERT into gis_geometry SELECT * FROM gis_point; +INSERT into gis_geometry SELECT * FROM gis_line; +INSERT into gis_geometry SELECT * FROM gis_polygon; +INSERT into gis_geometry SELECT * FROM gis_multi_point; +INSERT into gis_geometry SELECT * FROM gis_multi_line; +INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +SELECT fid, AsText(g) FROM gis_point; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +SELECT fid, AsText(g) FROM gis_line; +fid AsText(g) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +SELECT fid, AsText(g) FROM gis_polygon; +fid AsText(g) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +SELECT fid, AsText(g) FROM gis_multi_point; +fid AsText(g) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +SELECT fid, AsText(g) FROM gis_multi_line; +fid AsText(g) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +SELECT fid, AsText(g) FROM gis_multi_polygon; +fid AsText(g) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +SELECT fid, AsText(g) FROM gis_geometrycollection; +fid AsText(g) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, AsText(g) FROM gis_geometry; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, Dimension(g) FROM gis_geometry; +fid Dimension(g) +101 0 +102 0 +103 0 +104 0 +105 1 +106 1 +107 1 +108 2 +109 2 +110 2 +111 0 +112 0 +113 0 +114 1 +115 1 +116 1 +117 2 +118 2 +119 2 +120 1 +121 1 +122 0 +123 0 +SELECT fid, GeometryType(g) FROM gis_geometry; +fid GeometryType(g) +101 POINT +102 POINT +103 POINT +104 POINT +105 LINESTRING +106 LINESTRING +107 LINESTRING +108 POLYGON +109 POLYGON +110 POLYGON +111 MULTIPOINT +112 MULTIPOINT +113 MULTIPOINT +114 MULTILINESTRING +115 MULTILINESTRING +116 MULTILINESTRING +117 MULTIPOLYGON +118 MULTIPOLYGON +119 MULTIPOLYGON +120 GEOMETRYCOLLECTION +121 GEOMETRYCOLLECTION +122 GEOMETRYCOLLECTION +123 GEOMETRYCOLLECTION +SELECT fid, IsEmpty(g) FROM gis_geometry; +fid IsEmpty(g) +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +fid AsText(Envelope(g)) +101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, X(g) FROM gis_point; +fid X(g) +101 10 +102 20 +103 20 +104 10 +SELECT fid, Y(g) FROM gis_point; +fid Y(g) +101 10 +102 10 +103 20 +104 20 +SELECT fid, AsText(StartPoint(g)) FROM gis_line; +fid AsText(StartPoint(g)) +105 POINT(0 0) +106 POINT(10 10) +107 POINT(10 10) +SELECT fid, AsText(EndPoint(g)) FROM gis_line; +fid AsText(EndPoint(g)) +105 POINT(10 0) +106 POINT(10 10) +107 POINT(40 10) +SELECT fid, GLength(g) FROM gis_line; +fid GLength(g) +105 24.14213562373095 +106 40 +107 30 +SELECT fid, NumPoints(g) FROM gis_line; +fid NumPoints(g) +105 3 +106 5 +107 2 +SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +fid AsText(PointN(g, 2)) +105 POINT(0 10) +106 POINT(20 10) +107 POINT(40 10) +SELECT fid, IsClosed(g) FROM gis_line; +fid IsClosed(g) +105 0 +106 1 +107 0 +SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +fid AsText(Centroid(g)) +108 POINT(15 15) +109 POINT(25.416666666666668 25.416666666666668) +110 POINT(20 10) +SELECT fid, Area(g) FROM gis_polygon; +fid Area(g) +108 100 +109 2400 +110 450 +SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +fid AsText(ExteriorRing(g)) +108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +110 LINESTRING(0 0,30 0,30 30,0 0) +SELECT fid, NumInteriorRings(g) FROM gis_polygon; +fid NumInteriorRings(g) +108 0 +109 1 +110 0 +SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +fid AsText(InteriorRingN(g, 1)) +108 NULL +109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +110 NULL +SELECT fid, IsClosed(g) FROM gis_multi_line; +fid IsClosed(g) +114 0 +115 0 +116 0 +SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +fid AsText(Centroid(g)) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) +119 POINT(2 2) +SELECT fid, Area(g) FROM gis_multi_polygon; +fid Area(g) +117 1684.5 +118 1684.5 +119 4.5 +SELECT fid, NumGeometries(g) from gis_multi_point; +fid NumGeometries(g) +111 4 +112 4 +113 2 +SELECT fid, NumGeometries(g) from gis_multi_line; +fid NumGeometries(g) +114 2 +115 1 +116 2 +SELECT fid, NumGeometries(g) from gis_multi_polygon; +fid NumGeometries(g) +117 2 +118 2 +119 1 +SELECT fid, NumGeometries(g) from gis_geometrycollection; +fid NumGeometries(g) +120 2 +121 2 +122 0 +123 0 +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +fid AsText(GeometryN(g, 2)) +111 POINT(10 10) +112 POINT(11 11) +113 POINT(4 10) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +fid AsText(GeometryN(g, 2)) +114 LINESTRING(16 0,16 23,16 48) +115 NULL +116 LINESTRING(2 5,5 8,21 7) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +fid AsText(GeometryN(g, 2)) +117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +119 NULL +SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +fid AsText(GeometryN(g, 2)) +120 LINESTRING(0 0,10 10) +121 LINESTRING(3 6,7 9) +122 NULL +123 NULL +SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +fid AsText(GeometryN(g, 1)) +120 POINT(0 0) +121 POINT(44 6) +122 NULL +123 NULL +SELECT g1.fid as first, g2.fid as second, +Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +first second w c o e d t i r +120 120 1 1 0 1 0 1 1 0 +120 121 0 0 1 0 0 0 1 0 +120 122 0 1 NULL 0 NULL 0 NULL 0 +120 123 0 1 NULL 0 NULL 0 NULL 0 +121 120 0 0 1 0 0 0 1 0 +121 121 1 1 0 1 0 1 1 0 +121 122 0 1 NULL 0 NULL 0 NULL 0 +121 123 0 1 NULL 0 NULL 0 NULL 0 +122 120 1 0 NULL 0 NULL 0 NULL 0 +122 121 1 0 NULL 0 NULL 0 NULL 0 +122 122 1 1 NULL 1 NULL 0 NULL 0 +122 123 1 1 NULL 1 NULL 0 NULL 0 +123 120 1 0 NULL 0 NULL 0 NULL 0 +123 121 1 0 NULL 0 NULL 0 NULL 0 +123 122 1 1 NULL 1 NULL 0 NULL 0 +123 123 1 1 NULL 1 NULL 0 NULL 0 +DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +USE gis_ogs; +# Lakes +INSERT INTO lakes VALUES ( +101, 'BLUE LAKE', +PolyFromText( +'POLYGON( + (52 18,66 23,73 9,48 6,52 18), + (59 18,67 18,67 13,59 13,59 18) + )', +101)); +# Road Segments +INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +LineFromText( +'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 70 38, 72 48 )' ,101)); +INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +LineFromText( +'LINESTRING( 70 38, 84 42 )' ,101)); +INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +1, +LineFromText( +'LINESTRING( 28 26, 28 0 )',101)); +# DividedRoutes +INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +MLineFromText( +'MULTILINESTRING((10 48,10 21,10 0), + (16 0,16 23,16 48))', 101)); +# Forests +INSERT INTO forests VALUES(109, 'Green Forest', +MPolyFromText( +'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), + (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +101)); +# Bridges +INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +'POINT( 44 31 )', 101)); +# Streams +INSERT INTO streams VALUES(111, 'Cam Stream', +LineFromText( +'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +INSERT INTO streams VALUES(112, NULL, +LineFromText( +'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +# Buildings +INSERT INTO buildings VALUES(113, '123 Main Street', +PointFromText( +'POINT( 52 30 )', 101), +PolyFromText( +'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +INSERT INTO buildings VALUES(114, '215 Main Street', +PointFromText( +'POINT( 64 33 )', 101), +PolyFromText( +'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +# Ponds +INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +MPolyFromText( +'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), + ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +# Named Places +INSERT INTO named_places VALUES(117, 'Ashton', +PolyFromText( +'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +INSERT INTO named_places VALUES(118, 'Goose Island', +PolyFromText( +'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +# Map Neatlines +INSERT INTO map_neatlines VALUES(115, +PolyFromText( +'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +SELECT Dimension(shore) +FROM lakes +WHERE name = 'Blue Lake'; +Dimension(shore) +2 +SELECT GeometryType(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GeometryType(centerlines) +MULTILINESTRING +SELECT AsText(boundary) +FROM named_places +WHERE name = 'Goose Island'; +AsText(boundary) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(PolyFromWKB(AsBinary(boundary),101)) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT SRID(boundary) +FROM named_places +WHERE name = 'Goose Island'; +SRID(boundary) +101 +SELECT IsEmpty(centerline) +FROM road_segments +WHERE name = 'Route 5' +AND aliases = 'Main Street'; +IsEmpty(centerline) +0 +SELECT AsText(Envelope(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Envelope(boundary)) +POLYGON((59 13,67 13,67 18,59 18,59 13)) +SELECT X(position) +FROM bridges +WHERE name = 'Cam Bridge'; +X(position) +44 +SELECT Y(position) +FROM bridges +WHERE name = 'Cam Bridge'; +Y(position) +31 +SELECT AsText(StartPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(StartPoint(centerline)) +POINT(0 18) +SELECT AsText(EndPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(EndPoint(centerline)) +POINT(44 31) +SELECT GLength(centerline) +FROM road_segments +WHERE fid = 106; +GLength(centerline) +26 +SELECT NumPoints(centerline) +FROM road_segments +WHERE fid = 102; +NumPoints(centerline) +5 +SELECT AsText(PointN(centerline, 1)) +FROM road_segments +WHERE fid = 102; +AsText(PointN(centerline, 1)) +POINT(0 18) +SELECT AsText(Centroid(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Centroid(boundary)) +POINT(63 15.5) +SELECT Area(boundary) +FROM named_places +WHERE name = 'Goose Island'; +Area(boundary) +40 +SELECT AsText(ExteriorRing(shore)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(ExteriorRing(shore)) +LINESTRING(52 18,66 23,73 9,48 6,52 18) +SELECT NumInteriorRings(shore) +FROM lakes +WHERE name = 'Blue Lake'; +NumInteriorRings(shore) +1 +SELECT AsText(InteriorRingN(shore, 1)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(InteriorRingN(shore, 1)) +LINESTRING(59 18,67 18,67 13,59 13,59 18) +SELECT NumGeometries(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +NumGeometries(centerlines) +2 +SELECT AsText(GeometryN(centerlines, 2)) +FROM divided_routes +WHERE name = 'Route 75'; +AsText(GeometryN(centerlines, 2)) +LINESTRING(16 0,16 23,16 48) +SELECT IsClosed(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +IsClosed(centerlines) +0 +SELECT GLength(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GLength(centerlines) +96 +SELECT AsText(Centroid(shores)) +FROM ponds +WHERE fid = 120; +AsText(Centroid(shores)) +POINT(25 42) +SELECT Area(shores) +FROM ponds +WHERE fid = 120; +Area(shores) +8 +SELECT ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +FROM named_places +WHERE name = 'Goose Island'; +ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +1 +SELECT ST_Disjoint(centerlines, boundary) +FROM divided_routes, named_places +WHERE divided_routes.name = 'Route 75' +AND named_places.name = 'Ashton'; +ST_Disjoint(centerlines, boundary) +1 +SELECT ST_Touches(centerline, shore) +FROM streams, lakes +WHERE streams.name = 'Cam Stream' +AND lakes.name = 'Blue Lake'; +ST_Touches(centerline, shore) +1 +SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +Crosses(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +ST_Intersects(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Contains(forests.boundary, named_places.boundary) +FROM forests, named_places +WHERE forests.name = 'Green Forest' +AND named_places.name = 'Ashton'; +ST_Contains(forests.boundary, named_places.boundary) +0 +SELECT ST_Distance(position, boundary) +FROM bridges, named_places +WHERE bridges.name = 'Cam Bridge' +AND named_places.name = 'Ashton'; +ST_Distance(position, boundary) +12 +SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +FROM named_places, forests +WHERE named_places.name = 'Ashton' +AND forests.name = 'Green Forest'; +AsText(ST_Difference(named_places.boundary, forests.boundary)) +POLYGON((56 34,62 48,84 48,84 42,56 34)) +SELECT AsText(ST_Union(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Goose Island'; +AsText(ST_Union(shore, boundary)) +POLYGON((48 6,52 18,66 23,73 9,48 6)) +SELECT AsText(ST_SymDifference(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Ashton'; +AsText(ST_SymDifference(shore, boundary)) +MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +SELECT count(*) +FROM buildings, bridges +WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +count(*) +1 +DROP DATABASE gis_ogs; +USE test; diff --git a/mysql-test/suite/storage_engine/type_spatial_indexes.test b/mysql-test/suite/storage_engine/type_spatial_indexes.test new file mode 100644 index 00000000000..ae9fc592a3a --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial_indexes.test @@ -0,0 +1,15 @@ +# +# Indexes on spatial objects +# (spatial and non-spatial indexes) +# + +--source have_engine.inc + +--let $index = $default_index +--source type_spatial.inc + +let $index = SPATIAL; +--source type_spatial.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_text.inc b/mysql-test/suite/storage_engine/type_text.inc new file mode 100644 index 00000000000..0f31e91c776 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text.inc @@ -0,0 +1,65 @@ +# +# TEXT column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + t TEXT $col_opts, + t0 TEXT(0) $col_opts, + t1 TEXT(1) $col_opts, + t300 TEXT(300) $col_opts, + tm TEXT(65535) $col_opts, + t70k TEXT(70000) $col_opts, + t17m TEXT(17000000) $col_opts, + tt TINYTEXT $col_opts, + m MEDIUMTEXT $col_opts, + l LONGTEXT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Valid values + # (cannot get MAX for all columns due to max_allowed_packet limitations) + + INSERT INTO t1 VALUES + ('','','','','','','','','',''), + ('a','b','c','d','e','f','g','h','i','j'), + ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), + ( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) ); + + --sorted_result + SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; + + # Invalid values (produce warnings, except for mediumtext and longtext columns for which the values are within limits) + + INSERT INTO t1 VALUES + ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); + + --sorted_result + SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $alter_definition = ADD COLUMN ttt TEXT(4294967296) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_DISPLAYWIDTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/type_text.result b/mysql-test/suite/storage_engine/type_text.result new file mode 100644 index 00000000000..b3ca7a8d9da --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text.result @@ -0,0 +1,54 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +t0 TEXT(0) <CUSTOM_COL_OPTIONS>, +t1 TEXT(1) <CUSTOM_COL_OPTIONS>, +t300 TEXT(300) <CUSTOM_COL_OPTIONS>, +tm TEXT(65535) <CUSTOM_COL_OPTIONS>, +t70k TEXT(70000) <CUSTOM_COL_OPTIONS>, +t17m TEXT(17000000) <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t text # # # +t0 text # # # +t1 tinytext # # # +t300 text # # # +tm text # # # +t70k mediumtext # # # +t17m longtext # # # +tt tinytext # # # +m mediumtext # # # +l longtext # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) ); +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1265 Data truncated for column 't0' at row 1 +Warning 1265 Data truncated for column 't1' at row 1 +Warning 1265 Data truncated for column 't300' at row 1 +Warning 1265 Data truncated for column 'tm' at row 1 +Warning 1265 Data truncated for column 'tt' at row 1 +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296); +ERROR 42000: Display width out of range for 'ttt' (max = 4294967295) +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_text.test b/mysql-test/suite/storage_engine/type_text.test new file mode 100644 index 00000000000..63e710195d2 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text.test @@ -0,0 +1,10 @@ +# +# TEXT column types +# + +--source have_engine.inc + +--source type_text.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_text_indexes.result b/mysql-test/suite/storage_engine/type_text_indexes.result new file mode 100644 index 00000000000..a23373e2c0d --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text_indexes.result @@ -0,0 +1,137 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> t (t(32)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 t # # 32 NULL # # +INSERT INTO t1 (t,tt,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; +f + + +DROP TABLE t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS>, +PRIMARY KEY t (t(32)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 t # # 32 NULL # # +INSERT INTO t1 (t,tt,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; +f + + +EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f; +f + + +DROP TABLE t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX l_tt (l(256),tt(64)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 l_tt 1 l # # 256 NULL # # +t1 0 l_tt 2 tt # # 64 NULL # # +INSERT INTO t1 (t,tt,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # l_tt # # # # # +SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; +SUBSTRING(tt,64) SUBSTRING(l,256) + +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + + +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + + + +EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # l_tt l_tt # # # # +SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; +SUBSTRING(tt,64) SUBSTRING(l,256) + +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + + +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + + + +DROP TABLE t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS>, +INDEX (m(128)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 m 1 m # # 128 NULL # # +INSERT INTO t1 (t,tt,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # m # # # # +SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; +f +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_text_indexes.test b/mysql-test/suite/storage_engine/type_text_indexes.test new file mode 100644 index 00000000000..091717f5a9e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text_indexes.test @@ -0,0 +1,175 @@ +# +# TEXT columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as configured in define_engine + +let $create_definition = + t TEXT $col_indexed_opts, + tt TINYTEXT $col_opts, + m MEDIUMTEXT $col_opts, + l LONGTEXT $col_opts, + $default_index t (t(32)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types or indexes on them + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (t,tt,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; + + DROP TABLE t1; +} + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + t TEXT $col_indexed_opts, + tt TINYTEXT $col_opts, + m MEDIUMTEXT $col_opts, + l LONGTEXT $col_opts, + PRIMARY KEY t (t(32)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (t,tt,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f; + DROP TABLE t1; +} + +let $create_definition = + t TEXT $col_opts, + tt TINYTEXT $col_indexed_opts, + m MEDIUMTEXT $col_opts, + l LONGTEXT $col_indexed_opts, + UNIQUE INDEX l_tt (l(256),tt(64)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (t,tt,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + # Here we are getting possible key l_t, but not the final key + --replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; + SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; + + --replace_column 1 # 2 # 3 # 4 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; + SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; + DROP TABLE t1; +} + +let $create_definition = + t TEXT $col_opts, + tt TINYTEXT $col_opts, + m MEDIUMTEXT $col_indexed_opts, + l LONGTEXT $col_opts, + INDEX (m(128)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (t,tt,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; + SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_varbinary.inc b/mysql-test/suite/storage_engine/type_varbinary.inc new file mode 100644 index 00000000000..5801f228567 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varbinary.inc @@ -0,0 +1,101 @@ +# +# VARBINARY column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +let $create_definition = + v0 VARBINARY(0) $col_opts, + v1 VARBINARY(1) $col_opts, + v64 VARBINARY(64) $col_opts, + v65000 VARBINARY(65000) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = VARBINARY types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + --let $create_definition = v VARBINARY(65532) $col_opts + --let $table_name = t2 + --source create_table.inc + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t2; + + # Valid values + + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); + + --sorted_result + SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1; + + # Invalid values + + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); + INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; + + --sorted_result + SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; + + --let $alter_definition = ADD COLUMN v65536 VARBINARY(65536) $col_opts + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE or BLOB types + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + } + + DROP TABLE t1, t2; +} + + diff --git a/mysql-test/suite/storage_engine/type_varbinary.result b/mysql-test/suite/storage_engine/type_varbinary.result new file mode 100644 index 00000000000..309de3fe387 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varbinary.result @@ -0,0 +1,92 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARBINARY(0) <CUSTOM_COL_OPTIONS>, +v1 VARBINARY(1) <CUSTOM_COL_OPTIONS>, +v64 VARBINARY(64) <CUSTOM_COL_OPTIONS>, +v65000 VARBINARY(65000) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +CREATE TABLE t2 (v VARBINARY(65532) <CUSTOM_COL_OPTIONS>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varbinary(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1; +HEX(v0) HEX(v1) HEX(v64) HEX(v65000) + + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020202020202020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204D7953514C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A0A2020202020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A2020202020202020202020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569646520666F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696320756E6465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20 +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; +HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) + 0 + 0 + 48 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E20576527766520 5932 + 61 61626364656667686920616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364 130000 + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 5930 + 79 63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 130000 +ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) <CUSTOM_COL_OPTIONS>; +Warnings: +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +v65536 mediumblob # # # +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/type_varbinary.test b/mysql-test/suite/storage_engine/type_varbinary.test new file mode 100644 index 00000000000..65240995522 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varbinary.test @@ -0,0 +1,10 @@ +# +# VARBINARY column types +# + +--source have_engine.inc + +--source type_varbinary.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_varchar.inc b/mysql-test/suite/storage_engine/type_varchar.inc new file mode 100644 index 00000000000..472f74e0dd1 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varchar.inc @@ -0,0 +1,100 @@ +# +# VARCHAR column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +let $create_definition = + v0 VARCHAR(0) $col_opts, + v1 VARCHAR(1) $col_opts, + v64 VARCHAR(64) $col_opts, + v65000 VARCHAR(65000) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + --let $table_name = t2 + --let $create_definition = v VARCHAR(65532) $col_opts + --source create_table.inc + + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t2; + + # Valid values + + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); + + --sorted_result + SELECT * FROM t1; + + # Invalid values + + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); + INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; + + --sorted_result + SELECT v0, v1, v64, LENGTH(v65000) FROM t1; + + --let $alter_definition = ADD COLUMN v65536 VARCHAR(65536) $col_opts + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE or TEXT types + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + } + DROP TABLE t1, t2; +} + diff --git a/mysql-test/suite/storage_engine/type_varchar.result b/mysql-test/suite/storage_engine/type_varchar.result new file mode 100644 index 00000000000..055c8dcd7ca --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varchar.result @@ -0,0 +1,127 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARCHAR(0) <CUSTOM_COL_OPTIONS>, +v1 VARCHAR(1) <CUSTOM_COL_OPTIONS>, +v64 VARCHAR(64) <CUSTOM_COL_OPTIONS>, +v65000 VARCHAR(65000) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +CREATE TABLE t2 (v VARCHAR(65532) <CUSTOM_COL_OPTIONS>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varchar(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT * FROM t1; +v0 v1 v64 v65000 + + + + + + + + + + + + y Once there, double check that an article doesn't already exist Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) + o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Free to read in the Knowledgebase! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + o The 'default' book to read if you wont to learn to use MySQL / MariaDB. + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + * MariaDB Crash Course by Ben Forta + * MySQL (4th Edition) by Paul DuBois + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + * MySQL Admin Cookbook + * MySQL Cookbook by Paul DuBois + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + For MariaDB / MySQL end users + For developers who want to code on MariaDB or MySQL + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT v0, v1, v64, LENGTH(v65000) FROM t1; +v0 v1 v64 LENGTH(v65000) + 0 + 0 + H Here is a list of recommended books on MariaDB and MySQL. We've 2966 + a abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcd 65000 + y Once there, double check that an article doesn't already exist 2965 + y cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 65000 +ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) <CUSTOM_COL_OPTIONS>; +Warnings: +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +v65536 mediumtext # # # +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/type_varchar.test b/mysql-test/suite/storage_engine/type_varchar.test new file mode 100644 index 00000000000..8f7c5e72a72 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varchar.test @@ -0,0 +1,10 @@ +# +# VARCHAR column types +# + +--source have_engine.inc + +--source type_varchar.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/unexpected_result.inc b/mysql-test/suite/storage_engine/unexpected_result.inc new file mode 100644 index 00000000000..2552988dddc --- /dev/null +++ b/mysql-test/suite/storage_engine/unexpected_result.inc @@ -0,0 +1,50 @@ +# +# This include file prints a standard message about possibly unsupported functionality +# when a statement finished not as expected. +# Usage: +# --let $functionality = Foreign keys # optional +# --let $my_last_stmt = INSERT INTO t VALUES (1) # optional + +--let $versions = + +if (!$functionality) +{ + --let $functionality = Functionality +} +if ($mysql_errname) +{ + --let $result = finished with $mysql_errname + if ($mysql_errname == ER_SYNTAX_ERROR) + { + --let $functionality = $functionality or the syntax + } + if ($mysql_errname == ER_ILLEGAL_HA) + { + --let $functionality = $functionality or the syntax + --let $versions = unsupported + } +} +if (!$mysql_errname) +{ + --let $result = succeeded unexpectedly +} +if (!$versions) +{ + --let $versions = unsupported|malfunctioning, or the problem was caused by previous errors +} + +--echo # ------------ UNEXPECTED RESULT ------------ +if ($my_last_stmt) +{ + --echo # [ $my_last_stmt ] +} +--echo # The statement|command $result. +--echo # $functionality or the mix could be $versions. +--echo # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +--echo # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +--echo # Also, this problem may cause a chain effect (more errors of different kinds in the test). +--echo # ------------------------------------------- + +--let $my_last_stmt = +--let $functionality = + diff --git a/mysql-test/suite/storage_engine/update.result b/mysql-test/suite/storage_engine/update.result new file mode 100644 index 00000000000..3b96558c7c5 --- /dev/null +++ b/mysql-test/suite/storage_engine/update.result @@ -0,0 +1,50 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +UPDATE t1 SET a=a+100; +SELECT * FROM t1; +a b +101 a +101 a +10100 foobar +10100 foobar +102 b +102 b +103 c +103 c +104 d +104 d +105 e +105 e +UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100; +SELECT * FROM t1; +a b +1 NULL +1 NULL +10000 NULL +10000 NULL +2 NULL +2 NULL +3 NULL +3 NULL +4 NULL +4 NULL +5 NULL +5 NULL +UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1; +SELECT * FROM t1; +a b +1 NULL +1 update +10000 NULL +10000 NULL +2 NULL +2 NULL +3 NULL +3 NULL +4 NULL +4 NULL +5 NULL +5 NULL +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/update.test b/mysql-test/suite/storage_engine/update.test new file mode 100644 index 00000000000..4f892fa547d --- /dev/null +++ b/mysql-test/suite/storage_engine/update.test @@ -0,0 +1,43 @@ +# +# Basic UPDATE statements. +# UPDATE LOW_PRIORITY is covered in update_low_prio test +# UPDATE IGNORE is covered in update_ignore test +# Multi-table update is covered in update_multi test +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +UPDATE t1 SET a=a+100; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --sorted_result + SELECT * FROM t1; + + UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100; + --sorted_result + SELECT * FROM t1; + + # ORDER BY and LIMIT + UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1; + --sorted_result + SELECT * FROM t1; +} + +# Cleanup +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/update_ignore.result b/mysql-test/suite/storage_engine/update_ignore.result new file mode 100644 index 00000000000..26b7168196a --- /dev/null +++ b/mysql-test/suite/storage_engine/update_ignore.result @@ -0,0 +1,54 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +UPDATE IGNORE t1 SET b = 'upd1' WHERE b IS NOT NULL ORDER BY a LIMIT 1; +SELECT * FROM t1; +a b +1 a +1 upd1 +10000 foobar +10000 foobar +2 b +2 b +3 c +3 c +4 d +4 d +5 e +5 e +UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b' +WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); +Warnings: +Warning 1242 Subquery returns more than 1 row +SELECT * FROM t1; +a b +1 a +1 upd2a +10000 upd2a +10000 upd2a +2 upd2a +2 upd2a +3 upd2a +3 upd2a +4 upd2a +4 upd2a +5 upd2a +5 upd2a +SELECT * FROM t2; +c d +upd2b 1 +upd2b 1 +upd2b 10000 +upd2b 10000 +upd2b 2 +upd2b 2 +upd2b 3 +upd2b 3 +upd2b 4 +upd2b 4 +upd2b 5 +upd2b 5 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/update_ignore.test b/mysql-test/suite/storage_engine/update_ignore.test new file mode 100644 index 00000000000..ddd4f7405a3 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_ignore.test @@ -0,0 +1,43 @@ +# +# UPDATE IGNORE +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +--let $table_name = t2 +--let $create_definition = c $char_col, d $int_col +--source create_table.inc +INSERT INTO t2 (c,d) SELECT b, a FROM t1; + +UPDATE IGNORE t1 SET b = 'upd1' WHERE b IS NOT NULL ORDER BY a LIMIT 1; +if ($mysql_errname) +{ + --let $functionality = UPDATE IGNORE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --sorted_result + SELECT * FROM t1; + + UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b' + WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); + --sorted_result + SELECT * FROM t1; + --sorted_result + SELECT * FROM t2; +} + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/update_low_prio.result b/mysql-test/suite/storage_engine/update_low_prio.result new file mode 100644 index 00000000000..31a31b6be62 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_low_prio.result @@ -0,0 +1,66 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (11,'foobar'),(12,'b'); +SET LOW_PRIORITY_UPDATES = 0; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 2; +SELECT a+SLEEP(1) FROM t1; +connection default; +UPDATE t1 SET a=a+10; +connect con2,localhost,root,,; +SET lock_wait_timeout = 3; +SELECT a+SLEEP(1) FROM t1; +a+SLEEP(1) +21 +22 +connection con1; +a+SLEEP(1) +11 +12 +connection default; +SELECT * FROM t1; +a b +21 foobar +22 b +connection con1; +SELECT a+SLEEP(1) FROM t1; +connection default; +UPDATE LOW_PRIORITY t1 SET a=a+20; +connection con2; +SELECT a+SLEEP(1) FROM t1; +a+SLEEP(1) +21 +22 +connection con1; +a+SLEEP(1) +21 +22 +connection default; +SELECT * FROM t1; +a b +41 foobar +42 b +SET LOW_PRIORITY_UPDATES = 1; +connection con1; +SELECT a+SLEEP(1) FROM t1; +connection default; +UPDATE t1 SET a=a+30; +connection con2; +SELECT a+SLEEP(1) FROM t1; +a+SLEEP(1) +41 +42 +connection con1; +a+SLEEP(1) +41 +42 +connection default; +SELECT * FROM t1; +a b +71 foobar +72 b +disconnect con1; +disconnect con2; +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/update_low_prio.test b/mysql-test/suite/storage_engine/update_low_prio.test new file mode 100644 index 00000000000..6c089c7172f --- /dev/null +++ b/mysql-test/suite/storage_engine/update_low_prio.test @@ -0,0 +1,167 @@ +# +# UPDATE LOW_PRIORITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (11,'foobar'),(12,'b'); + +# We will have 3 connections: +# con1 will start SELECT which should give us enough time; +# default will run UPDATE +# con2 will then start another SELECT. +# With LOW_PRIORITY_UPDATES = 0, +# with standard UPDATE we should see old data in con1 resultset, +# but new data in con2 resultset. +# With UPDATE LOW_PRIORITY we should see old data in both resultsets. +# Then we will set LOW_PRIORITY_UPDATES to 1. +# Then with standard UPDATE we should also see old data in both resultsets. + +SET LOW_PRIORITY_UPDATES = 0; +SET lock_wait_timeout = 4; + +# Normal UPDATE with low_priority_updates=0 + +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 2; +--send +SELECT a+SLEEP(1) FROM t1; + +--connection default +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = = 'User sleep'; +# We don't need to wait long, +# if the feature works, threads +# should show up in the processlist right away +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +UPDATE t1 SET a=a+10; + +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 3; +let $field = Info; +let $condition = = 'UPDATE t1 SET a=a+10'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = Table locking + --source unexpected_result.inc +} +--sorted_result +SELECT a+SLEEP(1) FROM t1; + +--connection con1 +--sorted_result +--reap + +--connection default +--reap +if ($mysql_errname) +{ + --let $my_last_stmt = UPDATE t1 SET a=a+10 + --let $functionality = UPDATE + --source unexpected_result.inc +} + +--sorted_result +SELECT * FROM t1; + +# UPDATE LOW_PRIORITY + +--connection con1 +--send +SELECT a+SLEEP(1) FROM t1; + +--connection default +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +UPDATE LOW_PRIORITY t1 SET a=a+20; + +--connection con2 +let $field = Info; +let $condition = = 'UPDATE LOW_PRIORITY t1 SET a=a+20'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--sorted_result +SELECT a+SLEEP(1) FROM t1; + +--connection con1 +--sorted_result +--reap + +--connection default +--reap +--sorted_result +SELECT * FROM t1; + +SET LOW_PRIORITY_UPDATES = 1; + +# Normal UPDATE with low_priority_updates=1 + +--connection con1 +--send +SELECT a+SLEEP(1) FROM t1; + +--connection default +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +UPDATE t1 SET a=a+30; + +--connection con2 +let $field = Info; +let $condition = = 'UPDATE t1 SET a=a+30'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = Table locking + --source unexpected_result.inc +} +--sorted_result +SELECT a+SLEEP(1) FROM t1; + +--connection con1 +--sorted_result +--reap + +--connection default +--reap +if ($mysql_errname) +{ + --let $my_last_stmt = UPDATE t1 SET a=a+30 + --let $functionality = UPDATE + --source unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--disconnect con2 + +--connection default +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/update_multi.result b/mysql-test/suite/storage_engine/update_multi.result new file mode 100644 index 00000000000..42b2f239dd2 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_multi.result @@ -0,0 +1,65 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +UPDATE t1, t2 SET t1.a = t2.d+100, t2.c = 'multi' WHERE c < b AND a + d != 1; +SELECT * FROM t1; +a b +1 a +1 a +101 b +101 b +101 c +101 c +101 d +101 d +101 e +101 e +101 foobar +101 foobar +SELECT * FROM t2; +c d +foobar 10000 +foobar 10000 +multi 1 +multi 1 +multi 2 +multi 2 +multi 3 +multi 3 +multi 4 +multi 4 +multi 5 +multi 5 +UPDATE t2, t1 SET t2.d = DEFAULT WHERE c = 'foobar' and b = c; +SELECT * FROM t1; +a b +1 a +1 a +101 b +101 b +101 c +101 c +101 d +101 d +101 e +101 e +101 foobar +101 foobar +SELECT * FROM t2; +c d +foobar NULL +foobar NULL +multi 1 +multi 1 +multi 2 +multi 2 +multi 3 +multi 3 +multi 4 +multi 4 +multi 5 +multi 5 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/update_multi.test b/mysql-test/suite/storage_engine/update_multi.test new file mode 100644 index 00000000000..589a8319382 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_multi.test @@ -0,0 +1,44 @@ +# +# Multi-table UPDATE statements. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +--let $table_name = t2 +--let $create_definition = c $char_col, d $int_col +--source create_table.inc +INSERT INTO t2 (c,d) SELECT b, a FROM t1; + +UPDATE t1, t2 SET t1.a = t2.d+100, t2.c = 'multi' WHERE c < b AND a + d != 1; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --sorted_result + SELECT * FROM t1; + --sorted_result + SELECT * FROM t2; + + UPDATE t2, t1 SET t2.d = DEFAULT WHERE c = 'foobar' and b = c; + --sorted_result + SELECT * FROM t1; + --sorted_result + SELECT * FROM t2; +} + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/update_with_keys.result b/mysql-test/suite/storage_engine/update_with_keys.result new file mode 100644 index 00000000000..8250f31a19e --- /dev/null +++ b/mysql-test/suite/storage_engine/update_with_keys.result @@ -0,0 +1,90 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, INDEX(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); +UPDATE t1 SET a=100, b='f' WHERE b IN ('b','c'); +UPDATE t1 SET b='m' WHERE b = 'f'; +UPDATE t1 SET b='z' WHERE a < 2; +UPDATE t1 SET b=''; +SELECT * FROM t1; +a b +1 +100 +100 +4 +5 +6 +7 +8 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a'); +UPDATE t1 SET a=a+200; +UPDATE t1 SET a=0 WHERE a > 250; +UPDATE t1 SET a=205 WHERE a=200; +ERROR 23000: Duplicate entry '205' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +UPDATE t1 SET a=12345 ORDER BY a, b LIMIT 1; +SELECT * FROM t1; +a b +12345 a +200 f +201 a +202 b +203 c +204 d +205 e +UPDATE t1 SET a=80 WHERE a IN (202,203); +ERROR 23000: Duplicate entry '80' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'a'),(6,'f'); +UPDATE t1 SET a=6 WHERE a=3; +UPDATE t1 SET a=100 WHERE a=1; +ERROR 23000: Duplicate entry '100-a' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +UPDATE t1 SET a=4, b='d' WHERE b='f'; +ERROR 23000: Duplicate entry '4-d' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +UPDATE t1 SET a=a+1; +SELECT * FROM t1; +a b +101 a +2 a +3 b +5 d +6 e +7 c +7 f +UPDATE t1 SET b='z'; +ERROR 23000: Duplicate entry '7-z' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a'); +UPDATE t1 SET a=a+200; +UPDATE t1 SET a=0 WHERE a > 250; +UPDATE t1 SET a=205 WHERE a=200; +ERROR 23000: Duplicate entry '205' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +UPDATE t1 SET a=12345 ORDER BY a DESC, b LIMIT 1; +SELECT * FROM t1; +a b +0 a +12345 e +200 f +201 a +202 b +203 c +204 d +UPDATE t1 SET a=80 WHERE a IN (202,203); +ERROR 23000: Duplicate entry '80' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/update_with_keys.test b/mysql-test/suite/storage_engine/update_with_keys.test new file mode 100644 index 00000000000..578ee3b3294 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_with_keys.test @@ -0,0 +1,152 @@ +# +# UPDATE statements for tables with keys +# +--source have_engine.inc +--source have_default_index.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col, INDEX(b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); + UPDATE t1 SET a=100, b='f' WHERE b IN ('b','c'); + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + UPDATE t1 SET b='m' WHERE b = 'f'; + UPDATE t1 SET b='z' WHERE a < 2; + UPDATE t1 SET b=''; + --sorted_result + SELECT * FROM t1; + } + DROP TABLE t1; +} + +--let $create_definition = a $int_col, b $char_col, UNIQUE INDEX(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a'); + UPDATE t1 SET a=a+200; + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + UPDATE t1 SET a=0 WHERE a > 250; + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=205 WHERE a=200; + --source check_errors.inc + UPDATE t1 SET a=12345 ORDER BY a, b LIMIT 1; + --sorted_result + SELECT * FROM t1; + + # We'll check that the next update causes an error, + # but won't check the result because it might be different depending + # on whether the engine is transactional or not + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=80 WHERE a IN (202,203); + --source check_errors.inc + } + DROP TABLE t1; +} + +--let $create_definition = a $int_col, b $char_col, UNIQUE INDEX(a,b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'a'),(6,'f'); + UPDATE t1 SET a=6 WHERE a=3; + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=100 WHERE a=1; + --source check_errors.inc + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=4, b='d' WHERE b='f'; + --source check_errors.inc + UPDATE t1 SET a=a+1; + --sorted_result + SELECT * FROM t1; + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET b='z'; + --source check_errors.inc + } + DROP TABLE t1; +} + +--let $create_definition = a $int_col PRIMARY KEY, b $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Primary key + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a'); + UPDATE t1 SET a=a+200; + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + UPDATE t1 SET a=0 WHERE a > 250; + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=205 WHERE a=200; + --source check_errors.inc + UPDATE t1 SET a=12345 ORDER BY a DESC, b LIMIT 1; + + --sorted_result + SELECT * FROM t1; + + # We'll check that the next update causes an error, + # but won't check the result because it might be different depending + # on whether the engine is transactional or not + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=80 WHERE a IN (202,203); + --source check_errors.inc + } + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/vcol.result b/mysql-test/suite/storage_engine/vcol.result new file mode 100644 index 00000000000..bae7636f6cb --- /dev/null +++ b/mysql-test/suite/storage_engine/vcol.result @@ -0,0 +1,69 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # # +b int(11) # # VIRTUAL +INSERT INTO t1 (a) VALUES (1),(2); +INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +SELECT * FROM t1; +a b +1 2 +2 3 +3 4 +4 5 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1) PERSISTENT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # # +b int(11) # # PERSISTENT +INSERT INTO t1 (a) VALUES (1),(2); +INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +SELECT * FROM t1; +a b +1 2 +2 3 +3 4 +4 5 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1) VIRTUAL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # # +b int(11) # # VIRTUAL +INSERT INTO t1 (a) VALUES (1),(2); +INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +SELECT * FROM t1; +a b +1 2 +2 3 +3 4 +4 5 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> AS (a+1) PERSISTENT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # # +b int(11) # # PERSISTENT +INSERT INTO t1 (a) VALUES (1),(2); +INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +SELECT * FROM t1; +a b +1 2 +2 3 +3 4 +4 5 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/vcol.test b/mysql-test/suite/storage_engine/vcol.test new file mode 100644 index 00000000000..90819ffbd47 --- /dev/null +++ b/mysql-test/suite/storage_engine/vcol.test @@ -0,0 +1,72 @@ +# +# Virtual columns +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1); +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Virtual columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1),(2); + INSERT INTO t1 (a,b) VALUES (3,3),(4,4); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; + + let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1) PERSISTENT; + --source create_table.inc + + --replace_column 3 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1),(2); + INSERT INTO t1 (a,b) VALUES (3,3),(4,4); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; + + let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1) VIRTUAL; + --source create_table.inc + + --replace_column 3 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1),(2); + INSERT INTO t1 (a,b) VALUES (3,3),(4,4); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; + + let $create_definition = a $int_col, b $int_col AS (a+1) PERSISTENT; + --source create_table.inc + + --replace_column 3 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1),(2); + INSERT INTO t1 (a,b) VALUES (3,3),(4,4); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result index 692545ae0fb..1bd4e394f6a 100644 --- a/mysql-test/suite/sys_vars/r/all_vars.result +++ b/mysql-test/suite/sys_vars/r/all_vars.result @@ -10,6 +10,5 @@ there should be *no* long test name listed below: select distinct variable_name as `there should be *no* variables listed below:` from t2 left join t1 on variable_name=test_name where test_name is null; there should be *no* variables listed below: -expensive_subquery_limit drop table t1; drop table t2; diff --git a/mysql-test/suite/sys_vars/r/default_master_connection_basic.result b/mysql-test/suite/sys_vars/r/default_master_connection_basic.result new file mode 100644 index 00000000000..78425049324 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/default_master_connection_basic.result @@ -0,0 +1,94 @@ +SET @start_session_value = @@session.default_master_connection; +SELECT @start_session_value; +@start_session_value + +SET @@session.default_master_connection = 'bar'; +SET @@session.default_master_connection = DEFAULT; +SELECT @@session.default_master_connection; +@@session.default_master_connection + +SET @@session.default_master_connection = @start_session_value; +SELECT @@session.default_master_connection = ''; +@@session.default_master_connection = '' +1 +SET @@global.default_master_connection = 'master1'; +ERROR HY000: Variable 'default_master_connection' is a SESSION variable and can't be used with SET GLOBAL +SELECT @@global.default_master_connection; +ERROR HY000: Variable 'default_master_connection' is a SESSION variable +SET @@session.default_master_connection = 'master1'; +SELECT @@session.default_master_connection; +@@session.default_master_connection +master1 +SET @@session.default_master_connection = ''; +SELECT @@session.default_master_connection; +@@session.default_master_connection + +SET @@session.default_master_connection = '1234-5678'; +SELECT @@session.default_master_connection; +@@session.default_master_connection +1234-5678 +SET @@session.default_master_connection = '@!*/"'; +SELECT @@session.default_master_connection; +@@session.default_master_connection +@!*/" +SET @@session.default_master_connection = REPEAT('a',191); +SELECT @@session.default_master_connection; +@@session.default_master_connection +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +SET @@session.default_master_connection = master2; +SELECT @@session.default_master_connection; +@@session.default_master_connection +master2 +SET @@session.default_master_connection = 1; +ERROR 42000: Incorrect argument type to variable 'default_master_connection' +SET @@session.default_master_connection = 65530.30; +ERROR 42000: Incorrect argument type to variable 'default_master_connection' +SET @@session.default_master_connection = FALSE; +ERROR 42000: Incorrect argument type to variable 'default_master_connection' +SELECT @@session.default_master_connection; +@@session.default_master_connection +master2 +SET @@session.default_master_connection = REPEAT('a',192); +ERROR 42000: Variable 'default_master_connection' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +SELECT @@session.default_master_connection; +@@session.default_master_connection +master2 +SET @@session.default_master_connection = NULL; +ERROR 42000: Variable 'default_master_connection' can't be set to the value of 'NULL' +SELECT @@session.default_master_connection; +@@session.default_master_connection +master2 +SELECT @@global.default_master_connection = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='default_master_connection'; +ERROR HY000: Variable 'default_master_connection' is a SESSION variable +SELECT @@session.default_master_connection = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='default_master_connection'; +@@session.default_master_connection = VARIABLE_VALUE +1 +SET @@default_master_connection = 'foo'; +SELECT @@default_master_connection = @@local.default_master_connection; +@@default_master_connection = @@local.default_master_connection +1 +SELECT @@local.default_master_connection = @@session.default_master_connection; +@@local.default_master_connection = @@session.default_master_connection +1 +SET default_master_connection = 'foo'; +SELECT @@default_master_connection; +@@default_master_connection +foo +SET local.default_master_connection = 'foo'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default_master_connection = 'foo'' at line 1 +SELECT local.default_master_connection; +ERROR 42S02: Unknown table 'local' in field list +SET session.default_master_connection = 'foo'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default_master_connection = 'foo'' at line 1 +SELECT session.default_master_connection; +ERROR 42S02: Unknown table 'session' in field list +SELECT default_master_connection = @@session.default_master_connection; +ERROR 42S22: Unknown column 'default_master_connection' in 'field list' +SET @@session.default_master_connection = @start_session_value; +SELECT @@session.default_master_connection; +@@session.default_master_connection + diff --git a/mysql-test/suite/sys_vars/r/expensive_subquery_limit_basic.result b/mysql-test/suite/sys_vars/r/expensive_subquery_limit_basic.result new file mode 100644 index 00000000000..1617de21001 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/expensive_subquery_limit_basic.result @@ -0,0 +1,52 @@ +SET @start_global_value = @@global.expensive_subquery_limit; +SELECT @start_global_value; +@start_global_value +100 +select @@global.expensive_subquery_limit; +@@global.expensive_subquery_limit +100 +select @@session.expensive_subquery_limit; +@@session.expensive_subquery_limit +100 +show global variables like 'expensive_subquery_limit'; +Variable_name Value +expensive_subquery_limit 100 +show session variables like 'expensive_subquery_limit'; +Variable_name Value +expensive_subquery_limit 100 +select * from information_schema.global_variables where variable_name='expensive_subquery_limit'; +VARIABLE_NAME VARIABLE_VALUE +EXPENSIVE_SUBQUERY_LIMIT 100 +select * from information_schema.session_variables where variable_name='expensive_subquery_limit'; +VARIABLE_NAME VARIABLE_VALUE +EXPENSIVE_SUBQUERY_LIMIT 100 +set global expensive_subquery_limit=10; +set session expensive_subquery_limit=20; +select @@global.expensive_subquery_limit; +@@global.expensive_subquery_limit +10 +select @@session.expensive_subquery_limit; +@@session.expensive_subquery_limit +20 +show global variables like 'expensive_subquery_limit'; +Variable_name Value +expensive_subquery_limit 10 +show session variables like 'expensive_subquery_limit'; +Variable_name Value +expensive_subquery_limit 20 +select * from information_schema.global_variables where variable_name='expensive_subquery_limit'; +VARIABLE_NAME VARIABLE_VALUE +EXPENSIVE_SUBQUERY_LIMIT 10 +select * from information_schema.session_variables where variable_name='expensive_subquery_limit'; +VARIABLE_NAME VARIABLE_VALUE +EXPENSIVE_SUBQUERY_LIMIT 20 +set global expensive_subquery_limit=1.1; +ERROR 42000: Incorrect argument type to variable 'expensive_subquery_limit' +set global expensive_subquery_limit=1e1; +ERROR 42000: Incorrect argument type to variable 'expensive_subquery_limit' +set global expensive_subquery_limit="foo"; +ERROR 42000: Incorrect argument type to variable 'expensive_subquery_limit' +SET @@global.expensive_subquery_limit = @start_global_value; +SELECT @@global.expensive_subquery_limit; +@@global.expensive_subquery_limit +100 diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result index 441fb4cd362..268d40c1be3 100644 --- a/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result @@ -50,7 +50,7 @@ Warnings: Warning 1292 Truncated incorrect innodb_flush_log_at_trx_commit value: '1001' SELECT @@global.innodb_flush_log_at_trx_commit; @@global.innodb_flush_log_at_trx_commit -2 +3 '#----------------------FN_DYNVARS_046_05------------------------#' SELECT @@global.innodb_flush_log_at_trx_commit = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -60,22 +60,22 @@ VARIABLE_VALUE 1 SELECT @@global.innodb_flush_log_at_trx_commit; @@global.innodb_flush_log_at_trx_commit -2 +3 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_flush_log_at_trx_commit'; VARIABLE_VALUE -2 +3 '#---------------------FN_DYNVARS_046_06-------------------------#' SET @@global.innodb_flush_log_at_trx_commit = OFF; ERROR 42000: Incorrect argument type to variable 'innodb_flush_log_at_trx_commit' SELECT @@global.innodb_flush_log_at_trx_commit; @@global.innodb_flush_log_at_trx_commit -2 +3 SET @@global.innodb_flush_log_at_trx_commit = ON; ERROR 42000: Incorrect argument type to variable 'innodb_flush_log_at_trx_commit' SELECT @@global.innodb_flush_log_at_trx_commit; @@global.innodb_flush_log_at_trx_commit -2 +3 '#---------------------FN_DYNVARS_046_07----------------------#' SET @@global.innodb_flush_log_at_trx_commit = TRUE; SELECT @@global.innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/sys_vars/r/innodb_merge_sort_block_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_merge_sort_block_size_basic.result new file mode 100644 index 00000000000..90c2954e43d --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_merge_sort_block_size_basic.result @@ -0,0 +1,24 @@ +SELECT @@global.innodb_merge_sort_block_size; +@@global.innodb_merge_sort_block_size +1048576 +SELECT @@session.innodb_merge_sort_block_size; +@@session.innodb_merge_sort_block_size +1048576 +SET @old_global=@@global.innodb_merge_sort_block_size; +SET @old_session=@@session.innodb_merge_sort_block_size; +SET @@global.innodb_merge_sort_block_size = 2*1024*1024; +SET @@session.innodb_merge_sort_block_size = 4*1024*1024; +SELECT @@global.innodb_merge_sort_block_size; +@@global.innodb_merge_sort_block_size +2097152 +SELECT @@session.innodb_merge_sort_block_size; +@@session.innodb_merge_sort_block_size +4194304 +SET @@global.innodb_merge_sort_block_size = 1024*1024*1024+1; +Warnings: +Warning 1292 Truncated incorrect innodb_merge_sort_block_size value: '1073741825' +SELECT @@global.innodb_merge_sort_block_size; +@@global.innodb_merge_sort_block_size +1073741824 +SET @@global.innodb_merge_sort_block_size=@old_global; +SET @@session.innodb_merge_sort_block_size=@old_session; diff --git a/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result b/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result index d61e9dd20b0..6025e28ccaa 100644 --- a/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result +++ b/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result @@ -1,7 +1,7 @@ SET @start_value = @@global.max_relay_log_size; SELECT @start_value; @start_value -0 +1073741824 '#--------------------FN_DYNVARS_082_01------------------------#' SET @@global.max_relay_log_size = 5000; Warnings: @@ -9,7 +9,7 @@ Warning 1292 Truncated incorrect max_relay_log_size value: '5000' SET @@global.max_relay_log_size = DEFAULT; SELECT @@global.max_relay_log_size; @@global.max_relay_log_size -0 +1073741824 '#---------------------FN_DYNVARS_082_02-------------------------#' SET @@global.max_relay_log_size = @start_value; SELECT @@global.max_relay_log_size = 1024; @@ -17,15 +17,17 @@ SELECT @@global.max_relay_log_size = 1024; 0 '#--------------------FN_DYNVARS_082_03------------------------#' SET @@global.max_relay_log_size = 0; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '0' SELECT @@global.max_relay_log_size; @@global.max_relay_log_size -0 +4096 SET @@global.max_relay_log_size = 1; Warnings: Warning 1292 Truncated incorrect max_relay_log_size value: '1' SELECT @@global.max_relay_log_size; @@global.max_relay_log_size -0 +4096 SET @@global.max_relay_log_size = 1073741824; SELECT @@global.max_relay_log_size; @@global.max_relay_log_size @@ -48,7 +50,7 @@ Warnings: Warning 1292 Truncated incorrect max_relay_log_size value: '-1' SELECT @@global.max_relay_log_size; @@global.max_relay_log_size -0 +4096 SET @@global.max_relay_log_size = 100000000000; Warnings: Warning 1292 Truncated incorrect max_relay_log_size value: '100000000000' @@ -65,7 +67,7 @@ Warnings: Warning 1292 Truncated incorrect max_relay_log_size value: '-1024' SELECT @@global.max_relay_log_size; @@global.max_relay_log_size -0 +4096 SET @@global.max_relay_log_size = 1073741825; Warnings: Warning 1292 Truncated incorrect max_relay_log_size value: '1073741825' @@ -90,9 +92,9 @@ SELECT @@global.max_relay_log_size; 1073741824 '#-------------------FN_DYNVARS_082_05----------------------------#' SET @@session.max_relay_log_size = 4096; -ERROR HY000: Variable 'max_relay_log_size' is a GLOBAL variable and should be set with SET GLOBAL SELECT @@session.max_relay_log_size; -ERROR HY000: Variable 'max_relay_log_size' is a GLOBAL variable +@@session.max_relay_log_size +4096 '#----------------------FN_DYNVARS_082_06------------------------#' SELECT @@global.max_relay_log_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -110,11 +112,13 @@ Warnings: Warning 1292 Truncated incorrect max_relay_log_size value: '1' SELECT @@global.max_relay_log_size; @@global.max_relay_log_size -0 +4096 SET @@global.max_relay_log_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '0' SELECT @@global.max_relay_log_size; @@global.max_relay_log_size -0 +4096 '#---------------------FN_DYNVARS_082_08----------------------#' SET @@global.max_relay_log_size = 5000; Warnings: @@ -124,7 +128,8 @@ SELECT @@max_relay_log_size = @@global.max_relay_log_size; 1 '#---------------------FN_DYNVARS_082_09----------------------#' SET max_relay_log_size = 6000; -ERROR HY000: Variable 'max_relay_log_size' is a GLOBAL variable and should be set with SET GLOBAL +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '6000' SELECT @@max_relay_log_size; @@max_relay_log_size 4096 @@ -141,4 +146,4 @@ ERROR 42S22: Unknown column 'max_relay_log_size' in 'field list' SET @@global.max_relay_log_size = @start_value; SELECT @@global.max_relay_log_size; @@global.max_relay_log_size -0 +1073741824 diff --git a/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result new file mode 100644 index 00000000000..a5fe9b35ed5 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result @@ -0,0 +1,147 @@ +SET @start_value = @@global.slave_max_allowed_packet; +SELECT @start_value; +@start_value +1073741824 +'#--------------------FN_DYNVARS_072_01------------------------#' +SET @@global.slave_max_allowed_packet = 5000; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '5000' +SET @@global.slave_max_allowed_packet = DEFAULT; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +'#---------------------FN_DYNVARS_072_02-------------------------#' +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet = 1073741824; +@@global.slave_max_allowed_packet = 1073741824 +1 +'Bug# 34876: Incorrect Default Value is assigned to variable'; +'#--------------------FN_DYNVARS_072_03------------------------#' +SET @@global.slave_max_allowed_packet = 1024; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1025; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1025' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 65535; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '65535' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +64512 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_072_04-------------------------#' +SET @@global.slave_max_allowed_packet = -1; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '-1' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 100000000000; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '100000000000' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 10000.01; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = -1024; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '-1024' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 4294967296; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '4294967296' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1023; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1023' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.slave_max_allowed_packet = ON; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 'test'; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'#-------------------FN_DYNVARS_072_05----------------------------#' +SET @@session.slave_max_allowed_packet = 4096; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.slave_max_allowed_packet; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable +'#----------------------FN_DYNVARS_072_06------------------------#' +SELECT @@global.slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; +@@global.slave_max_allowed_packet = VARIABLE_VALUE +1 +SELECT @@slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; +@@slave_max_allowed_packet = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_072_07----------------------#' +SET @@global.slave_max_allowed_packet = TRUE; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = FALSE; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '0' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'#---------------------FN_DYNVARS_072_08----------------------#' +SET @@global.slave_max_allowed_packet = 5000; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '5000' +SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet; +@@slave_max_allowed_packet = @@global.slave_max_allowed_packet +1 +'#---------------------FN_DYNVARS_072_09----------------------#' +SET slave_max_allowed_packet = 6000; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@slave_max_allowed_packet; +@@slave_max_allowed_packet +4096 +SET local.slave_max_allowed_packet = 7000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'slave_max_allowed_packet = 7000' at line 1 +SELECT local.slave_max_allowed_packet; +ERROR 42S02: Unknown table 'local' in field list +SET global.slave_max_allowed_packet = 8000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'slave_max_allowed_packet = 8000' at line 1 +SELECT global.slave_max_allowed_packet; +ERROR 42S02: Unknown table 'global' in field list +SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet; +ERROR 42S22: Unknown column 'slave_max_allowed_packet' in 'field list' +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 diff --git a/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result b/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result index e6d9aff7141..0e1d7af5485 100644 --- a/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result +++ b/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result @@ -35,9 +35,6 @@ VARIABLE_VALUE 1024 '#--------------------FN_DYNVARS_165_03-------------------------#' SET @@sql_slave_skip_counter = 10; -ERROR HY000: Variable 'sql_slave_skip_counter' is a GLOBAL variable and should be set with SET GLOBAL SET @@session.sql_slave_skip_counter = 12; -ERROR HY000: Variable 'sql_slave_skip_counter' is a GLOBAL variable and should be set with SET GLOBAL SET @@local.sql_slave_skip_counter = 13; -ERROR HY000: Variable 'sql_slave_skip_counter' is a GLOBAL variable and should be set with SET GLOBAL SET @@global.sql_slave_skip_counter = 0; diff --git a/mysql-test/suite/sys_vars/t/default_master_connection_basic.test b/mysql-test/suite/sys_vars/t/default_master_connection_basic.test new file mode 100644 index 00000000000..627a236aaa7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/default_master_connection_basic.test @@ -0,0 +1,128 @@ +############## mysql-test\t\default_master_connection_basic.test ############### +# +# Implemented in the scope of MDEV-253 +# The variable is SESSION-only +# + +--source include/not_embedded.inc + +############################################################# +# Save initial value # +############################################################# + +SET @start_session_value = @@session.default_master_connection; +SELECT @start_session_value; + +################################################################### +# Display the DEFAULT value of default_master_connection # +################################################################### + +SET @@session.default_master_connection = 'bar'; +SET @@session.default_master_connection = DEFAULT; +SELECT @@session.default_master_connection; + +################################################################### +# Check the DEFAULT value of default_master_connection # +################################################################### + +SET @@session.default_master_connection = @start_session_value; +SELECT @@session.default_master_connection = ''; + +################################################# +# Check that the GLOBAL scope is not applicable # +################################################# + +--error ER_LOCAL_VARIABLE +SET @@global.default_master_connection = 'master1'; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@global.default_master_connection; + +#################################################################################### +# Change the value of default_master_connection to a valid value for SESSION Scope # +#################################################################################### + +SET @@session.default_master_connection = 'master1'; +SELECT @@session.default_master_connection; +SET @@session.default_master_connection = ''; +SELECT @@session.default_master_connection; +SET @@session.default_master_connection = '1234-5678'; +SELECT @@session.default_master_connection; +SET @@session.default_master_connection = '@!*/"'; +SELECT @@session.default_master_connection; +SET @@session.default_master_connection = REPEAT('a',191); +SELECT @@session.default_master_connection; +SET @@session.default_master_connection = master2; +SELECT @@session.default_master_connection; + + +##################################################################### +# Change the value of default_master_connection to an invalid value # +##################################################################### + +--error ER_WRONG_TYPE_FOR_VAR +SET @@session.default_master_connection = 1; +--error ER_WRONG_TYPE_FOR_VAR +SET @@session.default_master_connection = 65530.30; +--error ER_WRONG_TYPE_FOR_VAR +SET @@session.default_master_connection = FALSE; +SELECT @@session.default_master_connection; +--error ER_WRONG_VALUE_FOR_VAR +SET @@session.default_master_connection = REPEAT('a',192); +SELECT @@session.default_master_connection; +--error ER_WRONG_VALUE_FOR_VAR +SET @@session.default_master_connection = NULL; +SELECT @@session.default_master_connection; + +############################################################################### +# Check if the value in GLOBAL & SESSION Tables matches value in variable # +############################################################################### + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@global.default_master_connection = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='default_master_connection'; + +SELECT @@session.default_master_connection = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='default_master_connection'; + + +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@default_master_connection = 'foo'; +SELECT @@default_master_connection = @@local.default_master_connection; +SELECT @@local.default_master_connection = @@session.default_master_connection; + + +################################################################################### +# Check if default_master_connection can be accessed with and without @@ sign # +################################################################################### + +SET default_master_connection = 'foo'; +SELECT @@default_master_connection; +--Error ER_PARSE_ERROR +SET local.default_master_connection = 'foo'; +--Error ER_UNKNOWN_TABLE +SELECT local.default_master_connection; +--Error ER_PARSE_ERROR +SET session.default_master_connection = 'foo'; +--Error ER_UNKNOWN_TABLE +SELECT session.default_master_connection; +--Error ER_BAD_FIELD_ERROR +SELECT default_master_connection = @@session.default_master_connection; + + +#################################### +# Restore initial value # +#################################### + +SET @@session.default_master_connection = @start_session_value; +SELECT @@session.default_master_connection; + + +############################################################# +# END OF default_master_connection TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/t/expensive_subquery_limit_basic.test b/mysql-test/suite/sys_vars/t/expensive_subquery_limit_basic.test new file mode 100644 index 00000000000..c86433e94f5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/expensive_subquery_limit_basic.test @@ -0,0 +1,38 @@ +SET @start_global_value = @@global.expensive_subquery_limit; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.expensive_subquery_limit; +select @@session.expensive_subquery_limit; +show global variables like 'expensive_subquery_limit'; +show session variables like 'expensive_subquery_limit'; +select * from information_schema.global_variables where variable_name='expensive_subquery_limit'; +select * from information_schema.session_variables where variable_name='expensive_subquery_limit'; + +# +# show that it's writable +# +set global expensive_subquery_limit=10; +set session expensive_subquery_limit=20; +select @@global.expensive_subquery_limit; +select @@session.expensive_subquery_limit; +show global variables like 'expensive_subquery_limit'; +show session variables like 'expensive_subquery_limit'; +select * from information_schema.global_variables where variable_name='expensive_subquery_limit'; +select * from information_schema.session_variables where variable_name='expensive_subquery_limit'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global expensive_subquery_limit=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global expensive_subquery_limit=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global expensive_subquery_limit="foo"; + +SET @@global.expensive_subquery_limit = @start_global_value; +SELECT @@global.expensive_subquery_limit; + diff --git a/mysql-test/suite/sys_vars/t/innodb_merge_sort_block_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_merge_sort_block_size_basic.test new file mode 100644 index 00000000000..2ec4870f345 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_merge_sort_block_size_basic.test @@ -0,0 +1,19 @@ +--source include/have_xtradb.inc + +SELECT @@global.innodb_merge_sort_block_size; +SELECT @@session.innodb_merge_sort_block_size; + +SET @old_global=@@global.innodb_merge_sort_block_size; +SET @old_session=@@session.innodb_merge_sort_block_size; + +SET @@global.innodb_merge_sort_block_size = 2*1024*1024; +SET @@session.innodb_merge_sort_block_size = 4*1024*1024; + +SELECT @@global.innodb_merge_sort_block_size; +SELECT @@session.innodb_merge_sort_block_size; + +SET @@global.innodb_merge_sort_block_size = 1024*1024*1024+1; +SELECT @@global.innodb_merge_sort_block_size; + +SET @@global.innodb_merge_sort_block_size=@old_global; +SET @@session.innodb_merge_sort_block_size=@old_session; diff --git a/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test index e39778baca8..05d0fd1be82 100644 --- a/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test +++ b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test @@ -24,7 +24,7 @@ ############################################################################### --source include/load_sysvars.inc - +--source include/not_embedded.inc ################################################################### # START OF max_relay_log_size TESTS # @@ -105,9 +105,7 @@ SELECT @@global.max_relay_log_size; # Test if accessing session max_relay_log_size gives error # ######################################################################## ---Error ER_GLOBAL_VARIABLE SET @@session.max_relay_log_size = 4096; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR SELECT @@session.max_relay_log_size; @@ -150,7 +148,6 @@ SELECT @@max_relay_log_size = @@global.max_relay_log_size; # Check if max_relay_log_size can be accessed with and without @@ sign # ############################################################################# ---Error ER_GLOBAL_VARIABLE SET max_relay_log_size = 6000; SELECT @@max_relay_log_size; --Error ER_PARSE_ERROR diff --git a/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test b/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test new file mode 100644 index 00000000000..4caaae84906 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test @@ -0,0 +1,177 @@ +############## mysql-test\t\slave_max_allowed_packet_basic.test ################## +# # +# Variable Name: slave_max_allowed_packet # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value:1073741824 # +# Range: 1024 - 1073741824 # +# # +# # +# # +# Description: Test Cases of Dynamic System Variable slave_max_allowed_packet # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF slave_max_allowed_packet TESTS # +######################################################################## + + +########################################################################### +# Saving initial value of slave_max_allowed_packet in a temporary variable# +########################################################################### + +SET @start_value = @@global.slave_max_allowed_packet; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_072_01------------------------#' +######################################################################## +# Display the DEFAULT value of slave_max_allowed_packet # +######################################################################## + +SET @@global.slave_max_allowed_packet = 5000; +SET @@global.slave_max_allowed_packet = DEFAULT; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet = 1073741824; +--echo 'Bug# 34876: Incorrect Default Value is assigned to variable'; + +--echo '#--------------------FN_DYNVARS_072_03------------------------#' +######################################################################## +# Change the value of slave_max_allowed_packet to a valid value # +######################################################################## + +SET @@global.slave_max_allowed_packet = 1024; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1025; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 65535; +SELECT @@global.slave_max_allowed_packet; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_072_04-------------------------#' +########################################################################### +# Change the value of slave_max_allowed_packet to invalid value # +########################################################################### + +SET @@global.slave_max_allowed_packet = -1; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 100000000000; +SELECT @@global.slave_max_allowed_packet; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = 10000.01; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = -1024; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 4294967296; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1023; +SELECT @@global.slave_max_allowed_packet; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = ON; +SELECT @@global.slave_max_allowed_packet; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = 'test'; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#-------------------FN_DYNVARS_072_05----------------------------#' +########################################################################### +# Test if accessing session slave_max_allowed_packet gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.slave_max_allowed_packet = 4096; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.slave_max_allowed_packet; + + +--echo '#----------------------FN_DYNVARS_072_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; + +SELECT @@slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; + + +--echo '#---------------------FN_DYNVARS_072_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.slave_max_allowed_packet = TRUE; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = FALSE; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.slave_max_allowed_packet = 5000; +SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_09----------------------#' +################################################################################ +# Check if slave_max_allowed_packet can be accessed with and without @@ sign # +################################################################################ + +--Error ER_GLOBAL_VARIABLE +SET slave_max_allowed_packet = 6000; +SELECT @@slave_max_allowed_packet; +--Error ER_PARSE_ERROR +SET local.slave_max_allowed_packet = 7000; +--Error ER_UNKNOWN_TABLE +SELECT local.slave_max_allowed_packet; +--Error ER_PARSE_ERROR +SET global.slave_max_allowed_packet = 8000; +--Error ER_UNKNOWN_TABLE +SELECT global.slave_max_allowed_packet; +--Error ER_BAD_FIELD_ERROR +SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet; + + +############################## +# Restore initial value # +############################## + +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet; + + +######################################################################## +# END OF slave_max_allowed_packet TESTS # +######################################################################## diff --git a/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test index 10ca47133b7..e1ea74f33c3 100644 --- a/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test @@ -22,6 +22,11 @@ # server-system-variables.html # # # ############################################################################### +# # +# Modification date: 2012-09-30 # +# With implementation of MDEV-253, the variable scope can be session # +# # +############################################################################### --source include/not_embedded.inc --source include/load_sysvars.inc @@ -88,11 +93,8 @@ WHERE VARIABLE_NAME='sql_slave_skip_counter'; # Checking if variable is accessible with session scope # ################################################################### ---Error ER_GLOBAL_VARIABLE SET @@sql_slave_skip_counter = 10; ---Error ER_GLOBAL_VARIABLE SET @@session.sql_slave_skip_counter = 12; ---Error ER_GLOBAL_VARIABLE SET @@local.sql_slave_skip_counter = 13; SET @@global.sql_slave_skip_counter = 0; diff --git a/mysql-test/t/adddate_454.test b/mysql-test/t/adddate_454.test new file mode 100644 index 00000000000..1d69cdc9558 --- /dev/null +++ b/mysql-test/t/adddate_454.test @@ -0,0 +1,9 @@ +# +# MDEV-454 Addition of a time interval reduces the resulting value +# +create table t1 (d date); +insert into t1 values ('2012-00-00'); +select * from t1; +update t1 set d = adddate(d, interval 1 day); +select * from t1; +drop table t1; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 884e0fabb5e..15156b89d8e 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -104,7 +104,7 @@ explain extended select last_insert_id(); --error ER_DUP_ENTRY insert into t1 set i = 254; select last_insert_id(); ---error ER_DUP_ENTRY +--error 167 insert into t1 set i = null; select last_insert_id(); drop table t1; @@ -113,6 +113,7 @@ create table t1 (i tinyint unsigned not null auto_increment, key (i)); insert into t1 set i = 254; insert into t1 set i = null; select last_insert_id(); +--error 167 insert into t1 set i = null; select last_insert_id(); drop table t1; @@ -353,7 +354,7 @@ INSERT INTO t1 VALUES (18446744073709551601); SET @@SESSION.AUTO_INCREMENT_INCREMENT=10; SELECT @@SESSION.AUTO_INCREMENT_OFFSET; ---error ER_WARN_DATA_OUT_OF_RANGE +--error 167 INSERT INTO t1 VALUES (NULL), (NULL), (NULL); SELECT * FROM t1; diff --git a/mysql-test/t/auto_increment_ranges.inc b/mysql-test/t/auto_increment_ranges.inc new file mode 100644 index 00000000000..a94aa46d38e --- /dev/null +++ b/mysql-test/t/auto_increment_ranges.inc @@ -0,0 +1,240 @@ +# +# Test of auto_increment at end of range +# +--disable_warnings +drop table if exists t1; +--enable_warnings + +--echo # +--echo # Testing ranges with smallint +--echo # +let $type=smallint; +let $range_max=32767; + +eval create table t1 (a $type primary key auto_increment); +eval insert into t1 values($range_max); +--error 167 +insert into t1 values(NULL); +truncate table t1; +eval insert into t1 values($range_max-1); +insert into t1 values(NULL); +--error 167 +insert into t1 values(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max),(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max-1),(NULL),(NULL); +truncate table t1; +eval insert into t1 values($range_max+1); +select * from t1; +--error 167 +eval insert into t1 values(NULL); +drop table t1; + +--echo # +--echo # Testing ranges with unsigned smallint +--echo # + +let $type=smallint unsigned; +let $range_max=65535; + +eval create table t1 (a $type primary key auto_increment); +eval insert into t1 values($range_max); +--error 167 +insert into t1 values(NULL); +truncate table t1; +eval insert into t1 values($range_max-1); +insert into t1 values(NULL); +--error 167 +insert into t1 values(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max),(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max-1),(NULL),(NULL); +truncate table t1; +eval insert into t1 values($range_max+1); +select * from t1; +--error 167 +eval insert into t1 values(NULL); +drop table t1; + +--echo # +--echo # Testing ranges with integer +--echo # + +let $type=int; +let $range_max=2147483647; + +eval create table t1 (a $type primary key auto_increment); +eval insert into t1 values($range_max); +--error 167 +insert into t1 values(NULL); +truncate table t1; +eval insert into t1 values($range_max-1); +insert into t1 values(NULL); +--error 167 +insert into t1 values(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max),(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max-1),(NULL),(NULL); +truncate table t1; +eval insert into t1 values($range_max+1); +select * from t1; +--error 167 +eval insert into t1 values(NULL); +drop table t1; + +--echo # +--echo # Testing ranges with unsigned integer +--echo # + +let $type=int unsigned; +let $range_max=4294967295; + +eval create table t1 (a $type primary key auto_increment); +eval insert into t1 values($range_max); +--error 167 +insert into t1 values(NULL); +truncate table t1; +eval insert into t1 values($range_max-1); +insert into t1 values(NULL); +--error 167 +insert into t1 values(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max),(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max-1),(NULL),(NULL); +truncate table t1; +eval insert into t1 values($range_max+1); +select * from t1; +--error 167 +eval insert into t1 values(NULL); +drop table t1; + +--echo # +--echo # Testing ranges with bigint +--echo # + +let $type=bigint; +let $range_max=cast(9223372036854775807 as unsigned); + +eval create table t1 (a $type primary key auto_increment); +eval insert into t1 values($range_max); +--error 167 +insert into t1 values(NULL); +truncate table t1; +eval insert into t1 values($range_max-1); +insert into t1 values(NULL); +--error 167 +insert into t1 values(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max),(NULL); +select * from t1; +truncate table t1; +--error 167 +eval insert into t1 values($range_max-1),(NULL),(NULL); +truncate table t1; +eval insert into t1 values($range_max+1); +select * from t1; +--error 167 +eval insert into t1 values(NULL); +drop table t1; + +--echo # +--echo # Testing ranges with unsigned bigint +--echo # + +let $type=bigint unsigned; +let $range_max=18446744073709551615; + +eval create table t1 (a $type primary key auto_increment); +eval insert into t1 values($range_max-1); +--error ER_AUTOINC_READ_FAILED +insert into t1 values(NULL); +--error ER_AUTOINC_READ_FAILED +insert into t1 values(NULL); +truncate table t1; +eval insert into t1 values($range_max-1); +--error ER_AUTOINC_READ_FAILED +insert into t1 values(NULL); +--error ER_AUTOINC_READ_FAILED +insert into t1 values(NULL); +select * from t1; +truncate table t1; +--error ER_AUTOINC_READ_FAILED +eval insert into t1 values($range_max),(NULL); +select * from t1; +truncate table t1; +--error ER_AUTOINC_READ_FAILED +eval insert into t1 values($range_max-1),(NULL),(NULL); +drop table t1; + +--echo # +--echo # Test IGNORE and strict mode +--echo # +create table t1 (a smallint primary key auto_increment); +insert ignore into t1 values(32766),(NULL),(NULL),(1); +select * from t1; +truncate table t1; + +set @org_mode=@@sql_mode; +set @@sql_mode='ansi,traditional'; +insert ignore into t1 values(32766),(NULL),(NULL); +truncate table t1; +--error 167 +insert into t1 values(32766),(NULL),(NULL); +set @@sql_mode=@org_mode; +drop table t1; + +--echo # +--echo # Test auto increment with negative numbers +--echo # +CREATE TABLE t1 (a INTEGER AUTO_INCREMENT, PRIMARY KEY (a)); +INSERT INTO t1 VALUES (NULL), (2), (-5), (NULL); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES (-5), (NULL); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Test inserting a value out-of-range into an auto increment column +--echo # +CREATE TABLE t1 (a smallint AUTO_INCREMENT, PRIMARY KEY (a)); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (32768); +--error 167 +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # Test old behaviour +--echo # +create table t1 (a smallint primary key auto_increment); +insert into t1 values(32766),(NULL); +delete from t1 where a=32767; +--error 167 +insert into t1 values(NULL); +drop table t1; diff --git a/mysql-test/t/auto_increment_ranges_innodb.test b/mysql-test/t/auto_increment_ranges_innodb.test new file mode 100644 index 00000000000..c2afee7ac66 --- /dev/null +++ b/mysql-test/t/auto_increment_ranges_innodb.test @@ -0,0 +1,7 @@ +# +# Test of auto_increment at end of range +# + +--source include/have_innodb.inc +set default_storage_engine=innodb; +--source auto_increment_ranges.inc diff --git a/mysql-test/t/auto_increment_ranges_myisam.test b/mysql-test/t/auto_increment_ranges_myisam.test new file mode 100644 index 00000000000..90e84377540 --- /dev/null +++ b/mysql-test/t/auto_increment_ranges_myisam.test @@ -0,0 +1,7 @@ +# +# Test of auto_increment at end of range +# + +set default_storage_engine=MYISAM; +--source auto_increment_ranges.inc + diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index 9d6cc7d375a..f536f556780 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -175,6 +175,16 @@ drop table t1, t2; --echo End of 5.0 tests # +# lp:1001510 +# Bug #11764313 57135: CRASH IN ITEM_FUNC_CASE::FIND_ITEM WITH CASE WHEN +# ELSE CLAUSE +# + +CREATE TABLE t1(a YEAR); +SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END; +DROP TABLE t1; + +# # lp:839387 Assertion `(Item_result)i != TIME_RESULT' failed with CASE + datetime # @@ -182,3 +192,4 @@ create table t1 (f1 time); insert t1 values ('00:00:00'),('00:01:00'); select case t1.f1 when '00:00:00' then 1 end from t1; drop table t1; + diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index 103244eb2f7..d2b2a7e5523 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -86,3 +86,11 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00'; DROP TABLE t1; --echo End of 5.0 tests + +# +# Bug #11764818 57692: Crash in item_func_in::val_int() with ZEROFILL +# + +CREATE TABLE t1(a INT ZEROFILL); +SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; +DROP TABLE t1; diff --git a/mysql-test/t/create-big.test b/mysql-test/t/create-big.test index d487608f7e1..8d916f8da82 100644 --- a/mysql-test/t/create-big.test +++ b/mysql-test/t/create-big.test @@ -132,11 +132,20 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; --send create table t1 select 1 as i; connection addconroot1; set debug_sync='now WAIT_FOR parked'; ---error ER_TABLE_EXISTS_ERROR -alter table t3 rename to t1; +--send alter table t3 rename to t1 +connection addconroot2; +# Wait until the above ALTER TABLE RENAME is blocked due to CREATE +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table metadata lock" and + info = "alter table t3 rename to t1"; +--source include/wait_condition.inc set debug_sync='now SIGNAL go'; connection default; --reap +connection addconroot1; +--error ER_TABLE_EXISTS_ERROR +--reap connection default; show create table t1; drop table t1; @@ -146,11 +155,21 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; --send create table t1 select 1 as i; connection addconroot1; set debug_sync='now WAIT_FOR parked'; ---error ER_TABLE_EXISTS_ERROR -alter table t3 rename to t1, add k int; +--send alter table t3 rename to t1, add k int +connection addconroot2; +# Wait until the above ALTER TABLE RENAME is blocked due to CREATE +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table metadata lock" and + info = "alter table t3 rename to t1, add k int"; +--source include/wait_condition.inc set debug_sync='now SIGNAL go'; connection default; --reap +connection addconroot1; +--error ER_TABLE_EXISTS_ERROR +--reap +connection default; show create table t1; drop table t1,t3; diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test index 5fc01e4467e..91221b4f7c7 100644 --- a/mysql-test/t/ctype_utf32.test +++ b/mysql-test/t/ctype_utf32.test @@ -854,6 +854,11 @@ SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1 GROUP BY id ORDER BY l DESC; +--echo # +--echo # incorrect charset for val_str_ascii +--echo # + +SELECT '2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second; --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/datetime_456.test b/mysql-test/t/datetime_456.test new file mode 100644 index 00000000000..0c187959d52 --- /dev/null +++ b/mysql-test/t/datetime_456.test @@ -0,0 +1,8 @@ +# +# MDEV-456 An out-of-range datetime value (with a 5-digit year) can be created and cause troubles +# +create table t1 (d datetime); +insert t1 values (addtime('9999-12-31 23:59:59', '00:00:01')), + (from_days(3652499)); +select * from t1; +drop table t1; diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index 82204e1bfac..6ce6e439919 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -189,3 +189,12 @@ INSERT INTO t2 VALUES (1,0) ON DUPLICATE KEY UPDATE INSERT INTO t2(a,b) VALUES (1,0) ON DUPLICATE KEY UPDATE b=(SELECT VALUES(a)+2 FROM t1); DROP TABLE t1, t2; + +--echo # +--echo # MDEV-492: incorrect error check before sending OK in mysql_update +--echo # +CREATE TABLE t1 (a CHAR(3), b BLOB); +--error ER_DYN_COL_DATA +UPDATE t1 SET a = 'new' +WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL; +drop table t1; diff --git a/mysql-test/t/features.test b/mysql-test/t/features.test new file mode 100644 index 00000000000..cdfc9413da5 --- /dev/null +++ b/mysql-test/t/features.test @@ -0,0 +1,111 @@ +# Testing of feature statistics + +-- source include/have_geometry.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +show status like "feature%"; + +--echo # +--echo # Feature GIS +--echo # + +CREATE TABLE t1 (g POINT); +SHOW FIELDS FROM t1; +INSERT INTO t1 VALUES + (PointFromText('POINT(10 10)')), + (PointFromText('POINT(20 10)')), + (PointFromText('POINT(20 20)')), + (PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +drop table t1; + +show status like "feature_gis"; + +--echo # +--echo # Feature dynamic columns +--echo # +set @a= COLUMN_CREATE(1, 1212 AS int); +set @b= column_add(@a, 2, 1212 as integer); +select column_get(@b, 2 as integer); + +show status like "feature_dynamic_columns"; + +--echo # +--echo # Feature fulltext +--echo # + +CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)) engine=myisam; +INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), + ('Full-text indexes', 'are called collections'), + ('Only MyISAM tables','support collections'), + ('Function MATCH ... AGAINST()','is used to do a search'), + ('Full-text search in MySQL', 'implements vector space model'); +select * from t1 where MATCH(a,b) AGAINST ("collections"); +select * from t1 where MATCH(a,b) AGAINST ("indexes"); +drop table t1; + +# We need the following when running with --ps-protocol +--replace_result 4 2 +show status like "feature_fulltext"; + + +--echo # +--echo # Feature locale +--echo # + +SET lc_messages=sr_RS; +SET lc_messages=en_US; +show status like "feature_locale"; + +--echo # +--echo # Feature subquery +--echo # + +select (select 2); +SELECT (SELECT 1) UNION SELECT (SELECT 2); + +create table t1 (a int); +insert into t1 values (2); +select (select a from t1 where t1.a=t2.a), a from t1 as t2; +drop table t1; +--replace_result 8 4 +show status like "feature_subquery"; + +--echo # +--echo # Feature timezone +--echo # + +SELECT FROM_UNIXTIME(unix_timestamp()) > "1970-01-01"; +set time_zone="+03:00"; +SELECT FROM_UNIXTIME(unix_timestamp()) > "1970-01-01"; +set time_zone= @@global.time_zone; +show status like "feature_timezone"; + +--echo # +--echo # Feature triggers +--echo # + +create table t1 (i int); +--echo # let us test some very simple trigger +create trigger trg before insert on t1 for each row set @a:=1; +set @a:=0; +select @a; +insert into t1 values (1),(2); +select @a; +SHOW TRIGGERS IN test like 't1'; +drop trigger trg; +drop table t1; + +show status like "%trigger%"; + +--echo # +--echo # Feature xml +--echo # +SET @xml='<a aa1="aa1" aa2="aa2">a1<b ba1="ba1">b1<c>c1</c>b2</b>a2</a>'; +SELECT extractValue(@xml,'/a'); +select updatexml('<div><div><span>1</span><span>2</span></div></div>', + '/','<tr><td>1</td><td>2</td></tr>') as upd1; +--replace_result 4 2 +show status like "feature_xml"; diff --git a/mysql-test/t/filesort_debug.test b/mysql-test/t/filesort_debug.test index f89d46a7bd0..c375334ad29 100644 --- a/mysql-test/t/filesort_debug.test +++ b/mysql-test/t/filesort_debug.test @@ -11,7 +11,7 @@ SET @old_debug= @@session.debug; CREATE TABLE t1(f0 int auto_increment primary key, f1 int); INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5); -SET session debug_dbug= '+d,make_sort_keys_alloc_fail'; +SET session debug_dbug= '+d,alloc_sort_buffer_fail'; CALL mtr.add_suppression("Out of sort memory"); --error ER_OUT_OF_SORTMEMORY SELECT * FROM t1 ORDER BY f1 ASC, f0; diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 037e2fcaa73..a1df9359d30 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -701,3 +701,11 @@ disconnect con1; connection default; COMMIT; DROP TABLE t1; + +--echo # +--echo # Test flushing slave or relay logs twice +--echo # +--error ER_WRONG_USAGE +flush relay logs,relay logs; +--error ER_WRONG_USAGE +flush slave,slave; diff --git a/mysql-test/t/func_group_innodb.test b/mysql-test/t/func_group_innodb.test index bfe91f1f587..6706792d162 100644 --- a/mysql-test/t/func_group_innodb.test +++ b/mysql-test/t/func_group_innodb.test @@ -84,20 +84,6 @@ select count(*), min(7), max(7) from t2m, t1i; drop table t1m, t1i, t2m, t2i; - ---echo # ---echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN ---echo # - -CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, - KEY(b, c, a(765))) ENGINE=INNODB; -INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0); - -SELECT MIN(c) FROM t1 GROUP BY b; -EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; - -DROP TABLE t1; - --echo # --echo # Bug #57954: BIT_AND function returns incorrect results when --echo # semijoin=on @@ -173,4 +159,19 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date = DROP TABLE t1; +--echo # End of test BUG#12713907 + +--echo # +--echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN +--echo # + +CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, + KEY(b, c, a(765))) ENGINE=INNODB; +INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0); + +SELECT MIN(c) FROM t1 GROUP BY b; +EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; + +DROP TABLE t1; + --echo End of 5.5 tests diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 42705975b88..57ef68595bf 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -526,7 +526,7 @@ SELECT MAKETIME(0, 0, 4294967296); SELECT MAKETIME(CAST(-1 AS UNSIGNED), 0, 0); # check if EXTRACT() handles out-of-range values correctly -SELECT EXTRACT(HOUR FROM '100000:02:03'); +SELECT EXTRACT(HOUR FROM '10000:02:03'); # check if we get proper warnings if both input string truncation # and out-of-range value occur @@ -1172,3 +1172,5 @@ select cast(greatest(cast("0-0-0" as date), cast("10:20:05" as time)) as datetim select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010'); +--error ER_TOO_BIG_PRECISION +select now(258); diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index f4c9de4e7da..b0ad8329cfb 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -1293,6 +1293,21 @@ WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; #WHERE lakes.name = 'Blue Lake'; DROP DATABASE gis_ogs; + +--echo # +--echo # BUG #1043845 st_distance() results are incorrect depending on variable order +--echo # + +select st_distance(geomfromtext('LINESTRING(-95.9673005697771 36.13509598461, + -95.9673057475387 36.1344478941074, + -95.9673063519371 36.134484524621, + -95.9673049102515 36.1343976584193)'), + geomfromtext('point(-95.96269500000000000000 36.14181833333330000000)')) ; +select st_distance(geomfromtext('point(-95.96269500000000000000 36.14181833333330000000)'), + geomfromtext('LINESTRING(-95.9673005697771 36.13509598461, + -95.9673057475387 36.1344478941074, + -95.9673063519371 36.134484524621, + -95.9673049102515 36.1343976584193) ')) ; USE test; @@ -1344,4 +1359,3 @@ SELECT 1 FROM g1 WHERE a >= ANY DROP TABLE g1; --echo End of 5.5 tests - diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 86f1d3d05d1..2a346867da2 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1493,3 +1493,52 @@ SELECT f1,MIN(f2),MAX(f2) FROM t1 GROUP BY 1; DROP TABLE t1; --echo #End of test#49771 + +--echo # +--echo # Bug #58782 +--echo # Missing rows with SELECT .. WHERE .. IN subquery +--echo # with full GROUP BY and no aggr +--echo # + +CREATE TABLE t1 ( + pk INT NOT NULL, + col_int_nokey INT, + PRIMARY KEY (pk) +); + +INSERT INTO t1 VALUES (10,7); +INSERT INTO t1 VALUES (11,1); +INSERT INTO t1 VALUES (12,5); +INSERT INTO t1 VALUES (13,3); + +## original query: + +SELECT pk AS field1, col_int_nokey AS field2 +FROM t1 +WHERE col_int_nokey > 0 +GROUP BY field1, field2; + +## store query results in a new table: + +CREATE TABLE where_subselect + SELECT pk AS field1, col_int_nokey AS field2 + FROM t1 + WHERE col_int_nokey > 0 + GROUP BY field1, field2 +; + +## query the new table and compare to original using WHERE ... IN(): + +SELECT * +FROM where_subselect +WHERE (field1, field2) IN ( + SELECT pk AS field1, col_int_nokey AS field2 + FROM t1 + WHERE col_int_nokey > 0 + GROUP BY field1, field2 +); + +DROP TABLE t1; +DROP TABLE where_subselect; + +--echo # End of Bug #58782 diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test index 0fd3c54c787..6a1cb53dc40 100644 --- a/mysql-test/t/index_merge_innodb.test +++ b/mysql-test/t/index_merge_innodb.test @@ -156,6 +156,21 @@ select * from t1 where t1.zone_id=830 AND modified=9; drop table t0, t1; +--echo # +--echo # MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join +--echo # +CREATE TABLE t1 ( + a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b) +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d'); + + +SELECT ta.* FROM t1 AS ta, t1 AS tb +WHERE ( tb.b != ta.b OR tb.a = ta.a ) + AND ( tb.b = ta.c OR tb.b = ta.b ); + +DROP TABLE t1; set optimizer_switch= @optimizer_switch_save; diff --git a/mysql-test/t/last_value.test b/mysql-test/t/last_value.test new file mode 100644 index 00000000000..41cfdb5482d --- /dev/null +++ b/mysql-test/t/last_value.test @@ -0,0 +1,46 @@ +# +# Tests for the LAST_VALUE function +# + +--disable_warnings +drop table if exists t1; +drop database if exists mysqltest; +--enable_warnings + +# CREATE TABLE `queue` ( +# `id` int(10) unsigned NOT NULL AUTO_INCREMENT, +# `priority` int(11) DEFAULT NULL, +# `state` int(11) DEFAULT NULL, +# `pid` int(10) unsigned DEFAULT NULL, +# `dat` varbinary(200) DEFAULT NULL, +# PRIMARY KEY (`id`) +# ) + +CREATE TABLE t1 (a INT, b INT, c INT, d INT); +INSERT INTO t1 VALUES (1,3,0,NULL),(2,2,0,NULL),(3,4,0,NULL),(4,2,0,NULL); +SELECT * FROM t1; +UPDATE t1 SET c=LAST_VALUE(@last_a:=a,@last_b:=b,@last_c:=c,1), d=4211 WHERE c=0 ORDER BY b DESC LIMIT 1; +SELECT @last_a, @last_b, @last_c; +SELECT * FROM t1; +DROP TABLE t1; + +# +# Test with different types +# +# PS protocol gives slightly different metadata for the length +--enable_metadata +--disable_ps_protocol +SELECT LAST_VALUE(@last_a:=1,@last_b:=1); +select @last_b; +--enable_ps_protocol +SELECT LAST_VALUE(@last_a:=1,@last_b:=1.0); +select @last_b; +SELECT LAST_VALUE(@last_a:=1,@last_b:="hello"); +select @last_b; +SELECT date(LAST_VALUE(@last_a:=1,@last_b:="2001-02-03")); +select @last_b; +SELECT LAST_VALUE(@last_a:=1,@last_b:="2001-02-03",NULL); +select @last_b; +--disable_metadata +--error ER_PARSE_ERROR +SELECT LAST_VALUE(); diff --git a/mysql-test/t/mdev375.test b/mysql-test/t/mdev375.test new file mode 100644 index 00000000000..fe259b37808 --- /dev/null +++ b/mysql-test/t/mdev375.test @@ -0,0 +1,22 @@ +# +# MDEV-375 Server crashes in THD::print_aborted_warning with log_warnings > 3 +# +--source include/not_embedded.inc + +SET GLOBAL log_warnings=4; +SET GLOBAL max_connections=2; + +--connect (con1,localhost,root,,) +SELECT 1; +--connect (con2,localhost,root,,) +SELECT 2; +--disable_query_log +--error ER_CON_COUNT_ERROR +--connect (con3,localhost,root,,) +--enable_query_log + +--connection default +SELECT 0; + +SET GLOBAL log_warnings=default; +SET GLOBAL max_connections=default; diff --git a/mysql-test/t/mysql_plugin.test b/mysql-test/t/mysql_plugin.test index 71617b86330..a05b5a624d9 100644 --- a/mysql-test/t/mysql_plugin.test +++ b/mysql-test/t/mysql_plugin.test @@ -372,11 +372,11 @@ let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQL_DATADIR --basedir=$MYSQ --echo # Show the help. --echo # replace_result $MYSQL_PLUGIN mysql_plugin; ---replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ +--replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ /XX[a-z]/XX/ --exec $MYSQL_PLUGIN --help replace_result $MYSQL_PLUGIN mysql_plugin; ---replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ +--replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ /XX[a-z]/XX/ --exec $MYSQL_PLUGIN --version # diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 740c4078f20..986e180db13 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -23,7 +23,7 @@ insert into t1 values(null, "b"); set timestamp=@a+2; --let $binlog_pos_760=query_get_value(SHOW MASTER STATUS, Position, 1) insert into t1 values(null, "c"); ---let $binlog_pos_951=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000001' from $binlog_pos_760, Pos, 4) +--let $binlog_pos_951=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000001' from $binlog_pos_760, Pos, 5) set timestamp=@a+4; insert into t1 values(null, "d"); insert into t1 values(null, "e"); @@ -31,8 +31,8 @@ insert into t1 values(null, "e"); flush logs; set timestamp=@a+1; # this could happen on a slave insert into t1 values(null, "f"); ---let $binlog_pos_135=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000002', Pos, 3) ---let $binlog_pos_203=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000002', Pos, 4) +--let $binlog_pos_135=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000002', Pos, 4) +--let $binlog_pos_203=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000002', Pos, 5) # delimiters are for easier debugging in future @@ -50,22 +50,22 @@ let $MYSQLD_DATADIR= `select @@datadir`; --disable_query_log select "--- offset --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --offset=3 $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start-position --" as ""; --enable_query_log -let $start_pos= `select @binlog_start_pos + 653`; +let $start_pos= `select @binlog_start_pos + 693`; --exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log -let $stop_pos= `select @binlog_start_pos + 653`; +let $stop_pos= `select @binlog_start_pos + 693`; --exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start and stop positions ---" as ""; --enable_query_log -let $start_pos= `select @binlog_start_pos + 653`; -let $stop_pos= `select @binlog_start_pos + 770`; +let $start_pos= `select @binlog_start_pos + 693`; +let $stop_pos= `select @binlog_start_pos + 810`; --exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; @@ -88,16 +88,16 @@ flush logs; --disable_query_log select "--- offset --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --offset=3 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- start-position --" as ""; --enable_query_log -let $start_pos= `select @binlog_start_pos + 653`; +let $start_pos= `select @binlog_start_pos + 693`; --exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log -let $stop_pos= `select @binlog_start_pos + 69`; +let $stop_pos= `select @binlog_start_pos + 109`; --exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; @@ -117,22 +117,22 @@ select "--- Remote --" as ""; --disable_query_log select "--- offset --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --offset=2 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form --offset=3 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start-position --" as ""; --enable_query_log -let $start_pos= `select @binlog_start_pos + 653`; +let $start_pos= `select @binlog_start_pos + 693`; --exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log -let $stop_pos= `select @binlog_start_pos + 653`; +let $stop_pos= `select @binlog_start_pos + 693`; --exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start and stop positions ---" as ""; --enable_query_log -let $start_pos= `select @binlog_start_pos + 653`; -let $stop_pos= `select @binlog_start_pos + 770`; +let $start_pos= `select @binlog_start_pos + 693`; +let $stop_pos= `select @binlog_start_pos + 810`; --exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; @@ -152,16 +152,16 @@ select "--- Remote with 2 binlogs on command line --" as ""; --disable_query_log select "--- offset --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --offset=2 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +--exec $MYSQL_BINLOG --short-form --offset=3 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- start-position --" as ""; --enable_query_log -let $start_pos= `select @binlog_start_pos + 653`; +let $start_pos= `select @binlog_start_pos + 693`; --exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log -let $stop_pos= `select @binlog_start_pos + 28`; +let $stop_pos= `select @binlog_start_pos + 68`; --exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; diff --git a/mysql-test/t/mysqldump-max.test b/mysql-test/t/mysqldump-max.test index 27c1a3ce20c..d0a4870ba31 100644 --- a/mysql-test/t/mysqldump-max.test +++ b/mysql-test/t/mysqldump-max.test @@ -1194,7 +1194,7 @@ DROP TABLE t2; --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mwl136.sql --replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS LIMIT 6,3; +SHOW BINLOG EVENTS LIMIT 7,3; --perl my $f= "$ENV{MYSQLTEST_VARDIR}/tmp/mwl136.sql"; open F, '<', $f or die "Failed to open $f: $!\n"; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index a7585bea4f8..ffbec36873e 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -2120,6 +2120,11 @@ insert into t1 values ("Abcd"); --error $errno1,ER_PARSE_ERROR garbage; +let $errno_multi = $errno1,ER_NO_SUCH_TABLE,$errno2,1062; + +--error $errno_multi +SELECT * FROM non_existing_table; + drop table t2; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index a6f50107cbe..adb7e361a4f 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -865,6 +865,7 @@ CALL mtr.add_suppression("Out of sort memory"); --error ER_OUT_OF_SORTMEMORY select * from t1 order by b; drop table t1; +set session sort_buffer_size= 30000; --echo # --echo # Bug #39844: Query Crash Mysql Server 5.0.67 @@ -1391,7 +1392,205 @@ ORDER BY t2.c LIMIT 5; DROP TABLE t1,t2,t3; -# +--echo # +--echo # WL#1393 - Optimizing filesort with small limit +--echo # + +CREATE TABLE t1(f0 int auto_increment primary key, f1 int, f2 varchar(200)); +INSERT INTO t1(f1, f2) VALUES +(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"), +(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"), +(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"), +(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"), +(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"), +(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"), +(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"), +(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"), +(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"), +(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"), +(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"), +(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"), +(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"), +(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"), +(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"), +(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"), +(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"), +(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"), +(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"), +(96,"96"),(97,"97"),(98,"98"),(99,"99"); + +################ +## Test sort when source data fits in memory + +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 100; +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 30; +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 0; +SELECT * FROM t1 ORDER BY f2 DESC, f0 LIMIT 30; +SELECT * FROM t1 ORDER BY f2 DESC, f0 LIMIT 0; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 20; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 10 OFFSET 10; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0 OFFSET 10; + +################ +## Test sort when source data does not fit in memory +set sort_buffer_size= 32768; +CREATE TEMPORARY TABLE tmp (f1 int, f2 varchar(20)); +INSERT INTO tmp SELECT f1, f2 FROM t1; +INSERT INTO t1(f1, f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1, f2 FROM t1; +INSERT INTO t1(f1, f2) SELECT * FROM tmp; + +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 30; +SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 0; +SELECT * FROM t1 ORDER BY f2 DESC, f0 LIMIT 30; +SELECT * FROM t1 ORDER BY f2 DESC, f0 LIMIT 0; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 20; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 10 OFFSET 10; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0 OFFSET 10; + +################ +## Test with SQL_CALC_FOUND_ROWS +set sort_buffer_size= 32768; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 +ORDER BY f1, f0 LIMIT 30; +SELECT FOUND_ROWS(); + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 +ORDER BY f1, f0 LIMIT 0; +SELECT FOUND_ROWS(); + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 20; +SELECT FOUND_ROWS(); + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 0; +SELECT FOUND_ROWS(); + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 10 OFFSET 10; +SELECT FOUND_ROWS(); + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 0 OFFSET 10; +SELECT FOUND_ROWS(); + +################ +## Test sorting with join +## These are re-written to use PQ during execution. +set sort_buffer_size= 327680; + +SELECT * FROM t1 JOIN tmp on t1.f2=tmp.f2 +ORDER BY tmp.f1, f0 LIMIT 30; + +SELECT * FROM t1 JOIN tmp on t1.f2=tmp.f2 +ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 JOIN tmp on t1.f2=tmp.f2 +ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30; +SELECT FOUND_ROWS(); + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 JOIN tmp on t1.f2=tmp.f2 +WHERE t1.f2>20 +ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30; +SELECT FOUND_ROWS(); + +################ +## Test views +CREATE VIEW v1 as SELECT * FROM t1 ORDER BY f1, f0 LIMIT 30; +SELECT * FROM v1; +drop view v1; + +CREATE VIEW v1 as SELECT * FROM t1 ORDER BY f1, f0 LIMIT 100; +SELECT * FROM v1 ORDER BY f2, f0 LIMIT 30; + +CREATE VIEW v2 as SELECT * FROM t1 ORDER BY f2, f0 LIMIT 100; +SELECT * FROM v1 JOIN v2 on v1.f1=v2.f1 ORDER BY v1.f2,v1.f0,v2.f0 +LIMIT 30; + +################ +## Test group & having +SELECT floor(f1/10) f3, count(f2) FROM t1 +GROUP BY 1 ORDER BY 2,1 LIMIT 5; + +SELECT floor(f1/10) f3, count(f2) FROM t1 +GROUP BY 1 ORDER BY 2,1 LIMIT 0; + +################ +## Test SP +delimiter |; +CREATE PROCEDURE wl1393_sp_test() +BEGIN +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 30; +SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 15 OFFSET 15; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE f1>10 +ORDER BY f2, f0 LIMIT 15 OFFSET 15; +SELECT FOUND_ROWS(); +SELECT * FROM v1 ORDER BY f2, f0 LIMIT 30; +END| +CALL wl1393_sp_test()| +DROP PROCEDURE wl1393_sp_test| +delimiter ;| + +################ +## Test with subqueries +SELECT d1.f1, d1.f2 FROM t1 +LEFT JOIN (SELECT * FROM t1 ORDER BY f1 LIMIT 30) d1 on t1.f1=d1.f1 +ORDER BY d1.f2 DESC LIMIT 30; + +SELECT * FROM t1 WHERE f1 = (SELECT f1 FROM t1 ORDER BY 1 LIMIT 1); + +--error ER_SUBQUERY_NO_1_ROW +SELECT * FROM t1 WHERE f1 = (SELECT f1 FROM t1 ORDER BY 1 LIMIT 2); + +DROP TABLE t1, tmp; +DROP VIEW v1, v2; + +--echo # end of WL#1393 - Optimizing filesort with small limit + +--echo # +--echo # Bug #58761 +--echo # Crash in Field::is_null in field.h on subquery in WHERE clause +--echo # + +CREATE TABLE t1 ( + pk INT NOT NULL AUTO_INCREMENT, + col_int_key INT DEFAULT NULL, + col_varchar_key VARCHAR(1) DEFAULT NULL, + PRIMARY KEY (pk), + KEY col_varchar_key (col_varchar_key,col_int_key) +); + +INSERT INTO t1 VALUES (27,7,'x'); +INSERT INTO t1 VALUES (28,6,'m'); +INSERT INTO t1 VALUES (29,4,'c'); + +CREATE TABLE where_subselect + SELECT DISTINCT `pk` AS field1 , `pk` AS field2 + FROM t1 AS alias1 + WHERE alias1 . `col_int_key` > 229 + OR alias1 . `col_varchar_key` IS NOT NULL + GROUP BY field1, field2 +; + +SELECT * +FROM where_subselect +WHERE (field1, field2) IN ( + SELECT DISTINCT `pk` AS field1 , `pk` AS field2 + FROM t1 AS alias1 + WHERE alias1 . `col_int_key` > 229 + OR alias1 . `col_varchar_key` IS NOT NULL + GROUP BY field1, field2 +); + +DROP TABLE t1; +DROP TABLE where_subselect; + +--echo # End of Bug #58761 + +## # Bug#35844: Covering index for ref access not compatible with ORDER BY list # @@ -1613,3 +1812,42 @@ SELECT t2.b FROM t1, t2 WHERE t1.b = t2.a GROUP BY t2.b ORDER BY t1.b; drop table t1,t2; --echo End of 5.2 tests + +--echo # +--echo # Bug mdev-449: ORDER BY with small sort_buffer_size +--echo # + +CREATE TABLE t1(f0 int auto_increment primary key, f1 int, f2 varchar(200)); +INSERT INTO t1(f1, f2) VALUES +(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"), +(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"), +(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"), +(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"), +(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"), +(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"), +(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"), +(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"), +(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"), +(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"), +(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"), +(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"), +(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"), +(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"), +(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"), +(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"), +(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"), +(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"), +(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"), +(96,"96"),(97,"97"),(98,"98"),(99,"99"); + +set @save_sort_buffer_size= @@sort_buffer_size; +set sort_buffer_size= 2000; + +SELECT * FROM t1 ORDER BY f1 DESC, f0; + +set sort_buffer_size= @save_sort_buffer_size; + +DROP TABLE t1; + +--echo End of 5.3 tests + diff --git a/mysql-test/t/order_by_sortkey.test b/mysql-test/t/order_by_sortkey.test new file mode 100644 index 00000000000..43de028496e --- /dev/null +++ b/mysql-test/t/order_by_sortkey.test @@ -0,0 +1,64 @@ +# +# WL#1393 - ORDER BY with LIMIT tests +# +# A big test in a separate file, so that we can run the original +# order_by test with --debug without timeout. +# +# All the sort keys fit in memory, but the addon fields do not. +# +CREATE TABLE t1( + f0 int auto_increment PRIMARY KEY, + f1 int, + f2 varchar(200) +); + +INSERT INTO t1(f1, f2) VALUES +(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"), +(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"), +(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"), +(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"), +(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"), +(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"), +(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"), +(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"), +(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"), +(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"), +(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"), +(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"), +(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"), +(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"), +(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"), +(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"), +(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"), +(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"), +(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"), +(96,"96"),(97,"97"),(98,"98"),(99,"99"); + +CREATE TEMPORARY TABLE tmp (f1 int, f2 varchar(20)); +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; +INSERT INTO tmp SELECT f1,f2 FROM t1; +INSERT INTO t1(f1,f2) SELECT * FROM tmp; + +# Test when only sortkeys fits to memory +set sort_buffer_size= 32768; + +FLUSH STATUS; +SHOW SESSION STATUS LIKE 'Sort%'; + +SELECT * FROM t1 ORDER BY f2 LIMIT 100; + +SHOW SESSION STATUS LIKE 'Sort%'; + +DROP TABLE t1, tmp; diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test index d477843b22b..2c8cfafb90a 100644 --- a/mysql-test/t/parser.test +++ b/mysql-test/t/parser.test @@ -553,7 +553,7 @@ select master_pos_wait(); -- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT select master_pos_wait(1); -- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select master_pos_wait(1, 2, 3, 4); +select master_pos_wait(1, 2, 3, 4, 5); -- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT select rand(1, 2, 3); diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 08c028c8224..ef0d3df6661 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2476,3 +2476,13 @@ SELECT 1 FROM t1 AS t1_0 JOIN t1 ON t1_0.a LIKE (SELECT 1 FROM t1); SELECT * FROM vtmp; DROP VIEW vtmp; DROP TABLE t1; + +--echo # +--echo # MDEV-365 "Got assertion when doing alter table on a partition" +--echo # + +CREATE TABLE t1 ( i INT ) ENGINE=Aria PARTITION BY HASH(i) PARTITIONS 2; +INSERT INTO t1 VALUES (1),(2),(2),(3),(4); +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +SELECT * from t1 order by i; +DROP TABLE t1; diff --git a/mysql-test/t/partition_cache_innodb.test b/mysql-test/t/partition_cache_innodb.test new file mode 100644 index 00000000000..dbcfea3088c --- /dev/null +++ b/mysql-test/t/partition_cache_innodb.test @@ -0,0 +1,14 @@ +# t/cache_innodb.test +# +# Last update: +# 2006-07-26 ML test refactored (MySQL 5.1) +# main code t/innodb_cache.test --> include/query_cache.inc +# new wrapper t/cache_innodb.test +# + +--source include/have_query_cache.inc +--source include/have_innodb.inc +--source include/have_partition.inc +let $engine_type= innodb; + +--source include/query_cache_partitions.inc diff --git a/mysql-test/t/partition_cache_myisam.test b/mysql-test/t/partition_cache_myisam.test new file mode 100644 index 00000000000..5347225f6da --- /dev/null +++ b/mysql-test/t/partition_cache_myisam.test @@ -0,0 +1,14 @@ +# t/cache_innodb.test +# +# Last update: +# 2006-07-26 ML test refactored (MySQL 5.1) +# main code t/innodb_cache.test --> include/query_cache.inc +# new wrapper t/cache_innodb.test +# + +--source include/have_query_cache.inc + +--source include/have_partition.inc +let $engine_type= myisam; + +--source include/query_cache_partitions.inc diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index d955b46469c..ff28631862c 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3125,7 +3125,7 @@ DROP TABLE t1; --echo End of 5.1 tests. --echo # ---echo # LP bug#1001500 Crash on the second execution of the PS for +--echo # lp:1001500 Crash on the second execution of the PS for --echo # a query with degenerated conjunctive condition --echo # (see also mysql bug#12582849) --echo # @@ -3572,94 +3572,4 @@ show status like '%Handler_read%'; deallocate prepare st; drop table t1; ---echo # ---echo # LP bug#993459 Execution of PS for a query with GROUP BY ---echo # returns wrong result (see also mysql bug#13805127) ---echo # - -PREPARE s1 FROM -" -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2 -"; - ---echo -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - ---echo -SET @x = 2; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - ---echo -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - -DEALLOCATE PREPARE s1; - --echo # End of 5.3 tests diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test index ff910bdf5cf..3d32a8c0da6 100644 --- a/mysql-test/t/replace.test +++ b/mysql-test/t/replace.test @@ -25,9 +25,9 @@ drop table t1; create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value"); insert into t1 values (126,"first"),(63, "middle"),(0,"last"); ---error ER_DUP_ENTRY +--error 167 insert into t1 values (0,"error"); ---error ER_DUP_ENTRY +--error 167 replace into t1 values (0,"error"); replace into t1 values (126,"first updated"); replace into t1 values (63,default); diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test new file mode 100644 index 00000000000..6ae9484db71 --- /dev/null +++ b/mysql-test/t/show_explain.test @@ -0,0 +1,1115 @@ +# +# Tests for SHOW EXPLAIN FOR functionality +# +--source include/have_debug.inc +--source include/have_innodb.inc + +--disable_warnings +drop table if exists t0, t1, t2, t3, t4; +drop view if exists v1; +--enable_warnings + +# +# Testcases in this file do not work with embedded server. The reason for this +# is that we use the following commands for synchronization: +# +# set @show_explain_probe_select_id=1; +# set debug_dbug='d,show_explain_probe_join_exec_start'; +# send select count(*) from t1 where a < 100000; +# +# When ran with mysqltest_embedded, this translates into: +# +# Thread1> DBUG_PUSH("d,show_explain_probe_join_exec_start"); +# Thread1> create another thread for doing "send ... reap" +# Thread2> mysql_parse("select count(*) from t1 where a < 100000"); +# +# That is, "select count(*) ..." is ran in a thread for which DBUG_PUSH(...) +# has not been called. As a result, show_explain_probe_join_exec_start does not fire, and +# "select count(*) ..." does not wait till its SHOW EXPLAIN command, and the +# test fails. +# +-- source include/not_embedded.inc + + +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a int); +insert into t1 select A.a + 10*B.a + 100*C.a from t0 A, t0 B, t0 C; +alter table t1 add b int, add c int, add filler char(32); +update t1 set b=a, c=a, filler='fooo'; +alter table t1 add key(a), add key(b); + +# +# Try killing a non-existent thread +# +--error ER_NO_SUCH_THREAD +show explain for 2000000000; + +--error ER_SET_CONSTANTS_ONLY +show explain for (select max(a) from t0); + +# +# Setup two threads and their ids +# +let $thr1=`select connection_id()`; +connect (con1, localhost, root,,); +connection con1; +let $thr2=`select connection_id()`; +connection default; + +# SHOW EXPLAIN FOR <idle thread> +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; + +# SHOW EXPLAIN FOR <ourselves> +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr1; + +let $wait_condition= select State='show_explain_trap' from information_schema.processlist where id=$thr2; + +# +# Test SHOW EXPLAIN for simple queries +# +connection con1; +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send select count(*) from t1 where a < 100000; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + + +send select max(c) from t1 where a < 10; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + + +--echo # We can catch EXPLAIN, too. +set @show_expl_tmp= @@optimizer_switch; +set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_sort_keys=on'; +send explain select max(c) from t1 where a < 10; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set optimizer_switch= @show_expl_tmp; + + +--echo # UNION, first branch +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send explain select a from t0 A union select a+1 from t0 B; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + + +--echo # UNION, second branch +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send explain select a from t0 A union select a+1 from t0 B; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + + +--echo # Uncorrelated subquery, select +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send select a, (select max(a) from t0 B) from t0 A where a<1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + + +--echo # Uncorrelated subquery, explain +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send explain select a, (select max(a) from t0 B) from t0 A where a<1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + +--echo # correlated subquery, select +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + +--echo # correlated subquery, explain +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + +--echo # correlated subquery, select, while inside the subquery +set @show_explain_probe_select_id=2; # <--- +set debug_dbug='d,show_explain_probe_join_exec_start'; +send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + +--echo # correlated subquery, explain, while inside the subquery +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + + +--echo # correlated subquery, explain, while inside the subquery +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +connection default; +--source include/wait_condition.inc +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; + +# TODO: explain in the parent subuqery when the un-correlated child has been +# run (and have done irreversible cleanups) +# ^^ Is this at all possible after 5.3? +# Maybe, for 5.3 try this: +# - run before/after the parent has invoked child's optimization +# - run after materialization + +--echo # Try to do SHOW EXPLAIN for a query that runs a SET command: +--echo # I've found experimentally that select_id==2 here... +--echo # +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send set @foo= (select max(a) from t0 where sin(a) >0); +connection default; +--source include/wait_condition.inc +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; + +--echo # +--echo # Attempt SHOW EXPLAIN for an UPDATE +--echo # +create table t2 as select a as a, a as dummy from t0 limit 2; +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; +connection default; +--source include/wait_condition.inc +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; +drop table t2; + +--echo # +--echo # Attempt SHOW EXPLAIN for a DELETE +--echo # +create table t2 as select a as a, a as dummy from t0 limit 2; +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; +connection default; +--source include/wait_condition.inc +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; +drop table t2; + + +--echo # +--echo # Multiple SHOW EXPLAIN calls for one select +--echo # +create table t2 as select a as a, a as dummy from t0 limit 3; +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +evalp show explain for $thr2; +evalp show explain for $thr2; +connection con1; +reap; +drop table t2; + +--echo # +--echo # SHOW EXPLAIN for SELECT ... ORDER BY with "Using filesort" +--echo # +explain select * from t0 order by a; + +set debug_dbug='d,show_explain_probe_join_exec_start'; +set @show_explain_probe_select_id=1; +send select * from t0 order by a; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + +--echo # +--echo # SHOW EXPLAIN for SELECT ... with "Using temporary" +--echo # +connection default; +explain select distinct a from t0; +connection con1; + +set debug_dbug='d,show_explain_probe_join_exec_start'; +set @show_explain_probe_select_id=1; +send select distinct a from t0; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + +--echo # +--echo # SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort" +--echo # +connection default; +explain select distinct a from t0; +connection con1; + +set debug_dbug='d,show_explain_probe_join_exec_start'; +set @show_explain_probe_select_id=1; +send select distinct a from t0; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; + +--echo # +--echo # MDEV-238: SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY +--echo # +CREATE TABLE t2 ( a INT ); +INSERT INTO t2 VALUES (1),(2),(1),(4),(2); +explain SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a; + +set debug_dbug='d,show_explain_in_find_all_keys'; +send SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a; + +connection default; +--source include/wait_condition.inc +--echo # FIXED by "conservative assumptions about when QEP is available" fix: +--echo # NOTE: current code will not show "Using join buffer": +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; +DROP TABLE t2; + + +--echo # +--echo # MDEV-239: Assertion `field_types == 0 ... ' failed in Protocol_text::store(double, uint32, String*) with +--echo # SHOW EXPLAIN over EXPLAIN EXTENDED +--echo # + + +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (1),(2),(1),(4),(2); + +EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +send EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; +DROP TABLE t2; + + +--echo # +--echo # MDEV-240: SHOW EXPLAIN: Assertion `this->optimized == 2' failed in +--echo # JOIN::print_explain on query with a JOIN, TEMPTABLE view, +--echo # +CREATE TABLE t3 (a INT); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (8); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (4),(5),(6),(7),(8),(9); +explain SELECT * FROM v1, t2; + +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_join_exec_end'; +send SELECT * FROM v1, t2; + +connection default; +--source include/wait_condition.inc +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; +DROP VIEW v1; +DROP TABLE t2, t3; + +--echo # +--echo # MDEV-267: SHOW EXPLAIN: Server crashes in JOIN::print_explain on most of queries +--echo # +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +send select sleep(1); +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; + + +--echo # +--echo # Same as above, but try another reason for JOIN to be degenerate +--echo # +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +send select * from t0 where 1>10; +connection default; +--source include/wait_condition.inc +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; + +--echo # +--echo # Same as above, but try another reason for JOIN to be degenerate (2) +--echo # +create table t3(a int primary key); +insert into t3 select a from t0; +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +send select * from t0,t3 where t3.a=112233; +connection default; +--source include/wait_condition.inc +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; +drop table t3; + +--echo # +--echo # MDEV-270: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with +--echo # select tables optimized away +--echo # + +CREATE TABLE t2 (pk INT PRIMARY KEY, a INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES + (1,4),(2,62),(3,7),(4,1),(5,0),(6,7),(7,7),(8,1),(9,7),(10,1), + (11,5),(12,2),(13,0),(14,1),(15,8),(16,1),(17,1),(18,9),(19,1),(20,5) ; + +explain SELECT * FROM t2 WHERE a = + (SELECT MAX(a) FROM t2 + WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) + ); + +set @show_explain_probe_select_id=2; +set debug_dbug='d,show_explain_probe_do_select'; +send SELECT * FROM t2 WHERE a = + (SELECT MAX(a) FROM t2 + WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) + ); +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; +drop table t2; + + +--echo # +--echo # MDEV-273: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with impossible WHERE +--echo # +CREATE TABLE t2 (a1 INT, KEY(a1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES + (4),(6),(7),(1),(0),(7),(7),(1),(7),(1), + (5),(2),(0),(1),(8),(1),(1),(9),(1),(5); + +CREATE TABLE t3 (b1 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES + (4),(5),(8),(4),(8),(2),(9),(6),(4),(8), + (3),(5),(9),(6),(8),(3),(2),(6),(3),(1), + (4),(3),(1),(7),(0),(0),(9),(5),(9),(0), + (2),(2),(5),(9),(1),(4),(8),(6),(5),(5), + (1),(7),(2),(8),(9),(3),(2),(6),(6),(5), + (4),(3),(2),(7),(4),(6),(0),(8),(5),(8), + (2),(9),(7),(5),(7),(0),(4),(3),(1),(0), + (6),(2),(8),(3),(7),(3),(5),(5),(1),(2), + (1),(7),(1),(9),(9),(8),(3); +CREATE TABLE t4 (c1 INT) ENGINE=MyISAM; + +EXPLAIN +SELECT count(*) FROM t2, t3 +WHERE a1 < ALL ( + SELECT a1 FROM t2 + WHERE a1 IN ( SELECT a1 FROM t2, t4 ) +); + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_do_select'; +send +SELECT count(*) FROM t2, t3 +WHERE a1 < ALL ( + SELECT a1 FROM t2 + WHERE a1 IN ( SELECT a1 FROM t2, t4 ) +); + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; +drop table t2, t3, t4; + +--echo # +--echo # MDEV-275: SHOW EXPLAIN: server crashes in JOIN::print_explain with IN subquery and aggregate function +--echo # +CREATE TABLE t2 ( `pk` INT NOT NULL PRIMARY KEY, `a1` INT NOT NULL, KEY(`a1`)) ENGINE=MyISAM; +INSERT INTO t2 VALUES + (1,5),(2,4),(3,6),(4,9),(5,2),(6,8),(7,4),(8,8),(9,0),(10,43), + (11,23),(12,3),(13,45),(14,16),(15,2),(16,33),(17,2),(18,5),(19,9),(20,2); + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_end'; +send + SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`); +connection default; +--source include/wait_condition.inc +--error ER_TARGET_NOT_EXPLAINABLE +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; + +DROP TABLE t2; + +DROP TABLE t1; + +--echo # +--echo # MDEV-305: SHOW EXPLAIN: ref returned by SHOW EXPLAIN is different from the normal EXPLAIN ('const' vs empty string) +--echo # +CREATE TABLE t1(a INT, KEY(a)); +INSERT INTO t1 VALUES (3),(1),(5),(1); + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; + +send SELECT 'test' FROM t1 WHERE a=1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; + +DROP TABLE t1; + + +--echo # +--echo # MDEV-299: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN changes back and forth during query execution +--echo # + +create table t1 (key1 int, col1 int, col2 int, filler char(100), key(key1)); +insert into t1 select A.a+ 10 * B.a, 10, 10, 'filler-data' from t0 A, t0 B; + +# Make matches 3 records +update t1 set col1=3, col2=10 where key1=1; # small range +update t1 set col1=3, col2=1000 where key1=2; # big range +update t1 set col1=3, col2=10 where key1=3; # small range again +update t1 set col1=3, col2=1000 where key1=4; # big range + +set @tmp_mdev299_jcl= @@join_cache_level; +set join_cache_level=0; + +explain select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_test_if_quick_select'; + +send +select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +--source include/wait_condition.inc +evalp show explain for $thr2; +--source include/wait_condition.inc +evalp show explain for $thr2; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + +set debug_dbug=''; +drop table t1; + +--echo # +--echo # MDEV-297: SHOW EXPLAIN: Server gets stuck until timeout occurs while +--echo # executing SHOW INDEX and SHOW EXPLAIN in parallel +--echo # +CREATE TABLE t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)); +INSERT INTO t1 (a) VALUES (3),(1),(5),(1); + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; + +send SHOW INDEX FROM t1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; + +DROP TABLE t1; + +--echo # +--echo # MDEV-324: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN for a query with TEMPTABLE view +--echo # loses 'DERIVED' line on the way without saying that the plan was already deleted +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; + +EXPLAIN SELECT a + 1 FROM v1; + +set debug_dbug='d,show_explain_probe_join_tab_preread'; +set @show_explain_probe_select_id=1; + +send + SELECT a + 1 FROM v1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug_dbug=''; + +DROP VIEW v1; +DROP TABLE t1; + + +--echo # +--echo # MDEV-323: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN loses +--echo # 'UNION RESULT' line on the way without saying that the plan was already deleted +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (4),(6); + +EXPLAIN +SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 ); + +set debug_dbug='d,show_explain_probe_union_read'; +send +SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 ); + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; + +set debug_dbug=''; + +DROP TABLE t1; + +--echo # +--echo # MDEV-327: SHOW EXPLAIN: Different select_type in plans produced by SHOW EXPLAIN +--echo # and standard EXPLAIN: 'SUBQUERY' vs 'DEPENDENT SUBQUERY' +--echo # +CREATE TABLE t1 (a INT) ENGINE=Aria; +INSERT INTO t1 VALUES +(4),(6),(3),(5),(3),(246),(2),(9),(3),(8), +(1),(8),(8),(5),(7),(5),(1),(6),(2),(9); + +CREATE TABLE t2 (b INT) ENGINE=Aria; +INSERT INTO t2 VALUES +(1),(7),(4),(7),(0),(2),(9),(4),(0),(9), +(1),(3),(8),(8),(18),(84),(6),(3),(6),(6); + +EXPLAIN +SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias +WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b ); + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +--send +SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias +WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b ); + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; +set debug_dbug=''; +DROP TABLE t1, t2; + +--echo # +--echo # Test that SHOW EXPLAIN will print 'Distinct'. +--echo # +CREATE TABLE t1 (a int(10) unsigned not null primary key,b int(10) unsigned); +INSERT INTO t1 VALUES (1,1),(2,1),(3,1),(4,1); + +CREATE TABLE t3 (a int(10) unsigned, key(A), b text); +INSERT INTO t3 VALUES (1,'1'),(2,'2'); + +create temporary table t4 select * from t3; +insert into t3 select * from t4; +insert into t4 select * from t3; +insert into t3 select * from t4; +insert into t4 select * from t3; +insert into t3 select * from t4; +insert into t4 select * from t3; +insert into t3 select * from t4; +explain select distinct t1.a from t1,t3 where t1.a=t3.a; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +--send +select distinct t1.a from t1,t3 where t1.a=t3.a; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; +set debug_dbug=''; + +drop table t1,t3,t4; + +--echo # +--echo # ---------- SHOW EXPLAIN and permissions ----------------- +--echo # +grant ALL on test.* to test2@localhost; + +# Give the user SUPER privilege so it can set debug_dbug variable. +grant super on *.* to test2@localhost; +connect (con2, localhost, test2,,); +connection con1; + +--echo # +--echo # First, make sure that user 'test2' cannot do SHOW EXPLAIN on us +--echo # +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send +select * from t0 where a < 3; + +connection default; +--source include/wait_condition.inc + +connection con2; +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +evalp show explain for $thr2; + +connection default; +evalp show explain for $thr2; + +connection con1; +reap; +set debug_dbug=''; + +--echo # +--echo # Check that user test2 can do SHOW EXPLAIN on its own queries +--echo # +connect (con3, localhost, test2,,); + +connection con2; +let $thr_con2=`select connection_id()`; +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send +select * from t0 where a < 3; + +connection con1; +let $save_wait_condition= $wait_condition; +let $wait_condition= select State='show_explain_trap' from information_schema.processlist where id=$thr_con2; +--source include/wait_condition.inc + +connection con3; +evalp show explain for $thr_con2; + +connection con2; +reap; + +connection con1; + +disconnect con3; +let $wait_condition= $save_wait_condition; +--echo # +--echo # Now, grant test2 a PROCESSLIST permission, and see that he's able to observe us +--echo # +disconnect con2; +grant process on *.* to test2@localhost; +connect (con2, localhost, test2,,); +connection con1; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send +select * from t0 where a < 3; + +connection default; +--source include/wait_condition.inc + +connection con2; +evalp show explain for $thr2; + +connection con1; +reap; +set debug_dbug=''; + +revoke all privileges on test.* from test2@localhost; +drop user test2@localhost; + +disconnect con2; +--echo # +--echo # Test that it is possible to KILL a SHOW EXPLAIN command that's waiting +--echo # on its target thread +--echo # +connect (con2, localhost, root,,); +connect (con3, localhost, root,,); +connection con2; +create table t1 (pk int primary key, data char(64)) engine=innodb; +insert into t1 select A.a + 10 * B.a + 100 * C.a, 'data1' from t0 A, t0 B, t0 C; + +--echo # Lock two threads +set autocommit=0; +select * from t1 where pk between 10 and 20 for update; + +connection con1; +set autocommit=0; +# This will freeze +send +select * from t1 where pk between 10 and 20 for update; + +# run SHOW EXPLAIN on a frozen thread +connection default; +let $save_wait_condition= $wait_condition; +let $wait_condition= select State='Sending data' from information_schema.processlist where id=$thr2; +let $thr_default=`select connection_id()`; +--source include/wait_condition.inc +--echo # do: send_eval show explain for thr2; +--disable_query_log +send_eval show explain for $thr2; +--enable_query_log + +# kill the SHOW EXPLAIN command +connection con3; +let $wait_condition= select State='show explain' from information_schema.processlist where id=$thr_default; +--source include/wait_condition.inc +evalp kill query $thr_default; + +connection default; +--error ER_QUERY_INTERRUPTED +reap; + +connection con2; +rollback; + +connection con1; +reap; + +drop table t1; +disconnect con3; +disconnect con2; +let $wait_condition= $save_wait_condition; + +--echo # +--echo # Check that the I_S table is invisible +--echo # +select table_name from information_schema.tables where table_schema='information_schema' and table_name like '%explain%'; + +--echo # +--echo # MDEV-325: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN is different from standard EXPLAIN: type ALL vs 'index_merge'.. +--echo # +CREATE TABLE t1 (a INT, b INT, KEY(a), KEY(b)) ENGINE=MyISAM; +INSERT INTO t1 VALUES +(8,0),(128,5050),(5372,8),(234,7596),(2,0),(2907,8930),(1,0), +(0,5224),(8,7638),(960,5),(9872,1534),(0,2295),(3408,9809), +(7,0),(1168,0),(2089,5570),(0,205),(88,1018),(0,26528), +(0,0),(4,5567),(1444,145),(6,0),(1,7535),(7793,534),(70,9), +(178,1),(44,5),(189,0),(3,0); + +EXPLAIN +SELECT a+SLEEP(0.01) FROM t1 +WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129 +ORDER BY b; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +--send +SELECT a+SLEEP(0.01) FROM t1 +WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129 +ORDER BY b; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_do_select'; +--send +SELECT a+SLEEP(0.01) FROM t1 +WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129 +ORDER BY b; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; + +set debug_dbug=''; + +drop table t1; + +--echo # +--echo # MDEV-298: SHOW EXPLAIN: Plan returned by SHOW EXPLAIN only contains +--echo # 'Using temporary' while the standard EXPLAIN says 'Using temporary; Using filesort' +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9), + (10),(11),(12),(13),(14),(15),(16); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12, t1 t13; + +EXPLAIN SELECT a FROM t1 GROUP BY a; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +--send +SELECT a FROM t1 GROUP BY a; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; + +set debug_dbug=''; + +drop table t1; + +--echo # +--echo # MDEV-408: SHOW EXPLAIN: Some values are chopped off in SHOW EXPLAIN output +--echo # +CREATE TABLE t1 (a INT, b VARCHAR(35)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (3989,'Abilene'),(3873,'Akron'); + +CREATE TABLE t2 (c INT, d VARCHAR(52) PRIMARY KEY, KEY(c)) ENGINE=InnoDB; +INSERT INTO t2 VALUES (86,'English'),(87,'Russian'); + +explain SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's'; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +--send +SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's'; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; + +set debug_dbug=''; + +drop table t1, t2; + +--echo # +--echo # MDEV-412: SHOW EXPLAIN: Server crashes in JOIN::print_explain on a query with inner join and ORDER BY the same column twice +--echo # +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(3), KEY(b)) ENGINE=MyISAM; +INSERT INTO t1 VALUES +(3795,'USA'),(3913,'USA'),(3846,'ITA'),(4021,'USA'),(4005,'RUS'),(4038,'USA'), +(3825,'USA'),(3840,'USA'),(3987,'USA'),(3807,'USA'),(3896,'USA'),(4052,'USA'), +(3973,'USA'),(3982,'ITA'),(3965,'USA'),(3852,'RUS'),(4006,'USA'),(3800,'USA'), +(4020,'USA'),(4040,'USA'),(3916,'USA'),(3817,'USA'),(3885,'USA'),(3802,'USA'), +(4009,'ITA'),(3895,'USA'),(3963,'RUS'),(4045,'USA'),(3988,'USA'),(3815,'USA'), +(4063,'USA'),(3978,'USA'),(4019,'USA'),(3954,'USA'),(3950,'USA'),(3974,'ITA'), +(4054,'USA'),(4061,'RUS'),(3976,'USA'),(3966,'USA'),(3957,'USA'),(3981,'USA'), +(3923,'USA'),(3876,'USA'),(3819,'USA'),(3877,'USA'),(3829,'ITA'),(3964,'USA'), +(4053,'RUS'),(3917,'USA'),(3874,'USA'),(4023,'USA'),(4001,'USA'),(3872,'USA'), +(3890,'USA'),(3962,'USA'),(3886,'USA'),(4026,'ITA'),(3869,'USA'),(3937,'RUS'), +(3975,'USA'),(3944,'USA'),(3908,'USA'),(3867,'USA'),(3947,'USA'),(3838,'USA'), +(3796,'USA'),(3893,'USA'),(3920,'ITA'),(3994,'USA'),(3875,'RUS'),(4011,'USA'), +(4013,'USA'),(3810,'USA'),(3834,'USA'),(3968,'USA'),(3931,'USA'),(3839,'USA'), +(4042,'USA'),(4039,'ITA'),(3811,'USA'),(3837,'RUS'),(4041,'USA'),(3884,'USA'), +(3894,'USA'),(3879,'USA'),(3942,'USA'),(3959,'USA'),(3814,'USA'),(4044,'USA'), +(3971,'ITA'),(3823,'USA'),(3793,'RUS'),(3855,'USA'),(3905,'USA'),(3865,'USA'), +(4046,'USA'),(3990,'USA'),(4022,'USA'),(3833,'USA'),(3918,'USA'),(4064,'ITA'), +(3821,'USA'),(3836,'RUS'),(3921,'USA'),(3914,'USA'),(3888,'USA'); + +CREATE TABLE t2 (c VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('USA'); + +CREATE TABLE t3 (d VARCHAR(3), e VARCHAR(52), PRIMARY KEY (d,e)) ENGINE=MyISAM; +INSERT INTO t3 VALUES +('JPN','Japanese'),('KOR','Korean'),('POL','Polish'),('PRT','Portuguese'), +('ESP','Spanish'),('FRA','French'),('VNM','Vietnamese'); + +explain +SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_do_select'; + +send +SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; + +set debug_dbug=''; + +DROP TABLE t1,t2,t3; + + +--echo # +--echo # MDEV-423: SHOW EXPLAIN: 'Using where' for a subquery is shown in EXPLAIN, but not in SHOW EXPLAIN output +--echo # +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (7),(0),(9),(3),(4),(2),(5),(7),(0),(9),(3),(4),(2),(5); + +CREATE TABLE t2 (b INT, c INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES +(0,4),(8,6),(1,3),(8,5),(9,3),(24,246),(6,2),(1,9),(6,3),(2,8), +(4,1),(8,8),(4,8),(4,5),(7,7),(4,5),(1,1),(9,6),(4,2),(8,9); + +create table t3 like t2; +insert into t3 select * from t2; + +explain +SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias +WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10; + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; + +send +SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias +WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; + +set debug_dbug=''; + +DROP TABLE t1,t2,t3; + +--echo # +--echo # MDEV-416: Server crashes in SQL_SELECT::cleanup on EXPLAIN with SUM ( DISTINCT ) in a non-correlated subquery (5.5-show-explain tree) +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (8),(9); + +EXPLAIN SELECT * FROM t1 +WHERE ( 8, 89 ) IN ( SELECT b, SUM( DISTINCT b ) FROM t2 GROUP BY b ); + +DROP TABLE t1,t2; + +--echo # +--echo # Check if queries in non-default charsets work. +--echo # + +set names cp1251; +# The below are two Russian letters with codes E3FB in cp1251 encoding. +select charset('ãû'); +select hex('ãû'); + +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; + +send +select * from t0 where length('ãû') = a; + +connection default; +set names utf8; +--source include/wait_condition.inc +evalp show explain for $thr2; +set names default; + +connection con1; +# The constant should be two letters, the last looking like 'bl' +reap; + +set debug_dbug=''; +set names default; + +--echo # +--echo # MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref if FOR contains a non-numeric value +--echo # +--error ER_SET_CONSTANTS_ONLY +show explain for foo; + +--echo # End +drop table t0; diff --git a/mysql-test/t/show_explain_ps.test b/mysql-test/t/show_explain_ps.test new file mode 100644 index 00000000000..4ad1e4304de --- /dev/null +++ b/mysql-test/t/show_explain_ps.test @@ -0,0 +1,51 @@ +# +# Test how SHOW EXPLAIN is represented in performance schema +# +--source include/have_debug.inc +--source include/have_perfschema.inc +# Like all other perfschema tests, we don't work on embedded server: +--source include/not_embedded.inc + +--disable_warnings +drop table if exists t0, t1; +--enable_warnings + +select * from performance_schema.setup_instruments where name like '%show_explain%'; + +--echo # We've got no instances +select * from performance_schema.cond_instances where name like '%show_explain%'; + +--echo # Check out if our cond is hit. + +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +let $thr1=`select connection_id()`; +connect (con1, localhost, root,,); +connection con1; +let $thr2=`select connection_id()`; +connection default; + +let $wait_condition= select State='show_explain_trap' from information_schema.processlist where id=$thr2; + +# +# Test SHOW EXPLAIN for simple queries +# +connection con1; +set @show_explain_probe_select_id=1; +set debug_dbug='d,show_explain_probe_join_exec_start'; +send select count(*) from t0 where a < 100000; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + +set debug_dbug=''; + +select event_name +from performance_schema.events_waits_history_long +where event_name='wait/synch/cond/sql/show_explain'; + +drop table t0; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 148ee6172b2..7fc8dad3bb9 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9111,9 +9111,14 @@ DROP FUNCTION f1; --echo # ------------------------------------------------------------------ --echo # ---echo # LP bug#993459 Execution of PS for a query with GROUP BY +--echo # lp:993459 Execution of PS for a query with GROUP BY --echo # returns wrong result (see also mysql bug#13805127) --echo # + +--echo +--echo # Bug#13805127: Stored program cache produces wrong result in same THD +--echo + delimiter |; CREATE PROCEDURE p1(x INT UNSIGNED) @@ -9147,7 +9152,7 @@ CALL p1(1); DROP PROCEDURE p1; --echo # ---echo # LP bug#1002157 : testing stored function +--echo # lp:1002157 : testing stored function --echo # bug#62125 result for null incorrectly yields 1292 warning. --echo # diff --git a/mysql-test/t/str_to_datetime_457.test b/mysql-test/t/str_to_datetime_457.test new file mode 100644 index 00000000000..dd25f98ebdd --- /dev/null +++ b/mysql-test/t/str_to_datetime_457.test @@ -0,0 +1,26 @@ +# +# MDEV-457 Inconsistent data truncation on datetime values with fractional seconds represented as strings with no delimiters +# (and other problems with str_to_datetime) +# + +# first was ok, second was not +select cast('01:02:03 ' as time), cast('01:02:03 ' as time); +# first two were ok, third was not +select cast('2002-011-012' as date), cast('2002.11.12' as date), cast('2002.011.012' as date); +# only two microsecond digits were ok, third was truncated with a warning +select cast('2012103123595912' as datetime(6)), cast('20121031235959123' as datetime(6)); +# zero string date was considered 'out of range'. Must be either ok or invalid format +select cast(0 as date), cast('0000-00-00' as date), cast('0' as date); +# first was ok, second was not +select extract(hour from '100000:02:03'), extract(hour from '100000:02:03 '); + +--echo # +--echo # backward compatibility craziness +--echo # +select cast('12:00:00.12.34.56' as time); # was 12:00:00 +select cast('12:00:00 12.34.56' as time); # was 12:34:56 +select cast('12:00:00-12.34.56' as time); # was 12:00:00 +select cast('12:00:00.12.34.56' as datetime); +select cast('12:00:00-12.34.56' as datetime); +select cast('12:00:00 12.34.56' as datetime); +select cast('12:00:00.123456' as time); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 85dc68f5d99..9f35ecc43f1 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -5576,7 +5576,28 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U drop table t1; --echo # ---echo # LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +--echo # MDEV-367: Different results with and without subquery_cache on +--echo # a query with a constant NOT IN condition +--echo # +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); + +set @mdev367_optimizer_switch = @@optimizer_switch; + +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +set optimizer_switch=@mdev367_optimizer_switch; + +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +set optimizer_switch=@mdev367_optimizer_switch; + +DROP TABLE t1; + +--echo # +--echo # lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not --echo # precomputed and thus not part of optimization --echo # @@ -5686,5 +5707,65 @@ SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t drop table t1,t2; ---echo # return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +--echo # +--echo # MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +--echo # +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); + +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); + +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); + +create table t4 like t3; +insert into t4 select * from t3; + +--echo # This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); + +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; + +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); + +--echo # The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +show index_statistics; +set global userstat=@tmp_mdev410; + +DROP TABLE t1,t2,t3,t4; + +--echo # +--echo # MDEV-430: Server crashes in select_describe on EXPLAIN with +--echo # materialization+semijoin, 2 nested subqueries, aggregate functions +--echo # +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); + +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); + +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; + +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +--echo # +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); + +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); + +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; + +DROP TABLE t1,t2; + diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index b53967e35e5..50b34eece89 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -185,6 +185,75 @@ SELECT * FROM (SELECT default(a) FROM t GROUP BY a) d; DROP TABLE t; --echo # +--echo # LP BUG#1009187, MDEV-373, MYSQL bug#58628 +--echo # Wrong result for a query with [NOT] IN subquery predicate if +--echo # the left part of the predicate is explicit NULL +--echo # + +CREATE TABLE t1 (pk INT NOT NULL, i INT NOT NULL); +INSERT INTO t1 VALUES (0,10), (1,20), (2,30), (3,40); + +CREATE TABLE t2a (pk INT NOT NULL, i INT NOT NULL, PRIMARY KEY(i,pk)); +INSERT INTO t2a VALUES (0,0), (1,1), (2,2), (3,3); + +CREATE TABLE t2b (pk INT, i INT); +INSERT INTO t2b VALUES (0,0), (1,1), (2,2), (3,3); + +CREATE TABLE t2c (pk INT NOT NULL, i INT NOT NULL); +INSERT INTO t2c VALUES (0,0), (1,1), (2,2), (3,3); +create index it2c on t2c (i,pk); + +CREATE TABLE t2d (pk INT NOT NULL, i INT NOT NULL, PRIMARY KEY(i)); +INSERT INTO t2d VALUES (0,0), (1,1), (2,2), (3,3); + +EXPLAIN +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk); +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk); +SELECT * FROM t1 WHERE 1+NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk); +SELECT * FROM t1 WHERE NULL IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk) IS UNKNOWN; +SELECT t1.pk, NULL NOT IN (SELECT t2a.i FROM t2a WHERE t2a.pk = t1.pk) FROM t1; + +EXPLAIN +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk); +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk); +SELECT * FROM t1 WHERE NULL IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk) IS UNKNOWN; +SELECT t1.pk, NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk) FROM t1; + +EXPLAIN +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk); +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk); +SELECT * FROM t1 WHERE NULL IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk) IS UNKNOWN; +SELECT t1.pk, NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk) FROM t1; + +EXPLAIN +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk); +SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk); +SELECT * FROM t1 WHERE NULL IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk) IS UNKNOWN; +SELECT t1.pk, NULL NOT IN (SELECT t2d.i FROM t2d WHERE t2d.pk = t1.pk) FROM t1; + +EXPLAIN +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2a.i, t2a.pk FROM t2a WHERE t2a.pk = t1.pk); +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2a.i, t2a.pk FROM t2a WHERE t2a.pk = t1.pk); +SELECT (NULL, 1) NOT IN (SELECT t2a.i, t2a.pk FROM t2a WHERE t2a.pk = t1.pk) from t1; + +EXPLAIN +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2b.i, t2b.pk FROM t2b WHERE t2b.pk = t1.pk); +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2b.i, t2b.pk FROM t2b WHERE t2b.pk = t1.pk); +SELECT (NULL, 1) NOT IN (SELECT t2b.i, t2b.pk FROM t2b WHERE t2b.pk = t1.pk) from t1; + +EXPLAIN +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk); +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk); +SELECT (NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk) from t1; + +EXPLAIN +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2d.i, t2d.pk FROM t2d WHERE t2d.pk = t1.pk); +SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2d.i, t2d.pk FROM t2d WHERE t2d.pk = t1.pk); +SELECT (NULL, 1) NOT IN (SELECT t2d.i, t2d.pk FROM t2d WHERE t2d.pk = t1.pk) from t1; + +drop table t1, t2a, t2b, t2c, t2d; + +--echo # --echo # End of 5.1 tests. --echo # diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 3af8f31062c..523e1774a9c 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -244,6 +244,54 @@ drop procedure p1; drop tables t1,t2,t3; --echo # +--echo # Bug #58756 +--echo # Crash in heap_rrnd on query with HAVING ... IN (subquery) + LIMIT +--echo # + +CREATE TABLE t1 ( + col_time_key time DEFAULT NULL, + col_datetime_key datetime DEFAULT NULL, + col_varchar_nokey varchar(1) DEFAULT NULL, + KEY col_time_key (col_time_key), + KEY col_datetime_key (col_datetime_key) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES ('17:53:30','2005-11-10 12:40:29','h'); +INSERT INTO t1 VALUES ('11:35:49','2009-04-25 00:00:00','b'); +INSERT INTO t1 VALUES (NULL,'2002-11-27 00:00:00','s'); +INSERT INTO t1 VALUES ('06:01:40','2004-01-26 20:32:32','e'); +INSERT INTO t1 VALUES ('05:45:11','2007-10-26 11:41:40','j'); +INSERT INTO t1 VALUES ('00:00:00','2005-10-07 00:00:00','e'); +INSERT INTO t1 VALUES ('00:00:00','2000-07-15 05:00:34','f'); +INSERT INTO t1 VALUES ('06:11:01','2000-04-03 16:33:32','v'); +INSERT INTO t1 VALUES ('13:02:46',NULL,'x'); +INSERT INTO t1 VALUES ('21:44:25','2001-04-25 01:26:12','m'); +INSERT INTO t1 VALUES ('22:43:58','2000-12-27 00:00:00','c'); + +CREATE TABLE t2 ( + col_time_key time DEFAULT NULL, + col_datetime_key datetime DEFAULT NULL, + col_varchar_nokey varchar(1) DEFAULT NULL, + KEY col_time_key (col_time_key), + KEY col_datetime_key (col_datetime_key) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO t2 VALUES ('11:28:45','2004-10-11 18:13:16','w'); + +SELECT col_time_key, col_datetime_key +FROM +( SELECT * FROM t1 ) AS table1 +HAVING ( 'r' , 'e' ) IN + ( SELECT col_varchar_nokey , col_varchar_nokey FROM t2 ) +ORDER BY col_datetime_key +LIMIT 10; + +DROP TABLE t1; +DROP TABLE t2; + +--echo # End of Bug #58756 + +--echo # --echo # Bug#60085 crash in Item::save_in_field() with time data type --echo # diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index 0a0c73da39b..685587fe3c5 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -161,6 +161,14 @@ SELECT COUNT(*) AS total_rows, MIN(c1+0) AS min_value, MAX(c1+0) FROM t1; DROP TABLE t1; --echo # +--echo # WL#6219: Deprecate and remove YEAR(2) type +--echo # + +CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4)); +ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); +DROP TABLE t1; + +--echo # --echo End of 5.1 tests # diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 0585073a6f5..c4881f7df3f 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4613,6 +4613,54 @@ DROP TRIGGER tr; DROP VIEW v1; DROP TABLE t1,t2,t3; +--echo # +--echo # LP bug#1007622 Server crashes in handler::increment_statistics on +--echo # inserting into a view over a view +--echo # + +flush status; +--disable_ps_protocol +CREATE TABLE t1 (a INT); +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a1.* FROM t1 AS a1, t1 AS a2; +CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM v1; +INSERT INTO v2 (a) VALUES (1) ; +select * from t1; +drop view v2,v1; +drop table t1; +show status like '%view%'; +show status like 'Opened_table%'; +--enable_ps_protocol + +--echo # +--echo # MDEV-486 LP BUG#1010116 Incorrect query results in +--echo # view and derived tables +--echo # + +SELECT +`Derived1`.`id`, +`Derived2`.`Val1` +FROM (select 30631 as `id`) AS `Derived1` LEFT OUTER JOIN (SELECT +2 as `id`, +1 AS `Val1` +FROM (select 30631 as `id`) AS `Derived3`) AS `Derived2` ON `Derived1`.`id` = `Derived2`.`id`; + +create table t1 ( id int ); +insert into t1 values (30631); +create table t2 ( id int ); +insert into t2 values (30631); +create algorithm=MERGE view v2 as select 2 as id, 1 as val1 from t2; +select t1.*, v2.* from t1 left join v2 on t1.id = v2.id; +drop view v2; +drop table t1,t2; + +create table t1 ( id int ); +insert into t1 values (30631); +create table t2 ( id int ); +insert into t2 values (30631); +create algorithm=MERGE view v2 as select 2 as id, id is null as bbb, id as iddqd, 1 as val1 from t2; +select t1.*, v2.* from t1 left join v2 on t1.id = v2.id; +drop view v2; +drop table t1,t2; --echo # ----------------------------------------------------------------- --echo # -- End of 5.3 tests. --echo # ----------------------------------------------------------------- diff --git a/mysql-test/t/xa_binlog.test b/mysql-test/t/xa_binlog.test index 48f1dc6dfaa..430d45ab86a 100644 --- a/mysql-test/t/xa_binlog.test +++ b/mysql-test/t/xa_binlog.test @@ -27,6 +27,6 @@ SELECT * FROM t1 ORDER BY a; --replace_column 2 # 5 # --replace_regex /xid=[0-9]+/xid=XX/ -SHOW BINLOG EVENTS LIMIT 1,9; +SHOW BINLOG EVENTS LIMIT 2,9; DROP TABLE t1; |