summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.mysql.com>2008-04-03 11:50:43 +0200
committerunknown <msvensson@pilot.mysql.com>2008-04-03 11:50:43 +0200
commit2b0abf767645ec2f589fd040b7d4dcc6518f7d09 (patch)
treeabcc5a4053c601e7cce25995bc6169db4e48d8c2 /mysql-test/r
parent3b8d2707297ad4aa280fb59e0196b1e664a7ec62 (diff)
parent32bf1f60b770320e0d0ba2e25b5cd193ab482316 (diff)
downloadmariadb-git-2b0abf767645ec2f589fd040b7d4dcc6518f7d09.tar.gz
Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr BitKeeper/etc/ignore: auto-union BitKeeper/deleted/.del-rpl_row_charset.test: Auto merged CMakeLists.txt: Auto merged configure.in: Auto merged client/mysqltest.c: Auto merged mysql-test/extra/binlog_tests/blackhole.test: Auto merged mysql-test/include/commit.inc: Auto merged mysql-test/include/mix1.inc: Auto merged mysql-test/lib/mtr_report.pm: Auto merged mysql-test/r/commit_1innodb.result: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/ctype_big5.result: Auto merged mysql-test/r/drop.result: Auto merged mysql-test/r/group_by.result: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/r/loaddata.result: Auto merged mysql-test/r/mysqlbinlog.result: Auto merged mysql-test/r/partition_error.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/r/warnings.result: Auto merged mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result: Auto merged mysql-test/suite/binlog/r/binlog_stm_blackhole.result: Auto merged mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result: Auto merged mysql-test/suite/binlog/r/binlog_unsafe.result: Auto merged mysql-test/suite/binlog/t/binlog_unsafe.test: Auto merged mysql-test/suite/federated/federated.result: Auto merged mysql-test/suite/federated/federated.test: Auto merged mysql-test/suite/parts/r/partition_alter1_myisam.result: Auto merged mysql-test/suite/parts/r/partition_alter2_myisam.result: Auto merged mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result: Auto merged mysql-test/suite/rpl/r/rpl_row_log.result: Auto merged mysql-test/suite/rpl/r/rpl_row_log_innodb.result: Auto merged mysql-test/suite/rpl/t/disabled.def: Auto merged mysql-test/suite/rpl/t/rpl_flushlog_loop.test: Auto merged mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/csv.test: Auto merged mysql-test/t/disabled.def: Auto merged mysql-test/t/distinct.test: Auto merged mysql-test/t/drop.test: Auto merged mysql-test/t/group_by.test: Auto merged mysql-test/t/innodb.test: Auto merged mysql-test/t/loaddata.test: Auto merged mysql-test/t/partition_error.test: Auto merged mysql-test/t/query_cache.test: Auto merged mysql-test/t/sp.test: Auto merged mysql-test/t/view.test: Auto merged mysql-test/t/warnings.test: Auto merged sql/ha_ndbcluster.cc: Auto merged BitKeeper/deleted/.del-combinations: Delete: mysql-test/suite/binlog/combinations mysql-test/r/partition_not_windows.result: Use remote mysql-test/r/partition_symlink.result: Use remote mysql-test/r/symlink.result: SCCS merged mysql-test/suite/parts/inc/partition_basic.inc: SCCS merged mysql-test/suite/parts/inc/partition_check_drop.inc: Use remote mysql-test/suite/parts/inc/partition_layout_check1.inc: Use remote mysql-test/suite/parts/inc/partition_layout_check2.inc: Use remote mysql-test/suite/parts/r/partition_basic_innodb.result: Use remote mysql-test/suite/parts/r/partition_basic_myisam.result: Use remote mysql-test/suite/parts/r/partition_engine_myisam.result: Use remote mysql-test/suite/parts/t/partition_sessions.test: SCCS merged mysql-test/t/partition.test: SCCS merged mysql-test/t/partition_not_windows.test: Use remote mysql-test/t/partition_symlink.test: Use remote mysql-test/t/symlink.test: Use remote mysql-test/suite/binlog/r/binlog_multi_engine.result: Manual merge, name of binlog file changed mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test: Manual merge mysys/my_init.c: Manual merge
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/alter_table.result8
-rw-r--r--mysql-test/r/binlog_index.result39
-rw-r--r--mysql-test/r/change_user.result4
-rw-r--r--mysql-test/r/commit_1innodb.result16
-rw-r--r--mysql-test/r/compare.result38
-rw-r--r--mysql-test/r/connect.result103
-rw-r--r--mysql-test/r/create.result55
-rw-r--r--mysql-test/r/csv.result9
-rw-r--r--mysql-test/r/ctype_big5.result19
-rw-r--r--mysql-test/r/ctype_cp1250_ch.result186
-rw-r--r--mysql-test/r/ctype_cp932_binlog_row.result2
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result6
-rw-r--r--mysql-test/r/ctype_euckr.result19
-rw-r--r--mysql-test/r/ctype_gb2312.result19
-rw-r--r--mysql-test/r/ctype_gbk.result19
-rw-r--r--mysql-test/r/ctype_uca.result19
-rw-r--r--mysql-test/r/ctype_ucs.result93
-rw-r--r--mysql-test/r/ctype_ucs2_def.result10
-rw-r--r--mysql-test/r/distinct.result23
-rw-r--r--mysql-test/r/drop.result27
-rw-r--r--mysql-test/r/flush.result1
-rw-r--r--mysql-test/r/flush_read_lock_kill.result2
-rw-r--r--mysql-test/r/func_gconcat.result15
-rw-r--r--mysql-test/r/func_group.result6
-rw-r--r--mysql-test/r/func_math.result19
-rw-r--r--mysql-test/r/func_misc.result22
-rw-r--r--mysql-test/r/func_str.result5
-rw-r--r--mysql-test/r/func_time.result23
-rw-r--r--mysql-test/r/grant.result39
-rw-r--r--mysql-test/r/grant3.result17
-rw-r--r--mysql-test/r/group_by.result146
-rw-r--r--mysql-test/r/heap.result1
-rw-r--r--mysql-test/r/information_schema.result15
-rw-r--r--mysql-test/r/information_schema_db.result6
-rw-r--r--mysql-test/r/information_schema_inno.result11
-rw-r--r--mysql-test/r/innodb.result20
-rw-r--r--mysql-test/r/innodb_mysql.result6
-rw-r--r--mysql-test/r/kill.result2
-rw-r--r--mysql-test/r/loaddata.result76
-rw-r--r--mysql-test/r/log_tables.result11
-rw-r--r--mysql-test/r/merge-big.result51
-rw-r--r--mysql-test/r/merge.result26
-rw-r--r--mysql-test/r/mix2_myisam.result1
-rw-r--r--mysql-test/r/myisam.result182
-rw-r--r--mysql-test/r/mysqlbinlog.result16
-rw-r--r--mysql-test/r/mysqlbinlog2.result70
-rw-r--r--mysql-test/r/mysqldump-no-binlog.result1
-rw-r--r--mysql-test/r/null_key.result18
-rw-r--r--mysql-test/r/order_by.result42
-rw-r--r--mysql-test/r/partition.result53
-rw-r--r--mysql-test/r/partition_datatype.result90
-rw-r--r--mysql-test/r/partition_error.result13
-rw-r--r--mysql-test/r/partition_innodb.result9
-rw-r--r--mysql-test/r/partition_not_windows.result88
-rw-r--r--mysql-test/r/partition_range.result33
-rw-r--r--mysql-test/r/partition_symlink.result70
-rw-r--r--mysql-test/r/partition_windows.result40
-rw-r--r--mysql-test/r/plugin.result27
-rw-r--r--mysql-test/r/plugin_load.result3
-rw-r--r--mysql-test/r/query_cache.result36
-rw-r--r--mysql-test/r/range.result52
-rw-r--r--mysql-test/r/row.result9
-rw-r--r--mysql-test/r/select.result27
-rw-r--r--mysql-test/r/sp-code.result28
-rw-r--r--mysql-test/r/sp-error.result12
-rw-r--r--mysql-test/r/sp-security.result8
-rw-r--r--mysql-test/r/sp.result17
-rw-r--r--mysql-test/r/sp_notembedded.result34
-rw-r--r--mysql-test/r/sql_mode.result10
-rw-r--r--mysql-test/r/strict.result7
-rw-r--r--mysql-test/r/subselect3.result13
-rw-r--r--mysql-test/r/subselect_notembedded.result129
-rw-r--r--mysql-test/r/symlink.result83
-rw-r--r--mysql-test/r/tablelock.result9
-rw-r--r--mysql-test/r/temp_table.result11
-rw-r--r--mysql-test/r/trigger-trans.result19
-rw-r--r--mysql-test/r/trigger_notembedded.result4
-rw-r--r--mysql-test/r/type_binary.result1
-rw-r--r--mysql-test/r/type_set.result9
-rw-r--r--mysql-test/r/user_var-binlog.result2
-rw-r--r--mysql-test/r/view.result42
-rw-r--r--mysql-test/r/view_grant.result16
-rw-r--r--mysql-test/r/warnings.result38
83 files changed, 2242 insertions, 364 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 68b636829fc..3cec1f546d2 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -539,7 +539,7 @@ F2E5F1F2
drop table t1;
create table t1 ( a timestamp );
alter table t1 add unique ( a(1) );
-ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
drop table t1;
drop table if exists t1;
create table t1 (a int, key(a));
@@ -953,12 +953,12 @@ t1 CREATE TABLE `t1` (
KEY `b_2` (`b`(50))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 (a INT, KEY (a(20)));
-ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
ALTER TABLE t1 ADD d INT;
ALTER TABLE t1 ADD KEY (d(20));
-ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
ALTER TABLE t1 ADD e GEOMETRY NOT NULL, ADD SPATIAL KEY (e(30));
-ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
DROP TABLE t1;
CREATE TABLE t1 (s CHAR(8) BINARY);
INSERT INTO t1 VALUES ('test');
diff --git a/mysql-test/r/binlog_index.result b/mysql-test/r/binlog_index.result
new file mode 100644
index 00000000000..9f3c3746bd4
--- /dev/null
+++ b/mysql-test/r/binlog_index.result
@@ -0,0 +1,39 @@
+flush logs;
+flush logs;
+flush logs;
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+master-bin.000003 #
+master-bin.000004 #
+purge binary logs TO 'master-bin.000004';
+Warnings:
+Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
+*** must show a list starting from the 'TO' argument of PURGE ***
+show binary logs;
+Log_name File_size
+master-bin.000004 #
+reset master;
+flush logs;
+flush logs;
+flush logs;
+*** must be a warning master-bin.000001 was not found ***
+Warnings:
+Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
+*** must show one record, of the active binlog, left in the index file after PURGE ***
+show binary logs;
+Log_name File_size
+master-bin.000004 #
+reset master;
+flush logs;
+flush logs;
+flush logs;
+purge binary logs TO 'master-bin.000002';
+ERROR HY000: Fatal error during log purge
+show warnings;
+Level Code Message
+Error 1377 a problem with deleting MYSQLTEST_VARDIR/log/master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
+Error 1377 Fatal error during log purge
+reset master;
+End of tests
diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result
index 28b55dfd5e5..a075c01fe61 100644
--- a/mysql-test/r/change_user.result
+++ b/mysql-test/r/change_user.result
@@ -4,14 +4,14 @@ SELECT @@session.sql_big_selects;
1
SELECT @@global.max_join_size;
@@global.max_join_size
-18446744073709551615
+HA_POS_ERROR
change_user
SELECT @@session.sql_big_selects;
@@session.sql_big_selects
1
SELECT @@global.max_join_size;
@@global.max_join_size
-18446744073709551615
+HA_POS_ERROR
SET @@global.max_join_size = 10000;
SET @@session.max_join_size = default;
change_user
diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index f9be8c2b519..f226543c665 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -571,27 +571,35 @@ SUCCESS
# 16. A function changes non-trans-table.
#
+# For row-based logging, there is an extra commit for the
+# non-transactional changes saved in the transaction cache to
+# the binary log.
+#
select f1();
f1()
2
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(0, 0, 1, 0);
SUCCESS
commit;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(0, 0, 1, 0);
SUCCESS
# 17. Read-only statement, a function changes non-trans-table.
#
+# For row-based logging, there is an extra commit for the
+# non-transactional changes saved in the transaction cache to
+# the binary log.
+#
select f1() from t1;
f1()
2
2
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(1, 0, 2, 0);
SUCCESS
commit;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(1, 0, 2, 0);
SUCCESS
# 18. Read-write statement: UPDATE, change 0 (transactional) rows.
diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result
index c141b255716..44c258d7611 100644
--- a/mysql-test/r/compare.result
+++ b/mysql-test/r/compare.result
@@ -53,3 +53,41 @@ a b
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: ''
drop table if exists t1;
+CREATE TABLE t1 (b int(2) zerofill, c int(2) zerofill);
+INSERT INTO t1 (b,c) VALUES (1,2), (1,1), (2,2);
+SELECT CONCAT(b,c), CONCAT(b,c) = '0101' FROM t1;
+CONCAT(b,c) CONCAT(b,c) = '0101'
+0102 0
+0101 1
+0202 0
+EXPLAIN EXTENDED SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 1) and (concat('01',`test`.`t1`.`c`) = '0101'))
+SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101';
+b c
+01 01
+CREATE TABLE t2 (a int);
+INSERT INTO t2 VALUES (1),(2);
+SELECT a,
+(SELECT COUNT(*) FROM t1
+WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x
+FROM t2 ORDER BY a;
+a x
+1 1
+2 0
+EXPLAIN EXTENDED
+SELECT a,
+(SELECT COUNT(*) FROM t1
+WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x
+FROM t2 ORDER BY a;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using filesort
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
+Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select `test`.`t2`.`a` AS `a`,(select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01')))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
+DROP TABLE t1,t2;
+End of 5.0 tests
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 25cf4f90e6d..727433d3032 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -115,3 +115,106 @@ create temporary table t2(id integer not null auto_increment primary key);
set @id := 1;
delete from t1 where id like @id;
drop table t1;
+# ------------------------------------------------------------------
+# -- End of 4.1 tests
+# ------------------------------------------------------------------
+
+# -- Bug#33507: Event scheduler creates more threads than max_connections
+# -- which results in user lockout.
+
+GRANT USAGE ON *.* TO mysqltest_u1@localhost;
+
+SET GLOBAL max_connections = 3;
+SET GLOBAL event_scheduler = ON;
+
+# -- Waiting for Event Scheduler to start...
+
+# -- Disconnecting default connection...
+
+# -- Check that we allow exactly three user connections, no matter how
+# -- many threads are running.
+
+# -- Connecting (1)...
+# -- Establishing connection 'con_1' (user: mysqltest_u1)...
+# -- Connection 'con_1' has been established.
+
+# -- Connecting (2)...
+# -- Establishing connection 'con_2' (user: mysqltest_u1)...
+# -- Connection 'con_2' has been established.
+
+# -- Connecting (3)...
+# -- Establishing connection 'con_3' (user: mysqltest_u1)...
+# -- Connection 'con_3' has been established.
+
+# -- Connecting (4) [should fail]...
+# -- Establishing connection 'con_4' (user: mysqltest_u1)...
+# -- Error: can not establish connection 'con_4'.
+
+# -- Check that we allow one extra SUPER-user connection.
+
+# -- Connecting super (1)...
+# -- Establishing connection 'con_super_1' (user: root)...
+# -- Connection 'con_super_1' has been established.
+
+# -- Connecting super (2) [should fail]...
+# -- Establishing connection 'con_super_2' (user: root)...
+# -- Error: can not establish connection 'con_super_2'.
+
+# -- Ensure that we have Event Scheduler thread, 3 ordinary user
+# -- connections and one extra super-user connection.
+SELECT user FROM information_schema.processlist ORDER BY id;
+user
+event_scheduler
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+root
+
+# -- Resetting variables...
+SET GLOBAL max_connections = 151;
+
+# -- Stopping Event Scheduler...
+SET GLOBAL event_scheduler = OFF;
+
+# -- Waiting for Event Scheduler to stop...
+
+# -- That's it. Closing connections...
+
+# -- Restoring default connection...
+
+# -- Waiting for connections to close...
+
+DROP USER mysqltest_u1@localhost;
+
+# -- End of Bug#33507.
+
+# -- Bug#35074: max_used_connections is not correct.
+
+FLUSH STATUS;
+
+SHOW STATUS LIKE 'max_used_connections';
+Variable_name Value
+Max_used_connections 1
+
+# -- Starting Event Scheduler...
+SET GLOBAL event_scheduler = ON;
+# -- Waiting for Event Scheduler to start...
+
+# -- Opening a new connection to check max_used_connections...
+
+# -- Check that max_used_connections hasn't changed.
+SHOW STATUS LIKE 'max_used_connections';
+Variable_name Value
+Max_used_connections 2
+
+# -- Closing new connection...
+
+# -- Stopping Event Scheduler...
+SET GLOBAL event_scheduler = OFF;
+# -- Waiting for Event Scheduler to stop...
+
+# -- End of Bug#35074.
+
+# ------------------------------------------------------------------
+# -- End of 5.1 tests
+# ------------------------------------------------------------------
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index f4684c181d2..19b3adc9bf5 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1545,6 +1545,20 @@ Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 7
drop table t1,t2;
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1));
+DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE);
+DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 c1 1 c1 NULL 0 NULL NULL YES HASH
+DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 c1 1 c1 A NULL NULL NULL YES BTREE
+DROP TABLE t1;
End of 5.0 tests
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
@@ -1834,4 +1848,45 @@ DROP TABLE t3;
# -- End of Bug#18834.
+# --
+# -- Bug#34274: Invalid handling of 'DEFAULT 0' for YEAR data type.
+# --
+
+DROP TABLE IF EXISTS t1;
+
+CREATE TABLE t1(c1 YEAR DEFAULT 2008, c2 YEAR DEFAULT 0);
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` year(4) DEFAULT '2008',
+ `c2` year(4) DEFAULT '0000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+INSERT INTO t1 VALUES();
+
+SELECT * FROM t1;
+c1 c2
+2008 0000
+
+ALTER TABLE t1 MODIFY c1 YEAR DEFAULT 0;
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` year(4) DEFAULT '0000',
+ `c2` year(4) DEFAULT '0000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+INSERT INTO t1 VALUES();
+
+SELECT * FROM t1;
+c1 c2
+2008 0000
+0000 0000
+
+DROP TABLE t1;
+
+# -- End of Bug#34274
+
End of 5.1 tests
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index b0033383f00..b91272f7e59 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5379,4 +5379,13 @@ SHOW WARNINGS;
Level Code Message
Error 1178 The storage engine for the table doesn't support nullable columns
Error 1005 Can't create table 'test.t1' (errno: 138)
+create table t1 (c1 tinyblob not null) engine=csv;
+insert into t1 values("This");
+update t1 set c1="That" where c1="This";
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select * from t1;
+c1
+That
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index 4b1a3f3f398..2efcf549608 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -3,6 +3,8 @@ SET @test_character_set= 'big5';
SET @test_collation= 'big5_chinese_ci';
SET @safe_character_set_server= @@character_set_server;
SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
SET character_set_server= @test_character_set;
SET collation_server= @test_collation;
CREATE DATABASE d1;
@@ -69,10 +71,27 @@ select 1 from t1 order by cast(a as char(1));
1
1
drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=big5
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
SET NAMES big5;
SET collation_connection='big5_chinese_ci';
create table t1 select repeat('a',4000) a;
diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result
index 4b02fa2182a..7f0cdf3f17b 100644
--- a/mysql-test/r/ctype_cp1250_ch.result
+++ b/mysql-test/r/ctype_cp1250_ch.result
@@ -3,6 +3,192 @@ DROP TABLE IF EXISTS t1;
SHOW COLLATION LIKE 'cp1250_czech_cs';
Collation Charset Id Default Compiled Sortlen
cp1250_czech_cs cp1250 34 Yes 2
+SET @test_character_set= 'cp1250';
+SET @test_collation= 'cp1250_general_ci';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
+SET character_set_server= @test_character_set;
+SET collation_server= @test_collation;
+CREATE DATABASE d1;
+USE d1;
+CREATE TABLE t1 (c CHAR(10), KEY(c));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c char(10) cp1250_general_ci YES MUL NULL
+INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
+SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
+want3results
+aaa
+aaaa
+aaaaa
+DROP TABLE t1;
+CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c1 varchar(15) cp1250_general_ci YES MUL NULL
+INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
+SELECT c1 as want3results from t1 where c1 like 'l%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want3results from t1 where c1 like 'lo%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want1result from t1 where c1 like 'loc%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'loca%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locat%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locati%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locatio%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'location%';
+want1result
+location
+DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
+drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1250
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
+SET @test_character_set= 'cp1250';
+SET @test_collation= 'cp1250_czech_cs';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
+SET character_set_server= @test_character_set;
+SET collation_server= @test_collation;
+CREATE DATABASE d1;
+USE d1;
+CREATE TABLE t1 (c CHAR(10), KEY(c));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c char(10) cp1250_czech_cs YES MUL NULL
+INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
+SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
+want3results
+aaa
+aaaa
+aaaaa
+DROP TABLE t1;
+CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c1 varchar(15) cp1250_czech_cs YES MUL NULL
+INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
+SELECT c1 as want3results from t1 where c1 like 'l%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want3results from t1 where c1 like 'lo%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want1result from t1 where c1 like 'loc%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'loca%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locat%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locati%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locatio%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'location%';
+want1result
+location
+DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
+drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) COLLATE cp1250_czech_cs DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1250 COLLATE=cp1250_czech_cs
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs;
INSERT INTO t1 VALUES ('');
SELECT a, length(a), a='', a=' ', a=' ' FROM t1;
diff --git a/mysql-test/r/ctype_cp932_binlog_row.result b/mysql-test/r/ctype_cp932_binlog_row.result
index 39d7727b58a..0370b7a1cf6 100644
--- a/mysql-test/r/ctype_cp932_binlog_row.result
+++ b/mysql-test/r/ctype_cp932_binlog_row.result
@@ -9,8 +9,10 @@ EXECUTE stmt1 USING @var1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
+master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
SELECT HEX(f1) FROM t1;
HEX(f1)
8300
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
index cbdafc95b2a..946c06f1e07 100644
--- a/mysql-test/r/ctype_cp932_binlog_stm.result
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -40,9 +40,9 @@ IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
-master-bin.000001 783 Query 1 999 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
-master-bin.000001 999 Query 1 1088 use `test`; DROP PROCEDURE bug18293
-master-bin.000001 1088 Query 1 1167 use `test`; DROP TABLE t4
+master-bin.000001 783 Query 1 991 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
+master-bin.000001 991 Query 1 1080 use `test`; DROP PROCEDURE bug18293
+master-bin.000001 1080 Query 1 1159 use `test`; DROP TABLE t4
End of 5.0 tests
SHOW BINLOG EVENTS FROM 364;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result
index c2a1b70eda9..6490044ea1a 100644
--- a/mysql-test/r/ctype_euckr.result
+++ b/mysql-test/r/ctype_euckr.result
@@ -3,6 +3,8 @@ SET @test_character_set= 'euckr';
SET @test_collation= 'euckr_korean_ci';
SET @safe_character_set_server= @@character_set_server;
SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
SET character_set_server= @test_character_set;
SET collation_server= @test_collation;
CREATE DATABASE d1;
@@ -69,10 +71,27 @@ select 1 from t1 order by cast(a as char(1));
1
1
drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=euckr
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
SET NAMES euckr;
SET collation_connection='euckr_korean_ci';
create table t1 select repeat('a',4000) a;
diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result
index 42f6d6c6e3b..2f789ab5b13 100644
--- a/mysql-test/r/ctype_gb2312.result
+++ b/mysql-test/r/ctype_gb2312.result
@@ -3,6 +3,8 @@ SET @test_character_set= 'gb2312';
SET @test_collation= 'gb2312_chinese_ci';
SET @safe_character_set_server= @@character_set_server;
SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
SET character_set_server= @test_character_set;
SET collation_server= @test_collation;
CREATE DATABASE d1;
@@ -69,10 +71,27 @@ select 1 from t1 order by cast(a as char(1));
1
1
drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=gb2312
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
SET NAMES gb2312;
SET collation_connection='gb2312_chinese_ci';
create table t1 select repeat('a',4000) a;
diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result
index 0a326c3bf65..98a6839be4c 100644
--- a/mysql-test/r/ctype_gbk.result
+++ b/mysql-test/r/ctype_gbk.result
@@ -3,6 +3,8 @@ SET @test_character_set= 'gbk';
SET @test_collation= 'gbk_chinese_ci';
SET @safe_character_set_server= @@character_set_server;
SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
SET character_set_server= @test_character_set;
SET collation_server= @test_collation;
CREATE DATABASE d1;
@@ -69,10 +71,27 @@ select 1 from t1 order by cast(a as char(1));
1
1
drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=gbk
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
SET NAMES gbk;
SET collation_connection='gbk_chinese_ci';
create table t1 select repeat('a',4000) a;
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index 706e764b281..04727f84ff2 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -2538,6 +2538,8 @@ SET @test_character_set= 'utf8';
SET @test_collation= 'utf8_swedish_ci';
SET @safe_character_set_server= @@character_set_server;
SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
SET character_set_server= @test_character_set;
SET collation_server= @test_collation;
CREATE DATABASE d1;
@@ -2604,10 +2606,27 @@ select 1 from t1 order by cast(a as char(1));
1
1
drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) COLLATE utf8_swedish_ci DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci;
insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c');
select a, a regexp '[a]' from t1 order by binary a;
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index dd9ceeb1450..20dd85834dd 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -1,4 +1,97 @@
DROP TABLE IF EXISTS t1;
+SET @test_character_set= 'ucs2';
+SET @test_collation= 'ucs2_general_ci';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET @safe_character_set_client= @@character_set_client;
+SET @safe_character_set_results= @@character_set_results;
+SET character_set_server= @test_character_set;
+SET collation_server= @test_collation;
+CREATE DATABASE d1;
+USE d1;
+CREATE TABLE t1 (c CHAR(10), KEY(c));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c char(10) ucs2_general_ci YES MUL NULL
+INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
+SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
+want3results
+aaa
+aaaa
+aaaaa
+DROP TABLE t1;
+CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
+SHOW FULL COLUMNS FROM t1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c1 varchar(15) ucs2_general_ci YES MUL NULL
+INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
+SELECT c1 as want3results from t1 where c1 like 'l%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want3results from t1 where c1 like 'lo%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want1result from t1 where c1 like 'loc%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'loca%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locat%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locati%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'locatio%';
+want1result
+location
+SELECT c1 as want1result from t1 where c1 like 'location%';
+want1result
+location
+DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+select 1 from t1 order by cast(a as char(1));
+1
+1
+1
+drop table t1;
+set names utf8;
+create table t1 (
+name varchar(10),
+level smallint unsigned);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `name` varchar(10) DEFAULT NULL,
+ `level` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=ucs2
+insert into t1 values ('string',1);
+select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
+concat(name,space(level)) concat(name, repeat(' ',level))
+string string
+drop table t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
+SET character_set_client= @safe_character_set_client;
+SET character_set_results= @safe_character_set_results;
SET NAMES latin1;
SET character_set_connection=ucs2;
select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
diff --git a/mysql-test/r/ctype_ucs2_def.result b/mysql-test/r/ctype_ucs2_def.result
index 6fd45428368..005d46062fb 100644
--- a/mysql-test/r/ctype_ucs2_def.result
+++ b/mysql-test/r/ctype_ucs2_def.result
@@ -21,4 +21,14 @@ INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C');
INSERT INTO t1 VALUES('A ', 'A ');
ERROR 23000: Duplicate entry '' for key 'key1'
DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL,
+KEY(c1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('marshall\'s');
+INSERT INTO t1 VALUES ('marsh');
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index b2a9eb04c04..15e4c3f15b3 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -682,3 +682,26 @@ a a b
1 1 3
DROP TABLE t1;
End of 5.0 tests
+CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT,
+PRIMARY KEY(a,b,c,d,e),
+KEY(a,b,d,c)
+);
+INSERT INTO t1(a, b, c) VALUES (1, 1, 1),
+(1, 1, 2),
+(1, 1, 3),
+(1, 2, 1),
+(1, 2, 2),
+(1, 2, 3);
+EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 16 NULL 6 Using index
+SELECT DISTINCT a, b, d, c FROM t1;
+a b d c
+1 1 0 1
+1 1 0 2
+1 1 0 3
+1 2 0 1
+1 2 0 2
+1 2 0 3
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index 675c85d676e..b798b49dd34 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -93,4 +93,31 @@ create table mysql_test.`#sql-347f_7` (f1 int);
create table mysql_test.`#sql-347f_8` (f1 int);
drop table mysql_test.`#sql-347f_8`;
drop database mysql_test;
+
+# --
+# -- Bug#29958: Weird message on DROP DATABASE if mysql.proc does not
+# -- exist.
+# --
+DROP DATABASE IF EXISTS mysql_test;
+CREATE DATABASE mysql_test;
+DROP TABLE mysql.proc;
+DROP DATABASE mysql_test;
+Warnings:
+Error 1146 Table 'mysql.proc' doesn't exist
+
+# --
+# -- End of Bug#29958.
+# --
+
+create database mysqltestbug26703;
+use mysqltestbug26703;
+create table `#mysql50#abc``def` ( id int );
+create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
+ERROR 42000: Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
+create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
+create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
+ERROR 42000: Incorrect table name '#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+use test;
+drop database mysqltestbug26703;
End of 5.1 tests
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index f1b6c471943..b978304f59d 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -72,6 +72,7 @@ flush tables with read lock;
unlock tables;
drop table t1, t2;
set session low_priority_updates=default;
+select benchmark(200, (select sin(1))) > 1000;
End of 5.0 tests
set @old_general_log= @@general_log;
set @old_read_only= @@read_only;
diff --git a/mysql-test/r/flush_read_lock_kill.result b/mysql-test/r/flush_read_lock_kill.result
index f69656806da..0b599f343f7 100644
--- a/mysql-test/r/flush_read_lock_kill.result
+++ b/mysql-test/r/flush_read_lock_kill.result
@@ -1,3 +1,4 @@
+set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
drop table if exists t1;
create table t1 (kill_id int);
@@ -8,3 +9,4 @@ select ((@id := kill_id) - kill_id) from t1;
0
kill connection @id;
drop table t1;
+set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index b5bfadf1f57..04f83788571 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -937,4 +937,19 @@ SELECT GROUP_CONCAT(DISTINCT b, a ORDER BY b) FROM t1;
GROUP_CONCAT(DISTINCT b, a ORDER BY b)
11,22,32
DROP TABLE t1, t2, t3;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (),();
+SELECT s1.d1 FROM
+(
+SELECT
+t1.a as d1,
+GROUP_CONCAT(DISTINCT t1.a) AS d2
+FROM
+t1 AS t1,
+t1 AS t2
+GROUP BY 1
+) AS s1;
+d1
+NULL
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 4c1abb160c6..c198176532f 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1410,4 +1410,10 @@ Note 1003 select (`test`.`t1`.`a` + 1) AS `y` from `test`.`t1` group by (`test`.
DROP VIEW v1;
DROP TABLE t1;
SET SQL_MODE=DEFAULT;
+CREATE TABLE t1(a DOUBLE);
+INSERT INTO t1 VALUES (10), (20);
+SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
+AVG(a) CAST(AVG(a) AS DECIMAL)
+15 15
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 6a476d12896..b4a07f18521 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -408,3 +408,22 @@ a DIV 2
0
DROP TABLE t1;
End of 5.0 tests
+SELECT 1e308 + 1e308;
+1e308 + 1e308
+NULL
+SELECT -1e308 - 1e308;
+-1e308 - 1e308
+NULL
+SELECT 1e300 * 1e300;
+1e300 * 1e300
+NULL
+SELECT 1e300 / 1e-300;
+1e300 / 1e-300
+NULL
+SELECT EXP(750);
+EXP(750)
+NULL
+SELECT POW(10, 309);
+POW(10, 309)
+NULL
+End of 5.1 tests
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 745a340ec94..a6b912b4e0a 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -212,6 +212,25 @@ test
SELECT NAME_CONST('test', 'test');
test
test
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT NAME_CONST('flag',1) * MAX(a) FROM t1;
+NAME_CONST('flag',1) * MAX(a)
+3
+SELECT NAME_CONST('flag',1.5) * MAX(a) FROM t1;
+NAME_CONST('flag',1.5) * MAX(a)
+4.5
+SELECT NAME_CONST('flag',-1) * MAX(a) FROM t1;
+NAME_CONST('flag',-1) * MAX(a)
+-3
+SELECT NAME_CONST('flag',-1.5) * MAX(a) FROM t1;
+NAME_CONST('flag',-1.5) * MAX(a)
+-4.5
+SELECT NAME_CONST('flag', SQRT(4)) * MAX(a) FROM t1;
+ERROR HY000: Incorrect arguments to NAME_CONST
+SELECT NAME_CONST('flag',-SQRT(4)) * MAX(a) FROM t1;
+ERROR HY000: Incorrect arguments to NAME_CONST
+DROP TABLE t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (5), (2);
SELECT NAME_CONST(x,2) FROM (SELECT a x FROM t1) t;
@@ -230,6 +249,9 @@ select min(a) from t1 group by inet_ntoa(a);
min(a)
-2
drop table t1;
+SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
+NAME_CONST('var', 'value') COLLATE latin1_general_cs
+value
End of 5.0 tests
select connection_id() > 0;
connection_id() > 0
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index ea79eefb316..78748a4622f 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1431,6 +1431,11 @@ benchmark(100, NULL)
select benchmark(NULL, 1+1);
benchmark(NULL, 1+1)
NULL
+select benchmark(-1, 1);
+benchmark(-1, 1)
+NULL
+Warnings:
+Error 1411 Incorrect count value: '-1' for function benchmark
set @password="password";
set @my_data="clear text to encode";
select md5(encode(@my_data, "password"));
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 9cdf8a3cf50..cc0fb88b791 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -666,6 +666,8 @@ timestampadd(SQL_TSI_SECOND, 1, date)
select timestampadd(SQL_TSI_FRAC_SECOND, 1, date) from t1;
timestampadd(SQL_TSI_FRAC_SECOND, 1, date)
2003-01-02 00:00:00.000001
+Warnings:
+Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 6.2. Please use MICROSECOND instead
select timestampdiff(MONTH, '2001-02-01', '2001-05-01') as a;
a
3
@@ -699,6 +701,8 @@ a
select timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a;
a
7689538999999
+Warnings:
+Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 6.2. Please use MICROSECOND instead
select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1,
timestampdiff(SQL_TSI_DAY, '1900-02-01', '1900-03-01') as a2,
timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3,
@@ -1069,6 +1073,7 @@ timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
+Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 6.2. Please use MICROSECOND instead
Note 1003 select timestampdiff(WEEK,'2001-02-01','2001-05-01') AS `a1`,timestampdiff(SECOND_FRAC,'2001-02-01 12:59:59.120000','2001-05-01 12:58:58.119999') AS `a2`
select time_format('100:00:00', '%H %k %h %I %l');
time_format('100:00:00', '%H %k %h %I %l')
@@ -1261,6 +1266,24 @@ DATE_ADD(20071108, INTERVAL 1 DAY)
select LAST_DAY('2007-12-06 08:59:19.05') - INTERVAL 1 SECOND;
LAST_DAY('2007-12-06 08:59:19.05') - INTERVAL 1 SECOND
2007-12-30 23:59:59
+SELECT TIMESTAMPADD(FRAC_SECOND, 1, '2008-02-18');
+TIMESTAMPADD(FRAC_SECOND, 1, '2008-02-18')
+2008-02-18 00:00:00.000001
+Warnings:
+Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 6.2. Please use MICROSECOND instead
+SELECT TIMESTAMPDIFF(FRAC_SECOND, '2008-02-17', '2008-02-18');
+TIMESTAMPDIFF(FRAC_SECOND, '2008-02-17', '2008-02-18')
+86400000000
+Warnings:
+Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 6.2. Please use MICROSECOND instead
+SELECT DATE_ADD('2008-02-18', INTERVAL 1 FRAC_SECOND);
+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 'FRAC_SECOND)' at line 1
+SELECT DATE_SUB('2008-02-18', INTERVAL 1 FRAC_SECOND);
+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 'FRAC_SECOND)' at line 1
+SELECT '2008-02-18' + INTERVAL 1 FRAC_SECOND;
+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 'FRAC_SECOND' at line 1
+SELECT '2008-02-18' - INTERVAL 1 FRAC_SECOND;
+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 'FRAC_SECOND' at line 1
End of 5.0 tests
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index c157e1d4706..a56cce50259 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1306,4 +1306,43 @@ DROP DATABASE mysqltest1;
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
DROP USER mysqltest_1@localhost;
FLUSH PRIVILEGES;
+CREATE DATABASE dbbug33464;
+CREATE USER 'userbug33464'@'localhost';
+GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
+
+userbug33464@localhost dbbug33464
+DROP PROCEDURE IF EXISTS sp3;
+DROP FUNCTION IF EXISTS fn1;
+CREATE PROCEDURE sp3(v1 char(20))
+BEGIN
+SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
+END//
+CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
+BEGIN
+return 1;
+END//
+CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
+BEGIN
+return 2;
+END//
+USE dbbug33464;
+
+root@localhost dbbug33464
+SELECT fn1();
+fn1()
+1
+SELECT fn2();
+fn2()
+2
+DROP USER 'userbug33464'@'localhost';
+DROP FUNCTION fn1;
+Warnings:
+Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1'
+DROP FUNCTION fn2;
+Warnings:
+Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2'
+DROP PROCEDURE sp3;
+DROP USER 'userbug33464'@'localhost';
+use test;
+DROP DATABASE dbbug33464;
End of 5.1 tests
diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result
index cc7f46855b2..f38848111ad 100644
--- a/mysql-test/r/grant3.result
+++ b/mysql-test/r/grant3.result
@@ -138,3 +138,20 @@ SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by
user host db select_priv
DROP USER CUser2@localhost;
DROP USER CUser2@LOCALHOST;
+CREATE DATABASE mysqltest_1;
+CREATE TABLE mysqltest_1.t1 (a INT);
+CREATE USER 'mysqltest1'@'%';
+GRANT SELECT, UPDATE ON `mysqltest_1`.* TO 'mysqltest1'@'%';
+REVOKE SELECT ON `mysqltest_1`.* FROM 'mysqltest1'@'%';
+GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO 'mysqltest1'@'%';
+FLUSH PRIVILEGES;
+SHOW GRANTS;
+Grants for mysqltest1@%
+GRANT USAGE ON *.* TO 'mysqltest1'@'%'
+GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO 'mysqltest1'@'%'
+GRANT UPDATE ON `mysqltest_1`.* TO 'mysqltest1'@'%'
+SELECT * FROM mysqltest_1.t1;
+a
+DROP USER 'mysqltest1'@'%';
+DROP DATABASE mysqltest_1;
+End of 5.0 tests
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index a1e7d403035..062efea839f 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1128,6 +1128,152 @@ id c1 c2
4 2 3
1 5 1
DROP TABLE t1;
+#
+# Bug#27219: Aggregate functions in ORDER BY.
+#
+SET @save_sql_mode=@@sql_mode;
+SET @@sql_mode='ONLY_FULL_GROUP_BY';
+CREATE TABLE t1 (a INT, b INT, c INT DEFAULT 0);
+INSERT INTO t1 (a, b) VALUES (3,3), (2,2), (3,3), (2,2), (3,3), (4,4);
+CREATE TABLE t2 SELECT * FROM t1;
+SELECT 1 FROM t1 ORDER BY COUNT(*);
+1
+1
+SELECT 1 FROM t1 ORDER BY COUNT(*) + 1;
+1
+1
+SELECT 1 FROM t1 ORDER BY COUNT(*) + a;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT 1 FROM t1 ORDER BY COUNT(*), 1;
+1
+1
+SELECT 1 FROM t1 ORDER BY COUNT(*), a;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT 1 FROM t1 ORDER BY SUM(a);
+1
+1
+SELECT 1 FROM t1 ORDER BY SUM(a + 1);
+1
+1
+SELECT 1 FROM t1 ORDER BY SUM(a) + 1;
+1
+1
+SELECT 1 FROM t1 ORDER BY SUM(a), b;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT a FROM t1 ORDER BY COUNT(b);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1 ORDER BY (SELECT SUM(t2.a) FROM t2);
+a
+3
+2
+3
+2
+3
+4
+SELECT t1.a FROM t1 ORDER BY (SELECT SUM(t2.a), t2.a FROM t2);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1 ORDER BY (SELECT SUM(t2.a) FROM t2 ORDER BY t2.a);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1 ORDER BY (SELECT t2.a FROM t2 ORDER BY SUM(t2.b) LIMIT 1);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1
+WHERE t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t2.b) LIMIT 1);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1 GROUP BY t1.a
+HAVING t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t2.a) LIMIT 1);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1 GROUP BY t1.a
+HAVING t1.a IN (SELECT t2.a FROM t2 ORDER BY SUM(t1.b));
+a
+2
+3
+4
+SELECT t1.a FROM t1 GROUP BY t1.a
+HAVING t1.a IN (SELECT t2.a FROM t2 ORDER BY t2.a, SUM(t2.b));
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1 GROUP BY t1.a
+HAVING t1.a > ANY (SELECT t2.a FROM t2 ORDER BY t2.a, SUM(t2.b));
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1
+WHERE t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t1.b));
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT 1 FROM t1 GROUP BY t1.a
+HAVING (SELECT AVG(SUM(t1.b) + 1) FROM t2 ORDER BY SUM(t2.a) LIMIT 1);
+1
+1
+1
+1
+SELECT 1 FROM t1 GROUP BY t1.a
+HAVING (SELECT AVG(SUM(t1.b) + t2.b) FROM t2 ORDER BY SUM(t2.a) LIMIT 1);
+1
+1
+1
+1
+SELECT 1 FROM t1 GROUP BY t1.a
+HAVING (SELECT AVG(t1.b + t2.b) FROM t2 ORDER BY SUM(t2.a) LIMIT 1);
+1
+1
+1
+1
+SELECT 1 FROM t1 GROUP BY t1.a
+HAVING (SELECT AVG(SUM(t1.b) + 1) FROM t2 ORDER BY t2.a LIMIT 1);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT 1 FROM t1 GROUP BY t1.a
+HAVING (SELECT AVG(SUM(t1.b) + t2.b) FROM t2 ORDER BY t2.a LIMIT 1);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT 1 FROM t1 GROUP BY t1.a
+HAVING (SELECT AVG(t1.b + t2.b) FROM t2 ORDER BY t2.a LIMIT 1);
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT t1.a FROM t1
+WHERE t1.a = (SELECT t2.a FROM t2 GROUP BY t2.a
+ORDER BY SUM(t2.b), SUM(t1.b) LIMIT 1);
+a
+4
+SELECT t1.a, SUM(t1.b) FROM t1
+WHERE t1.a = (SELECT SUM(t2.b) FROM t2 GROUP BY t2.a
+ORDER BY SUM(t2.b), SUM(t1.b) LIMIT 1)
+GROUP BY t1.a;
+a SUM(t1.b)
+4 4
+SELECT t1.a, SUM(t1.b) FROM t1
+WHERE t1.a = (SELECT SUM(t2.b) FROM t2
+ORDER BY SUM(t2.b) + SUM(t1.b) LIMIT 1)
+GROUP BY t1.a;
+a SUM(t1.b)
+SELECT t1.a, SUM(t1.b) FROM t1
+WHERE t1.a = (SELECT SUM(t2.b) FROM t2
+ORDER BY SUM(t2.b + t1.a) LIMIT 1)
+GROUP BY t1.a;
+a SUM(t1.b)
+SELECT t1.a FROM t1 GROUP BY t1.a
+HAVING (1, 1) = (SELECT SUM(t1.a), t1.a FROM t2 LIMIT 1);
+a
+select avg (
+(select
+(select sum(outr.a + innr.a) from t1 as innr limit 1) as tt
+from t1 as outr order by outr.a limit 1))
+from t1 as most_outer;
+avg (
+(select
+(select sum(outr.a + innr.a) from t1 as innr limit 1) as tt
+from t1 as outr order by outr.a limit 1))
+29.0000
+select avg (
+(select (
+(select sum(outr.a + innr.a) from t1 as innr limit 1)) as tt
+from t1 as outr order by count(outr.a) limit 1)) as tt
+from t1 as most_outer;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order by outr.a;
+tt
+29
+29
+35
+35
+35
+41
+SET sql_mode=@save_sql_mode;
+DROP TABLE t1, t2;
End of 5.0 tests
CREATE TABLE t1 (a INT, b INT,
PRIMARY KEY (a),
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index ddf675e2f73..a2c208ee3e1 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -256,6 +256,7 @@ set @a=repeat(' ',20);
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
Warnings:
Note 1265 Data truncated for column 'v' at row 1
+Note 1265 Data truncated for column 'c' at row 1
select concat('*',v,'*',c,'*',t,'*') from t1;
concat('*',v,'*',c,'*',t,'*')
*+ *+*+ *
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index faf3e0bb411..5e9e5c6f31c 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1475,11 +1475,22 @@ f6 bigint(20) NO 10
f7 datetime NO NULL
f8 datetime YES 2006-01-01 00:00:00
drop table t1;
-End of 5.0 tests.
show fields from information_schema.table_names;
ERROR 42S02: Unknown table 'table_names' in information_schema
show keys from information_schema.table_names;
ERROR 42S02: Unknown table 'table_names' in information_schema
+USE information_schema;
+SET max_heap_table_size = 16384;
+CREATE TABLE test.t1( a INT );
+SELECT *
+FROM tables ta
+JOIN collations co ON ( co.collation_name = ta.table_catalog )
+JOIN character_sets cs ON ( cs.character_set_name = ta.table_catalog );
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
+DROP TABLE test.t1;
+SET max_heap_table_size = DEFAULT;
+USE test;
+End of 5.0 tests.
select * from information_schema.engines WHERE ENGINE="MyISAM";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
MyISAM DEFAULT Default engine as of MySQL 3.23 with great performance NO NO NO
@@ -1637,4 +1648,6 @@ show open tables where f1()=0;
show open tables where f1()=0;
drop table t1;
drop function f1;
+select * from information_schema.tables where 1=sleep(100000);
+select * from information_schema.columns where 1=sleep(100000);
End of 5.1 tests.
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index 3044a11fb39..eff5f117c50 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -128,7 +128,7 @@ grant show view on v6 to testdb_2@localhost;
create table t2 (f1 char(4));
create definer=`no_such_user`@`no_such_host` view v7 as select * from t2;
Warnings:
-Note 1449 There is no 'no_such_user'@'no_such_host' registered
+Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
show fields from testdb_1.v6;
Field Type Null Key Default Extra
f1 char(4) YES NULL
@@ -144,7 +144,7 @@ show fields from testdb_1.v7;
Field Type Null Key Default Extra
f1 char(4) YES NULL
Warnings:
-Note 1449 There is no 'no_such_user'@'no_such_host' registered
+Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
create table t3 (f1 char(4), f2 char(4));
create view v3 as select f1,f2 from t3;
grant insert(f1), insert(f2) on v3 to testdb_2@localhost;
@@ -164,7 +164,7 @@ show fields from testdb_1.v7;
Field Type Null Key Default Extra
f1 char(4) YES NULL
Warnings:
-Note 1449 There is no 'no_such_user'@'no_such_host' registered
+Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
show create view testdb_1.v7;
View Create View character_set_client collation_connection
v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` latin1 latin1_swedish_ci
diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result
index 2ea2a0bec0b..4f36fd2b8b5 100644
--- a/mysql-test/r/information_schema_inno.result
+++ b/mysql-test/r/information_schema_inno.result
@@ -78,3 +78,14 @@ NULL NULL
db-1 t-2
NULL NULL
drop database `db-1`;
+create table t1(id int primary key) engine = Innodb;
+create table t2(pid int, foreign key (pid) references t1(id)) engine = Innodb;
+set foreign_key_checks = 0;
+drop table t1;
+select UNIQUE_CONSTRAINT_NAME
+from information_schema.referential_constraints
+where constraint_schema = schema();
+UNIQUE_CONSTRAINT_NAME
+NULL
+drop table t2;
+set foreign_key_checks = 1;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 15d451c03ae..0cd276852bf 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1836,6 +1836,7 @@ set @a=repeat(' ',20);
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
Warnings:
Note 1265 Data truncated for column 'v' at row 1
+Note 1265 Data truncated for column 'c' at row 1
select concat('*',v,'*',c,'*',t,'*') from t1;
concat('*',v,'*',c,'*',t,'*')
*+ *+*+ *
@@ -3244,3 +3245,22 @@ where table_schema='test' and table_name = 't1';
table_comment data_free_is_set
this is a comment 1
drop table t1;
+CREATE TABLE t1 (
+c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+c2 VARCHAR(128) NOT NULL,
+PRIMARY KEY(c1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100;
+CREATE TABLE t2 (
+c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+c2 INT(10) UNSIGNED DEFAULT NULL,
+PRIMARY KEY(c1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
+AUTO_INCREMENT
+200
+ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
+AUTO_INCREMENT
+200
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index ffc3ca25a99..c7f5e72bb8b 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1356,6 +1356,12 @@ id type d
NULL member 3
NULL member 4
DROP TABLE t1;
+set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment;
+set global innodb_autoextend_increment=8;
+set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
+set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
+set global innodb_commit_concurrency=0;
+set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
End of 5.0 tests
CREATE TABLE `t2` (
`k` int(11) NOT NULL auto_increment,
diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result
index a522d18f36b..8b6830d4798 100644
--- a/mysql-test/r/kill.result
+++ b/mysql-test/r/kill.result
@@ -1,3 +1,4 @@
+set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
drop table if exists t1, t2, t3;
create table t1 (kill_id int);
@@ -137,3 +138,4 @@ KILL CONNECTION_ID();
# of close of the connection socket
SELECT 1;
Got one of the listed errors
+set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index a18cef792c5..d01feed8099 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -261,6 +261,82 @@ SELECT * FROM t1;
c1 c2 c3 c4
10 1970-02-01 01:02:03 1.1e-100 1.1e+100
DROP TABLE t1;
+
+# --
+# -- Bug#35469: server crash with LOAD DATA INFILE to a VIEW.
+# --
+
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+DROP VIEW IF EXISTS v2;
+DROP VIEW IF EXISTS v3;
+
+CREATE TABLE t1(c1 INT, c2 VARCHAR(255));
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v2 AS SELECT 1 + 2 AS c0, c1, c2 FROM t1;
+CREATE VIEW v3 AS SELECT 1 AS d1, 2 AS d2;
+
+LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v1
+FIELDS ESCAPED BY '\\'
+ TERMINATED BY ','
+ ENCLOSED BY '"'
+ LINES TERMINATED BY '\n' (c1, c2);
+
+SELECT * FROM t1;
+c1 c2
+1 "string1"
+2 "string2"
+3 "string3"
+
+SELECT * FROM v1;
+c1 c2
+1 "string1"
+2 "string2"
+3 "string3"
+
+DELETE FROM t1;
+
+LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2
+FIELDS ESCAPED BY '\\'
+ TERMINATED BY ','
+ ENCLOSED BY '"'
+ LINES TERMINATED BY '\n' (c1, c2);
+
+SELECT * FROM t1;
+c1 c2
+1 "string1"
+2 "string2"
+3 "string3"
+
+SELECT * FROM v2;
+c0 c1 c2
+3 1 "string1"
+3 2 "string2"
+3 3 "string3"
+
+DELETE FROM t1;
+
+LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2
+FIELDS ESCAPED BY '\\'
+ TERMINATED BY ','
+ ENCLOSED BY '"'
+ LINES TERMINATED BY '\n' (c0, c2);
+ERROR HY000: Invalid column reference (v2.c0) in LOAD DATA
+
+LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v3
+FIELDS ESCAPED BY '\\'
+ TERMINATED BY ','
+ ENCLOSED BY '"'
+ LINES TERMINATED BY '\n' (d1, d2);
+ERROR HY000: The target table v3 of the LOAD is not updatable
+
+DROP TABLE t1;
+DROP VIEW v1;
+DROP VIEW v2;
+DROP VIEW v3;
+
+# -- End of Bug#35469.
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
SET NAMES latin1;
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result
index 0a7634df85a..2a4cee9fbbc 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -107,6 +107,17 @@ Database Table In_use Name_locked
SET GLOBAL GENERAL_LOG=ON;
SET GLOBAL SLOW_QUERY_LOG=ON;
truncate table mysql.general_log;
+set names binary;
+select _koi8r'ÔÅÓÔ' as test;
+test
+ÔÅÓÔ
+select * from mysql.general_log;
+event_time user_host thread_id server_id command_type argument
+TIMESTAMP USER_HOST THREAD_ID 1 Query set names binary
+TIMESTAMP USER_HOST THREAD_ID 1 Query select _koi8r'\xD4\xC5\xD3\xD4' as test
+TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.general_log
+set names utf8;
+truncate table mysql.general_log;
set names utf8;
create table bug16905 (s char(15) character set utf8 default 'пуÑто');
insert into bug16905 values ('новое');
diff --git a/mysql-test/r/merge-big.result b/mysql-test/r/merge-big.result
index 82fedc1df73..e34ebbd9578 100644
--- a/mysql-test/r/merge-big.result
+++ b/mysql-test/r/merge-big.result
@@ -24,54 +24,3 @@ UNLOCK TABLES;
SET SESSION debug="-d,sleep_open_and_lock_after_open";
# connection default
DROP TABLE t1;
-#
-# Extra tests for Bug#26379 - Combination of FLUSH TABLE and
-# REPAIR TABLE corrupts a MERGE table
-#
-CREATE TABLE t1 (c1 INT);
-CREATE TABLE t2 (c1 INT);
-CREATE TABLE t3 (c1 INT);
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (2);
-INSERT INTO t3 VALUES (3);
-#
-# CREATE ... SELECT
-# try to access parent from another thread.
-#
-# connection con1
-SET SESSION debug="+d,sleep_create_select_before_lock";
-CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2)
-INSERT_METHOD=FIRST SELECT * FROM t3;
-# connection default
-# Now try to access the parent.
-# If 3 is in table, SELECT had to wait.
-SELECT * FROM t4 ORDER BY c1;
-c1
-1
-2
-3
-# connection con1
-SET SESSION debug="-d,sleep_create_select_before_lock";
-# connection default
-# Cleanup for next test.
-DROP TABLE t4;
-DELETE FROM t1 WHERE c1 != 1;
-#
-# CREATE ... SELECT
-# try to access child from another thread.
-#
-# connection con1
-SET SESSION debug="+d,sleep_create_select_before_lock";
-CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2)
-INSERT_METHOD=FIRST SELECT * FROM t3;
-# connection default
-# Now try to access a child.
-# If 3 is in table, SELECT had to wait.
-SELECT * FROM t1 ORDER BY c1;
-c1
-1
-3
-# connection con1
-SET SESSION debug="-d,sleep_create_select_before_lock";
-# connection default
-DROP TABLE t1, t2, t3, t4;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index a709817b7ef..4c05000573c 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -964,6 +964,28 @@ id ref
3 2
4 5
DROP TABLE t1, t2, t3;
+CREATE TABLE t1(a INT);
+CREATE TABLE m1(a INT) ENGINE=MERGE;
+SHOW CREATE TABLE m1;
+Table Create Table
+m1 CREATE TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1
+DROP TABLE m1;
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=();
+SHOW CREATE TABLE m1;
+Table Create Table
+m1 CREATE TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE m1 UNION=(t1);
+ALTER TABLE m1 UNION=();
+SHOW CREATE TABLE m1;
+Table Create Table
+m1 CREATE TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1, m1;
End of 5.0 tests
create table t1 (c1 int, index(c1));
create table t2 (c1 int, index(c1)) engine=merge union=(t1);
@@ -1129,7 +1151,7 @@ SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` int(11) DEFAULT NULL
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=()
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1
INSERT INTO t4 VALUES (4);
ERROR HY000: Table 't4' is read only
DROP TABLE t4;
@@ -1146,7 +1168,7 @@ SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` int(11) DEFAULT NULL
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=()
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1
INSERT INTO t4 VALUES (4);
ERROR HY000: Table 't4' is read only
DROP TABLE t4;
diff --git a/mysql-test/r/mix2_myisam.result b/mysql-test/r/mix2_myisam.result
index cabc4de8d21..ee10f265933 100644
--- a/mysql-test/r/mix2_myisam.result
+++ b/mysql-test/r/mix2_myisam.result
@@ -1415,6 +1415,7 @@ set @a=repeat(' ',20);
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
Warnings:
Note 1265 Data truncated for column 'v' at row 1
+Note 1265 Data truncated for column 'c' at row 1
select concat('*',v,'*',c,'*',t,'*') from t1;
concat('*',v,'*',c,'*',t,'*')
*+ *+*+ *
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 1c8b5e9d7d9..112a7b7649b 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -1086,6 +1086,7 @@ set @a=repeat(' ',20);
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
Warnings:
Note 1265 Data truncated for column 'v' at row 1
+Note 1265 Data truncated for column 'c' at row 1
select concat('*',v,'*',c,'*',t,'*') from t1;
concat('*',v,'*',c,'*',t,'*')
*+ *+*+ *
@@ -2023,4 +2024,185 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(130),
+c2 VARCHAR(1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(130),
+c2 VARCHAR(1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(130),
+c2 VARCHAR(1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
+INSERT INTO t1 VALUES('b', 'b');
+INSERT INTO t1 VALUES('c', 'b');
+DELETE FROM t1 WHERE c1='b';
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(130),
+c2 VARCHAR(1),
+KEY (c1)
+) ENGINE=MyISAM;
+# Insert 100 rows. Query log disabled.
+UPDATE t1 SET c1=REPEAT("a",128) LIMIT 90;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+100
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+100
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(50),
+c2 VARCHAR(1)
+) ENGINE=MyISAM DEFAULT CHARSET UTF8;
+INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b');
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(50),
+c2 VARCHAR(1)
+) ENGINE=MyISAM DEFAULT CHARSET UTF8;
+INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b');
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(50),
+c2 VARCHAR(1)
+) ENGINE=MyISAM DEFAULT CHARSET UTF8;
+INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b');
+INSERT INTO t1 VALUES('b', 'b');
+INSERT INTO t1 VALUES('c', 'b');
+DELETE FROM t1 WHERE c1='b';
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(50),
+c2 VARCHAR(1),
+KEY (c1)
+) ENGINE=MyISAM DEFAULT CHARSET UTF8;
+# Insert 100 rows. Query log disabled.
+UPDATE t1 SET c1=REPEAT(_utf8 x'e0ae85',43) LIMIT 90;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+100
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+100
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 VARCHAR(10) NOT NULL,
+c2 CHAR(10) DEFAULT NULL,
+c3 VARCHAR(10) NOT NULL,
+KEY (c1),
+KEY (c2)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0;
+
+MyISAM file: MYSQLTEST_VARDIR/master-data/test/t1
+Record format: Packed
+Character set: utf8_general_ci (33)
+Data records: 0 Deleted blocks: 0
+Recordlength: 94
+
+table description:
+Key Start Len Index Type
+1 2 30 multip. varchar
+2 33 30 multip. char NULL
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index ccc2d2f8b05..c455a57cb38 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -21,7 +21,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -67,7 +67,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -99,7 +99,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -121,7 +121,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -167,7 +167,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -199,7 +199,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -299,7 +299,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -349,7 +349,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result
index 89fc4b87d29..dba9bdc9d70 100644
--- a/mysql-test/r/mysqlbinlog2.result
+++ b/mysql-test/r/mysqlbinlog2.result
@@ -22,7 +22,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -65,7 +65,7 @@ SET INSERT_ID=1/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -104,7 +104,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -130,7 +130,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -165,7 +165,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -188,7 +188,7 @@ SET INSERT_ID=3/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -218,7 +218,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -249,7 +249,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -284,7 +284,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -307,7 +307,7 @@ SET INSERT_ID=1/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -338,7 +338,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -361,7 +361,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -380,7 +380,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -402,7 +402,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -448,7 +448,7 @@ SET INSERT_ID=3/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -471,7 +471,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -493,7 +493,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -523,7 +523,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -566,7 +566,7 @@ SET INSERT_ID=1/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -604,7 +604,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -630,7 +630,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -664,7 +664,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -687,7 +687,7 @@ SET INSERT_ID=3/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -717,7 +717,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -747,7 +747,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -782,7 +782,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -805,7 +805,7 @@ SET INSERT_ID=1/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -836,7 +836,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -858,7 +858,7 @@ SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -877,7 +877,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -899,7 +899,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -945,7 +945,7 @@ SET INSERT_ID=3/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -968,7 +968,7 @@ SET INSERT_ID=6/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -990,7 +990,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
@@ -1020,7 +1020,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
diff --git a/mysql-test/r/mysqldump-no-binlog.result b/mysql-test/r/mysqldump-no-binlog.result
new file mode 100644
index 00000000000..78bc19b7cba
--- /dev/null
+++ b/mysql-test/r/mysqldump-no-binlog.result
@@ -0,0 +1 @@
+mysqldump: Error: Binlogging on server not active
diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result
index 8a440284c53..58c587fe588 100644
--- a/mysql-test/r/null_key.result
+++ b/mysql-test/r/null_key.result
@@ -429,3 +429,21 @@ Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 5
DROP TABLE t1,t2,t3,t4;
+CREATE TABLE t1 (
+a int(11) default NULL,
+b int(11) default NULL,
+KEY a (a,b)
+);
+INSERT INTO t1 VALUES (0,10),(0,11),(0,12);
+CREATE TABLE t2 (
+a int(11) default NULL,
+b int(11) default NULL,
+KEY a (a)
+);
+INSERT INTO t2 VALUES (3,NULL),(3,11),(3,12);
+SELECT * FROM t2 inner join t1 WHERE ( t1.a = 0 OR t1.a IS NULL) AND t2.a = 3 AND t2.b = t1.b;
+a b a b
+3 11 0 11
+3 12 0 12
+drop table t1, t2;
+End of 5.0 tests
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 3d0f4915d0a..faab8e49880 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -1416,3 +1416,45 @@ SELECT @tmp_tables_after = @tmp_tables_before;
@tmp_tables_after = @tmp_tables_before
1
DROP TABLE t1;
+#
+# Bug#31590: Wrong error message on sort buffer being too small.
+#
+create table t1(a int, b tinytext);
+insert into t1 values (1,2),(3,2);
+set session sort_buffer_size= 30000;
+Warnings:
+Warning 1292 Truncated incorrect sort_buffer_size value: '30000'
+set session max_sort_length= 2180;
+select * from t1 order by b;
+ERROR HY001: Out of sort memory; increase server sort buffer size
+drop table t1;
+CREATE TABLE t2 (a varchar(32), b int(11), c float, d double,
+UNIQUE KEY a (a,b,c), KEY b (b), KEY c (c));
+CREATE TABLE t1 (a varchar(32), b char(3), UNIQUE KEY a (a,b), KEY b (b));
+CREATE TABLE t3 (a varchar(32), b char(3), UNIQUE KEY a (a,b));
+INSERT INTO t3 SELECT * FROM t1;
+EXPLAIN
+SELECT d FROM t1, t2
+WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
+ORDER BY t2.c LIMIT 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a,b b 4 const 4 Using where; Using temporary; Using filesort
+1 SIMPLE t2 ref a,b,c a 40 test.t1.a,const 11 Using where
+SELECT d FROM t1, t2
+WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
+ORDER BY t2.c LIMIT 1;
+d
+52.5
+EXPLAIN
+SELECT d FROM t3 AS t1, t2 AS t2
+WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
+ORDER BY t2.c LIMIT 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range a,b,c c 5 NULL 420 Using where
+1 SIMPLE t1 ref a a 39 test.t2.a,const 10 Using where; Using index
+SELECT d FROM t3 AS t1, t2 AS t2
+WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
+ORDER BY t2.c LIMIT 1;
+d
+52.5
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index a361a8f6bcc..b13010f8471 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,4 +1,7 @@
drop table if exists t1;
+create table t1 (a int) partition by list ((a/3)*10 div 1)
+(partition p0 values in (0), partition p1 values in (1));
+ERROR HY000: This partition function is not allowed
CREATE TABLE t1 (
d DATE NOT NULL
)
@@ -44,15 +47,6 @@ partition by key(a)
partitions 1e+300;
ERROR 42000: Only integers allowed as number here near '1e+300' at line 3
create table t1 (a int)
-partition by key (a)
-(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
-ERROR 42000: Incorrect table name 'part-data'
-create table t1 (a int)
-partition by key (a)
-(partition p0,
-partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
-ERROR 42000: Incorrect table name 'part-data'
-create table t1 (a int)
partition by list (a)
(partition p0 values in (1));
create procedure pz()
@@ -342,7 +336,7 @@ PARTITION BY LIST (a)
(PARTITION x1 VALUES IN (10), PARTITION x2 VALUES IN (20));
analyze table t1;
Table Op Msg_type Msg_text
-test.t1 analyze status OK
+test.t1 analyze note The storage engine for the table doesn't support analyze
drop table t1;
create table t1
(a int)
@@ -536,11 +530,9 @@ t1 CREATE TABLE `t1` (
alter table t1
partition by key(a)
(partition p0, partition p1 engine=heap);
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
alter table t1
partition by key(a)
(partition p0 engine=heap, partition p1);
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
alter table t1
engine=heap
partition by key (a)
@@ -1045,9 +1037,7 @@ SHOW TABLE STATUS;
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 MyISAM 10 Fixed 1 14 14 0 0 7 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
ALTER TABLE t1 OPTIMIZE PARTITION p0;
-SHOW TABLE STATUS;
-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 MyISAM 10 Fixed 1 7 7 0 1024 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
+ERROR 42000: The storage engine for the table doesn't support optimize partition
DROP TABLE t1;
CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a);
ALTER TABLE t1 DISABLE KEYS;
@@ -1062,6 +1052,12 @@ test.t1 repair note The storage engine for the table doesn't support repair
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check note The storage engine for the table doesn't support check
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze note The storage engine for the table doesn't support analyze
drop table t1;
drop procedure if exists mysqltest_1;
create table t1 (a int)
@@ -1207,25 +1203,6 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SELECT id FROM t1 WHERE status = 'Verified'
id
22589
drop table t1, t2;
-set @org_mode=@@sql_mode;
-set @@sql_mode='NO_DIR_IN_CREATE';
-select @@sql_mode;
-@@sql_mode
-NO_DIR_IN_CREATE
-create table t1 (i int )
-partition by range (i)
-(
-partition p01 values less than (1000)
-data directory='/not/existing'
- index directory='/not/existing'
-);
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `i` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
-DROP TABLE t1, t2;
-set @@sql_mode=@org_mode;
create table t1 (c1 varchar(255),c2 tinyint,primary key(c1))
partition by key (c1) partitions 10 ;
insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1;
@@ -1319,6 +1296,14 @@ ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED;
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 'EXTENDED' at line 1
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
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 'EXTENDED' at line 1
+ALTER TABLE t1 ANALYZE PARTITION p1;
+ERROR 42000: The storage engine for the table doesn't support analyze partition
+ALTER TABLE t1 CHECK PARTITION p1;
+ERROR 42000: The storage engine for the table doesn't support check partition
+ALTER TABLE t1 REPAIR PARTITION p1;
+ERROR 42000: The storage engine for the table doesn't support repair partition
+ALTER TABLE t1 OPTIMIZE PARTITION p1;
+ERROR 42000: The storage engine for the table doesn't support optimize partition
DROP TABLE t1;
CREATE TABLE t1 (s1 BIGINT UNSIGNED)
PARTITION BY RANGE (s1) (
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index c6506178b03..43d9aac13b7 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -1,4 +1,11 @@
drop table if exists t1;
+# test with not null
+create table t1 (a bit not null) partition by key (a);
+insert into t1 values (b'1');
+select hex(a) from t1 where a = b'1';
+hex(a)
+1
+drop table t1;
create table t1 (a tinyint not null) partition by key (a);
insert into t1 values (2);
select * from t1 where a = 2;
@@ -30,22 +37,22 @@ a
2
drop table t1;
create table t1 (a float not null) partition by key (a);
-insert into t1 values (2.1);
-select * from t1 where a = 2.1;
+insert into t1 values (0.5);
+select * from t1 where a = 0.5;
a
+0.5
drop table t1;
create table t1 (a double not null) partition by key (a);
-insert into t1 values (2.1);
-select * from t1 where a = 2.1;
+insert into t1 values (0.5);
+select * from t1 where a = 0.5;
a
-2.1
+0.5
drop table t1;
-create table t1 (a decimal not null) partition by key (a);
+create table t1 (a decimal(4,2) not null) partition by key (a);
insert into t1 values (2.1);
-Warnings:
-Note 1265 Data truncated for column 'a' at row 1
select * from t1 where a = 2.1;
a
+2.10
drop table t1;
create table t1 (a date not null) partition by key (a);
insert into t1 values ('2001-01-01');
@@ -125,6 +132,21 @@ select * from t1 where a = 'y';
a
y
drop table t1;
+# test with null allowed
+create table t1 (a bit) partition by key (a);
+insert into t1 values (b'1');
+insert into t1 values (NULL);
+select hex(a) from t1 where a = b'1';
+hex(a)
+1
+select hex(a) from t1 where a is NULL;
+hex(a)
+NULL
+select hex(a) from t1 order by a;
+hex(a)
+NULL
+1
+drop table t1;
create table t1 (a tinyint) partition by key (a);
insert into t1 values (2);
select * from t1 where a = 2;
@@ -156,22 +178,22 @@ a
2
drop table t1;
create table t1 (a float) partition by key (a);
-insert into t1 values (2.1);
-select * from t1 where a = 2.1;
+insert into t1 values (0.5);
+select * from t1 where a = 0.5;
a
+0.5
drop table t1;
create table t1 (a double) partition by key (a);
-insert into t1 values (2.1);
-select * from t1 where a = 2.1;
+insert into t1 values (0.5);
+select * from t1 where a = 0.5;
a
-2.1
+0.5
drop table t1;
-create table t1 (a decimal) partition by key (a);
+create table t1 (a decimal(4,2)) partition by key (a);
insert into t1 values (2.1);
-Warnings:
-Note 1265 Data truncated for column 'a' at row 1
select * from t1 where a = 2.1;
a
+2.10
drop table t1;
create table t1 (a date) partition by key (a);
insert into t1 values ('2001-01-01');
@@ -254,25 +276,41 @@ drop table t1;
create table t1 (a varchar(65531)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
-select * from t1 where a = 'aaa%';
+select * from t1 where a = 'aaaa';
a
+aaaa
select * from t1 where a like 'aaa%';
a
aaaa
+select * from t1 where a = 'bbbb';
+a
+bbbb
drop table t1;
create table t1 (a varchar(65532)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
-select * from t1 where a = 'aaa%';
+select * from t1 where a = 'aaaa';
a
+aaaa
select * from t1 where a like 'aaa%';
a
aaaa
+select * from t1 where a = 'bbbb';
+a
+bbbb
drop table t1;
create table t1 (a varchar(65533) not null) partition by key (a);
+insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
-select * from t1 where a = 'aaa%';
+select * from t1 where a = 'aaaa';
+a
+aaaa
+select * from t1 where a like 'aaa%';
a
+aaaa
+select * from t1 where a = 'bbbb';
+a
+bbbb
drop table t1;
create table t1 (a varchar(65533)) partition by key (a);
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
@@ -280,3 +318,17 @@ create table t1 (a varchar(65534) not null) partition by key (a);
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
create table t1 (a varchar(65535)) partition by key (a);
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
+create table t1 (a bit(27), primary key (a)) engine=myisam
+partition by hash (a)
+(partition p0, partition p1, partition p2);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bit(27) NOT NULL DEFAULT '\0\0\0\0',
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM, PARTITION p2 ENGINE = MyISAM) */
+insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34);
+select hex(a) from t1 where a = 7;
+hex(a)
+7
+drop table t1;
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 9bee70e9fb5..547ce1ca316 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -1,4 +1,17 @@
drop table if exists t1;
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (a)
+( PARTITION p0 ENGINE=MyISAM,
+PARTITION p1);
+ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
+CREATE TABLE t1 (a INT)
+PARTITION BY LIST (a)
+SUBPARTITION BY HASH (a)
+( PARTITION p0 VALUES IN (0)
+( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2),
+PARTITION p1 VALUES IN (1)
+( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM));
+ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
CREATE TABLE t1 (
a int
)
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index 8cb8bc7c13f..6e56f9023eb 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -79,8 +79,7 @@ engine = innodb
partition by list (a)
(partition p0 values in (0));
alter table t1 engine = x;
-Warnings:
-Warning 1286 Unknown table engine 'x'
+ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -151,9 +150,11 @@ DROP TABLE t1;
create table t1 (int_column int, char_column char(5))
PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2
(PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB);
-alter table t1 PARTITION BY RANGE (int_column)
+alter table t1
+ENGINE = MyISAM
+PARTITION BY RANGE (int_column)
subpartition by key (char_column) subpartitions 2
-(PARTITION p1 VALUES LESS THAN (5) ENGINE = myisam);
+(PARTITION p1 VALUES LESS THAN (5));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/partition_not_windows.result b/mysql-test/r/partition_not_windows.result
index be2c896dca3..44afdea3855 100644
--- a/mysql-test/r/partition_not_windows.result
+++ b/mysql-test/r/partition_not_windows.result
@@ -1,16 +1,66 @@
create table t1 (a int) engine myisam
partition by range (a)
subpartition by hash (a)
-(partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLD_DATADIR/tmpdata' INDEX DIRECTORY = 'MYSQLD_DATADIR/tmpinx'
+(partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
(SUBPARTITION subpart00, SUBPARTITION subpart01));
-Checking if file exists before alter
+# Checking if file exists before alter
ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
-(partition p1 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLD_DATADIR/tmpdata' INDEX DIRECTORY = 'MYSQLD_DATADIR/tmpinx'
+(partition p1 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
(SUBPARTITION subpart10, SUBPARTITION subpart11),
-partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'MYSQLD_DATADIR/tmpdata' INDEX DIRECTORY = 'MYSQLD_DATADIR/tmpinx'
+partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
(SUBPARTITION subpart20, SUBPARTITION subpart21));
-Checking if file exists after alter
+# Checking if file exists after alter
drop table t1;
+set @org_mode=@@sql_mode;
+set @@sql_mode='NO_DIR_IN_CREATE';
+select @@sql_mode;
+@@sql_mode
+NO_DIR_IN_CREATE
+create table t1 (i int )
+partition by range (i)
+(
+partition p01 values less than (1000)
+data directory='/not/existing'
+ index directory='/not/existing'
+);
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
+Warning 0 INDEX DIRECTORY option ignored
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
+DROP TABLE t1, t2;
+set @@sql_mode=@org_mode;
+CREATE TABLE t1(a INT)
+PARTITION BY KEY (a)
+(PARTITION p0 DATA DIRECTORY 'TEST_DIR/master-data/test');
+ERROR HY000: Incorrect arguments to DATA DIRECTORY
+CREATE TABLE t1(a INT)
+PARTITION BY KEY (a)
+(PARTITION p0 INDEX DIRECTORY 'TEST_DIR/master-data/test');
+ERROR HY000: Incorrect arguments to INDEX DIRECTORY
+CREATE TABLE ts (id INT, purchased DATE)
+PARTITION BY RANGE(YEAR(purchased))
+SUBPARTITION BY HASH(TO_DAYS(purchased)) (
+PARTITION p0 VALUES LESS THAN (1990) (
+SUBPARTITION s0a
+DATA DIRECTORY = 'TEST_DIR/master-data/test',
+SUBPARTITION s0b
+DATA DIRECTORY = 'TEST_DIR/master-data/test'
+));
+ERROR HY000: Incorrect arguments to DATA DIRECTORY
+CREATE TABLE ts (id INT, purchased DATE)
+PARTITION BY RANGE(YEAR(purchased))
+SUBPARTITION BY HASH(TO_DAYS(purchased)) (
+PARTITION p0 VALUES LESS THAN (1990) (
+SUBPARTITION s0a
+INDEX DIRECTORY = 'TEST_DIR/master-data/test',
+SUBPARTITION s0b
+INDEX DIRECTORY = 'TEST_DIR/master-data/test'
+));
+ERROR HY000: Incorrect arguments to INDEX DIRECTORY
DROP TABLE IF EXISTS `example`;
CREATE TABLE `example` (
`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -19,9 +69,27 @@ CREATE TABLE `example` (
PRIMARY KEY (`ID_EXAMPLE`)
) ENGINE = MYISAM
PARTITION BY HASH(ID_EXAMPLE)(
-PARTITION p0 DATA DIRECTORY = '/build/5.1/data/partitiontest/p0Data',
-PARTITION p1 DATA DIRECTORY = '/build/5.1/data/partitiontest/p1Data',
-PARTITION p2 DATA DIRECTORY = '/build/5.1/data/partitiontest/p2Data',
-PARTITION p3 DATA DIRECTORY = '/build/5.1/data/partitiontest/p3Data'
+PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p0Data'
+INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p0Index',
+PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p1Data'
+INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p1Index',
+PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p2Data'
+INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p2Index',
+PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p3Data'
+INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p3Index'
+);
+# Checking that MyISAM .MYD and .MYI are in test db and data/idx dir
+DROP TABLE example;
+CREATE TABLE `example` (
+`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
+`DESCRIPTION` varchar(30) NOT NULL,
+`LEVEL` smallint(5) unsigned DEFAULT NULL,
+PRIMARY KEY (`ID_EXAMPLE`)
+) ENGINE = MYISAM
+PARTITION BY HASH(ID_EXAMPLE)(
+PARTITION p0 DATA DIRECTORY = '/not/existent/p0Data',
+PARTITION p1 DATA DIRECTORY = '/not/existent/p1Data',
+PARTITION p2 DATA DIRECTORY = '/not/existent/p2Data',
+PARTITION p3 DATA DIRECTORY = '/not/existent/p3Data'
);
-ERROR HY000: Can't create/write to file '/build/5.1/data/partitiontest/p0Data/example#P#p0.MYD' (Errcode: 2)
+Got one of the listed errors
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index 4da79704ec3..b027ef088ae 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -1,4 +1,37 @@
drop table if exists t1, t2;
+create table t1 (a int)
+partition by range (a)
+( partition p0 values less than (maxvalue));
+alter table t1 add partition (partition p1 values less than (100000));
+ERROR HY000: MAXVALUE can only be used in last partition definition
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a integer)
+partition by range (a)
+( partition p0 values less than (4),
+partition p1 values less than (100));
+create trigger tr1 before insert on t1
+for each row begin
+set @a = 1;
+end|
+alter table t1 drop partition p0;
+drop table t1;
+create table t1 (a integer)
+partition by range (a)
+( partition p0 values less than (4),
+partition p1 values less than (100));
+LOCK TABLES t1 WRITE;
+alter table t1 drop partition p0;
+alter table t1 reorganize partition p1 into
+( partition p0 values less than (4),
+partition p1 values less than (100));
+alter table t1 add partition ( partition p2 values less than (200));
+UNLOCK TABLES;
+drop table t1;
create table t1 (a int unsigned)
partition by range (a)
(partition pnull values less than (0),
diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result
index 68f7a8a0c96..eb92a4f733d 100644
--- a/mysql-test/r/partition_symlink.result
+++ b/mysql-test/r/partition_symlink.result
@@ -13,11 +13,11 @@ USE test;
CREATE TABLE t1 (a INT)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
-DATA DIRECTORY 'MYSQLD_DATADIR/mysqltest2'
- INDEX DIRECTORY 'MYSQLD_DATADIR/mysqltest2',
+DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
+ INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp',
PARTITION p1 VALUES IN (1)
-DATA DIRECTORY 'MYSQLD_DATADIR/test'
- INDEX DIRECTORY 'MYSQLD_DATADIR/test',
+DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
+ INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp',
PARTITION p2 VALUES IN (2)
);
# without the patch for bug#32091 this would create
@@ -49,35 +49,73 @@ USE mysqltest2;
CREATE TABLE t1 (a INT)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
-DATA DIRECTORY 'MYSQLD_DATADIR/mysqltest2'
- INDEX DIRECTORY 'MYSQLD_DATADIR/mysqltest2',
+DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
+ INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp',
PARTITION p1 VALUES IN (1)
-DATA DIRECTORY 'MYSQLD_DATADIR/test'
- INDEX DIRECTORY 'MYSQLD_DATADIR/test'
+DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
+ INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp'
);
# user mysqltest_1:
USE test;
CREATE TABLE t1 (a INT)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
-DATA DIRECTORY 'MYSQLD_DATADIR/mysqltest2'
- INDEX DIRECTORY 'MYSQLD_DATADIR/mysqltest2',
+DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
+ INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp',
PARTITION p1 VALUES IN (1)
-DATA DIRECTORY 'MYSQLD_DATADIR/test'
- INDEX DIRECTORY 'MYSQLD_DATADIR/test'
+DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
+ INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp'
);
Got one of the listed errors
CREATE TABLE t1 (a INT)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
-DATA DIRECTORY 'MYSQLD_DATADIR/test'
- INDEX DIRECTORY 'MYSQLD_DATADIR/test',
+DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
+ INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp',
PARTITION p1 VALUES IN (1)
-DATA DIRECTORY 'MYSQLD_DATADIR/mysqltest2'
- INDEX DIRECTORY 'MYSQLD_DATADIR/mysqltest2'
+DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
+ INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp'
);
Got one of the listed errors
# user root (cleanup):
DROP DATABASE mysqltest2;
USE test;
DROP USER mysqltest_1@localhost;
+create table t2 (i int )
+partition by range (i)
+(
+partition p01 values less than (1000)
+data directory="MYSQLTEST_VARDIR/tmp"
+ index directory="MYSQLTEST_VARDIR/tmp"
+);
+set @org_mode=@@sql_mode;
+set @@sql_mode='NO_DIR_IN_CREATE';
+select @@sql_mode;
+@@sql_mode
+NO_DIR_IN_CREATE
+create table t1 (i int )
+partition by range (i)
+(
+partition p01 values less than (1000)
+data directory='/not/existing'
+ index directory='/not/existing'
+);
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
+Warning 0 INDEX DIRECTORY option ignored
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
+DROP TABLE t1, t2;
+set @@sql_mode=@org_mode;
+create table t1 (a int)
+partition by key (a)
+(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+ERROR 42000: Incorrect table name 'part-data'
+create table t1 (a int)
+partition by key (a)
+(partition p0,
+partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+ERROR 42000: Incorrect table name 'part-data'
diff --git a/mysql-test/r/partition_windows.result b/mysql-test/r/partition_windows.result
index 1fc9e2ba254..c2d4054deeb 100644
--- a/mysql-test/r/partition_windows.result
+++ b/mysql-test/r/partition_windows.result
@@ -1,14 +1,30 @@
-DROP TABLE IF EXISTS `example`;
-CREATE TABLE `example` (
-`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
-`DESCRIPTION` varchar(30) NOT NULL,
-`LEVEL` smallint(5) unsigned DEFAULT NULL,
-PRIMARY KEY (`ID_EXAMPLE`)
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c1 int(10) unsigned NOT NULL AUTO_INCREMENT,
+c2 varchar(30) NOT NULL,
+c3 smallint(5) unsigned DEFAULT NULL,
+PRIMARY KEY (c1)
) ENGINE = MYISAM
-PARTITION BY HASH(ID_EXAMPLE)(
-PARTITION p0 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p0Data',
-PARTITION p1 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p1Data',
-PARTITION p2 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p2Data',
-PARTITION p3 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p3Data'
+PARTITION BY HASH(c1)(
+PARTITION p0
+DATA DIRECTORY = 'C:/mysqltest/p0Data'
+ INDEX DIRECTORY = 'D:/mysqltest/p0Index',
+PARTITION p1,
+PARTITION p2
+DATA DIRECTORY = 'E:/mysqltest/p2Data'
+ INDEX DIRECTORY = 'F:/mysqltest/p2Index'
);
-ERROR HY000: Can't create/write to file 'C:\build\5.1\data\partitiontest\p0Data\example#P#p0.MYD' (Errcode: 2)
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
+Warning 0 INDEX DIRECTORY option ignored
+Warning 0 DATA DIRECTORY option ignored
+Warning 0 INDEX DIRECTORY option ignored
+INSERT INTO t1 VALUES (NULL, "first", 1);
+INSERT INTO t1 VALUES (NULL, "second", 2);
+INSERT INTO t1 VALUES (NULL, "third", 3);
+ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index');
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
+Warning 0 INDEX DIRECTORY option ignored
+INSERT INTO t1 VALUES (NULL, "last", 4);
+DROP TABLE t1;
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index e4af1535775..782d2a5a9a4 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -27,3 +27,30 @@ SET GLOBAL example_enum_var= e2;
SET GLOBAL example_enum_var= impossible;
ERROR 42000: Variable 'enum_var' can't be set to the value of 'impossible'
UNINSTALL PLUGIN example;
+INSTALL PLUGIN example SONAME 'ha_example.so';
+select @@session.sql_mode into @old_sql_mode;
+set session sql_mode='';
+set global example_ulong_var=500;
+select @@global.example_ulong_var;
+@@global.example_ulong_var
+500
+set global example_ulong_var=1111;
+Warnings:
+Warning 1292 Truncated incorrect ulong_var value: '1111'
+select @@global.example_ulong_var;
+@@global.example_ulong_var
+1000
+set session sql_mode='STRICT_ALL_TABLES';
+set global example_ulong_var=500;
+select @@global.example_ulong_var;
+@@global.example_ulong_var
+500
+set global example_ulong_var=1111;
+ERROR 42000: Variable 'ulong_var' can't be set to the value of '1111'
+select @@global.example_ulong_var;
+@@global.example_ulong_var
+500
+set session sql_mode=@old_sql_mode;
+set session old=bla;
+ERROR HY000: Variable 'old' is a read only variable
+UNINSTALL PLUGIN example;
diff --git a/mysql-test/r/plugin_load.result b/mysql-test/r/plugin_load.result
new file mode 100644
index 00000000000..33116cc20ab
--- /dev/null
+++ b/mysql-test/r/plugin_load.result
@@ -0,0 +1,3 @@
+SELECT @@global.example_enum_var = 'e2';
+@@global.example_enum_var = 'e2'
+1
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 473d120839c..5d99624df30 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1650,10 +1650,46 @@ a (select count(*) from t2)
3 0
4 0
drop table t1,t2;
+#
+# Bug#25132 disabled query cache: Qcache_free_blocks = 1
+#
+set global query_cache_size=100000;
+set global query_cache_size=0;
+set global query_cache_type=0;
+show status like 'Qcache_free_blocks';
+Variable_name Value
+Qcache_free_blocks 0
+Restore default values.
set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size=default;
+FLUSH STATUS;
+SET GLOBAL query_cache_size=10*1024*1024;
+SET @save_concurrent_insert= @@concurrent_insert;
+SET GLOBAL concurrent_insert= 0;
+CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t1 (c1) VALUES (1), (2);
+SHOW GLOBAL VARIABLES LIKE 'concurrent_insert';
+Variable_name Value
+concurrent_insert 0
+SHOW STATUS LIKE 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+SELECT * FROM t1;
+c1
+1
+2
+SELECT * FROM t1;
+c1
+1
+2
+SHOW STATUS LIKE 'Qcache_hits';
+Variable_name Value
+Qcache_hits 1
+DROP TABLE t1;
+SET GLOBAL concurrent_insert= @save_concurrent_insert;
+SET GLOBAL query_cache_size= default;
End of 5.0 tests
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 92db6d8429f..cc5e8d2be96 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -1153,6 +1153,58 @@ explain select * from t1 where dateval >= '2007-01-01 00:00:00' and dateval <= '
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range dateval dateval 4 NULL 2 Using where
drop table t1;
+CREATE TABLE t1 (
+a varchar(32), index (a)
+) DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
+INSERT INTO t1 VALUES
+('B'), ('A'), ('A'), ('C'), ('B'), ('A'), ('A');
+SELECT a FROM t1 WHERE a='b' OR a='B';
+a
+B
+B
+EXPLAIN SELECT a FROM t1 WHERE a='b' OR a='B';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 35 NULL 3 Using where; Using index
+DROP TABLE t1;
+CREATE TABLE t1 (f1 TINYINT(11) UNSIGNED NOT NULL, PRIMARY KEY (f1));
+INSERT INTO t1 VALUES (127),(254),(0),(1),(255);
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 256;
+COUNT(*)
+5
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 256.0;
+COUNT(*)
+5
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 255;
+COUNT(*)
+4
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < -1;
+COUNT(*)
+0
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -1;
+COUNT(*)
+5
+DROP TABLE t1;
+CREATE TABLE t1 ( f1 TINYINT(11) NOT NULL, PRIMARY KEY (f1));
+INSERT INTO t1 VALUES (127),(126),(0),(-128),(-127);
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 128;
+COUNT(*)
+5
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 128.0;
+COUNT(*)
+5
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 127;
+COUNT(*)
+4
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -129;
+COUNT(*)
+5
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -129.0;
+COUNT(*)
+5
+SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -128;
+COUNT(*)
+4
+DROP TABLE t1;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, filler char(100));
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index d3d7988316e..3feaa6255c1 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -434,3 +434,12 @@ SELECT @x;
@x
99
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1);
+SELECT ROW(a, 1) IN (SELECT SUM(b), 1) FROM t1 GROUP BY a;
+ROW(a, 1) IN (SELECT SUM(b), 1)
+1
+SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a;
+ROW(a, 1) IN (SELECT SUM(b), 3)
+0
+DROP TABLE t1;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index d3dca16fe4f..4b2464af688 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4313,6 +4313,33 @@ SELECT * FROM t1 WHERE c1 > NULL + 1;
c1
DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY);
+INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0');
+SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar');
+a
+foo0
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (a INT, c INT, KEY(a));
+INSERT INTO t1 VALUES (1, 1), (2, 2);
+INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),
+(2, 1), (2, 2), (2, 3), (2, 4), (2, 5),
+(3, 1), (3, 2), (3, 3), (3, 4), (3, 5),
+(4, 1), (4, 2), (4, 3), (4, 4), (4, 5);
+FLUSH STATUS;
+SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3;
+b
+1
+2
+SHOW STATUS LIKE 'Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 2
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 6
+DROP TABLE t1, t2;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index f9c6914468c..39770dc4f2a 100644
--- a/mysql-test/r/sp-code.result
+++ b/mysql-test/r/sp-code.result
@@ -842,6 +842,34 @@ Pos Instruction
21 jump 3
drop procedure proc_33618_h;
drop procedure proc_33618_c;
+drop procedure if exists p_20906_a;
+drop procedure if exists p_20906_b;
+create procedure p_20906_a() SET @a=@a+1, @b=@b+1;
+show procedure code p_20906_a;
+Pos Instruction
+0 stmt 31 "SET @a=@a+1"
+1 stmt 31 "SET @b=@b+1"
+set @a=1;
+set @b=1;
+call p_20906_a();
+select @a, @b;
+@a @b
+2 2
+create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1;
+show procedure code p_20906_b;
+Pos Instruction
+0 stmt 31 "SET @a=@a+1"
+1 stmt 31 "SET @b=@b+1"
+2 stmt 31 "SET @c=@c+1"
+set @a=1;
+set @b=1;
+set @c=1;
+call p_20906_b();
+select @a, @b, @c;
+@a @b @c
+2 2 2
+drop procedure p_20906_a;
+drop procedure p_20906_b;
End of 5.0 tests.
CREATE PROCEDURE p1()
BEGIN
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index bc2ab13fe5f..5ac61821cea 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1638,3 +1638,15 @@ Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed
call p1();
call p1();
drop procedure p1;
+drop procedure if exists proc_8759;
+create procedure proc_8759()
+begin
+declare should_be_illegal condition for sqlstate '00000';
+declare continue handler for should_be_illegal set @x=0;
+end$$
+ERROR 42000: Bad SQLSTATE: '00000'
+create procedure proc_8759()
+begin
+declare continue handler for sqlstate '00000' set @x=0;
+end$$
+ERROR 42000: Bad SQLSTATE: '00000'
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index 1a1645ca971..cf26f0076d7 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -357,10 +357,10 @@ ERROR 42000: Access denied; you need the SUPER privilege for this operation
use mysqltest;
CREATE DEFINER='a @ b @ c'@localhost PROCEDURE wl2897_p3() SELECT 3;
Warnings:
-Note 1449 There is no 'a @ b @ c'@'localhost' registered
+Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exist
CREATE DEFINER='a @ b @ c'@localhost FUNCTION wl2897_f3() RETURNS INT RETURN 3;
Warnings:
-Note 1449 There is no 'a @ b @ c'@'localhost' registered
+Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exist
---> connection: con1root
use mysqltest;
@@ -420,9 +420,9 @@ DROP USER mysqltest_1@localhost;
---> connection: mysqltest_2_con
use mysqltest;
CALL bug13198_p1();
-ERROR HY000: There is no 'mysqltest_1'@'localhost' registered
+ERROR HY000: The user specified as a definer ('mysqltest_1'@'localhost') does not exist
SELECT bug13198_f1();
-ERROR HY000: There is no 'mysqltest_1'@'localhost' registered
+ERROR HY000: The user specified as a definer ('mysqltest_1'@'localhost') does not exist
---> connection: root
DROP USER mysqltest_2@localhost;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 8b50f16cc8c..768e0cc07a5 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6862,6 +6862,23 @@ end//
call proc_33618(20);
drop table t_33618;
drop procedure proc_33618;
+#
+# Bug#30787: Stored function ignores user defined alias.
+#
+use test;
+drop function if exists func30787;
+create table t1(f1 int);
+insert into t1 values(1),(2);
+create function func30787(p1 int) returns int
+begin
+return p1;
+end |
+select (select func30787(f1)) as ttt from t1;
+ttt
+1
+2
+drop function func30787;
+drop table t1;
# ------------------------------------------------------------------
# -- End of 5.0 tests
# ------------------------------------------------------------------
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 0b1fa565d28..d15efc6d7d7 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -1,3 +1,5 @@
+set @old_concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert= 0;
drop table if exists t1,t3;
drop procedure if exists bug4902|
create procedure bug4902()
@@ -17,11 +19,11 @@ begin
show processlist;
end|
call bug4902_2()|
-Id User Host db Command Time State Info
-# root localhost test Query # NULL show processlist
+show warnings|
+Level Code Message
call bug4902_2()|
-Id User Host db Command Time State Info
-# root localhost test Query # NULL show processlist
+show warnings|
+Level Code Message
drop procedure bug4902_2|
drop table if exists t1|
create table t1 (
@@ -208,3 +210,27 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
drop user mysqltest_1@localhost;
drop procedure 15298_1;
drop procedure 15298_2;
+drop table if exists t1;
+drop procedure if exists p1;
+create table t1 (value varchar(15));
+create procedure p1() update t1 set value='updated' where value='old';
+call p1();
+insert into t1 (value) values ("old");
+select get_lock('b26162',120);
+get_lock('b26162',120)
+1
+select 'rl_acquirer', value from t1 where get_lock('b26162',120);;
+set session low_priority_updates=on;
+call p1();;
+select 'rl_contender', value from t1;
+rl_contender value
+rl_contender old
+select release_lock('b26162');
+release_lock('b26162')
+1
+rl_acquirer value
+rl_acquirer old
+drop procedure p1;
+drop table t1;
+set session low_priority_updates=default;
+set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index 2b34ff8c021..401340f204c 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -496,3 +496,13 @@ xb x
xcx
drop table t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
+create user mysqltest_32753@localhost;
+set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
+set session sql_mode='PAD_CHAR_TO_FULL_LENGTH';
+flush privileges;
+select current_user();
+current_user()
+mysqltest_32753@localhost
+set session sql_mode=@OLD_SQL_MODE;
+flush privileges;
+drop user mysqltest_32753@localhost;
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index cc1a2535896..ef58a760297 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -895,7 +895,6 @@ ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
ERROR 22003: Out of range value for column 'col2' at row 1
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
-ERROR 22003: Out of range value for column 'col1' at row 3
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
@@ -923,10 +922,10 @@ SELECT * FROM t1;
col1 col2
-2.2e-307 0
1e-303 0
-1.7e+308 1.7e+308
+NULL 1.7e+308
-2.2e-307 0
-2e-307 0
-1.7e+308 1.7e+308
+NULL 1.7e+308
0 NULL
2 NULL
NULL NULL
@@ -934,6 +933,8 @@ NULL NULL
DROP TABLE t1;
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
+Warnings:
+Note 1265 Data truncated for column 'col1' at row 3
INSERT INTO t1 (col1) VALUES ('hellobob');
ERROR 22001: Data too long for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('hellobob');
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index ac492caf89a..89cc3626aa9 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -758,5 +758,16 @@ EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
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 t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
-DROP TABLE t1;
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2 (placeholder CHAR(11));
+INSERT INTO t2 VALUES("placeholder");
+SELECT ROW(1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a;
+ROW(1, 2) IN (SELECT t1.a, 2)
+1
+SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
+ROW(1, 2) IN (SELECT t1.a, 2 FROM t2)
+1
+DROP TABLE t1, t2;
End of 5.0 tests
diff --git a/mysql-test/r/subselect_notembedded.result b/mysql-test/r/subselect_notembedded.result
index 90aadcae398..9ef8c492ee3 100644
--- a/mysql-test/r/subselect_notembedded.result
+++ b/mysql-test/r/subselect_notembedded.result
@@ -4,101 +4,36 @@ purge master logs before adddate(current_timestamp(), interval -4 day);
create table t1(a int,b int,key(a),key(b));
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
(6,7),(7,4),(5,3);
-select sum(a),a from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1
-)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1)
-group by a;
-sum(a) a
-select sum(a),a from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1)
-group by a;
-ERROR HY000: Thread stack overrun detected
-explain select sum(a),a from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1
-)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1)
-group by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index a a 5 NULL 9 Using where; Using index
-2 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-3 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-4 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-5 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-6 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-7 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-8 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-9 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-10 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-11 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
-12 SUBQUERY t1 range a a 5 NULL 1 Using where; Using temporary; Using filesort
-13 SUBQUERY t1 index NULL a 5 NULL 9 Using index
-explain select sum(a),a from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
-select sum(a) from t1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1
-)group by b limit 1)group by b limit 1)group by b limit 1)
-group by a;
-ERROR HY000: Thread stack overrun detected
+5
+4
+3
+2
+1
+26
+25
+24
+23
+22
+21
+20
+19
+18
+17
+16
+15
+14
+13
+12
+11
+10
+9
+8
+7
+6
+5
+4
+3
+2
+1
drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 6ac5242bcf0..bda0d7d1451 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -22,6 +22,7 @@ insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
drop table t2;
+create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="MYSQLTEST_VARDIR/tmp" index directory="MYSQLTEST_VARDIR/run";
insert into t9 select * from t1;
check table t9;
Table Op Msg_type Msg_text
@@ -54,10 +55,16 @@ t9 CREATE TABLE `t9` (
`d` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
+create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp";
Got one of the listed errors
+create database mysqltest;
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="/this-dir-does-not-exist";
Got one of the listed errors
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
Got one of the listed errors
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="MYSQLTEST_VARDIR/run";
Got one of the listed errors
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="MYSQLTEST_VARDIR/tmp";
Got one of the listed errors
alter table t9 rename mysqltest.t9;
select count(*) from mysqltest.t9;
@@ -74,6 +81,7 @@ t9 CREATE TABLE `t9` (
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
drop database mysqltest;
create table t1 (a int not null) engine=myisam;
+alter table t1 data directory="MYSQLTEST_VARDIR/tmp";
Warnings:
Warning 0 DATA DIRECTORY option ignored
show create table t1;
@@ -82,6 +90,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add b int;
+alter table t1 data directory="MYSQLTEST_VARDIR/log";
Warnings:
Warning 0 DATA DIRECTORY option ignored
show create table t1;
@@ -90,6 +99,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t1 index directory="MYSQLTEST_VARDIR/log";
Warnings:
Warning 0 INDEX DIRECTORY option ignored
show create table t1;
@@ -100,28 +110,22 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1(a INT)
-DATA DIRECTORY='MYSQLD_DATADIR/mysql'
-INDEX DIRECTORY='MYSQLD_DATADIR/mysql';
-RENAME TABLE t1 TO user;
-ERROR HY000: Can't create/write to file 'MYSQLD_DATADIR/mysql/user.MYI' (Errcode: 17)
-DROP TABLE t1;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `i` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `i` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1;
+DATA DIRECTORY='TEST_DIR/tmp'
+INDEX DIRECTORY='TEST_DIR/tmp';
+Got one of the listed errors
+CREATE TABLE t2(a INT)
+DATA DIRECTORY='TEST_DIR/tmp'
+INDEX DIRECTORY='TEST_DIR/tmp';
+RENAME TABLE t2 TO t1;
+ERROR HY000: Can't create/write to file 'TEST_DIR/tmp/t1.MYI' (Errcode: 17)
+DROP TABLE t2;
+create temporary table t1 (a int) engine=myisam data directory="MYSQLTEST_VARDIR/log" select 9 a;
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
+create temporary table t1 (a int) engine=myisam data directory="MYSQLTEST_VARDIR/log" select 99 a;
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -139,26 +143,33 @@ a
42
drop table t1;
End of 4.1 tests
-CREATE DATABASE db1;
-CREATE DATABASE db2;
-USE db2;
-INSERT INTO db2.t1 VALUES (1);
-SELECT * FROM db2.t1;
-b
-1
-RESET QUERY CACHE;
-USE db1;
SET SESSION keep_files_on_create = TRUE;
CREATE TABLE t1 (a INT) ENGINE MYISAM;
Got one of the listed errors
-CREATE TABLE t3 (a INT) Engine=MyISAM;
-INSERT INTO t3 VALUES (1),(2),(3);
-TRUNCATE TABLE t3;
-SELECT * from t3;
-a
-SET SESSION keep_files_on_create = DEFAULT;
-DROP TABLE db2.t1, db1.t3;
-DROP DATABASE db1;
-DROP DATABASE db2;
-USE test;
+SET SESSION keep_files_on_create = FALSE;
+CREATE TABLE t1 (a INT) ENGINE MYISAM;
+DROP TABLE t1;
End of 5.0 tests
+CREATE TABLE t1(a INT)
+INDEX DIRECTORY='TEST_DIR/master-data/mysql';
+ERROR HY000: Incorrect arguments to INDEX DIRECTORY
+CREATE TABLE t1(a INT)
+DATA DIRECTORY='TEST_DIR/master-data/test';
+ERROR HY000: Incorrect arguments to DATA DIRECTORY
+CREATE TABLE t1(a INT)
+DATA DIRECTORY='TEST_DIR/master-data/';
+ERROR HY000: Incorrect arguments to DATA DIRECTORY
+CREATE TABLE t1(a INT)
+INDEX DIRECTORY='TEST_DIR/master-data';
+ERROR HY000: Incorrect arguments to INDEX DIRECTORY
+CREATE TABLE t1(a INT)
+INDEX DIRECTORY='TEST_DIR/master-data_var';
+ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errcode: 2)
+SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE';
+CREATE TABLE t1(a INT) DATA DIRECTORY='MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp';
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
+Warning 0 INDEX DIRECTORY option ignored
+DROP TABLE t1;
+SET @@SQL_MODE=@OLD_SQL_MODE;
+End of 5.1 tests
diff --git a/mysql-test/r/tablelock.result b/mysql-test/r/tablelock.result
index 2ffd8f928a9..6923ad40916 100644
--- a/mysql-test/r/tablelock.result
+++ b/mysql-test/r/tablelock.result
@@ -46,3 +46,12 @@ CREATE TABLE t2 (a int);
lock tables t1 write,t1 as b write, t2 write, t2 as c read;
drop table t2,t1;
unlock tables;
+create temporary table t1(f1 int);
+lock tables t1 write;
+insert into t1 values (1);
+show columns from t1;
+Field Type Null Key Default Extra
+f1 int(11) YES NULL
+insert into t1 values(2);
+drop table t1;
+unlock tables;
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index 1c846700346..6df09463d02 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -184,3 +184,14 @@ select * from t1;
a
42
drop table t1;
+CREATE TEMPORARY TABLE t1(a INT, b VARCHAR(20));
+INSERT INTO t1 VALUES(1, 'val1'), (2, 'val2'), (3, 'val3');
+DELETE FROM t1 WHERE a=1;
+SELECT count(*) FROM t1;
+count(*)
+2
+DELETE FROM t1;
+SELECT * FROM t1;
+a b
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result
index cd5f629564f..dccaa27c5fd 100644
--- a/mysql-test/r/trigger-trans.result
+++ b/mysql-test/r/trigger-trans.result
@@ -140,4 +140,23 @@ select * from t3;
c
1
drop table t1, t2, t3;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=innodb;
+CREATE TABLE t2(b INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=innodb;
+INSERT INTO t1 VALUES (1);
+CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW SET @a = 1;
+CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW SET @b = 1;
+SET @a = 0;
+SET @b = 0;
+TRUNCATE t1;
+SELECT @a, @b;
+@a @b
+0 0
+INSERT INTO t1 VALUES (1);
+DELETE FROM t1;
+SELECT @a, @b;
+@a @b
+1 1
+DROP TABLE t2, t1;
End of 5.0 tests
diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result
index 87e8f68da38..1e13bff03b1 100644
--- a/mysql-test/r/trigger_notembedded.result
+++ b/mysql-test/r/trigger_notembedded.result
@@ -133,9 +133,9 @@ CREATE DEFINER='mysqltest_nonexs'@'localhost'
FOR EACH ROW
SET @new_sum = 0;
Warnings:
-Note 1449 There is no 'mysqltest_nonexs'@'localhost' registered
+Note 1449 The user specified as a definer ('mysqltest_nonexs'@'localhost') does not exist
INSERT INTO t1 VALUES(6);
-ERROR HY000: There is no 'mysqltest_nonexs'@'localhost' registered
+ERROR HY000: The user specified as a definer ('mysqltest_nonexs'@'localhost') does not exist
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost latin1 latin1_swedish_ci latin1_swedish_ci
diff --git a/mysql-test/r/type_binary.result b/mysql-test/r/type_binary.result
index 432c58272a2..00f4183aec3 100644
--- a/mysql-test/r/type_binary.result
+++ b/mysql-test/r/type_binary.result
@@ -125,6 +125,7 @@ create table t1 (c char(2), vc varchar(2));
insert into t1 values(0x4120, 0x4120);
insert into t1 values(0x412020, 0x412020);
Warnings:
+Note 1265 Data truncated for column 'c' at row 1
Note 1265 Data truncated for column 'vc' at row 1
drop table t1;
set @old_sql_mode= @@sql_mode, sql_mode= 'traditional';
diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result
index 877400ab7e1..e36f21f2996 100644
--- a/mysql-test/r/type_set.result
+++ b/mysql-test/r/type_set.result
@@ -85,3 +85,12 @@ t1 CREATE TABLE `t1` (
`f1` set('1','2','3','4','5','6','7','8','9','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','1') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+CREATE TABLE t1(c set('1','2','3','4','5','6','7','8','9','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(7);
+INSERT INTO t1 VALUES(9223372036854775808);
+SELECT * FROM t1;
+c
+1,2,3
+64
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result
index 3a7d59798ae..05efea79fe7 100644
--- a/mysql-test/r/user_var-binlog.result
+++ b/mysql-test/r/user_var-binlog.result
@@ -22,7 +22,7 @@ SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/;
use test/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@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 *//*!*/;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 3a7519cdcf1..9bea52ef769 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3613,6 +3613,30 @@ ERROR HY000: Field of view 'test.v1' underlying table doesn't have a default val
set @@sql_mode=@old_mode;
drop view v1;
drop table t1;
+create table t1 (a int, key(a));
+create table t2 (c int);
+create view v1 as select a b from t1;
+create view v2 as select 1 a from t2, v1 where c in
+(select 1 from t1 where b = a);
+insert into t1 values (1), (1);
+insert into t2 values (1), (1);
+prepare stmt from "select * from v2 where a = 1";
+execute stmt;
+a
+1
+1
+1
+1
+drop view v1, v2;
+drop table t1, t2;
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT p.a AS a FROM t1 p, t1 q;
+INSERT INTO t1 VALUES (1), (1);
+SELECT MAX(a), COUNT(DISTINCT a) FROM v1 GROUP BY a;
+MAX(a) COUNT(DISTINCT a)
+1 1
+DROP VIEW v1;
+DROP TABLE t1;
# -----------------------------------------------------------------
# -- Bug#34337: Server crash when Altering a view using a table name.
# -----------------------------------------------------------------
@@ -3631,6 +3655,24 @@ DROP TABLE t1;
# -- End of test case for Bug#34337.
# -----------------------------------------------------------------
+# -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
+# -- causing syntax error
+# -----------------------------------------------------------------
+
+CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
+
+SELECT * FROM v1;
+1
+1
+SHOW CREATE TABLE v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from DUAL where 1 latin1 latin1_swedish_ci
+
+DROP VIEW v1;
+
+# -- End of test case for Bug#35193.
+
+# -----------------------------------------------------------------
# -- End of 5.0 tests.
# -----------------------------------------------------------------
DROP DATABASE IF EXISTS `d-1`;
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 133fb5600bf..3585635d0f9 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -515,10 +515,10 @@ drop user mysqltest_1@localhost;
drop database mysqltest;
create definer=some_user@`` sql security invoker view v1 as select 1;
Warnings:
-Note 1449 There is no 'some_user'@'' registered
+Note 1449 The user specified as a definer ('some_user'@'') does not exist
create definer=some_user@localhost sql security invoker view v2 as select 1;
Warnings:
-Note 1449 There is no 'some_user'@'localhost' registered
+Note 1449 The user specified as a definer ('some_user'@'localhost') does not exist
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci
@@ -601,14 +601,14 @@ CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
Warnings:
-Note 1449 There is no 'no-such-user'@'localhost' registered
+Note 1449 The user specified as a definer ('no-such-user'@'localhost') does not exist
SHOW CREATE VIEW v;
View Create View character_set_client collation_connection
v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM v;
-ERROR HY000: There is no 'no-such-user'@'localhost' registered
+ERROR HY000: The user specified as a definer ('no-such-user'@'localhost') does not exist
DROP VIEW v;
DROP TABLE t1;
USE test;
@@ -722,7 +722,7 @@ SELECT * FROM v1;
ERROR 42000: SELECT command denied to user 'inv_17254'@'localhost' for table 'v1'
for a superuser
SELECT * FROM v1;
-ERROR HY000: There is no 'def_17254'@'localhost' registered
+ERROR HY000: The user specified as a definer ('def_17254'@'localhost') does not exist
DROP USER inv_17254@localhost;
DROP DATABASE db17254;
DROP DATABASE IF EXISTS mysqltest_db1;
@@ -932,7 +932,7 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1;
Warnings:
-Note 1449 There is no 'no_such'@'user_1' registered
+Note 1449 The user specified as a definer ('no_such'@'user_1') does not exist
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
@@ -940,7 +940,7 @@ Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
Warnings:
-Note 1449 There is no 'no_such'@'user_1' registered
+Note 1449 The user specified as a definer ('no_such'@'user_1') does not exist
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
@@ -948,7 +948,7 @@ Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1;
Warnings:
-Note 1449 There is no 'no_such'@'user_2' registered
+Note 1449 The user specified as a definer ('no_such'@'user_2') does not exist
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index b0c02ec47fe..46fdace9125 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -276,4 +276,42 @@ DROP TABLE t3;
DROP PROCEDURE sp1;
DROP PROCEDURE sp2;
DROP PROCEDURE sp3;
+create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext tinytext);
+create table t2 (c_tinyblob tinyblob);
+set @c = repeat(' ', 256);
+set @q = repeat('q', 256);
+set sql_mode = '';
+insert into t1 values(@c, @c, @c);
+Warnings:
+Note 1265 Data truncated for column 'c_char' at row 1
+Note 1265 Data truncated for column 'c_varchar' at row 1
+Note 1265 Data truncated for column 'c_tinytext' at row 1
+insert into t2 values(@c);
+Warnings:
+Warning 1265 Data truncated for column 'c_tinyblob' at row 1
+insert into t1 values(@q, @q, @q);
+Warnings:
+Warning 1265 Data truncated for column 'c_char' at row 1
+Warning 1265 Data truncated for column 'c_varchar' at row 1
+Warning 1265 Data truncated for column 'c_tinytext' at row 1
+insert into t2 values(@q);
+Warnings:
+Warning 1265 Data truncated for column 'c_tinyblob' at row 1
+set sql_mode = 'traditional';
+insert into t1 values(@c, @c, @c);
+Warnings:
+Note 1265 Data truncated for column 'c_char' at row 1
+Note 1265 Data truncated for column 'c_varchar' at row 1
+Note 1265 Data truncated for column 'c_tinytext' at row 1
+insert into t2 values(@c);
+ERROR 22001: Data too long for column 'c_tinyblob' at row 1
+insert into t1 values(@q, NULL, NULL);
+ERROR 22001: Data too long for column 'c_char' at row 1
+insert into t1 values(NULL, @q, NULL);
+ERROR 22001: Data too long for column 'c_varchar' at row 1
+insert into t1 values(NULL, NULL, @q);
+ERROR 22001: Data too long for column 'c_tinytext' at row 1
+insert into t2 values(@q);
+ERROR 22001: Data too long for column 'c_tinyblob' at row 1
+drop table t1, t2;
End of 5.0 tests