diff options
author | unknown <serg@sergbook.mysql.com> | 2004-12-31 15:26:24 +0100 |
---|---|---|
committer | unknown <serg@sergbook.mysql.com> | 2004-12-31 15:26:24 +0100 |
commit | b99bea6704299399c84bd8374ef7f248ff9570c5 (patch) | |
tree | 928b06c231edee4cb95ace87ed30e879e3dcb0fb /mysql-test | |
parent | bd23099be0b22845e8c97e2fb36ee3c6eb0e2491 (diff) | |
parent | 5eaf65ab4be77911eb03cceefac9ecea48c25f71 (diff) | |
download | mariadb-git-b99bea6704299399c84bd8374ef7f248ff9570c5.tar.gz |
manually merged
configure.in:
Auto merged
client/mysqldump.c:
Auto merged
innobase/buf/buf0rea.c:
Auto merged
innobase/dict/dict0load.c:
Auto merged
innobase/fil/fil0fil.c:
Auto merged
innobase/include/fil0fil.h:
Auto merged
innobase/include/row0mysql.h:
Auto merged
innobase/include/trx0trx.h:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/row/row0ins.c:
Auto merged
innobase/row/row0mysql.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
innobase/trx/trx0trx.c:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/r/grant_cache.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/ndb_blob.result:
Auto merged
mysql-test/r/ps_1general.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/timezone2.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/grant.test:
Auto merged
mysql-test/t/merge.test:
Auto merged
mysql-test/t/multi_update.test:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
Auto merged
ndb/src/ndbapi/NdbConnection.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Auto merged
ndb/src/ndbapi/NdbOperationDefine.cpp:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_myisammrg.cc:
Auto merged
sql/ha_myisammrg.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_table.cc:
Auto merged
sql/strfunc.cc:
Auto merged
sql/unireg.cc:
Auto merged
vio/vio.c:
Auto merged
vio/viosocket.c:
Auto merged
Diffstat (limited to 'mysql-test')
30 files changed, 429 insertions, 33 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index c21deaf39b6..b3b961fe42d 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -596,7 +596,8 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password= MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $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" MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" -export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR TESTS_BINDIR +export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES +export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR export NDB_TOOLS_DIR MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result index 7049c02f304..5ebd20a7f83 100644 --- a/mysql-test/ndb/basic.result +++ b/mysql-test/ndb/basic.result @@ -31,12 +31,12 @@ QUIT Quit management client <id> = ALL | Any database node id Connected to Management Server at: localhost:1186 -Node 1: started (Version 4.1.8) -Node 2: started (Version 4.1.8) +Node 1: started (Version 4.1.9) +Node 2: started (Version 4.1.9) -Node 1: started (Version 4.1.8) +Node 1: started (Version 4.1.9) -Node 2: started (Version 4.1.8) +Node 2: started (Version 4.1.9) Executing CLUSTERLOG on node 1 OK! Executing CLUSTERLOG on node 2 OK! diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 37f5d0aa26a..3da828ebf9c 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -121,7 +121,7 @@ create database mysqltest; create table mysqltest.t1 (a int,b int,c int); grant all on mysqltest.t1 to mysqltest_1@localhost; alter table t1 rename t2; -ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2' +ERROR 42000: INSERT,CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2' revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; delete from mysql.user where user=_binary'mysqltest_1'; drop database mysqltest; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 238191b8e03..891786961b1 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -591,3 +591,14 @@ x,y 0078002C0079 z 007A x,y,z,ä,ö,ü 0078002C0079002C007A002C00E4002C00F6002C00FC drop table t1; +create table t1(a enum('a','b','c')) default character set ucs2; +insert into t1 values('a'),('b'),('c'); +alter table t1 add b char(1); +show warnings; +Level Code Message +select * from t1 order by a; +a b +a NULL +b NULL +c NULL +drop table t1; diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 758a83defed..2db014c4a52 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -296,6 +296,9 @@ Tuesday 52 2001 %W %V %X 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 15-01-20 %d-%m-%y 00:00:00 15-2001-1 %d-%Y-%c 00:00:00 +select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); +concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')) +2003-01-02 08:11:02.123456 truncate table t1; insert into t1 values ('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'), diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index 419413e4156..0bd53b32dd7 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -63,8 +63,8 @@ a0 select 'a' union select concat('a', -0.0); a a -a-0.0 +a0.0 select 'a' union select concat('a', -0.0000); a a -a-0.0000 +a0.0000 diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 90aa04515d7..3a28cccfac5 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -124,3 +124,5 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` +select rand(rand); +ERROR 42S22: Unknown column 'rand' in 'field list' diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index ff0529472da..530651e63f8 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -691,3 +691,15 @@ select count(*) as total, left(c,10) as reg from t1 group by reg order by reg de total reg 10 2004-12-10 drop table t1; +select quote(ltrim(concat(' ', 'a'))); +quote(ltrim(concat(' ', 'a'))) +'a' +select quote(trim(concat(' ', 'a'))); +quote(trim(concat(' ', 'a'))) +'a' +select trim(null from 'kate') as "must_be_null"; +must_be_null +NULL +select trim('xyz' from null) as "must_be_null"; +must_be_null +NULL diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 87a496e7a1b..ddaa0064f18 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -37,6 +37,28 @@ Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA' delete from mysql.user where user='mysqltest_1'; flush privileges; +delete from mysql.user where user='mysqltest_1'; +flush privileges; +grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10; +select * from mysql.user where user="mysqltest_1"; +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N 10 0 0 +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 +grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30; +select * from mysql.user where user="mysqltest_1"; +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N 10 20 30 +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 +delete from mysql.user where user='mysqltest_1'; +flush privileges; grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index 48cbac10d46..dd784c65953 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -45,7 +45,6 @@ show grants for current_user(); Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT, INSERT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' -use mysqltest; insert into t1 values (1, 'I can''t change it!'); update t1 set data='I can change it!' where id = 1; ERROR 42000: update command denied to user 'mysqltest_1'@'localhost' for table 't1' @@ -55,8 +54,6 @@ select * from t1; id data 1 I can't change it! drop table t1; -drop database mysqltest; -use test; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; @@ -222,3 +219,17 @@ drop user mysqltest_B@'%'; ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysql' drop user mysqltest_B@'%'; drop user mysqltest_3@localhost; +create table t1 (a int, b int); +grant select (a) on t1 to mysqltest_1@localhost with grant option; +grant select (a,b) on t1 to mysqltest_2@localhost; +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't1' +grant select on t1 to mysqltest_3@localhost; +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1' +drop table t1; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; +drop database mysqltest; +use test; diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result index 0c59ed1584c..2a1170ee751 100644 --- a/mysql-test/r/grant_cache.result +++ b/mysql-test/r/grant_cache.result @@ -134,7 +134,7 @@ a b c a 1 1 1 test.t1 2 2 2 test.t1 select * from t2; -ERROR 42000: select command denied to user 'mysqltest_2'@'localhost' for table 't2' +ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -148,7 +148,7 @@ select "user3"; user3 user3 select * from t1; -ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1' select a from t1; a 1 @@ -156,7 +156,7 @@ a select c from t1; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' select * from t2; -ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't2' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 't2' select mysqltest.t1.c from test.t1,mysqltest.t1; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' show status like "Qcache_queries_in_cache"; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index e014d2b80b7..54feabc6608 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -677,4 +677,9 @@ a b c 1 2 0 1 1 1 1 1 0 +show index from t3; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t3 1 a 1 a A NULL NULL NULL YES BTREE +t3 1 a 2 b A NULL NULL NULL YES BTREE +t3 1 a 3 c A NULL NULL NULL YES BTREE drop table t1, t2, t3; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 62b7bdb9fb1..346629044b4 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -387,6 +387,7 @@ USE `test`; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +drop database mysqldump_test_db; create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -409,3 +410,143 @@ USE `mysqldump_test_db`; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; drop database mysqldump_test_db; +CREATE TABLE t1 (a CHAR(10)); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!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" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!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 */; + +/*!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" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +/*!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" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('Ž™šá'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +/*!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" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('Ž™šá'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +/*!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" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +DROP TABLE t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (4),(5),(6); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!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" */; +DROP TABLE IF EXISTS `t2`; +CREATE TABLE `t2` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +LOCK TABLES `t2` WRITE; +INSERT INTO `t2` VALUES (4),(5),(6); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!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 */; + +DROP TABLE t1; +DROP TABLE t2; +drop database mysqldump_test_db; diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index 44109dabbc8..f806cf08ea9 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -467,3 +467,21 @@ a b 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB drop table t1; +create table t1 ( +id int(11) unsigned primary key NOT NULL auto_increment, +msg text NOT NULL +) engine=ndbcluster default charset=utf8; +insert into t1 (msg) values( +'Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length).'); +select * from t1; +id msg +1 Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length). +drop table t1; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 2507d545feb..29309564c45 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -834,7 +834,7 @@ execute s_t9 ; my_col 1 select a as my_col from t1; -ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' +ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' grant select on mysqltest.t1 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; @@ -873,7 +873,7 @@ Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' execute s_t1 ; -ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' +ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' revoke all privileges, grant option from second_user@localhost ; show grants for second_user@localhost ; Grants for second_user@localhost diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index a425f054d5e..1a1a9a256db 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1433,7 +1433,7 @@ Note 1003 (select `test`.`t1`.`s1` AS `s1` from `test`.`t1`) s1 tttt drop table t1; -create table t1 (s1 char(5), index s1(s1)); +create table t1 (s1 char(5) not null, index s1(s1)); create table t2 (s1 char(5), index s1(s1)); insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); @@ -1459,25 +1459,25 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select `test`.`t1`.`s1` AS `s1`,<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where Warnings: Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 chicking NULL where (`test`.`t2`.`s1` < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` @@ -2133,3 +2133,30 @@ SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 c Oceania drop table t1; +CREATE TABLE t1 ( f1 BIGINT ); +INSERT INTO t1 SET f1= NULL; +INSERT INTO t1 SET f1= 1; +CREATE TABLE t2 ( f1 BIGINT ); +SELECT f1 FROM t1 +WHERE f1 <> ALL ( SELECT f1 FROM t2 ); +f1 +NULL +1 +INSERT INTO t2 VALUES (1), (2); +SELECT f1 FROM t1 +WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 ); +f1 +NULL +1 +SELECT f1 FROM t1 +WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 +UNION +SELECT f1 FROM t2 WHERE f1 > 3); +f1 +NULL +1 +SELECT f1 FROM t1 +WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); +f1 +NULL +1 diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index 040ec866080..94d660c90d0 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -297,9 +297,9 @@ convert_tz(b, 'Europe/Moscow', 'UTC') update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') where t1.a = t2.c and t2.d = (select max(d) from t2); select * from mysql.time_zone_name; -ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; -ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 56704cf4f35..1659a9dddb5 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -145,13 +145,13 @@ set global timed_mutexes=0; show variables like 'timed_mutexes'; Variable_name Value timed_mutexes OFF -set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="INNODB"; +set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE"; show local variables like 'storage_engine'; Variable_name Value storage_engine HEAP show global variables like 'storage_engine'; Variable_name Value -storage_engine InnoDB +storage_engine MERGE set GLOBAL query_cache_size=100000; set GLOBAL myisam_max_sort_file_size=2000000; show global variables like 'myisam_max_sort_file_size'; @@ -250,7 +250,7 @@ set max_join_size="hello"; ERROR 42000: Incorrect argument type to variable 'max_join_size' set storage_engine=UNKNOWN_TABLE_TYPE; ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE' -set storage_engine=INNODB, big_tables=2; +set storage_engine=MERGE, big_tables=2; ERROR 42000: Variable 'big_tables' can't be set to the value of '2' show local variables like 'storage_engine'; Variable_name Value diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 9d6cb6649ab..506c47ae55a 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -376,3 +376,13 @@ insert into t1 values ('x,y'); insert into t1 values ('x,y,z,Ä,Ö,Ü'); select a, hex(a) from t1 order by a; drop table t1; + +# +# Bug#7302 UCS2 data in ENUM fields get truncated when new column is added +# +create table t1(a enum('a','b','c')) default character set ucs2; +insert into t1 values('a'),('b'),('c'); +alter table t1 add b char(1); +show warnings; +select * from t1 order by a; +drop table t1; diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index c369a9c85d5..800e5880b09 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -166,6 +166,8 @@ select date,format,cast(str_to_date(date, format) as datetime) as datetime from select date,format,DATE(str_to_date(date, format)) as date2 from t1; select date,format,TIME(str_to_date(date, format)) as time from t1; select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; +# Test small bug in %f handling +select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); # Test wrong dates or converion specifiers diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index e58c097b5a6..668aefc2d8d 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -51,3 +51,10 @@ SELECT ASIN(1.2-0.2); #select floor(log(16)/log(2)); explain extended select degrees(pi()),radians(360); + +# +# Bug #7281: problem with rand() +# + +--error 1054 +select rand(rand); diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 4404429cf7e..a5d95332caa 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -429,3 +429,17 @@ create table t1 (a int not null primary key, b varchar(40), c datetime); insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; drop table t1; +# crashing bug with QUOTE() and LTRIM() or TRIM() fixed +# Bug #7495 +# + +select quote(ltrim(concat(' ', 'a'))); +select quote(trim(concat(' ', 'a'))); + +# +# Bug#7455 unexpected result: TRIM(<NULL> FROM <whatever>) gives NOT NULL +# According to ANSI if one of the TRIM arguments is NULL, then the result +# must be NULL too. +# +select trim(null from 'kate') as "must_be_null"; +select trim('xyz' from null) as "must_be_null"; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index c05bed4b701..0bb83891fe2 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -33,6 +33,23 @@ delete from mysql.user where user='mysqltest_1'; flush privileges; # +# Test of GRANTS specifying user limits +# +delete from mysql.user where user='mysqltest_1'; +flush privileges; +grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10; +select * from mysql.user where user="mysqltest_1"; +show grants for mysqltest_1@localhost; +grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30; +select * from mysql.user where user="mysqltest_1"; +show grants for mysqltest_1@localhost; +# This is just to double check that one won't ignore results of selects +flush privileges; +show grants for mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +flush privileges; + +# # Test that the new db privileges are stored/retrieved correctly # diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index ad3fc1c228e..7a09559ac56 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -59,10 +59,9 @@ flush privileges; use mysqltest; create table t1 (id int primary key, data varchar(255)); -connect (mrbad, localhost, mysqltest_1,,); +connect (mrbad, localhost, mysqltest_1,,mysqltest); connection mrbad; show grants for current_user(); -use mysqltest; insert into t1 values (1, 'I can''t change it!'); --error 1142 update t1 set data='I can change it!' where id = 1; @@ -70,11 +69,10 @@ update t1 set data='I can change it!' where id = 1; --error 1142 insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!'; select * from t1; +disconnect mrbad; connection default; drop table t1; -drop database mysqltest; -use test; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; @@ -226,4 +224,26 @@ connection default; drop user mysqltest_B@'%'; drop user mysqltest_3@localhost; # +# +# +create table t1 (a int, b int); +grant select (a) on t1 to mysqltest_1@localhost with grant option; +connect (mrugly, localhost, mysqltest_1,,mysqltest); +connection mrugly; +--error 1143 +grant select (a,b) on t1 to mysqltest_2@localhost; +--error 1142 +grant select on t1 to mysqltest_3@localhost; +disconnect mrugly; + +connection default; +drop table t1; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; + +drop database mysqltest; +use test; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 02c3aae71ef..4c8d7cc1b74 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -303,5 +303,8 @@ select a,b,c from t3 force index (a) where a=1 order by a,b,c; explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +# BUG#7377 SHOW index on MERGE table crashes debug server +show index from t3; + drop table t1, t2, t3; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index b74b06fe191..de66218c4a6 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -434,6 +434,7 @@ delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2 drop table t1,t2; # Test for BUG#5837 - delete with outer join and const tables +--disable_warnings create table t1 ( aclid bigint not null primary key, status tinyint(1) not null @@ -443,6 +444,7 @@ create table t2 ( refid bigint not null primary key, aclid bigint, index idx_acl(aclid) ) engine = innodb; +--enable_warnings insert into t2 values(1,null); delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; drop table t1, t2; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 7a811e69147..7b1fdc7c05b 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -146,3 +146,31 @@ drop table t1; create database mysqldump_test_db character set latin2 collate latin2_bin; --exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db; drop database mysqldump_test_db; + +# +# Bug #7020 +# Check that we don't dump in UTF8 in compatible mode by default, +# but use the default compiled values, or the values given in +# --default-character-set=xxx. However, we should dump in UTF8 +# if it is explicitely set. + +CREATE TABLE t1 (a CHAR(10)); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 +DROP TABLE t1; + +# +# WL #2319: Exclude Tables from dump +# + +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (4),(5),(6); +--exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index 06ecbc66d97..96e38bfb58e 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -389,3 +389,17 @@ set autocommit=1; alter table t1 engine=myisam; select * from t1 order by a; drop table t1; + +# -- bug #7340 -- +create table t1 ( + id int(11) unsigned primary key NOT NULL auto_increment, + msg text NOT NULL +) engine=ndbcluster default charset=utf8; +insert into t1 (msg) values( +'Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length).'); +select * from t1; +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index d0202bff48d..bedeecd5d12 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -894,7 +894,7 @@ drop table t1; # # IN optimisation test results # -create table t1 (s1 char(5), index s1(s1)); +create table t1 (s1 char(5) not null, index s1(s1)); create table t2 (s1 char(5), index s1(s1)); insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); @@ -1391,3 +1391,29 @@ INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','M /*!40000 ALTER TABLE t1 ENABLE KEYS */; SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); drop table t1; + +# +# Test cases for bug #7351: +# quantified predicate with subquery returning empty result set +# + +CREATE TABLE t1 ( f1 BIGINT ); +INSERT INTO t1 SET f1= NULL; +INSERT INTO t1 SET f1= 1; +CREATE TABLE t2 ( f1 BIGINT ); + +SELECT f1 FROM t1 + WHERE f1 <> ALL ( SELECT f1 FROM t2 ); + +INSERT INTO t2 VALUES (1), (2); + +SELECT f1 FROM t1 + WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 ); + +SELECT f1 FROM t1 + WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 + UNION + SELECT f1 FROM t2 WHERE f1 > 3); + +SELECT f1 FROM t1 + WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 97c59224c63..6c1ae733647 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -89,7 +89,7 @@ set global timed_mutexes=0; show variables like 'timed_mutexes'; -set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="INNODB"; +set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE"; show local variables like 'storage_engine'; show global variables like 'storage_engine'; set GLOBAL query_cache_size=100000; @@ -146,7 +146,7 @@ set max_join_size="hello"; --error 1286 set storage_engine=UNKNOWN_TABLE_TYPE; --error 1231 -set storage_engine=INNODB, big_tables=2; +set storage_engine=MERGE, big_tables=2; show local variables like 'storage_engine'; --error 1229 set SESSION query_cache_size=10000; |