diff options
author | unknown <bell@52.0.168.192.in-addr.arpa> | 2005-02-23 19:22:52 +0200 |
---|---|---|
committer | unknown <bell@52.0.168.192.in-addr.arpa> | 2005-02-23 19:22:52 +0200 |
commit | 2c1ef3c604fb87fe0f5484d4174bee72c59a88ae (patch) | |
tree | 78f2044bceb113c001dadb36382ad3fe8363df7b /mysql-test | |
parent | b1b896cfb3bbb3488d4e6b3e43a095e279590576 (diff) | |
parent | e09a6c1a203e986b4c4d34cf8a8b72b39e4c573d (diff) | |
download | mariadb-git-2c1ef3c604fb87fe0f5484d4174bee72c59a88ae.tar.gz |
Merge 52.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/mysql-5.0
into 52.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/work-repl-5.0
BitKeeper/etc/logging_ok:
auto-union
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/protocol.cc:
Auto merged
Diffstat (limited to 'mysql-test')
35 files changed, 375 insertions, 26 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 8a71d8fc566..cee8ca4bfd0 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -450,6 +450,7 @@ while test $# -gt 0; do --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace" EXTRA_MYSQLBINLOG_OPT="$EXTRA_MYSQLBINLOG_OPT \ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlbinlog.trace" + EXTRA_MYSQL_CLIENT_TEST_OPT="--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysql_client_test.trace" ;; --fast) FAST_START=1 @@ -690,7 +691,7 @@ then EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root" fi -MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent" +MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent $EXTRA_MYSQL_CLIENT_TEST_OPT" MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" diff --git a/mysql-test/r/count_distinct2.result b/mysql-test/r/count_distinct2.result index f6b888dec3b..131e3b325ec 100644 --- a/mysql-test/r/count_distinct2.result +++ b/mysql-test/r/count_distinct2.result @@ -116,7 +116,7 @@ count(distinct n) 5000 show status like 'Created_tmp_disk_tables'; Variable_name Value -Created_tmp_disk_tables 2 +Created_tmp_disk_tables 1 drop table t1; create table t1 (s text); flush status; @@ -125,5 +125,5 @@ count(distinct s) 5000 show status like 'Created_tmp_disk_tables'; Variable_name Value -Created_tmp_disk_tables 2 +Created_tmp_disk_tables 1 drop table t1; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index cd804939a75..21c40e24fe2 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -325,3 +325,8 @@ latin1_bin 6109 latin1_bin 61 latin1_bin 6120 drop table t1; +CREATE TABLE „a (a int); +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 '„a (a int)' at line 1 +SELECT '„a' as str; +str +„a diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index faab013559a..893c7cc7039 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -861,3 +861,6 @@ user c one <one> two <two> DROP TABLE t1; +select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8); +convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8) +1 diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 071cb673501..fd6a834c694 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -344,3 +344,22 @@ INSERT INTO t1 VALUES ('root','localhost'), ('root','%'); SELECT * FROM (SELECT (SELECT a.a FROM t1 AS a WHERE a.a = b.a) FROM t1 AS b) AS c; ERROR 21000: Subquery returns more than 1 row DROP TABLE t1; +create table t1(a int); +create table t2(a int); +create table t3(a int); +insert into t1 values(1),(1); +insert into t2 values(2),(2); +insert into t3 values(3),(3); +select * from t1 union distinct select * from t2 union all select * from t3; +a +1 +2 +3 +3 +select * from (select * from t1 union distinct select * from t2 union all select * from t3) X; +a +1 +2 +3 +3 +drop table t1, t2, t3; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 71a1a7539b0..85a0c2c55f9 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -742,3 +742,9 @@ WHERE a = CONV('e251273eb74a8ee3', 16, 10); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 DROP TABLE t1; +SELECT CHAR(NULL,121,83,81,'76') as my_column; +my_column +ySQL +SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column; +my_column +4 diff --git a/mysql-test/r/index_merge_ror_cpk.result b/mysql-test/r/index_merge_ror_cpk.result index 6cfeb20b2de..79bb1297abf 100644 --- a/mysql-test/r/index_merge_ror_cpk.result +++ b/mysql-test/r/index_merge_ror_cpk.result @@ -59,7 +59,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref key1 key1 4 const 100 Using where explain select * from t1 where pk1 < 7500 and key1 = 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL 38 Using intersect(key1,PRIMARY); Using where +1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL ROWS Using intersect(key1,PRIMARY); Using where explain select * from t1 where pktail1ok=1 and key1=10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge key1,pktail1ok key1,pktail1ok 4,4 NULL 1 Using intersect(key1,pktail1ok); Using where diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index e8ec4f70139..121de940560 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -494,8 +494,8 @@ select TABLE_NAME,TABLE_TYPE,ENGINE from information_schema.tables where table_schema='information_schema' limit 2; TABLE_NAME TABLE_TYPE ENGINE -SCHEMATA TEMPORARY MyISAM -TABLES TEMPORARY MyISAM +SCHEMATA TEMPORARY MEMORY +TABLES TEMPORARY MEMORY show tables from information_schema like "T%"; Tables_in_information_schema (T%) TABLES @@ -610,3 +610,24 @@ create view v1 as select * from t1, t2; set @got_val= (select count(*) from information_schema.columns); drop view v1; drop table t1, t2; +CREATE TABLE t_crashme ( f1 BIGINT); +CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; +CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; +drop view a2, a1; +drop table t_crashme; +select table_schema,table_name, column_name from +information_schema.columns +where data_type = 'longtext'; +table_schema table_name column_name +information_schema COLUMNS COLUMN_TYPE +information_schema ROUTINES ROUTINE_DEFINITION +information_schema ROUTINES SQL_MODE +information_schema VIEWS VIEW_DEFINITION +select table_name, column_name, data_type from information_schema.columns +where data_type = 'datetime'; +table_name column_name data_type +TABLES CREATE_TIME datetime +TABLES UPDATE_TIME datetime +TABLES CHECK_TIME datetime +ROUTINES CREATED datetime +ROUTINES LAST_ALTERED datetime diff --git a/mysql-test/r/multi_statement.result b/mysql-test/r/multi_statement.result index 4451b0a355e..3a8d86bf349 100644 --- a/mysql-test/r/multi_statement.result +++ b/mysql-test/r/multi_statement.result @@ -31,3 +31,20 @@ select 5'abcd' select 'finish'; finish finish +flush status; +create table t1 (i int); +insert into t1 values (1); +select * from t1 where i = 1; +insert into t1 values (2),(3),(4); +select * from t1 where i = 2; +select * from t1 where i = 3|||| +i +1 +i +2 +i +3 +show status like 'Slow_queries'|||| +Variable_name Value +Slow_queries 2 +drop table t1|||| diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 9f08fae4964..d8d9e60acd1 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -64,6 +64,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, @@ -83,10 +84,12 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, `b` float default NULL @@ -97,6 +100,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; CREATE TABLE t1(a int, b text, c varchar(3)); @@ -153,6 +157,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` varchar(255) default NULL @@ -172,6 +177,7 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; CREATE TABLE t1 (a int) ENGINE=MYISAM; @@ -179,6 +185,7 @@ INSERT INTO t1 VALUES (1), (2); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -194,10 +201,12 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -213,6 +222,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; create table ```a` (i int); @@ -229,6 +239,7 @@ create table t1(a int); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -246,10 +257,12 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -264,6 +277,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; set global sql_mode='ANSI_QUOTES'; @@ -274,6 +288,7 @@ set global sql_mode='ANSI_QUOTES'; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -291,10 +306,12 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -309,6 +326,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; set global sql_mode=''; drop table t1; @@ -320,6 +338,7 @@ insert into t1 values (1),(2),(3); /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -330,6 +349,7 @@ CREATE TABLE `t1` ( /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 1 2 @@ -345,6 +365,7 @@ create view v1 as select * from t1; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -365,6 +386,7 @@ CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` fro /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; drop view v1; drop table t1; @@ -376,6 +398,7 @@ drop table t1; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -387,6 +410,7 @@ USE `test`; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; create database mysqldump_test_db character set latin2 collate latin2_bin; @@ -397,6 +421,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; @@ -408,6 +433,7 @@ USE `mysqldump_test_db`; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; drop database mysqldump_test_db; CREATE TABLE t1 (a CHAR(10)); @@ -420,6 +446,7 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -438,10 +465,12 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -457,10 +486,12 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -476,10 +507,12 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -495,10 +528,12 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -514,6 +549,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; CREATE TABLE t1 (a int); @@ -528,6 +564,7 @@ INSERT INTO t2 VALUES (4),(5),(6); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL @@ -546,6 +583,7 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 153121f0662..cd3c8e162f7 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -1,5 +1,6 @@ drop table if exists t5, t6, t7, t8; drop database if exists mysqltest ; +drop database if exists client_test_db; drop database if exists testtets; drop table if exists t1Aa,t2Aa,v1Aa,v2Aa; drop view if exists t1Aa,t2Aa,v1Aa,v2Aa; diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result index d105e208777..98a8c53d5fd 100644 --- a/mysql-test/r/rpl_charset.result +++ b/mysql-test/r/rpl_charset.result @@ -246,3 +246,10 @@ SET TIMESTAMP=1000000000; SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30; INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); drop table t1; +create table `t1` ( +`pk` varchar(10) not null default '', +primary key (`pk`) +) engine=myisam default charset=latin1; +set @p=_latin1 'test'; +update t1 set pk='test' where pk=@p; +drop table t1; diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 69e4b082422..c28ea0fce02 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -852,8 +852,8 @@ NULL NULL 3.40282e+38 0 DROP TABLE t1; CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED); -INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308); -INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308'); +INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308); +INSERT INTO t1 VALUES ('-2.2E-307',0),('-2E-307',0),('+1.7E+308','+1.7E+308'); INSERT INTO t1 (col1) VALUES (-2.2E-330); INSERT INTO t1 (col1) VALUES (+1.7E+309); Got one of the listed errors @@ -864,7 +864,7 @@ ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES ('-1.2E-3'); ERROR 22003: Out of range value adjusted for column 'col2' at row 1 UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0; -ERROR 22003: Out of range value adjusted for column 'col1' at row 2 +ERROR 22003: Out of range value adjusted 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; @@ -890,9 +890,11 @@ Warning 1264 Out of range value adjusted for column 'col2' at row 1 Warning 1264 Out of range value adjusted for column 'col2' at row 1 SELECT * FROM t1; col1 col2 --2.2e-307 0 +0 0 +1e-303 0 1.7e+308 1.7e+308 --2.2e-307 0 +0 0 +-2e-307 0 1.7e+308 1.7e+308 0 NULL 2 NULL diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 6e36f24d8b0..2dd58f54327 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -94,6 +94,6 @@ d 2002-10-24 14:50:40 show status like "created_tmp%tables"; Variable_name Value -Created_tmp_disk_tables 1 +Created_tmp_disk_tables 0 Created_tmp_tables 2 drop table t1; diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 6c4a1fab857..2d5c2d2ac97 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, t2; SET SQL_WARNINGS=1; CREATE TABLE t1 ( id int(11) NOT NULL auto_increment, @@ -677,3 +677,19 @@ a 9999.999 0000.000 drop table t1; +CREATE TABLE t1 +(EMPNUM CHAR(3) NOT NULL, +HOURS DECIMAL(5)); +CREATE TABLE t2 +(EMPNUM CHAR(3) NOT NULL, +HOURS BIGINT); +INSERT INTO t1 VALUES ('E1',40); +INSERT INTO t1 VALUES ('E8',NULL); +INSERT INTO t2 VALUES ('E1',40); +SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t2); +EMPNUM +E1 +SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t1); +EMPNUM +E1 +DROP TABLE t1,t2; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 8140167870e..eec9701d054 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -11,6 +11,12 @@ SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; 0.001e+1 0.001e-1 -0.001e+01 -0.001e-01 0.01 0.0001 -0.01 -0.0001 +SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0; +123.23E+02 -123.23E-02 "123.23E+02"+0.0 "-123.23E-02"+0.0 +12323 -1.2323 12323 -1.2323 +SELECT 2147483647E+02,21474836.47E+06; +2147483647E+02 21474836.47E+06 +214748364700 21474836470000 create table t1 (f1 float(24),f2 float(52)); show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment @@ -209,3 +215,23 @@ c 0.0002 2e-05 drop table t1; +CREATE TABLE t1 ( +reckey int unsigned NOT NULL, +recdesc varchar(50) NOT NULL, +PRIMARY KEY (reckey) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (108, 'Has 108 as key'); +INSERT INTO t1 VALUES (109, 'Has 109 as key'); +select * from t1 where reckey=108; +reckey recdesc +108 Has 108 as key +select * from t1 where reckey=1.08E2; +reckey recdesc +108 Has 108 as key +select * from t1 where reckey=109; +reckey recdesc +109 Has 109 as key +select * from t1 where reckey=1.09E2; +reckey recdesc +109 Has 109 as key +drop table t1; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 511ef5e3188..8ae1d145227 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -127,7 +127,7 @@ drop table t1; set @a=_latin2'test'; select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_general_ci 3 +latin2 latin2_general_ci 2 select @a=_latin2'TEST'; @a=_latin2'TEST' 1 @@ -137,12 +137,13 @@ select @a=_latin2'TEST' collate latin2_bin; set @a=_latin2'test' collate latin2_general_ci; select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_general_ci 0 +latin2 latin2_general_ci 2 select @a=_latin2'TEST'; @a=_latin2'TEST' 1 select @a=_latin2'TEST' collate latin2_bin; -ERROR HY000: Illegal mix of collations (latin2_general_ci,EXPLICIT) and (latin2_bin,EXPLICIT) for operation '=' +@a=_latin2'TEST' collate latin2_bin +0 select charset(@a:=_latin2'test'); charset(@a:=_latin2'test') latin2 @@ -151,21 +152,22 @@ collation(@a:=_latin2'test') latin2_general_ci select coercibility(@a:=_latin2'test'); coercibility(@a:=_latin2'test') -3 +2 select collation(@a:=_latin2'test' collate latin2_bin); collation(@a:=_latin2'test' collate latin2_bin) latin2_bin select coercibility(@a:=_latin2'test' collate latin2_bin); coercibility(@a:=_latin2'test' collate latin2_bin) -0 +2 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'; (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' 0 select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_bin 0 +latin2 latin2_bin 2 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci; -ERROR HY000: Illegal mix of collations (latin2_bin,EXPLICIT) and (latin2_general_ci,EXPLICIT) for operation '=' +(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci +1 create table t1 (a varchar(50)); reset master; SET TIMESTAMP=10000; diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index a2e99be62ad..222638f64bb 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -1,6 +1,33 @@ drop table if exists t1, t2; SET SQL_WARNINGS=1; create table t1 (a int); +create table t1 (a int); +ERROR 42S01: Table 't1' already exists +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1050 Table 't1' already exists +show warnings; +Level Code Message +Error 1050 Table 't1' already exists +create table t2(a int) default charset qwerty; +ERROR 42000: Unknown character set: 'qwerty' +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1115 Unknown character set: 'qwerty' +create table t (i); +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 ')' at line 1 +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1064 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 ')' at line 1 insert into t1 values (1); insert into t1 values ("hej"); Warnings: diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index cee0324d12f..6006ee4c527 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -66,3 +66,12 @@ SET collation_connection='latin1_swedish_ci'; -- source include/ctype_filesort.inc SET collation_connection='latin1_bin'; -- source include/ctype_filesort.inc + +# +# Bug#8041 +# An unknown character (e.g. 0x84) should result in ERROR, +# It was treated like a space character earlier. +# Howerver, it should still work fine as a string part. +--error 1064 +CREATE TABLE „a (a int); +SELECT '„a' as str; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 8e3eb71c3e5..35f2b2642be 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -693,3 +693,8 @@ INSERT INTO t1 VALUES ('one'),('two'); SELECT CHARSET('a'); SELECT user, CONCAT('<', user, '>') AS c FROM t1; DROP TABLE t1; + +# +# Bug#8385: utf8_general_ci treats Cyrillic letters I and SHORT I as the same +# +select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8); diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index df860d92b38..1e3ffd5160b 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -236,3 +236,15 @@ INSERT INTO t1 VALUES ('root','localhost'), ('root','%'); --error 1242 SELECT * FROM (SELECT (SELECT a.a FROM t1 AS a WHERE a.a = b.a) FROM t1 AS b) AS c; DROP TABLE t1; +# +# test of union subquery in the FROM clause with complex distinct/all (BUG#6565) +# +create table t1(a int); +create table t2(a int); +create table t3(a int); +insert into t1 values(1),(1); +insert into t2 values(2),(2); +insert into t3 values(3),(3); +select * from t1 union distinct select * from t2 union all select * from t3; +select * from (select * from t1 union distinct select * from t2 union all select * from t3) X; +drop table t1, t2, t3; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index ffbcc1d774b..a69febef340 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -479,3 +479,9 @@ EXPLAIN WHERE a = CONV('e251273eb74a8ee3', 16, 10); DROP TABLE t1; + +# +# Bug #6317: string function CHAR, parameter is NULL, wrong result +# +SELECT CHAR(NULL,121,83,81,'76') as my_column; +SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column; diff --git a/mysql-test/t/index_merge_ror_cpk.test b/mysql-test/t/index_merge_ror_cpk.test index 867b0b3a036..94abf395d0a 100644 --- a/mysql-test/t/index_merge_ror_cpk.test +++ b/mysql-test/t/index_merge_ror_cpk.test @@ -63,6 +63,7 @@ select pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1; # Verify that CPK is always used for index intersection scans # (this is because it is used as a filter, not for retrieval) explain select * from t1 where badkey=1 and key1=10; +--replace_result 38 ROWS 37 ROWS explain select * from t1 where pk1 < 7500 and key1 = 10; # Verify that keys with 'tails' of PK members are ok. diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index baf817b7c84..86d7bad76bc 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -363,3 +363,40 @@ create view v1 as select * from t1, t2; set @got_val= (select count(*) from information_schema.columns); drop view v1; drop table t1, t2; + +# +# Bug #7476: crash on SELECT * FROM INFORMATION_SCHEMA.TABLES +# + +CREATE TABLE t_crashme ( f1 BIGINT); +CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; +CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; +let $tab_count= 65; +--disable_query_log +while ($tab_count) +{ + EVAL CREATE TABLE t_$tab_count (f1 BIGINT); + dec $tab_count ; +} +--disable_result_log +SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +let $tab_count= 65; +while ($tab_count) +{ + EVAL DROP TABLE t_$tab_count; + dec $tab_count ; +} +--enable_query_log +drop view a2, a1; +drop table t_crashme; + +# +# Bug #7215 information_schema: columns are longtext instead of varchar +# Bug #7217 information_schema: columns are varbinary() instead of timestamp +# +select table_schema,table_name, column_name from +information_schema.columns +where data_type = 'longtext'; +select table_name, column_name, data_type from information_schema.columns +where data_type = 'datetime'; diff --git a/mysql-test/t/multi_statement-master.opt b/mysql-test/t/multi_statement-master.opt new file mode 100644 index 00000000000..b30df037531 --- /dev/null +++ b/mysql-test/t/multi_statement-master.opt @@ -0,0 +1,2 @@ +--log-slow-queries=slow.log +--log-queries-not-using-indexes diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index 862f2294641..2abec332878 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -14,3 +14,18 @@ select "abcd'";'abcd'select "'abcd";'abcd' select 5'abcd' delimiter ;'abcd' select 'finish'; + +# Bug #8475: Make sure every statement that is a slow query in +# a multi-statement query gets logged as a slow query. +flush status; +delimiter ||||; +create table t1 (i int); +insert into t1 values (1); +select * from t1 where i = 1; +insert into t1 values (2),(3),(4); +select * from t1 where i = 2; +select * from t1 where i = 3|||| +show status like 'Slow_queries'|||| +drop table t1|||| + +delimiter ;|||| diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 86aecf43cbd..3639fc2e262 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -1,3 +1,10 @@ # We run with different binaries for normal and --embedded-server +# +# If this test fails with "command "$MYSQL_CLIENT_TEST" failed", +# you should either run mysql_client_test separartely against a running +# server or run mysql-test-run --debug mysql_client_test and check +# var/log/mysql_client_test.trace + --disable_result_log +--exec echo $MYSQL_CLIENT_TEST --exec $MYSQL_CLIENT_TEST diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 81934547f82..22a4a8bf2c9 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -11,7 +11,9 @@ --disable_warnings drop table if exists t5, t6, t7, t8; drop database if exists mysqltest ; + # Cleanup from other tests +drop database if exists client_test_db; drop database if exists testtets; drop table if exists t1Aa,t2Aa,v1Aa,v2Aa; drop view if exists t1Aa,t2Aa,v1Aa,v2Aa; diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test index c61df09fdcc..d2c195dfdbf 100644 --- a/mysql-test/t/rpl_charset.test +++ b/mysql-test/t/rpl_charset.test @@ -157,3 +157,15 @@ connection master; drop table t1; sync_slave_with_master; +# +# BUG#6676: Derivation of variables must be correct on slave +# +connection master; +create table `t1` ( + `pk` varchar(10) not null default '', + primary key (`pk`) +) engine=myisam default charset=latin1; +set @p=_latin1 'test'; +update t1 set pk='test' where pk=@p; +drop table t1; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 850d3c1741c..47b5754232c 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -175,7 +175,7 @@ while ($1) commit; drop table t1; let $VERSION=`select version()`; ---replace_result $VERSION VERSION +--replace_result $VERSION VERSION "xid=373" "xid=146" show binlog events in 'master-bin.000001'; --replace_result $VERSION VERSION show binlog events in 'master-bin.000002'; diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index d8833f6f914..d3928a623f4 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -828,8 +828,8 @@ DROP TABLE t1; # Test INSERT with DOUBLE CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED); -INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308); -INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308'); +INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308); +INSERT INTO t1 VALUES ('-2.2E-307',0),('-2E-307',0),('+1.7E+308','+1.7E+308'); # We don't give warnings for underflow INSERT INTO t1 (col1) VALUES (-2.2E-330); --error 1367,1264 diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 6f170a52700..18ac5d1e467 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -1,7 +1,7 @@ # bug in decimal() with negative numbers by kaido@tradenet.ee --disable_warnings -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, t2; --enable_warnings SET SQL_WARNINGS=1; @@ -268,3 +268,20 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000 --enable_warnings select * from t1; drop table t1; + +# Test for BUG#8397: decimal type in subselects (Item_cache_decimal) +CREATE TABLE t1 +(EMPNUM CHAR(3) NOT NULL, +HOURS DECIMAL(5)); +CREATE TABLE t2 +(EMPNUM CHAR(3) NOT NULL, +HOURS BIGINT); + +INSERT INTO t1 VALUES ('E1',40); +INSERT INTO t1 VALUES ('E8',NULL); +INSERT INTO t2 VALUES ('E1',40); + +SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t2); +SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t1); + +DROP TABLE t1,t2; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 4f40d97743a..6e991dc53d4 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -12,6 +12,8 @@ SELECT 10,10.0,10.,.1e+2,100.0e-1; SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; +SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0; +SELECT 2147483647E+02,21474836.47E+06; create table t1 (f1 float(24),f2 float(52)); show full columns from t1; @@ -122,3 +124,23 @@ create table t1 (c char(6)); insert into t1 values (2e5),(2e6),(2e-4),(2e-5); select * from t1; drop table t1; + +# +# Test of comparison of integer with float-in-range (Bug #7840) +# This is needed because some ODBC applications (like Foxpro) uses +# floats for everything. +# + +CREATE TABLE t1 ( + reckey int unsigned NOT NULL, + recdesc varchar(50) NOT NULL, + PRIMARY KEY (reckey) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES (108, 'Has 108 as key'); +INSERT INTO t1 VALUES (109, 'Has 109 as key'); +select * from t1 where reckey=108; +select * from t1 where reckey=1.08E2; +select * from t1 where reckey=109; +select * from t1 where reckey=1.09E2; +drop table t1; diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index 5dc24bde21f..07076f1f6f4 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -85,7 +85,6 @@ select @a=_latin2'TEST' collate latin2_bin; set @a=_latin2'test' collate latin2_general_ci; select charset(@a),collation(@a),coercibility(@a); select @a=_latin2'TEST'; ---error 1267 select @a=_latin2'TEST' collate latin2_bin; # @@ -98,7 +97,6 @@ select collation(@a:=_latin2'test' collate latin2_bin); select coercibility(@a:=_latin2'test' collate latin2_bin); select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'; select charset(@a),collation(@a),coercibility(@a); ---error 1267 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci; # Check that user variables are binlogged correctly (BUG#3875) diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 67162e7f84b..c71365c3da6 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -7,6 +7,19 @@ drop table if exists t1, t2; SET SQL_WARNINGS=1; create table t1 (a int); +--error 1050 +create table t1 (a int); +show count(*) errors; +show errors; +show warnings; +--error 1115 +create table t2(a int) default charset qwerty; +show count(*) errors; +show errors; +--error 1064 +create table t (i); +show count(*) errors; +show errors; insert into t1 values (1); insert into t1 values ("hej"); insert into t1 values ("hej"),("då"); |