diff options
author | unknown <monty@hundin.mysql.fi> | 2002-01-16 00:42:52 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-01-16 00:42:52 +0200 |
commit | f015cbdc7e3427cf0f77012c4ce89f3cf8d5dd5f (patch) | |
tree | 890cb295feeab3ebd6413663178be56ec5ed21a2 /mysql-test/r | |
parent | 71a5af5b52642cbe64960275f1994f5a57832ff3 (diff) | |
download | mariadb-git-f015cbdc7e3427cf0f77012c4ce89f3cf8d5dd5f.tar.gz |
Add support for NULL=NULL in keys (Used in GROUP BY optimization)
Add ISAM to Windows version
Fix of test results
Fixes for NULL keys in HEAP tables.
Docs/manual.texi:
Changelog
heap/hp_open.c:
Add support for NULL=NULL in keys (for GROUP BY)
heap/hp_rkey.c:
Cleanup
heap/hp_write.c:
Cleanup
include/config-win.h:
Add ISAM to Windows version
include/my_base.h:
Add support for NULL=NULL in keys (for GROUP BY)
libmysqld/Makefile.am:
Rename of innobase to innodb
myisam/mi_write.c:
Add support for NULL=NULL in keys (for GROUP BY)
BitKeeper/etc/ignore:
Added libmysqld/ha_innodb.cc to the ignore list
mysql-test/r/group_by.result:
Test of NULL keys in HEAP tables
mysql-test/r/heap.result:
Test of NULL keys in HEAP tables
mysql-test/r/null.result:
Cleanup
mysql-test/r/order_by.result:
Fix for result of new ORDER BY optimization
mysql-test/t/group_by.test:
Test of NULL keys in HEAP tables
mysql-test/t/heap.test:
Test of NULL keys in HEAP tables
mysql-test/t/null.test:
Cleanup
sql/ha_heap.cc:
Add support of NULL keys
sql/item_strfunc.h:
Fix for BINARY and CAST functions
sql/item_timefunc.h:
Fix for BINARY and CAST functions
sql/sql_parse.cc:
Cleanup
sql/sql_select.cc:
Add support for NULL=NULL in keys (for GROUP BY)
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/group_by.result | 81 | ||||
-rw-r--r-- | mysql-test/r/heap.result | 26 | ||||
-rw-r--r-- | mysql-test/r/null.result | 1 | ||||
-rw-r--r-- | mysql-test/r/order_by.result | 6 |
4 files changed, 110 insertions, 4 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index a0e234aa69c..a67298c73c0 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -263,3 +263,84 @@ score count(*) 2 1 1 2 drop table t1; +CREATE TABLE t1 (a char(1)); +INSERT INTO t1 VALUES ('A'),('B'),('A'),('B'),('A'),('B'),(NULL),('a'),('b'),(NULL),('A'),('B'),(NULL); +SELECT a FROM t1 GROUP BY a; +a +NULL +A +B +SELECT a,count(*) FROM t1 GROUP BY a; +a count(*) +NULL 3 +A 5 +B 5 +SELECT a FROM t1 GROUP BY binary a; +a +NULL +A +B +a +b +SELECT a,count(*) FROM t1 GROUP BY binary a; +a count(*) +NULL 3 +A 4 +B 4 +a 1 +b 1 +SELECT binary a FROM t1 GROUP BY 1; +binary a +NULL +A +B +a +b +SELECT binary a,count(*) FROM t1 GROUP BY 1; +binary a count(*) +NULL 3 +A 4 +B 4 +a 1 +b 1 +SET SQL_BIG_TABLES=1; +SELECT a FROM t1 GROUP BY a; +a +NULL +A +B +SELECT a,count(*) FROM t1 GROUP BY a; +a count(*) +NULL 3 +A 5 +B 5 +SELECT a FROM t1 GROUP BY binary a; +a +NULL +A +B +a +b +SELECT a,count(*) FROM t1 GROUP BY binary a; +a count(*) +NULL 3 +A 4 +B 4 +a 1 +b 1 +SELECT binary a FROM t1 GROUP BY 1; +binary a +NULL +A +B +a +b +SELECT binary a,count(*) FROM t1 GROUP BY 1; +binary a count(*) +NULL 3 +A 4 +B 4 +a 1 +b 1 +SET SQL_BIG_TABLES=0; +drop table t1; diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 5495997324a..fc4a116307e 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -165,3 +165,29 @@ explain select * from t1 where btn="a" and new_col="a"; table type possible_keys key key_len ref rows Extra t1 ref btn btn 11 const,const 10 where used drop table t1; +CREATE TABLE t1 ( +a int default NULL, +b int default NULL, +KEY a (a), +UNIQUE b (b) +) type=heap; +INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3); +SELECT * FROM t1 WHERE a=NULL; +a b +explain SELECT * FROM t1 WHERE a IS NULL; +table type possible_keys key key_len ref rows Extra +t1 ref a a 5 const 10 where used +SELECT * FROM t1 WHERE a<=>NULL; +a b +NULL 99 +SELECT * FROM t1 WHERE b=NULL; +a b +explain SELECT * FROM t1 WHERE b IS NULL; +table type possible_keys key key_len ref rows Extra +t1 ref b b 5 const 1 where used +SELECT * FROM t1 WHERE b<=>NULL; +a b +99 NULL +INSERT INTO t1 VALUES (1,3); +Duplicate entry '3' for key 1 +DROP TABLE t1; diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 77f2c67bf05..e6e3b7155a3 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -40,7 +40,6 @@ insert into t1 values (null); select * from t1 where x != 0; x drop table t1; -DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( indexed_field int default NULL, KEY indexed_field (indexed_field) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index a9d18e838cb..9bc716ee8b9 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -286,15 +286,15 @@ a b c 1 NULL NULL explain select * from t1 where a = 1 order by a desc, b desc; table type possible_keys key key_len ref rows Extra -t1 ref a a 4 const 5 where used; Using index; Using filesort +t1 ref a a 4 const 5 where used; Using index select * from t1 where a = 1 order by a desc, b desc; a b c 1 3 b -1 1 NULL 1 1 b 1 1 b -1 NULL NULL +1 1 NULL 1 NULL b +1 NULL NULL explain select * from t1 where a = 1 and b is null order by a desc, b desc; table type possible_keys key key_len ref rows Extra t1 ref a a 9 const,const 2 where used; Using index; Using filesort |