summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-07-23 20:39:36 +0300
committerunknown <monty@mashka.mysql.fi>2002-07-23 20:39:36 +0300
commit10bd14dee8488b59798e9b24db1c50759e9242ae (patch)
treedd3586b209432966efbbf77cd272760438711106 /mysql-test
parentb42ca98d34a2e834dfc454338493fa26553c8d20 (diff)
parenta8caad316a89d6eeb8c22e70bc7a5fd4cf6ce904 (diff)
downloadmariadb-git-10bd14dee8488b59798e9b24db1c50759e9242ae.tar.gz
merge
include/my_sys.h: Auto merged include/myisam.h: Auto merged myisam/mi_check.c: Auto merged sql/Makefile.am: Auto merged sql/ha_myisam.h: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_myisammrg.h: Auto merged sql/handler.cc: Auto merged sql/item.h: Auto merged sql/lex.h: Auto merged sql/mysql_priv.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/structs.h: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/insert_select.result2
-rw-r--r--mysql-test/r/key.result31
-rw-r--r--mysql-test/r/query_cache.result6
-rw-r--r--mysql-test/r/rpl000001.result2
-rw-r--r--mysql-test/r/rpl000016.result2
-rw-r--r--mysql-test/r/union.result4
-rw-r--r--mysql-test/r/user_var.result2
-rw-r--r--mysql-test/r/variables.result274
-rw-r--r--mysql-test/t/key.test20
-rw-r--r--mysql-test/t/query_cache.test6
-rw-r--r--mysql-test/t/rpl000001.test2
-rw-r--r--mysql-test/t/rpl000009.test18
-rw-r--r--mysql-test/t/rpl000016.test2
-rw-r--r--mysql-test/t/rpl_compat.test2
-rw-r--r--mysql-test/t/union.test2
-rw-r--r--mysql-test/t/user_var.test2
-rw-r--r--mysql-test/t/variables-master.opt1
-rw-r--r--mysql-test/t/variables.test197
18 files changed, 540 insertions, 35 deletions
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index d61b6c67030..e24c3179a0c 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -61,7 +61,7 @@ SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM crash2
WHERE numeropost=9 ORDER BY numreponse ASC;
show variables like '%bulk%';
Variable_name Value
-myisam_bulk_insert_tree_size 8388608
+bulk_insert_buffer_size 8388608
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM crash2
WHERE numeropost=9 ORDER BY numreponse ASC;
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 6dfe0809e7f..1cd9c9dfe79 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -147,3 +147,34 @@ t1 0 e 1 e A 0 NULL NULL BTREE
t1 0 b 1 b A NULL NULL NULL YES BTREE
t1 1 c 1 c A NULL NULL NULL YES BTREE
drop table t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
+UNIQUE (c,i));
+INSERT INTO t1 (c) VALUES (NULL),(NULL);
+SELECT * FROM t1;
+c i
+ 1
+ 2
+INSERT INTO t1 (c) VALUES ('a'),('a');
+SELECT * FROM t1;
+c i
+ 1
+ 2
+a 1
+a 2
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c CHAR(10) NULL, i INT NOT NULL AUTO_INCREMENT,
+UNIQUE (c,i));
+INSERT INTO t1 (c) VALUES (NULL),(NULL);
+SELECT * FROM t1;
+c i
+NULL 1
+NULL 2
+INSERT INTO t1 (c) VALUES ('a'),('a');
+SELECT * FROM t1;
+c i
+NULL 1
+NULL 2
+a 1
+a 2
+drop table t1;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index af14575a812..3afe1cd62cc 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -226,7 +226,7 @@ show status like "Qcache_free_blocks";
Variable_name Value
Qcache_free_blocks 1
drop table t1, t2, t3, t11, t21;
-set sql_query_cache_type=demand;
+set query_cache_type=demand;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
select * from t1;
@@ -242,7 +242,7 @@ a
1
2
3
-set sql_query_cache_type=2;
+set query_cache_type=2;
select sql_cache * from t1;
a
1
@@ -254,7 +254,7 @@ Qcache_hits 4
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
-set sql_query_cache_type=on;
+set query_cache_type=on;
reset query cache;
show status like "Qcache_queries_in_cache";
Variable_name Value
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result
index 60a5db1de3a..2c36df65ca9 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl000001.result
@@ -67,7 +67,7 @@ select (@id := id) - id from t2;
kill @id;
drop table t2;
Server shutdown in progress
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
select count(*) from t1;
count(*)
diff --git a/mysql-test/r/rpl000016.result b/mysql-test/r/rpl000016.result
index 9d6ba071200..ccd584bfcdc 100644
--- a/mysql-test/r/rpl000016.result
+++ b/mysql-test/r/rpl000016.result
@@ -33,7 +33,7 @@ master-bin.003
insert into t2 values(1234);
set insert_id=1234;
insert into t2 values(NULL);
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
purge master logs to 'master-bin.003';
show master logs;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 7d914d029af..52f4d4a14f6 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -194,9 +194,9 @@ a
1
2
set SQL_SELECT_LIMIT=2;
-(select * from t1 limit 2) union (select * from t2 limit 3);
+(select * from t1 limit 1) union (select * from t2 limit 3);
a
1
-2
+11
set SQL_SELECT_LIMIT=DEFAULT;
drop table t1,t2;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 5c8b4581c5c..5643900182e 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -1,5 +1,5 @@
set @a := foo;
-You may only use constant expressions with SET
+Unknown column 'foo' in 'field list'
set @a := connection_id() + 3;
select @a - connection_id();
@a - connection_id()
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 52c2c026bd3..4227ecfdadb 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -44,17 +44,277 @@ c_id c_name c_country
1 Bozo USA
4 Mr. Floppy GB
drop table t1;
+set max_join_size=100;
+show variables like 'max_join_size';
+Variable_name Value
+max_join_size 100
+show global variables like 'max_join_size';
+Variable_name Value
+max_join_size 4294967295
+set GLOBAL max_join_size=2000;
+show global variables like 'max_join_size';
+Variable_name Value
+max_join_size 2000
+set max_join_size=DEFAULT;
+show variables like 'max_join_size';
+Variable_name Value
+max_join_size 2000
+set GLOBAL max_join_size=DEFAULT;
+show global variables like 'max_join_size';
+Variable_name Value
+max_join_size 4294967295
+set @@max_join_size=1000, @@global.max_join_size=2000;
+select @@local.max_join_size, @@global.max_join_size;
+@@max_join_size @@max_join_size
+1000 2000
+select @@identity, length(@@version)>0;
+@@identity length(@@version)>0
+0 1
select @@VERSION=version();
@@VERSION=version()
1
select last_insert_id(345);
last_insert_id(345)
345
-select @@IDENTITY,last_insert_id();
-@@IDENTITY last_insert_id()
-345 345
-select @@identity;
-@@IDENTITY
-345
-select @@unknown_variable;
+select @@IDENTITY,last_insert_id(), @@identity;
+@@identity last_insert_id() @@identity
+345 345 345
+set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
+set global concurrent_insert=ON;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert ON
+set global concurrent_insert=1;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert ON
+set global concurrent_insert=0;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert OFF
+set global concurrent_insert=OFF;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert OFF
+set global concurrent_insert=DEFAULT;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert ON
+set table_type=MYISAM, table_type="HEAP", global table_type="INNODB";
+show local variables like 'table_type';
+Variable_name Value
+table_type HEAP
+show global variables like 'table_type';
+Variable_name Value
+table_type INNODB
+set GLOBAL query_cache_size=100000;
+set GLOBAL safe_show_database=0;
+set myisam_max_sort_file_size=10000, GLOBAL myisam_max_sort_file_size=20000;
+show variables like 'myisam_max_sort_file_size';
+Variable_name Value
+myisam_max_sort_file_size 10000
+show global variables like 'myisam_max_sort_file_size';
+Variable_name Value
+myisam_max_sort_file_size 20000
+set myisam_max_sort_file_size=default;
+show variables like 'myisam_max_sort_file_size';
+Variable_name Value
+myisam_max_sort_file_size 20000
+set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
+set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
+show global variables like 'net_%';
+Variable_name Value
+net_buffer_length 1024
+net_read_timeout 300
+net_retry_count 10
+net_write_timeout 200
+show session variables like 'net_%';
+Variable_name Value
+net_buffer_length 2048
+net_read_timeout 600
+net_retry_count 10
+net_write_timeout 500
+set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
+show global variables like 'net_%';
+Variable_name Value
+net_buffer_length 1024
+net_read_timeout 900
+net_retry_count 10
+net_write_timeout 1000
+show session variables like 'net_%';
+Variable_name Value
+net_buffer_length 7168
+net_read_timeout 600
+net_retry_count 10
+net_write_timeout 500
+set net_buffer_length=1;
+show variables like 'net_buffer_length';
+Variable_name Value
+net_buffer_length 1024
+set net_buffer_length=2000000000;
+show variables like 'net_buffer_length';
+Variable_name Value
+net_buffer_length 1048576
+set GLOBAL character set cp1251_koi8;
+show global variables like "convert_character_set";
+Variable_name Value
+convert_character_set cp1251_koi8
+set character set cp1251_koi8;
+show variables like "convert_character_set";
+Variable_name Value
+convert_character_set cp1251_koi8
+set global character set default, session character set default;
+show variables like "convert_character_set";
+Variable_name Value
+convert_character_set cp1251_koi8
+select @@timestamp>0;
+@@timestamp>0
+1
+set big_tables=OFFF;
+Variable 'big_tables' can't be set to the value of 'OFFF'
+set big_tables="OFFF";
+Variable 'big_tables' can't be set to the value of 'OFFF'
+set unknown_variable=1;
Unknown system variable 'unknown_variable'
+set max_join_size="hello";
+Wrong argument type to variable 'max_join_size'
+set table_type=UNKNOWN_TABLE_TYPE;
+Variable 'table_type' can't be set to the value of 'UNKNOWN_TABLE_TYPE'
+set table_type=INNODB, big_tables=2;
+Variable 'big_tables' can't be set to the value of '2'
+show local variables like 'table_type';
+Variable_name Value
+table_type HEAP
+set SESSION query_cache_size=10000;
+Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+set GLOBAL table_type=DEFAULT;
+Variable 'table_type' doesn't have a default value
+set convert_character_set=UNKNOWN_CHARACTER_SET;
+Unknown character set: 'UNKNOWN_CHARACTER_SET'
+set character set unknown;
+Unknown character set: 'unknown'
+set character set 0;
+Wrong argument type to variable 'convert_character_set'
+set global autocommit=1;
+Variable 'autocommit' is a LOCAL variable and can't be used with SET GLOBAL
+select @@global.timestamp;
+Variable 'timestamp' is a LOCAL variable and can't be used with SET GLOBAL
+set @@version='';
+Unknown system variable 'version'
+set @@concurrent_insert=1;
+Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
+set @@global.sql_auto_is_null=1;
+Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL
+select @@global.sql_auto_is_null;
+Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL
+set autocommit=1;
+set big_tables=1;
+select @@autocommit, @@big_tables;
+@@autocommit @@big_tables
+1 1
+set global binlog_cache_size=100;
+set bulk_insert_buffer_size=100;
+set convert_character_set=cp1251_koi8;
+set convert_character_set=default;
+set @@global.concurrent_insert=1;
+set global connect_timeout=100;
+set global delay_key_write=1;
+set global delayed_insert_limit=100;
+set global delayed_insert_timeout=100;
+set global delayed_queue_size=100;
+set global flush=1;
+set global flush_time=100;
+set insert_id=1;
+set interactive_timeout=100;
+set join_buffer_size=100;
+set last_insert_id=1;
+set global local_infile=1;
+set long_query_time=100;
+set low_priority_updates=1;
+set max_allowed_packet=100;
+set global max_binlog_cache_size=100;
+set global max_binlog_size=100;
+set global max_connect_errors=100;
+set global max_connections=100;
+set global max_delayed_threads=100;
+set max_heap_table_size=100;
+set max_join_size=100;
+set max_sort_length=100;
+set max_tmp_tables=100;
+set global max_user_connections=100;
+select @@max_user_connections;
+@@max_user_connections
+100
+set global max_write_lock_count=100;
+set myisam_max_extra_sort_file_size=100;
+select @@myisam_max_extra_sort_file_size;
+@@myisam_max_extra_sort_file_size
+100
+set myisam_max_sort_file_size=100;
+set myisam_sort_buffer_size=100;
+set net_buffer_length=100;
+set net_read_timeout=100;
+set net_write_timeout=100;
+set global query_cache_limit=100;
+set global query_cache_size=100;
+set global query_cache_type=demand;
+set read_buffer_size=100;
+set read_rnd_buffer_size=100;
+set global rpl_recovery_rank=100;
+set global safe_show_database=1;
+set global server_id=100;
+set global slave_net_timeout=100;
+set global slow_launch_time=100;
+set sort_buffer_size=100;
+set sql_auto_is_null=1;
+select @@sql_auto_is_null;
+@@sql_auto_is_null
+1
+set @@sql_auto_is_null=0;
+select @@sql_auto_is_null;
+@@sql_auto_is_null
+0
+set sql_big_selects=1;
+set sql_big_tables=1;
+set sql_buffer_result=1;
+set sql_log_bin=1;
+set sql_log_off=1;
+set sql_log_update=1;
+set sql_low_priority_updates=1;
+set sql_max_join_size=200;
+select @@sql_max_join_size,@@max_join_size;
+@@sql_max_join_size @@max_join_size
+200 200
+set sql_quote_show_create=1;
+set sql_safe_updates=1;
+set sql_select_limit=1;
+set global sql_slave_skip_counter=100;
+set sql_warnings=1;
+set global table_cache=100;
+set table_type=myisam;
+set global thread_cache_size=100;
+set timestamp=1, timestamp=default;
+set tmp_table_size=100;
+set tx_isolation="READ-COMMITTED";
+set wait_timeout=100;
+set log_warnings=1;
+DROP TABLE IF EXISTS t1,t2;
+create table t1 (a int not null auto_increment, primary key(a));
+create table t2 (a int not null auto_increment, primary key(a));
+insert into t1 values(null),(null),(null);
+insert into t2 values(null),(null),(null);
+set global key_buffer_size=100000;
+select @@key_buffer_size;
+@@key_buffer_size
+98304
+select * from t1 where a=2;
+a
+2
+select * from t2 where a=3;
+a
+3
+check table t1,t2;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t2 check status OK
+drop table t1,t2;
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 6fc975a1cb3..1996c793880 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -168,3 +168,23 @@ drop table t1;
create table t1 (a int not null unique, b int unique, c int, d int not null primary key, key(c), e int not null unique);
show keys from t1;
drop table t1;
+
+#
+# Problem with UNIQUE() with NULL parts and auto increment
+#
+
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
+UNIQUE (c,i));
+INSERT INTO t1 (c) VALUES (NULL),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 (c) VALUES ('a'),('a');
+SELECT * FROM t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c CHAR(10) NULL, i INT NOT NULL AUTO_INCREMENT,
+UNIQUE (c,i));
+INSERT INTO t1 (c) VALUES (NULL),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 (c) VALUES ('a'),('a');
+SELECT * FROM t1;
+drop table t1;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index a3227a5db1d..e7633f3bae0 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -139,17 +139,17 @@ drop table t1, t2, t3, t11, t21;
#
# SELECT SQL_CACHE ...
#
-set sql_query_cache_type=demand;
+set query_cache_type=demand;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
select * from t1;
show status like "Qcache_queries_in_cache";
select sql_cache * from t1;
-set sql_query_cache_type=2;
+set query_cache_type=2;
select sql_cache * from t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
-set sql_query_cache_type=on;
+set query_cache_type=on;
#
# RESET QUERY CACHE
#
diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test
index a5496d505f0..6d46124d238 100644
--- a/mysql-test/t/rpl000001.test
+++ b/mysql-test/t/rpl000001.test
@@ -85,7 +85,7 @@ wait_for_slave_to_stop;
# --replace_result 9306 9999 3334 9999 3335 9999
# show slave status;
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
select count(*) from t1;
connection master1;
diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test
index 208e6f0b037..d45fe0870ff 100644
--- a/mysql-test/t/rpl000009.test
+++ b/mysql-test/t/rpl000009.test
@@ -1,5 +1,6 @@
-#this one assumes we are ignoring updates on tables in database foo, but doing
-#the ones in database bar
+# This one assumes we are ignoring updates on tables in database foo, but doing
+# the ones in database bar
+
source include/master-slave.inc;
connection master;
drop database if exists foo;
@@ -32,9 +33,10 @@ sync_with_master;
drop database if exists bar;
drop database if exists foo;
-#now let's test load data from master
+# Now let's test load data from master
+
+# First create some databases and tables on the master
-#first create some databases and tables on the master
connection master;
set sql_log_bin = 0;
create database foo;
@@ -55,11 +57,11 @@ save_master_pos;
connection slave;
sync_with_master;
-#this should show that the slave is empty at this point
+# This should show that the slave is empty at this point
show databases;
load data from master;
-#now let's check if we have the right tables and the right data in them
+# Now let's check if we have the right tables and the right data in them
show databases;
use foo;
show tables;
@@ -68,7 +70,7 @@ show tables;
select * from bar.t1;
select * from bar.t2;
-#now let's see if replication works
+# Now let's see if replication works
connection master;
insert into bar.t1 values (4, 'four bar');
save_master_pos;
@@ -76,7 +78,7 @@ connection slave;
sync_with_master;
select * from bar.t1;
-#now time for cleanup
+# Now time for cleanup
connection master;
drop database bar;
drop database foo;
diff --git a/mysql-test/t/rpl000016.test b/mysql-test/t/rpl000016.test
index 7559b2d3515..b830d0b8d91 100644
--- a/mysql-test/t/rpl000016.test
+++ b/mysql-test/t/rpl000016.test
@@ -54,7 +54,7 @@ sync_with_master;
wait_for_slave_to_stop;
#restart slave skipping one event
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
connection master;
diff --git a/mysql-test/t/rpl_compat.test b/mysql-test/t/rpl_compat.test
index c9455c1e2d2..9c67cce1680 100644
--- a/mysql-test/t/rpl_compat.test
+++ b/mysql-test/t/rpl_compat.test
@@ -58,7 +58,7 @@ sync_with_master ;
#now slave will hit an error
wait_for_slave_to_stop;
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
select count(*) from t1;
connection master1;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index f5a92b05e0d..d13b5dec662 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -88,6 +88,6 @@ insert into t2 values (11),(12),(13),(14),(15);
(select * from t1 limit 2) union (select * from t2 limit 3);
(select * from t1 limit 2) union (select * from t2 limit 20,3);
set SQL_SELECT_LIMIT=2;
-(select * from t1 limit 2) union (select * from t2 limit 3);
+(select * from t1 limit 1) union (select * from t2 limit 3);
set SQL_SELECT_LIMIT=DEFAULT;
drop table t1,t2;
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 70283446fb3..bb1a9b59611 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -1,4 +1,4 @@
-error 1204;
+error 1054;
set @a := foo;
set @a := connection_id() + 3;
select @a - connection_id();
diff --git a/mysql-test/t/variables-master.opt b/mysql-test/t/variables-master.opt
new file mode 100644
index 00000000000..5851d32ec31
--- /dev/null
+++ b/mysql-test/t/variables-master.opt
@@ -0,0 +1 @@
+max_join_size=10
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index b3127402238..967c21f7eab 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -32,9 +32,200 @@ drop table t1;
# Test system variables
#
+set max_join_size=100;
+show variables like 'max_join_size';
+show global variables like 'max_join_size';
+set GLOBAL max_join_size=2000;
+show global variables like 'max_join_size';
+set max_join_size=DEFAULT;
+show variables like 'max_join_size';
+set GLOBAL max_join_size=DEFAULT;
+show global variables like 'max_join_size';
+set @@max_join_size=1000, @@global.max_join_size=2000;
+select @@local.max_join_size, @@global.max_join_size;
+select @@identity, length(@@version)>0;
select @@VERSION=version();
select last_insert_id(345);
-select @@IDENTITY,last_insert_id();
-select @@identity;
+select @@IDENTITY,last_insert_id(), @@identity;
+
+set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
+
+set global concurrent_insert=ON;
+show variables like 'concurrent_insert';
+set global concurrent_insert=1;
+show variables like 'concurrent_insert';
+set global concurrent_insert=0;
+show variables like 'concurrent_insert';
+set global concurrent_insert=OFF;
+show variables like 'concurrent_insert';
+set global concurrent_insert=DEFAULT;
+show variables like 'concurrent_insert';
+
+set table_type=MYISAM, table_type="HEAP", global table_type="INNODB";
+show local variables like 'table_type';
+show global variables like 'table_type';
+set GLOBAL query_cache_size=100000;
+set GLOBAL safe_show_database=0;
+
+set myisam_max_sort_file_size=10000, GLOBAL myisam_max_sort_file_size=20000;
+show variables like 'myisam_max_sort_file_size';
+show global variables like 'myisam_max_sort_file_size';
+set myisam_max_sort_file_size=default;
+show variables like 'myisam_max_sort_file_size';
+
+set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
+set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
+show global variables like 'net_%';
+show session variables like 'net_%';
+set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
+show global variables like 'net_%';
+show session variables like 'net_%';
+set net_buffer_length=1;
+show variables like 'net_buffer_length';
+set net_buffer_length=2000000000;
+show variables like 'net_buffer_length';
+
+set GLOBAL character set cp1251_koi8;
+show global variables like "convert_character_set";
+set character set cp1251_koi8;
+show variables like "convert_character_set";
+set global character set default, session character set default;
+show variables like "convert_character_set";
+select @@timestamp>0;
+
+# The following should give errors
+
+--error 1231
+set big_tables=OFFF;
+--error 1231
+set big_tables="OFFF";
--error 1193
-select @@unknown_variable;
+set unknown_variable=1;
+--error 1232
+set max_join_size="hello";
+--error 1231
+set table_type=UNKNOWN_TABLE_TYPE;
+--error 1231
+set table_type=INNODB, big_tables=2;
+show local variables like 'table_type';
+--error 1229
+set SESSION query_cache_size=10000;
+--error 1230
+set GLOBAL table_type=DEFAULT;
+--error 1115
+set convert_character_set=UNKNOWN_CHARACTER_SET;
+--error 1115
+set character set unknown;
+--error 1232
+set character set 0;
+--error 1228
+set global autocommit=1;
+--error 1228
+select @@global.timestamp;
+--error 1193
+set @@version='';
+--error 1229
+set @@concurrent_insert=1;
+--error 1228
+set @@global.sql_auto_is_null=1;
+--error 1228
+select @@global.sql_auto_is_null;
+
+# Test setting all variables
+
+set autocommit=1;
+set big_tables=1;
+select @@autocommit, @@big_tables;
+set global binlog_cache_size=100;
+set bulk_insert_buffer_size=100;
+set convert_character_set=cp1251_koi8;
+set convert_character_set=default;
+set @@global.concurrent_insert=1;
+set global connect_timeout=100;
+set global delay_key_write=1;
+set global delayed_insert_limit=100;
+set global delayed_insert_timeout=100;
+set global delayed_queue_size=100;
+set global flush=1;
+set global flush_time=100;
+set insert_id=1;
+set interactive_timeout=100;
+set join_buffer_size=100;
+set last_insert_id=1;
+set global local_infile=1;
+set long_query_time=100;
+set low_priority_updates=1;
+set max_allowed_packet=100;
+set global max_binlog_cache_size=100;
+set global max_binlog_size=100;
+set global max_connect_errors=100;
+set global max_connections=100;
+set global max_delayed_threads=100;
+set max_heap_table_size=100;
+set max_join_size=100;
+set max_sort_length=100;
+set max_tmp_tables=100;
+set global max_user_connections=100;
+select @@max_user_connections;
+set global max_write_lock_count=100;
+set myisam_max_extra_sort_file_size=100;
+select @@myisam_max_extra_sort_file_size;
+set myisam_max_sort_file_size=100;
+set myisam_sort_buffer_size=100;
+set net_buffer_length=100;
+set net_read_timeout=100;
+set net_write_timeout=100;
+set global query_cache_limit=100;
+set global query_cache_size=100;
+set global query_cache_type=demand;
+set read_buffer_size=100;
+set read_rnd_buffer_size=100;
+set global rpl_recovery_rank=100;
+set global safe_show_database=1;
+set global server_id=100;
+set global slave_net_timeout=100;
+set global slow_launch_time=100;
+set sort_buffer_size=100;
+set sql_auto_is_null=1;
+select @@sql_auto_is_null;
+set @@sql_auto_is_null=0;
+select @@sql_auto_is_null;
+set sql_big_selects=1;
+set sql_big_tables=1;
+set sql_buffer_result=1;
+set sql_log_bin=1;
+set sql_log_off=1;
+set sql_log_update=1;
+set sql_low_priority_updates=1;
+set sql_max_join_size=200;
+select @@sql_max_join_size,@@max_join_size;
+set sql_quote_show_create=1;
+set sql_safe_updates=1;
+set sql_select_limit=1;
+set global sql_slave_skip_counter=100;
+set sql_warnings=1;
+set global table_cache=100;
+set table_type=myisam;
+set global thread_cache_size=100;
+set timestamp=1, timestamp=default;
+set tmp_table_size=100;
+set tx_isolation="READ-COMMITTED";
+set wait_timeout=100;
+set log_warnings=1;
+
+#
+# key buffer
+#
+
+DROP TABLE IF EXISTS t1,t2;
+create table t1 (a int not null auto_increment, primary key(a));
+create table t2 (a int not null auto_increment, primary key(a));
+insert into t1 values(null),(null),(null);
+insert into t2 values(null),(null),(null);
+set global key_buffer_size=100000;
+select @@key_buffer_size;
+select * from t1 where a=2;
+select * from t2 where a=3;
+check table t1,t2;
+drop table t1,t2;
+