diff options
author | unknown <monty@mashka.mysql.fi> | 2003-11-18 13:47:27 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-11-18 13:47:27 +0200 |
commit | e72124c4ccad5b390b84562389175dcd7355769c (patch) | |
tree | 0a23d90c946c5f05a8c160fc7c6ef3f05505fc79 /mysql-test | |
parent | 61e682b8adafdfae736327fee4ea0263e1a0bd37 (diff) | |
download | mariadb-git-e72124c4ccad5b390b84562389175dcd7355769c.tar.gz |
CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS
New multi-key-cache handling. This was needed becasue the old one didn't work reliable with MERGE tables.
ALTER TABLE table_name ... CHARACTER SET ... now changes all char/varchar/text columns to the given character set
(One must use ALTER TABLE ... DEFAULT CHARACTER SET ... to change the default character set)
Fixed that have_compress is detected properly (fixes problems with func_compress.test on platforms without zlib)
New syntax for CACHE INDEX ('keys' is optional if no index name is given and one mentions the key cache name only ones)
Removed compiler warnings
Added mysql_set_server_option() to allow clients like PHP to easaily set/reset the multi-statement flag.
BUILD/compile-pentium-valgrind-max:
Add test of isam
client/mysql.cc:
CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS
include/my_base.h:
Remove HA_EXTRA_SET_KEY_CACHE
include/my_no_pthread.h:
Add defines to ignore rw-locks when running without threads
include/my_sys.h:
Added function for multi-key-caches
include/myisam.h:
Added function to handle multi-key-caches
include/mysql.h:
Added mysql_set_server_option
include/mysql_com.h:
CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS
Added enum_mysql_set_option
include/mysqld_error.h:
Added error message for unknown key cache
innobase/srv/srv0start.c:
Removed warning that is confused for MySQL users
libmysql/libmysql.c:
Added mysql_set_server_option()
libmysql/libmysql.def:
Added mysql_set_server_option()
myisam/ft_nlq_search.c:
Removed compiler warning
myisam/ft_static.c:
Removed compiler warning and fixed wrong return value
myisam/mi_check.c:
Clean up multi-key-cache usage
myisam/mi_checksum.c:
Removed not used variable
myisam/mi_close.c:
keycache -> key_cache
myisam/mi_delete_all.c:
keycache -> key_cache
myisam/mi_extra.c:
keycache -> key_cache
Removed HA_EXTRA_SET_KEY_CACHE
myisam/mi_keycache.c:
Changed logic so that it's MyISAM that is responsible for assign tables to different key caches instead of the upper level
myisam/mi_locking.c:
Don't change key cache on unlock (must be done before)
myisam/mi_open.c:
Fetch key cache to use from multi_key_cache_search()
myisam/mi_page.c:
keycache -> key_cache
myisam/mi_panic.c:
keycache -> key_cache
myisam/mi_preload.c:
keycache -> key_cache
myisam/mi_test1.c:
Use KEY_CACHE_BLOCK_SIZE
myisam/mi_test2.c:
Always test resize_key_cache()
myisam/mi_test3.c:
Use KEY_CACHE_BLOCK_SIZE instead of 512
myisam/myisamchk.c:
update for multiple key caches
myisam/myisamdef.h:
Remove reg_keycache
Add unique_name_length for storing length of unique_file_name
myisam/myisamlog.c:
Change how end_key_cache() is called
mysql-test/mysql-test-run.sh:
Fixed web link
Added name of failed test to abort row.
mysql-test/r/alter_table.result:
Testing of ALTER TABLE ... [DEFAULT] CHARACTER SET
mysql-test/r/case.result:
Update result for DEFAULT CHARSET...
mysql-test/r/cast.result:
Update result for DEFAULT CHARSET...
mysql-test/r/create.result:
Update result for DEFAULT CHARSET...
mysql-test/r/ctype_collate.result:
Update result for DEFAULT CHARSET...
mysql-test/r/ctype_latin1_de.result:
Update result for DEFAULT CHARSET...
mysql-test/r/ctype_many.result:
Update result for DEFAULT CHARSET...
mysql-test/r/ctype_mb.result:
Update result for DEFAULT CHARSET...
mysql-test/r/ctype_recoding.result:
Update result for DEFAULT CHARSET...
mysql-test/r/ctype_ucs.result:
Update result for DEFAULT CHARSET...
mysql-test/r/derived.result:
Use STRAIGHT_JOIN to make join order predictable
mysql-test/r/fulltext.result:
Update result for DEFAULT CHARSET...
mysql-test/r/func_str.result:
Update result for DEFAULT CHARSET...
mysql-test/r/func_system.result:
Update result for DEFAULT CHARSET...
mysql-test/r/gis-rtree.result:
Update result for DEFAULT CHARSET...
mysql-test/r/innodb.result:
Update result for DEFAULT CHARSET...
mysql-test/r/key_cache.result:
Update test for new key cache syntax.
Added more tests
mysql-test/r/merge.result:
Update result for DEFAULT CHARSET...
mysql-test/r/preload.result:
New syntax
mysql-test/r/show_check.result:
Update result for DEFAULT CHARSET...
mysql-test/r/sql_mode.result:
Update result for DEFAULT CHARSET...
mysql-test/r/subselect.result:
Update result for DEFAULT CHARSET...
mysql-test/r/type_blob.result:
Update result for DEFAULT CHARSET...
mysql-test/r/type_enum.result:
Update result for DEFAULT CHARSET...
mysql-test/r/type_nchar.result:
Update result for DEFAULT CHARSET...
mysql-test/r/type_set.result:
Update result for DEFAULT CHARSET...
mysql-test/r/union.result:
Use STRAIGHT_JOIN to make join order predictable
mysql-test/t/alter_table.test:
Testing of ALTER TABLE ... [DEFAULT] CHARACTER SET
mysql-test/t/ctype_many.test:
Update result for DEFAULT CHARSET...
mysql-test/t/derived.test:
Use STRAIGHT_JOIN to make join order predictable
mysql-test/t/isam.test:
Use disable warnings for test loop
mysql-test/t/join.test:
Update test now when we only support 61 tables in join
mysql-test/t/key_cache.test:
Update test for new key cache syntax.
Added more tests
mysql-test/t/preload.test:
Update for new syntax
mysql-test/t/union.test:
Use STRAIGHT_JOIN to make join order predictable
mysys/Makefile.am:
Added mf_keycaches.c
mysys/hash.c:
TRUE -> 1
mysys/mf_keycache.c:
Removed compiler warnings
Striped end space
Fixed indentation and improved function comments
TRUE -> 1
Changed parameters to end_key_cache() to make it easer to use
Fixed bug when using key blocks size > 1024 bytes (First part of index file could be overwritten with wrong data)
Split function flush_key_blocks into two functions to not get mutex used twice when called from flush_all_key_blocks()
mysys/my_bitmap.c:
More debugging
Safe bitmap_free()
Fixed indentation
mysys/my_getopt.c:
Ensure that we initialize option->value, option->max_value and value from GET_ASK_ADDR
mysys/my_thr_init.c:
Remove not used mutex THR_LOCK_keycache
mysys/typelib.c:
Fixed function comments
sql-common/client.c:
CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS
Fixed the multi_result flag is set also on SELECT;s
sql/ha_myisam.cc:
Fixed multiple key_cache handling
(Now done on MyISAM level)
sql/ha_myisammrg.cc:
Fixed multiple key_cache handling
(Now done on MyISAM level)
sql/handler.cc:
New multi key cache handling
sql/handler.h:
New multi key cache handling
Added support for default character set
sql/item.h:
Added function cleanup() (Needed for prepared statements / cursors)
sql/item_cmpfunc.h:
Added cleanup function
sql/item_func.cc:
Indentation cleanup
sql/mysql_priv.h:
New multi-key-cache functions
Removed LOCK_assign
sql/mysqld.cc:
New multi-key-cache handling
Fixed that variable have_compress is set correctly
sql/protocol.cc:
SELECT didn't work reliable in multi-statements
sql/set_var.cc:
Support for new key cache variables
sql/set_var.h:
Support for new key cache variables
sql/share/czech/errmsg.txt:
New error messages
sql/share/danish/errmsg.txt:
New error messages
sql/share/dutch/errmsg.txt:
New error messages
sql/share/english/errmsg.txt:
New error messages
sql/share/estonian/errmsg.txt:
New error messages
sql/share/french/errmsg.txt:
New error messages
sql/share/german/errmsg.txt:
New error messages
sql/share/greek/errmsg.txt:
New error messages
sql/share/hungarian/errmsg.txt:
New error messages
sql/share/italian/errmsg.txt:
New error messages
sql/share/japanese/errmsg.txt:
New error messages
sql/share/korean/errmsg.txt:
New error messages
sql/share/norwegian-ny/errmsg.txt:
New error messages
sql/share/norwegian/errmsg.txt:
New error messages
sql/share/polish/errmsg.txt:
New error messages
sql/share/portuguese/errmsg.txt:
New error messages
sql/share/romanian/errmsg.txt:
New error messages
sql/share/russian/errmsg.txt:
New error messages
sql/share/serbian/errmsg.txt:
New error messages
sql/share/slovak/errmsg.txt:
New error messages
sql/share/spanish/errmsg.txt:
New error messages
sql/share/swedish/errmsg.txt:
New error messages
sql/share/ukrainian/errmsg.txt:
New error messages
sql/sql_base.cc:
Removed all key_cache handling (this is now done on MyISAM level)
Change table_charset -> default_table_charset
sql/sql_db.cc:
table_charset -> default_table_charset
sql/sql_delete.cc:
table_charset -> default_table_charset
sql/sql_lex.cc:
CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS
sql/sql_lex.h:
New option to store a name and length
sql/sql_parse.cc:
Support for mysql_set_server_option()
Reset "default" keycache status variables in 'FLUSH STATUS' (Need to be improved later)
sql/sql_show.cc:
Add DEFAULT before CHARSET (for table character sets)
Fetch key cache variables from 'sql_key_cache'
sql/sql_table.cc:
table_charset -> default_table_charset
New multi-key-cache handling
sql/sql_test.cc:
Write information from all key caches
sql/sql_yacc.yy:
Changed syntax for CACHE INDEX ...
Force user to use DEFAULT before database/table level character sets
sql/structs.h:
Added SHOW_KEY_CACHE_LONG (to get values from sql_key_cache)
sql/table.cc:
table_charset -> default_table_charset
sql/table.h:
New key cache handling (this is now done in mysys/mf_keycaches.c)
sql/unireg.h:
A
Diffstat (limited to 'mysql-test')
36 files changed, 198 insertions, 121 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 46d6819b819..f908ffeb2a6 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -575,7 +575,7 @@ show_failed_diff () $DIFF -c $result_file $reject_file echo "-------------------------------------------------------" echo "Please follow the instructions outlined at" - echo "http://www.mysql.com/doc/R/e/Reporting_mysqltest_bugs.html" + echo "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html" echo "to find the reason to this problem and how to report this." fi } @@ -1311,7 +1311,7 @@ run_testcase () show_failed_diff $tname $ECHO if [ x$FORCE != x1 ] ; then - $ECHO "Aborting. To continue, re-run with '--force'." + $ECHO "Aborting becasue $tname failed. To continue, re-run with '--force'." $ECHO if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] then diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 9d3a0461f9f..b82255bf652 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -319,6 +319,29 @@ alter table t1 change a a char(10) character set koi8r; select a,hex(a) from t1; a hex(a) D4C5D3D4 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set koi8r default NULL +) TYPE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 DEFAULT CHARACTER SET latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set koi8r default NULL +) TYPE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 CHARACTER SET latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 DEFAULT CHARACTER SET cp1251; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set latin1 default NULL +) TYPE=MyISAM DEFAULT CHARSET=cp1251 drop table t1; CREATE TABLE t1 ( Host varchar(16) binary NOT NULL default '', diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 4aab3defa2b..9b03422f54c 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -103,7 +103,7 @@ t1 CREATE TABLE `t1` ( `c6` char(3) default NULL, `c7` double(3,1) default NULL, `c8` double(3,1) default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; SELECT CASE WHEN 1 @@ -150,5 +150,5 @@ t1 CREATE TABLE `t1` ( `COALESCE(1,'1')` char(1) NOT NULL default '', `COALESCE(1.1,'1')` char(3) NOT NULL default '', `COALESCE('a' COLLATE latin1_bin,'b')` char(1) character set latin1 collate latin1_bin NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 974a79580ae..43afd02169c 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -45,7 +45,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `t` char(4) character set cp1251 NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select cast(_latin1'ab' AS char) as c1, @@ -72,7 +72,7 @@ t1 CREATE TABLE `t1` ( `c3` char(2) binary NOT NULL default '', `c4` char(2) binary NOT NULL default '', `c5` char(2) binary NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select cast(_koi8r'' AS nchar) as c1, @@ -99,7 +99,7 @@ t1 CREATE TABLE `t1` ( `c3` char(2) character set utf8 NOT NULL default '', `c4` char(2) character set utf8 NOT NULL default '', `c5` char(2) character set utf8 NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select cast("2001-1-1" as date) = "2001-01-01"; cast("2001-1-1" as date) = "2001-01-01" diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index d61614180b3..28f06f0bf47 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -179,7 +179,7 @@ t1 CREATE TABLE `t1` ( KEY `b_29` (`b`), KEY `b_30` (`b`), KEY `b_31` (`b`) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 select if(1,'1','0'), month("2002-08-02"); drop table t1; @@ -197,7 +197,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=HEAP CHARSET=latin1 +) TYPE=HEAP DEFAULT CHARSET=latin1 drop table t1; SET SESSION table_type="gemini"; SELECT @@table_type; @@ -210,7 +210,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SET SESSION table_type=default; drop table t1; create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2)); @@ -275,7 +275,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `id` int(11) NOT NULL default '0', `name` char(20) default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 select * from t3; id name create table if not exists t3 like t1; @@ -289,7 +289,7 @@ show create table t3; Table Create Table t3 CREATE TEMPORARY TABLE `t3` ( `id` int(11) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 select * from t3; id drop table t3; @@ -298,7 +298,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `id` int(11) NOT NULL default '0', `name` char(20) default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 select * from t3; id name drop table t2, t3; @@ -313,14 +313,14 @@ Table Create Table t3 CREATE TEMPORARY TABLE `t3` ( `id` int(11) NOT NULL default '0', `name` char(20) default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 create table t2 like t3; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `id` int(11) NOT NULL default '0', `name` char(20) default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 select * from t2; id name create table t3 like t1; @@ -346,7 +346,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=HEAP CHARSET=latin1 +) TYPE=HEAP DEFAULT CHARSET=latin1 drop table t1; SET SESSION table_type="gemini"; SELECT @@table_type; @@ -359,7 +359,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SET SESSION table_type=default; drop table t1; create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob); diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result index 6a9da97042b..2186b155f99 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -491,7 +491,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `latin1_f` char(32) NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SHOW FIELDS FROM t1; Field Type Null Key Default Extra latin1_f char(32) @@ -501,7 +501,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `latin1_f` char(32) character set latin1 collate latin1_bin default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SHOW FIELDS FROM t1; Field Type Null Key Default Extra latin1_f char(32) YES NULL @@ -509,8 +509,8 @@ ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `latin1_f` char(32) collate latin1_bin default NULL -) TYPE=MyISAM CHARSET=latin1 COLLATE=latin1_bin + `latin1_f` char(32) character set latin1 collate latin1_bin default NULL +) TYPE=MyISAM DEFAULT CHARSET=latin1 SHOW FIELDS FROM t1; Field Type Null Key Default Extra latin1_f char(32) YES NULL diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 07ea97258d9..f1049b81d26 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -225,7 +225,7 @@ t1 CREATE TABLE `t1` ( `word` varchar(255) collate latin1_german2_ci NOT NULL default '', `word2` varchar(255) collate latin1_german2_ci NOT NULL default '', KEY `word` (`word`) -) TYPE=MyISAM CHARSET=latin1 COLLATE=latin1_german2_ci +) TYPE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae'); update t1 set word2=word; select word, word=binary 0xdf as t from t1 having t > 0; @@ -284,7 +284,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `s1` char(5) collate latin1_german2_ci default NULL -) TYPE=MyISAM CHARSET=latin1 COLLATE=latin1_german2_ci +) TYPE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci INSERT INTO t1 VALUES (''); INSERT INTO t1 VALUES ('ue'); SELECT DISTINCT s1 FROM t1; diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index c465655473d..764503f9e22 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -9,14 +9,14 @@ Table Create Table t1 CREATE TABLE `t1` ( `comment` char(32) character set latin1 NOT NULL default '', `koi8_ru_f` char(32) character set koi8r NOT NULL default '' -) TYPE=MyISAM CHARSET=latin5 +) TYPE=MyISAM DEFAULT CHARSET=latin5 ALTER TABLE t1 CHANGE comment comment CHAR(32) CHARACTER SET latin2 NOT NULL; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `comment` char(32) character set latin2 NOT NULL default '', `koi8_ru_f` char(32) character set koi8r NOT NULL default '' -) TYPE=MyISAM CHARSET=latin5 +) TYPE=MyISAM DEFAULT CHARSET=latin5 ALTER TABLE t1 ADD latin5_f CHAR(32) NOT NULL; SHOW CREATE TABLE t1; Table Create Table @@ -24,8 +24,8 @@ t1 CREATE TABLE `t1` ( `comment` char(32) character set latin2 NOT NULL default '', `koi8_ru_f` char(32) character set koi8r NOT NULL default '', `latin5_f` char(32) NOT NULL default '' -) TYPE=MyISAM CHARSET=latin5 -ALTER TABLE t1 CHARSET=latin2; +) TYPE=MyISAM DEFAULT CHARSET=latin5 +ALTER TABLE t1 DEFAULT CHARSET=latin2; ALTER TABLE t1 ADD latin2_f CHAR(32) NOT NULL; SHOW CREATE TABLE t1; Table Create Table @@ -34,14 +34,14 @@ t1 CREATE TABLE `t1` ( `koi8_ru_f` char(32) character set koi8r NOT NULL default '', `latin5_f` char(32) character set latin5 NOT NULL default '', `latin2_f` char(32) NOT NULL default '' -) TYPE=MyISAM CHARSET=latin2 +) TYPE=MyISAM DEFAULT CHARSET=latin2 ALTER TABLE t1 DROP latin2_f, DROP latin5_f; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `comment` char(32) NOT NULL default '', `koi8_ru_f` char(32) character set koi8r NOT NULL default '' -) TYPE=MyISAM CHARSET=latin2 +) TYPE=MyISAM DEFAULT CHARSET=latin2 INSERT INTO t1 (koi8_ru_f,comment) VALUES ('a','LAT SMALL A'); INSERT INTO t1 (koi8_ru_f,comment) VALUES ('b','LAT SMALL B'); INSERT INTO t1 (koi8_ru_f,comment) VALUES ('c','LAT SMALL C'); diff --git a/mysql-test/r/ctype_mb.result b/mysql-test/r/ctype_mb.result index ce4a4f98b42..88cd1b4f7fe 100644 --- a/mysql-test/r/ctype_mb.result +++ b/mysql-test/r/ctype_mb.result @@ -5,7 +5,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(4) character set utf8 NOT NULL default '', `c2` char(4) character set utf8 NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 DELETE FROM t1; ALTER TABLE t1 ADD c3 CHAR(4) CHARACTER SET utf8; SHOW CREATE TABLE t1; @@ -14,7 +14,7 @@ t1 CREATE TABLE `t1` ( `c1` char(4) character set utf8 NOT NULL default '', `c2` char(4) character set utf8 NOT NULL default '', `c3` char(4) character set utf8 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd'); Warnings: Warning 1264 Data truncated for column 'c1' at row 1 @@ -30,7 +30,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(4) character set utf8 default NULL, KEY `key_a` (`a`(3)) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 key_a 1 a A NULL 9 NULL YES BTREE @@ -40,7 +40,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(4) default NULL, KEY `key_a` (`a`(3)) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 key_a 1 a A NULL 3 NULL YES BTREE @@ -50,7 +50,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(4) character set utf8 default NULL, KEY `key_a` (`a`(3)) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 key_a 1 a A NULL 9 NULL YES BTREE diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index 1fe07692290..5afd2c041c8 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -6,7 +6,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(10) character set cp1251 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SELECT a FROM t1; a @@ -25,7 +25,7 @@ SHOW CREATE TABLE ; Table Create Table CREATE TABLE `` ( `` char(32) character set koi8r NOT NULL default '' COMMENT ' ' -) TYPE=MyISAM CHARSET=latin1 COMMENT=' ' +) TYPE=MyISAM DEFAULT CHARSET=latin1 COMMENT=' ' SHOW FIELDS FROM ; Field Type Null Key Default Extra char(32) @@ -37,7 +37,7 @@ SHOW CREATE TABLE ; Table Create Table CREATE TABLE `` ( `` char(32) character set koi8r NOT NULL default '' COMMENT ' ' -) TYPE=MyISAM CHARSET=latin1 COMMENT=' ' +) TYPE=MyISAM DEFAULT CHARSET=latin1 COMMENT=' ' SHOW FIELDS FROM ; Field Type Null Key Default Extra char(32) @@ -49,7 +49,7 @@ SHOW CREATE TABLE таблица; Table Create Table таблица CREATE TABLE `таблица` ( `поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий поля' -) TYPE=MyISAM CHARSET=latin1 COMMENT='комментарий таблицы' +) TYPE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы' SHOW FIELDS FROM таблица; Field Type Null Key Default Extra поле char(32) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index db626c8acb1..977797f0278 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -45,7 +45,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `l` char(10) character set ucs2 NOT NULL default '', `r` char(10) character set ucs2 NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; SET NAMES koi8r; SET character_set_connection=ucs2; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 37742893c2b..6d322078018 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -164,7 +164,7 @@ create table t1 (mat_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, create table t2 (mat_id MEDIUMINT UNSIGNED NOT NULL, pla_id MEDIUMINT UNSIGNED NOT NULL); insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4), (NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8), (NULL, 'i', 9); insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105); -SELECT d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; pla_id mat_id 100 1 101 1 @@ -172,7 +172,7 @@ pla_id mat_id 103 2 104 2 105 3 -SELECT d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; pla_id test 100 1 101 1 @@ -180,13 +180,13 @@ pla_id test 103 2 104 2 105 3 -explain SELECT d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY m2 ALL NULL NULL NULL NULL 9 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where 2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort 2 DERIVED m2 index NULL PRIMARY 3 NULL 9 Using index -explain SELECT d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY m2 ALL NULL NULL NULL NULL 9 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 56f95ff0c90..f65210bb6f1 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -201,7 +201,7 @@ t2 CREATE TABLE `t2` ( `inhalt` text, KEY `tig` (`ticket`), FULLTEXT KEY `tix` (`inhalt`) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 select * from t2 where MATCH inhalt AGAINST (NULL); ticket inhalt select * from t2 where MATCH inhalt AGAINST ('foobar'); diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 26741cff864..a3327a7a80b 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -539,7 +539,7 @@ t1 CREATE TABLE `t1` ( `substring(_latin2'ab',1)` char(2) character set latin2 NOT NULL default '', `insert(_latin2'abcd',2,3,_latin2'ef')` char(6) character set latin2 NOT NULL default '', `replace(_latin2'abcd',_latin2'b',_latin2'B')` char(4) character set latin2 NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select SUBSTR('abcdefg',3,2); SUBSTR('abcdefg',3,2) diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result index 9d370b43099..d045d4865dc 100644 --- a/mysql-test/r/func_system.result +++ b/mysql-test/r/func_system.result @@ -49,7 +49,7 @@ t1 CREATE TABLE `t1` ( `database()` char(34) character set utf8 NOT NULL default '', `user()` char(77) character set utf8 NOT NULL default '', `version` char(40) default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select TRUE,FALSE,NULL; TRUE FALSE NULL diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 173a065adc2..ca54ec59938 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -11,7 +11,7 @@ t1 CREATE TABLE `t1` ( `g` geometry NOT NULL default '', PRIMARY KEY (`fid`), SPATIAL KEY `g` (`g`(32)) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)')); INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)')); INSERT INTO t1 (g) VALUES (GeomFromText('LineString(148 148, 152 152)')); @@ -294,7 +294,7 @@ t2 CREATE TABLE `t2` ( `g` geometry NOT NULL default '', PRIMARY KEY (`fid`), SPATIAL KEY `g` (`g`(32)) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 SELECT count(*) FROM t2; count(*) 100 diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index af39dbf51f1..1fd23f1b804 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -819,7 +819,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(20) default NULL, KEY `a` (`a`(5)) -) TYPE=InnoDB CHARSET=latin1 +) TYPE=InnoDB DEFAULT CHARSET=latin1 drop table t1; create temporary table t1 (a int not null auto_increment, primary key(a)) type=innodb; insert into t1 values (NULL),(NULL),(NULL); diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 79fe0599bc4..4bc4cad40a4 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -1,3 +1,4 @@ +drop table if exists t1, t2, t3; SET @save_key_buffer=@@key_buffer_size; SELECT @@key_buffer_size, @@small.key_buffer_size; @@key_buffer_size @@small.key_buffer_size @@ -74,15 +75,15 @@ select @@keycache1.key_buffer_size; 0 select @@keycache1.key_cache_block_size; @@keycache1.key_cache_block_size -0 +2048 select @@key_buffer_size; @@key_buffer_size 2097152 select @@key_cache_block_size; @@key_cache_block_size 1024 -drop table if exists t1, t2; -create table t1 (p int primary key, a char(10)); +set global keycache1.key_buffer_size=1024*1024; +create table t1 (p int primary key, a char(10)) delay_key_write=1; create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a)); insert into t1 values (1, 'qqqq'), (11, 'yyyy'); insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), @@ -99,7 +100,7 @@ p i a 4 3 zzzz update t1 set p=2 where p=1; update t2 set i=2 where i=1; -cache index t1 keys in keycache1; +cache index t1 keys (`primary`) in keycache1; Table Op Msg_type Msg_text test.t1 assign_to_keycache status OK explain select p from t1; @@ -125,15 +126,15 @@ id select_type table type possible_keys key key_len ref rows Extra select count(*) from t1, t2 where t1.p = t2.i; count(*) 3 -cache index t2 keys in keycache1; +cache index t2 in keycache1; Table Op Msg_type Msg_text test.t2 assign_to_keycache status OK update t2 set p=p+1000, i=2 where a='qqqq'; -cache index t2 keys in keycache2; +cache index t2 in keycache2; Table Op Msg_type Msg_text test.t2 assign_to_keycache status OK insert into t2 values (2000, 3, 'yyyy'); -cache index t2 keys in keycache1; +cache index t2 in keycache1; Table Op Msg_type Msg_text test.t2 assign_to_keycache status OK update t2 set p=3000 where a='zzzz'; @@ -174,6 +175,12 @@ qqqq yyyy yyyy zzzz +cache index t1 in unknown_key_cache; +ERROR HY000: Unknown key cache 'unknown_key_cache' +cache index t1 keys (unknown_key) in keycache1; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache error Key column 'unknown_key' doesn't exist in table +test.t1 assign_to_keycache status Operation failed select @@keycache2.key_buffer_size; @@keycache2.key_buffer_size 4194304 @@ -186,7 +193,11 @@ select @@keycache2.key_buffer_size; 0 select @@keycache2.key_cache_block_size; @@keycache2.key_cache_block_size -0 +1024 +set global keycache2.key_buffer_size=1024*1024; +select @@keycache2.key_buffer_size; +@@keycache2.key_buffer_size +1048576 update t2 set p=4000 where a='zzzz'; update t1 set p=p+1; set global keycache1.key_buffer_size=0; @@ -232,3 +243,17 @@ select p from t1; p 3 12 +create table t3 (like t1); +cache index t3 in small; +Table Op Msg_type Msg_text +test.t3 assign_to_keycache status OK +insert into t3 select * from t1; +cache index t3 in keycache2; +Table Op Msg_type Msg_text +test.t3 assign_to_keycache status OK +cache index t1,t2 in default; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +test.t2 assign_to_keycache status OK +drop table t1,t2,t3; +set global keycache1.key_buffer_size=0; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 9a99d1c64fb..01635313590 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -175,7 +175,7 @@ t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL default '0', `b` char(20) default NULL, KEY `a` (`a`) -) TYPE=MRG_MyISAM CHARSET=latin1 UNION=(`t1`,`t2`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) create table t4 (a int not null, b char(10), key(a)) type=MERGE UNION=(t1,t2); select * from t4; ERROR HY000: Can't open file: 't4.MRG' (errno: 143) @@ -190,7 +190,7 @@ t5 CREATE TABLE `t5` ( `a` int(11) NOT NULL default '0', `b` char(20) default NULL, KEY `a` (`a`) -) TYPE=MRG_MyISAM CHARSET=latin1 UNION=(`t1`,`mysqltest`.`t6`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`mysqltest`.`t6`) alter table t5 type=myisam; drop table t5, mysqltest.t6; drop database mysqltest; @@ -263,14 +263,14 @@ t3 CREATE TABLE `t3` ( `incr` int(11) NOT NULL default '0', `othr` int(11) NOT NULL default '0', PRIMARY KEY (`incr`) -) TYPE=MRG_MyISAM CHARSET=latin1 UNION=(`t1`,`t2`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) alter table t3 drop primary key; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `incr` int(11) NOT NULL default '0', `othr` int(11) NOT NULL default '0' -) TYPE=MRG_MyISAM CHARSET=latin1 UNION=(`t1`,`t2`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) drop table t3,t2,t1; create table t1 (a int not null, key(a)) type=merge; select * from t1; @@ -299,28 +299,28 @@ t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', KEY `a` (`a`,`b`) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 show create table t4; Table Create Table t4 CREATE TABLE `t4` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', KEY `a` (`a`,`b`) -) TYPE=MRG_MyISAM CHARSET=latin1 UNION=(`t1`,`t2`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) show create table t5; Table Create Table t5 CREATE TABLE `t5` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL auto_increment, PRIMARY KEY (`a`,`b`) -) TYPE=MRG_MyISAM CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`t1`,`t2`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`t1`,`t2`) show create table t6; Table Create Table t6 CREATE TABLE `t6` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL auto_increment, PRIMARY KEY (`a`,`b`) -) TYPE=MRG_MyISAM CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) insert into t1 values (1,NULL),(1,NULL),(1,NULL),(1,NULL); insert into t2 values (2,NULL),(2,NULL),(2,NULL),(2,NULL); select * from t3 order by b,a limit 3; @@ -385,7 +385,7 @@ t4 CREATE TABLE `t4` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', KEY `a` (`a`,`b`) -) TYPE=MRG_MyISAM CHARSET=latin1 UNION=(`t1`,`t2`,`t3`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`,`t3`) select * from t4 order by a,b; a b 1 1 @@ -411,7 +411,7 @@ t4 CREATE TABLE `t4` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', KEY `a` (`a`,`b`) -) TYPE=MRG_MyISAM CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`t1`,`t2`,`t3`) +) TYPE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`t1`,`t2`,`t3`) insert into t4 values (4,1),(4,2); select * from t1 order by a,b; a b diff --git a/mysql-test/r/preload.result b/mysql-test/r/preload.result index 4d9293c7929..bd7b828d5b9 100644 --- a/mysql-test/r/preload.result +++ b/mysql-test/r/preload.result @@ -69,7 +69,7 @@ flush status; select @@preload_buffer_size; @@preload_buffer_size 32768 -load index into cache t1 keys; +load index into cache t1; Table Op Msg_type Msg_text test.t1 preload_keys status OK show status like "key_read%"; @@ -93,7 +93,7 @@ set session preload_buffer_size=256*1024; select @@preload_buffer_size; @@preload_buffer_size 262144 -load index into cache t1 keys ignore leaves; +load index into cache t1 ignore leaves; Table Op Msg_type Msg_text test.t1 preload_keys status OK show status like "key_read%"; @@ -117,7 +117,7 @@ set session preload_buffer_size=1*1024; select @@preload_buffer_size; @@preload_buffer_size 1024 -load index into cache t1 keys, t2 keys (primary,b) ignore leaves; +load index into cache t1, t2 keys (primary,b) ignore leaves; Table Op Msg_type Msg_text test.t1 preload_keys status OK test.t2 preload_keys status OK @@ -141,7 +141,7 @@ show status like "key_read%"; Variable_name Value Key_read_requests 0 Key_reads 0 -load index into cache t3 keys, t2 keys (primary,b) ; +load index into cache t3, t2 keys (primary,b) ; Table Op Msg_type Msg_text test.t3 preload_keys error Table 'test.t3' doesn't exist test.t2 preload_keys status OK diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 2a5955e6d87..2f29dcfdb47 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -77,13 +77,13 @@ show create table t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 alter table t1 rename t2; show create table t2; Table Create Table t2 CREATE TEMPORARY TABLE `t2` ( `a` int(11) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t2; create table t1 ( test_set set( 'val1', 'val2', 'val3' ) not null default '', @@ -96,7 +96,7 @@ t1 CREATE TABLE `t1` ( `test_set` set('val1','val2','val3') NOT NULL default '', `name` char(20) default 'O''Brien' COMMENT 'O''Brien as default', `c` int(11) NOT NULL default '0' COMMENT 'int column' -) TYPE=MyISAM CHARSET=latin1 COMMENT='it''s a table' +) TYPE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table' show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment test_set set('val1','val2','val3') latin1_swedish_ci select,insert,update,references @@ -109,7 +109,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', UNIQUE KEY `aa` (`a`) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int not null, primary key (a)); show create table t1; @@ -117,7 +117,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', PRIMARY KEY (`a`) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; flush tables; show open tables; @@ -135,7 +135,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` char(10) default NULL, KEY `b` (`b`) -) TYPE=MyISAM CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' +) TYPE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' alter table t1 MAX_ROWS=200 ROW_FORMAT=dynamic PACK_KEYS=0; show create table t1; Table Create Table @@ -143,7 +143,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` varchar(10) default NULL, KEY `b` (`b`) -) TYPE=MyISAM CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test' +) TYPE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test' ALTER TABLE t1 AVG_ROW_LENGTH=0 CHECKSUM=0 COMMENT="" MIN_ROWS=0 MAX_ROWS=0 PACK_KEYS=DEFAULT DELAY_KEY_WRITE=0 ROW_FORMAT=default; show create table t1; Table Create Table @@ -151,7 +151,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` varchar(10) default NULL, KEY `b` (`b`) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0)); show columns from t1; @@ -221,7 +221,7 @@ t1 CREATE TABLE `t1` ( `type_long_blob` longblob, PRIMARY KEY (`type_tiny`), KEY `type_short` (`type_short`) -) TYPE=MyISAM CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' +) TYPE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' insert into t1 (type_timestamp) values ("2003-02-07 10:00:01"); select * from t1; type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index 06451b8ac34..dddfe2432ee 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -18,7 +18,7 @@ t1 CREATE TABLE `t1` ( `email` varchar(60) character set latin2 NOT NULL default '', PRIMARY KEY (`a`), UNIQUE KEY `email` TYPE BTREE (`email`) -) TYPE=HEAP CHARSET=latin1 ROW_FORMAT=DYNAMIC +) TYPE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC set @@sql_mode="ansi_quotes"; show variables like 'sql_mode'; Variable_name Value @@ -31,7 +31,7 @@ t1 CREATE TABLE "t1" ( "email" varchar(60) character set latin2 NOT NULL default '', PRIMARY KEY ("a"), UNIQUE KEY "email" TYPE BTREE ("email") -) TYPE=HEAP CHARSET=latin1 ROW_FORMAT=DYNAMIC +) TYPE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC set @@sql_mode="no_table_options"; show variables like 'sql_mode'; Variable_name Value @@ -57,7 +57,7 @@ t1 CREATE TABLE `t1` ( `email` varchar(60) character set latin2 NOT NULL default '', PRIMARY KEY (`a`), UNIQUE KEY `email` (`email`) -) TYPE=HEAP CHARSET=latin1 ROW_FORMAT=DYNAMIC +) TYPE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC set @@sql_mode="no_field_options,mysql323,mysql40"; show variables like 'sql_mode'; Variable_name Value diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 31b5ff84365..95638cbee41 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1071,7 +1071,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(1) NOT NULL default '0', `(SELECT 1)` bigint(1) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; @@ -1079,7 +1079,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(1) NOT NULL default '0', `(SELECT a)` bigint(1) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; @@ -1087,7 +1087,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(1) NOT NULL default '0', `(SELECT a+0)` bigint(17) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; select * from t1; @@ -1097,7 +1097,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(17) NOT NULL default '0' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int); insert into t1 values (1), (2), (3); diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 82aefa78bb2..d1147e55119 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -23,7 +23,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` mediumtext, `b` mediumblob -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2,t3 #; CREATE TABLE t1 (a char(257) default "hello"); diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index c0f0be246c9..f30feb4c0e6 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1627,12 +1627,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` enum('','a','b') NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a enum (' ','a','b ') not null default 'b '); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` enum('','a','b') NOT NULL default 'b' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/type_nchar.result b/mysql-test/r/type_nchar.result index c495853cd4c..63193418f77 100644 --- a/mysql-test/r/type_nchar.result +++ b/mysql-test/r/type_nchar.result @@ -4,47 +4,47 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` char(10) character set utf8 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (c national char(10)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` char(10) character set utf8 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (c national varchar(10)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` varchar(10) character set utf8 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (c nvarchar(10)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` varchar(10) character set utf8 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (c nchar varchar(10)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` varchar(10) character set utf8 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (c national character varying(10)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` varchar(10) character set utf8 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (c nchar varying(10)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` varchar(10) character set utf8 default NULL -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index 086f55a47a5..e98ec2c3fc4 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -4,14 +4,14 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` set('','a','b') NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a set (' ','a','b ') not null default 'b '); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` set('','a','b') NOT NULL default 'b' -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 ( user varchar(64) NOT NULL default '', path varchar(255) NOT NULL default '', privilege set('select','RESERVED30','RESERVED29','RESERVED28','RESERVED27','RESERVED26', 'RESERVED25','RESERVED24','data.delete','RESERVED22','RESERVED21', 'RESERVED20','data.insert.none','data.insert.approve', 'data.insert.delete','data.insert.move','data.insert.propose', 'data.insert.reject','RESERVED13','RESERVED12','RESERVED11','RESERVED10', 'RESERVED09','data.update','RESERVED07','RESERVED06','RESERVED05', 'RESERVED04','metadata.delete','metadata.put','RESERVED01','RESERVED00') NOT NULL default '', KEY user (user) ) TYPE=MyISAM CHARSET=utf8; DROP TABLE t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 5729d3b32ee..00eddd596cf 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -486,7 +486,7 @@ a b 2 2 3 3 4 4 -explain (select * from t1 where a=1 and b=10) union (select t1.a,t2.a from t1,t2 where t1.a=t2.a); +explain (select * from t1 where a=1 and b=10) union (select straight_join t1.a,t2.a from t1,t2 where t1.a=t2.a); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 06a5db13ea3..11fe997e789 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -170,6 +170,17 @@ select a,hex(a) from t1; alter table t1 change a a char(10) character set koi8r; select a,hex(a) from t1; +# +# Test ALTER TABLE .. CHARACTER SET .. +# +show create table t1; +alter table t1 DEFAULT CHARACTER SET latin1; +show create table t1; +alter table t1 CHARACTER SET latin1; +show create table t1; +alter table t1 DEFAULT CHARACTER SET cp1251; +show create table t1; + drop table t1; # diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index a1549f952e5..7b44439aa50 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -16,7 +16,7 @@ ALTER TABLE t1 CHANGE comment comment CHAR(32) CHARACTER SET latin2 NOT NULL; SHOW CREATE TABLE t1; ALTER TABLE t1 ADD latin5_f CHAR(32) NOT NULL; SHOW CREATE TABLE t1; -ALTER TABLE t1 CHARSET=latin2; +ALTER TABLE t1 DEFAULT CHARSET=latin2; ALTER TABLE t1 ADD latin2_f CHAR(32) NOT NULL; SHOW CREATE TABLE t1; ALTER TABLE t1 DROP latin2_f, DROP latin5_f; diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 80b131ac6fe..ee50ffda476 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -83,11 +83,11 @@ create table t2 (mat_id MEDIUMINT UNSIGNED NOT NULL, pla_id MEDIUMINT UNSIGNED N insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4), (NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8), (NULL, 'i', 9); insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105); -SELECT d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; -SELECT d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; -explain SELECT d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; -explain SELECT d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; drop table t1,t2; # diff --git a/mysql-test/t/isam.test b/mysql-test/t/isam.test index a31ba864b2f..e35ed0dfd4a 100644 --- a/mysql-test/t/isam.test +++ b/mysql-test/t/isam.test @@ -12,12 +12,14 @@ create table t1 (a tinyint not null auto_increment, b blob not null, primary key let $1=100; disable_query_log; +--disable_warnings while ($1) { eval insert into t1 (b) values(repeat(char(65+$1),65540-$1)); dec $1; } enable_query_log; +--enable_warnings delete from t1 where (a & 1); select sum(length(b)) from t1; drop table t1; diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index e8977ae9b62..8cef925cc24 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -112,7 +112,7 @@ drop table t1, t2; create table t1 (a int primary key); insert into t1 values(1),(2); select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a); ---replace_result "31 tables" "XX tables" "62 tables" "XX tables" +--replace_result "31 tables" "XX tables" "61 tables" "XX tables" --error 1116 select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a); drop table t1; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 371d610eb5f..dc9f9c9b18a 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -1,6 +1,9 @@ # # Test of multiple key caches # +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings SET @save_key_buffer=@@key_buffer_size; @@ -58,12 +61,9 @@ select @@keycache1.key_cache_block_size; select @@key_buffer_size; select @@key_cache_block_size; +set global keycache1.key_buffer_size=1024*1024; ---disable_warnings -drop table if exists t1, t2; ---enable_warnings - -create table t1 (p int primary key, a char(10)); +create table t1 (p int primary key, a char(10)) delay_key_write=1; create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a)); insert into t1 values (1, 'qqqq'), (11, 'yyyy'); @@ -75,7 +75,7 @@ select * from t2; update t1 set p=2 where p=1; update t2 set i=2 where i=1; -cache index t1 keys in keycache1; +cache index t1 keys (`primary`) in keycache1; explain select p from t1; select p from t1; @@ -84,11 +84,11 @@ select i from t2; explain select count(*) from t1, t2 where t1.p = t2.i; select count(*) from t1, t2 where t1.p = t2.i; -cache index t2 keys in keycache1; +cache index t2 in keycache1; update t2 set p=p+1000, i=2 where a='qqqq'; -cache index t2 keys in keycache2; +cache index t2 in keycache2; insert into t2 values (2000, 3, 'yyyy'); -cache index t2 keys in keycache1; +cache index t2 in keycache1; update t2 set p=3000 where a='zzzz'; select * from t2; explain select p from t2; @@ -98,12 +98,18 @@ select i from t2; explain select a from t2; select a from t2; +# Test some error conditions +--error 1287 +cache index t1 in unknown_key_cache; +cache index t1 keys (unknown_key) in keycache1; + select @@keycache2.key_buffer_size; select @@keycache2.key_cache_block_size; set global keycache2.key_buffer_size=0; select @@keycache2.key_buffer_size; select @@keycache2.key_cache_block_size; - +set global keycache2.key_buffer_size=1024*1024; +select @@keycache2.key_buffer_size; update t2 set p=4000 where a='zzzz'; update t1 set p=p+1; @@ -119,4 +125,14 @@ select a from t2; select * from t1; select p from t1; +# Use the 'small' key cache +create table t3 (like t1); +cache index t3 in small; +insert into t3 select * from t1; +cache index t3 in keycache2; +cache index t1,t2 in default; +drop table t1,t2,t3; +# Cleanup +# We don't reset keycache2 as we want to ensure that mysqld will reset it +set global keycache1.key_buffer_size=0; diff --git a/mysql-test/t/preload.test b/mysql-test/t/preload.test index 7357b42c599..7eff5cee08f 100644 --- a/mysql-test/t/preload.test +++ b/mysql-test/t/preload.test @@ -63,7 +63,7 @@ show status like "key_read%"; flush tables; flush status; select @@preload_buffer_size; -load index into cache t1 keys; +load index into cache t1; show status like "key_read%"; select count(*) from t1 where b = 'test1'; show status like "key_read%"; @@ -72,7 +72,7 @@ flush tables; flush status; show status like "key_read%"; set session preload_buffer_size=256*1024; select @@preload_buffer_size; -load index into cache t1 keys ignore leaves; +load index into cache t1 ignore leaves; show status like "key_read%"; select count(*) from t1 where b = 'test1'; show status like "key_read%"; @@ -81,7 +81,7 @@ flush tables; flush status; show status like "key_read%"; set session preload_buffer_size=1*1024; select @@preload_buffer_size; -load index into cache t1 keys, t2 keys (primary,b) ignore leaves; +load index into cache t1, t2 keys (primary,b) ignore leaves; show status like "key_read%"; select count(*) from t1 where b = 'test1'; select count(*) from t2 where b = 'test1'; @@ -89,7 +89,7 @@ show status like "key_read%"; flush tables; flush status; show status like "key_read%"; -load index into cache t3 keys, t2 keys (primary,b) ; +load index into cache t3, t2 keys (primary,b) ; show status like "key_read%"; flush tables; flush status; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 1f3f4085734..3cfdc14b0b8 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -280,7 +280,7 @@ explain extended (select * from t1 where a=1) union (select * from t2 where a=1) (select * from t1 where a=5 and a=6) union (select * from t2 where a=1); (select t1.a,t1.b from t1,t2 where t1.a=5) union (select * from t2 where a=1); (select * from t1 where a=1) union (select t1.a,t2.a from t1,t2 where t1.a=t2.a); -explain (select * from t1 where a=1 and b=10) union (select t1.a,t2.a from t1,t2 where t1.a=t2.a); +explain (select * from t1 where a=1 and b=10) union (select straight_join t1.a,t2.a from t1,t2 where t1.a=t2.a); explain (select * from t1 where a=1) union (select * from t1 where b=1); drop table t1,t2; create table t1 ( id int not null auto_increment, primary key (id) ,user_name text ); |