summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2004-12-31 15:26:24 +0100
committerunknown <serg@sergbook.mysql.com>2004-12-31 15:26:24 +0100
commitb99bea6704299399c84bd8374ef7f248ff9570c5 (patch)
tree928b06c231edee4cb95ace87ed30e879e3dcb0fb /mysql-test/t
parentbd23099be0b22845e8c97e2fb36ee3c6eb0e2491 (diff)
parent5eaf65ab4be77911eb03cceefac9ecea48c25f71 (diff)
downloadmariadb-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/t')
-rw-r--r--mysql-test/t/ctype_ucs.test10
-rw-r--r--mysql-test/t/date_formats.test2
-rw-r--r--mysql-test/t/func_math.test7
-rw-r--r--mysql-test/t/func_str.test14
-rw-r--r--mysql-test/t/grant.test17
-rw-r--r--mysql-test/t/grant2.test28
-rw-r--r--mysql-test/t/merge.test3
-rw-r--r--mysql-test/t/multi_update.test2
-rw-r--r--mysql-test/t/mysqldump.test28
-rw-r--r--mysql-test/t/ndb_blob.test14
-rw-r--r--mysql-test/t/subselect.test28
-rw-r--r--mysql-test/t/variables.test4
12 files changed, 150 insertions, 7 deletions
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;