From 6b386c08a5c2c7dc3e379b1160d82da6f1688d05 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Sat, 11 Jan 2003 18:02:10 +0200 Subject: Fix for a bug in SHOW GRANTS when : grant on database.* to xx@yy with grant option; is done. --- mysql-test/t/grant.test | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 7ee3b08cc3b..bd04b2e4c41 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -39,3 +39,6 @@ show grants for mysqltest_1@localhost; revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; flush privileges; +grant usage on test.* to user@localhost with grant option; +show grants for user@localhost; + -- cgit v1.2.1 From 9ec97f2c08fbc022d597e30e249ae403b467dc6b Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Fri, 24 Jan 2003 01:54:39 +0200 Subject: fixed table invalidation in simple renaming --- mysql-test/t/query_cache.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 6c3f3d6ac52..f77ea3c3b2a 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -383,3 +383,17 @@ disable_result_log; select * from mysql.db; enable_result_log; show status like "Qcache_queries_in_cache"; + + +# +# simple rename test +# +create table t1(id int auto_increment primary key); +insert into t1 values (NULL), (NULL), (NULL); +select * from t1 where id=2; +alter table t1 rename to t2; +-- error 1146 +select * from t1 where id=2; +drop table t2; +-- error 1146 +select * from t1 where id=2; -- cgit v1.2.1 From fa7a94ed14f0bdd39b99abfca872444fdb5fff11 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Sat, 25 Jan 2003 15:07:51 +0200 Subject: Added timeout for wait_for_master_pos Fixed comparision of log-binary name to handle comparison when file name extension wraps from .999 to .1000 Don't replicate CREATE/DROP DATABASE if wild_xxx_table=database.% is used. --- mysql-test/t/rpl000009.test | 8 +++++--- mysql-test/t/rpl_master_pos_wait.test | 9 +++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 mysql-test/t/rpl_master_pos_wait.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test index 3d0827718ec..5f55355271a 100644 --- a/mysql-test/t/rpl000009.test +++ b/mysql-test/t/rpl000009.test @@ -9,6 +9,7 @@ create database bar; save_master_pos; connection slave; sync_with_master; +create database foo; drop table if exists foo.foo; create table foo.foo (n int); insert into foo.foo values(4); @@ -24,13 +25,14 @@ connection slave; sync_with_master; select foo.foo.n,bar.bar.m from foo.foo,bar.bar; connection master; -drop database if exists bar; +drop database bar; drop database if exists foo; save_master_pos; connection slave; sync_with_master; -drop database if exists bar; -drop database if exists foo; +--error 1008 +drop database bar; +drop database foo; # Now let's test load data from master diff --git a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/t/rpl_master_pos_wait.test new file mode 100644 index 00000000000..a6aae222a89 --- /dev/null +++ b/mysql-test/t/rpl_master_pos_wait.test @@ -0,0 +1,9 @@ +# See if master_pos_wait(,,timeout) +# Terminates with "timeout expired" (-1) +source include/master-slave.inc; +save_master_pos; +connection slave; +sync_with_master; +# Ask for a master log that has certainly not been reached yet +# timeout= 10 seconds +select master_pos_wait('master-bin.999999',0,10); -- cgit v1.2.1 From 710ffb2d89a05ae723de98170b66a80f2f79beef Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 28 Jan 2003 06:48:26 +0200 Subject: Fix when using auto_increment and last_insert_id() in the same insert statement. --- mysql-test/t/rpl_insert_id.test | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 mysql-test/t/rpl_insert_id.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test new file mode 100644 index 00000000000..3f3636d3082 --- /dev/null +++ b/mysql-test/t/rpl_insert_id.test @@ -0,0 +1,39 @@ +#see if queries that use both +#auto_increment and LAST_INSERT_ID() +#are replicated well +source include/master-slave.inc; +connection master; +drop table if exists t1; +create table t1(a int auto_increment, key(a)); +create table t2(b int auto_increment, c int, key(b)); +insert into t1 values (1),(2),(3); +insert into t1 values (null); +insert into t2 values (null,last_insert_id()); +save_master_pos; +connection slave; +sync_with_master; +select * from t1; +select * from t2; +connection master; +#check if multi-line inserts, +#which set last_insert_id to the first id inserted, +#are replicated the same way +drop table t1; +drop table t2; +create table t1(a int auto_increment, key(a)); +create table t2(b int auto_increment, c int, key(b)); +insert into t1 values (10); +insert into t1 values (null),(null),(null); +insert into t2 values (5,0); +insert into t2 values (null,last_insert_id()); +save_master_pos; +connection slave; +sync_with_master; +select * from t1; +select * from t2; +connection master; +drop table t1; +drop table t2; +save_master_pos; +connection slave; +sync_with_master; -- cgit v1.2.1 From 689578a0997f54c590bcf4791e30710602851bc4 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 28 Jan 2003 08:38:28 +0200 Subject: Fixes for Netware Call pthread_mutex_destroy() on not used mutex. Changed comments in .h and .c files from // -> /* */ Added detection of mutex on which one didn't call pthread_mutex_destroy() Fixed bug in create_tmp_field() which causes a memory overrun in queries that uses "ORDER BY constant_expression" Added optimisation for ORDER BY NULL --- mysql-test/t/backup.test | 2 +- mysql-test/t/count_distinct.test | 1 + mysql-test/t/func_crypt.test | 2 ++ mysql-test/t/grant_cache.test | 17 +++++++++++------ mysql-test/t/group_by.test | 21 +++++++++++++++++++++ mysql-test/t/rpl000015.test | 4 ++-- mysql-test/t/rpl000017.test | 4 ++-- mysql-test/t/rpl_rotate_logs.test | 4 ++-- 8 files changed, 42 insertions(+), 13 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index ad332cde646..55fe140850d 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -4,7 +4,7 @@ connection con1; set SQL_LOG_BIN=0; drop table if exists t1; create table t1(n int); ---replace_result "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X" +--replace_result "errno = 1" "errno = X" "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X" backup table t1 to '../bogus'; backup table t1 to '../tmp'; drop table t1; diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test index 3d795d44821..f3584686f69 100644 --- a/mysql-test/t/count_distinct.test +++ b/mysql-test/t/count_distinct.test @@ -31,6 +31,7 @@ insert into t1 values ('Berkeley Public2','Berkeley'); insert into t1 values ('NYC Lib','New York'); select t2.isbn,city,t1.libname,count(t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city,t1.libname; select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct t1.libname) > 1; +select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct concat(t1.libname,'a')) > 1; drop table t1, t2, t3; # diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test index f01504d3691..55c0d6d3b9d 100644 --- a/mysql-test/t/func_crypt.test +++ b/mysql-test/t/func_crypt.test @@ -1,3 +1,5 @@ +-- source include/have_crypt.inc + select length(encrypt('foo', 'ff')) <> 0; --replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l. select password('test'),length(encrypt('test')),encrypt('test','aa'); diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test index 09ce1021fbf..7dfbb3b8d83 100644 --- a/mysql-test/t/grant_cache.test +++ b/mysql-test/t/grant_cache.test @@ -6,7 +6,7 @@ drop table if exists test.t1,mysqltest.t1,mysqltest.t2; reset query cache; flush status; -connect (root,localhost,root,,test,0,master.sock); +connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); connection root; create database if not exists mysqltest; @@ -17,7 +17,7 @@ insert into mysqltest.t2 values (3,3,3); create table test.t1 (a char (10)); insert into test.t1 values ("test.t1"); select * from t1; -connect (root2,localhost,root,,mysqltest,0,master.sock); +connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,master.sock); connection root2; # put queries in cache select * from t1; @@ -35,7 +35,7 @@ grant SELECT on test.t1 to mysqltest_2@localhost; grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost; # The following queries should be fetched from cache -connect (user1,localhost,mysqltest_1,,mysqltest,0,master.sock); +connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock); connection user1; select "user1"; select * from t1; @@ -47,13 +47,14 @@ show status like "Qcache_hits"; show status like "Qcache_not_cached"; # The following queries should be fetched from cache -connect (user2,localhost,mysqltest_2,,mysqltest,0,master.sock); +connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,master.sock); connection user2; select "user2"; select * from t1; select a from t1; select c from t1; select * from mysqltest.t1,test.t1; +--replace_result 127.0.0.1 localhost --error 1142 select * from t2; show status like "Qcache_queries_in_cache"; @@ -61,16 +62,20 @@ show status like "Qcache_hits"; show status like "Qcache_not_cached"; # The following queries should not be fetched from cache -connect (user3,localhost,mysqltest_3,,mysqltest,0,master.sock); +connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,master.sock); connection user3; select "user3"; +--replace_result 127.0.0.1 localhost --error 1143 select * from t1; select a from t1; +--replace_result 127.0.0.1 localhost --error 1143 select c from t1; +--replace_result 127.0.0.1 localhost --error 1142 select * from t2; +--replace_result 127.0.0.1 localhost --error 1143 select mysqltest.t1.c from test.t1,mysqltest.t1; show status like "Qcache_queries_in_cache"; @@ -78,7 +83,7 @@ show status like "Qcache_hits"; show status like "Qcache_not_cached"; # Connect without a database -connect (user4,localhost,mysqltest_1,,*NO-ONE*,0,master.sock); +connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock); connection user4; select "user4"; --error 1046 diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index bc01577c249..98b1ee238b1 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -36,8 +36,10 @@ INSERT INTO t2 VALUES (2,'name','pass','mail','Y','v','n','adr','1','1','1'); INSERT INTO t2 VALUES (3,'name','pass','mail','Y','v','n','adr','1','1','1'); SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid; +SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid ORDER BY NULL; SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid; SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid; +SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL; drop table test.t1,test.t2; # @@ -100,6 +102,7 @@ INSERT INTO t2 VALUES (91,2); INSERT INTO t2 VALUES (92,2); SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid; +SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY NULL; SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname; drop table t1,t2; @@ -234,16 +237,20 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3); explain select userid,count(*) from t1 group by userid desc; +explain select userid,count(*) from t1 group by userid desc order by null; select userid,count(*) from t1 group by userid desc; select userid,count(*) from t1 group by userid desc having (count(*)+1) IN (4,3); select userid,count(*) from t1 group by userid desc having 3 IN (1,COUNT(*)); explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; explain select spid,count(*) from t1 where spid between 1 and 2 group by spid; +explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null; select spid,count(*) from t1 where spid between 1 and 2 group by spid; select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; explain select sql_big_result spid,sum(userid) from t1 group by spid desc; +explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null; select sql_big_result spid,sum(userid) from t1 group by spid desc; explain select sql_big_result score,count(*) from t1 group by score desc; +explain select sql_big_result score,count(*) from t1 group by score desc order by null; select sql_big_result score,count(*) from t1 group by score desc; drop table t1; @@ -365,3 +372,17 @@ select a,count(*) from t1 group by a; set option sql_big_tables=1; select a,count(*) from t1 group by a; drop table t1; + +# +# Test of GROUP BY ... ORDER BY NULL optimization +# + +create table t1 (a int not null, b int not null); +insert into t1 values (1,1),(1,2),(3,1),(3,2),(2,2),(2,1); +create table t2 (a int not null, b int not null, key(a)); +insert into t2 values (1,3),(3,1),(2,2),(1,1); +select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b; +select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL; +explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b; +explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL; +drop table t1,t2; diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index c42e14699c5..26d32ea3e11 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -1,5 +1,5 @@ -connect (master,localhost,root,,test,0,master.sock); -connect (slave,localhost,root,,test,0, slave.sock); +connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); connection master; reset master; show master status; diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test index f346ca39ca0..d4f41f1e374 100644 --- a/mysql-test/t/rpl000017.test +++ b/mysql-test/t/rpl000017.test @@ -1,5 +1,5 @@ -connect (master,localhost,root,,test,0,master.sock); -connect (slave,localhost,root,,test,0,slave.sock); +connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); connection master; reset master; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index a9bb98932ed..6edbf363b1a 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -9,9 +9,9 @@ # changes # - Test creating a duplicate key error and recover from it # -connect (master,localhost,root,,test,0,master.sock); +connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); drop table if exists t1, t2, t3, t4; -connect (slave,localhost,root,,test,0,slave.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); system cat /dev/null > var/slave-data/master.info; system chmod 000 var/slave-data/master.info; connection slave; -- cgit v1.2.1 From 4fb3244014418bd76e8cf755275798a166d980d7 Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Tue, 28 Jan 2003 14:36:22 +0100 Subject: fixed "DROP table_open_in_handler" hang --- mysql-test/t/handler.test | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test index 4f1b11c80ff..f5bab7cf337 100644 --- a/mysql-test/t/handler.test +++ b/mysql-test/t/handler.test @@ -28,13 +28,15 @@ handler t2 read a next; handler t2 read a=(15); handler t2 read a=(16); -!$1070 handler t2 read a=(19,"fff"); +--error 1070 +handler t2 read a=(19,"fff"); handler t2 read b=(19,"fff"); handler t2 read b=(19,"yyy"); handler t2 read b=(19); -!$1109 handler t1 read a last; +--error 1109 +handler t1 read a last; handler t2 read a=(11); handler t2 read a>=(11); @@ -60,8 +62,19 @@ handler t2 read first; handler t2 read next; alter table t1 type=MyISAM; handler t2 read next; -!$1064 handler t2 read last; +--error 1064 +handler t2 read last; handler t2 close; -drop table if exists t1; + +# +# DROP TABLE +# +handler t1 open as t2; +drop table t1; +create table t1 (a int); +insert into t1 values (17); +--error 1109 +handler t2 read first; +drop table t1; -- cgit v1.2.1 From c6beb583f6f251ccd86651f7063aaee431463755 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Wed, 29 Jan 2003 10:38:56 +0200 Subject: fixed functions to be able work with group function as argument made bisone 1.75 compatible code --- mysql-test/t/group_by.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index b21ae88007b..6e256d7896f 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -323,3 +323,26 @@ select a,count(*) from t1 group by a; set option sql_big_tables=1; select a,count(*) from t1 group by a; drop table t1; + + +# +# group function arguments in some functions +# + +create table t1 (a int, b int); +insert into t1 values (1, 4); +insert into t1 values (10, 40); +insert into t1 values (1, 4); +insert into t1 values (10, 43); +insert into t1 values (1, 4); +insert into t1 values (10, 41); +insert into t1 values (1, 4); +insert into t1 values (10, 43); +insert into t1 values (1, 4); +select a, MAX(b), INTERVAL (MAX(b), 1,3,10,30,39,40,50,60,100,1000) from t1 group by a; +select a, MAX(b), CASE MAX(b) when 4 then 4 when 43 then 43 else 0 end from t1 group by a; +select a, MAX(b), FIELD(MAX(b), '43', '4', '5') from t1 group by a; +select a, MAX(b), CONCAT_WS(MAX(b), '43', '4', '5') from t1 group by a; +select a, MAX(b), ELT(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f') from t1 group by a; +select a, MAX(b), MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') from t1 group by a; +drop table t1; -- cgit v1.2.1 From f47e5501e7f065875b89444fa86807be25983553 Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Mon, 3 Feb 2003 09:17:47 +0100 Subject: bug tests added --- mysql-test/t/binary.test | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test index fc2d91e20fe..95815cda60f 100644 --- a/mysql-test/t/binary.test +++ b/mysql-test/t/binary.test @@ -26,11 +26,18 @@ drop table t1,t2; # Test of binary and normal strings # -create table t1 (a char(10) not null, b char(10) binary not null,index (a)); +create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b)); insert into t1 values ("hello ","hello "),("hello2 ","hello2 "); +select * from t1 where a="hello"; select * from t1 where a="hello "; -select * from t1 where b="hello "; +select * from t1 ignore index (a) where a="hello "; select * from t1 where b="hello"; +select * from t1 where b="hello "; +select * from t1 ignore index (b) where b="hello "; +# blob test +alter table t1 modify b tinytext not null, drop key b, add key (b(100)); +select * from t1 where b="hello "; +select * from t1 ignore index (b) where b="hello "; drop table t1; # -- cgit v1.2.1 From e3cd63521cd68743393b35c0056faf3e9388ca1c Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Mon, 3 Feb 2003 20:20:32 +0200 Subject: Fix for MIN/MAX with empty tables MIN(key_column) could in some cases return NULL on a column with NULL and other values. MIN(key_column) and MAX(key_column) could in some cases return wrong values when used in OUTER JOIN. --- mysql-test/t/func_group.test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 57e9ae24e08..04a2ff68a92 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -99,3 +99,30 @@ insert into t1 values (5.2,'nem'),(8.64,'monty'),(11.12,'sinisa'); select sum(num) from t1; select sum(num) from t1 group by user; drop table t1; + +# +# Test problem with MIN() optimization in case of null values +# + +create table t1 (a1 int, a2 char(3), key k1(a1), key k2(a2)); +insert into t1 values(10,'aaa'), (10,null), (10,'bbb'), (20,'zzz'); +create table t2(a1 char(3), a2 int, a3 real, key k1(a1), key k2(a2, a1)); +select * from t1; +# The following returned NULL in 4.0.10 +select min(a2) from t1; +select max(t1.a1), max(t2.a2) from t1, t2; +select max(t1.a1) from t1, t2; +select max(t2.a2), max(t1.a1) from t1, t2; + +explain select min(a2) from t1; +explain select max(t1.a1), max(t2.a2) from t1, t2; + +insert into t2 values('AAA', 10, 0.5); +select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9; +select max(t2.a1), max(t1.a1) from t1, t2 where t2.a2=9; +select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left outer join t2 on t1.a1=10; +select max(t1.a2) from t1 left outer join t2 on t1.a1=10; +select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=20; +select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=10; +select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1='AAA'; +drop table t1,t2; -- cgit v1.2.1 From 59400e211f2e23a9d19948585da00007248862df Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 4 Feb 2003 01:05:39 +0200 Subject: Fixed bug in ulonglong parsing for constructs that only takes unsigned longlong as parameter. --- mysql-test/t/bigint.test | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index 15c61c2c0dc..023e50b7677 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -4,7 +4,7 @@ select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296; select 9223372036854775807,-009223372036854775808; select +9999999999999999999,-9999999999999999999; - +select 9223372036854775808+1; # # In 3.23 we have to disable the test of column to bigint as # this fails on AIX powerpc (the resolution for double is not good enough) @@ -35,3 +35,13 @@ alter table t1 modify big bigint not null; select min(big),max(big),max(big)-1 from t1; select min(big),max(big),max(big)-1 from t1 group by a; drop table t1; + +# +# Test problem with big values fir auto_increment +# + +create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999; +insert into t1 values (null,1); +select * from t1; +select * from t1 limit 9999999999; +drop table t1; -- cgit v1.2.1