Commit a5e248d4 authored by Horst Hunger's avatar Horst Hunger

Final fix for bug#38349: Did the changes due to the 2 reviews.

- Updated slow_query_log_file_basic and general_log_file basis instead of the func version as
the func version run good but the basic versions fail.
- Sent innodb.test to dev@innodb.com.
- variables.test has differences probably due to a bug in mtr or in the SET statement (see bug#39369).
- general_log_file_basic.test and slow_query_log_file_bsaic.test have differences, which might be 
produced by the new mtr (see bug#38124).
parent 54eff66e
'#---------------------BS_STVARS_002_01----------------------#' '#---------------------BS_STVARS_002_01----------------------#'
SET @start_value= @@global.binlog_format;
SELECT COUNT(@@GLOBAL.binlog_format); SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format) COUNT(@@GLOBAL.binlog_format)
1 1
...@@ -9,19 +10,13 @@ COUNT(@@SESSION.binlog_format) ...@@ -9,19 +10,13 @@ COUNT(@@SESSION.binlog_format)
1 Expected 1 Expected
'#---------------------BS_STVARS_002_02----------------------#' '#---------------------BS_STVARS_002_02----------------------#'
SET @@GLOBAL.binlog_format=1; SET @@GLOBAL.binlog_format=1;
Expected error 'Read only variable' SELECT @@GLOBAL.binlog_format;
Bug: Writeable static variable @@GLOBAL.binlog_format
SELECT COUNT(@@GLOBAL.binlog_format); STATEMENT
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SET @@SESSION.binlog_format=1; SET @@SESSION.binlog_format=1;
Expected error 'Read only variable' SELECT @@SESSION.binlog_format;
Bug: Writeable static variable @@SESSION.binlog_format
SELECT COUNT(@@SESSION.binlog_format); STATEMENT
COUNT(@@SESSION.binlog_format)
1
1 Expected
'#---------------------BS_STVARS_002_03----------------------#' '#---------------------BS_STVARS_002_03----------------------#'
SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
...@@ -73,3 +68,4 @@ SELECT COUNT(@@GLOBAL.binlog_format); ...@@ -73,3 +68,4 @@ SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format) COUNT(@@GLOBAL.binlog_format)
1 1
1 Expected 1 Expected
SET @@global.binlog_format= @start_value;
...@@ -15,7 +15,7 @@ utf8 ...@@ -15,7 +15,7 @@ utf8
'#--------------------FN_DYNVARS_011_02-------------------------#' '#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default' 'connection default'
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1(b CHAR(40) character set utf8); CREATE TABLE t1(b CHAR(40) CHARACTER SET utf8);
'--verify that character_set_connection converts character_set_client--' '--verify that character_set_connection converts character_set_client--'
SET @@session.character_set_client = utf8; SET @@session.character_set_client = utf8;
SET @@session.character_set_results = utf8; SET @@session.character_set_results = utf8;
...@@ -53,3 +53,4 @@ SET @@global.character_set_connection = @global_character_set_connection; ...@@ -53,3 +53,4 @@ SET @@global.character_set_connection = @global_character_set_connection;
SET @@session.character_set_connection = @session_character_set_connection; SET @@session.character_set_connection = @session_character_set_connection;
SET @@session.character_set_client = @session_character_set_client; SET @@session.character_set_client = @session_character_set_client;
SET @@session.character_set_results = @session_character_set_results; SET @@session.character_set_results = @session_character_set_results;
DROP TABLE t1;
drop table if exists t1; DROP TABLE IF EXISTS t1;
## Creating new table ## ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
id INT NOT NULL auto_increment, id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id), PRIMARY KEY (id),
name varchar(30) name VARCHAR(30)
) ENGINE = INNODB; ) ENGINE = INNODB;
'#--------------------FN_DYNVARS_017_01-------------------------#' '#--------------------FN_DYNVARS_017_01-------------------------#'
## Creating new connection ## ## Creating new connection ##
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
SET @@autocommit = 0; SET @@autocommit = 0;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
## Setting value of variable to 0 ## ## Setting value of variable to 0 ##
SET @@session.completion_type = 0; SET @@session.completion_type = 0;
## Here commit & rollback should work normally ## ## Here commit & rollback should work normally ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
2 Record_2 2 Record_2
3 Record_3 3 Record_3
DELETE FROM t1 where id = 2; DELETE FROM t1 WHERE id = 2;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
3 Record_3 3 Record_3
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
3 Record_3 3 Record_3
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
INSERT into t1(name) values('Record_5'); INSERT INTO t1(name) VALUES('Record_5');
COMMIT; COMMIT;
'#--------------------FN_DYNVARS_017_02-------------------------#' '#--------------------FN_DYNVARS_017_02-------------------------#'
SET @@session.completion_type = 2; SET @@session.completion_type = 2;
## Here commit should work as COMMIT RELEASE ## ## Here commit should work as COMMIT RELEASE ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
3 Record_3 3 Record_3
4 Record_4 4 Record_4
5 Record_5 5 Record_5
INSERT into t1(name) values('Record_6'); INSERT INTO t1(name) VALUES('Record_6');
INSERT into t1(name) values('Record_7'); INSERT INTO t1(name) VALUES('Record_7');
COMMIT; COMMIT;
## Inserting rows should give error here because connection should ## ## Inserting rows should give error here because connection should ##
## disconnect after using COMMIT ## ## disconnect after using COMMIT ##
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
Got one of the listed errors Got one of the listed errors
## Creating new connection test_con2 ## ## Creating new connection test_con2 ##
SET @@session.completion_type = 2; SET @@session.completion_type = 2;
## Inserting rows and using Rollback which should Rollback & release ## ## Inserting rows and using Rollback which should Rollback & release ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
3 Record_3 3 Record_3
...@@ -69,8 +69,9 @@ id name ...@@ -69,8 +69,9 @@ id name
5 Record_5 5 Record_5
6 Record_6 6 Record_6
7 Record_7 7 Record_7
INSERT into t1(name) values('Record_8'); INSERT INTO t1(name) VALUES('Record_8');
INSERT into t1(name) values('Record_9'); INSERT INTO t1(name) VALUES('Record_9');
ROLLBACK; ROLLBACK;
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
Got one of the listed errors Got one of the listed errors
DROP TABLE t1;
drop table if exists t1; DROP TABLE IF EXISTS t1;
## Creating new table ## ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
name varchar(30) name VARCHAR(30)
); );
'#--------------------FN_DYNVARS_018_01-------------------------#' '#--------------------FN_DYNVARS_018_01-------------------------#'
SET @start_value= @@global.concurrent_insert;
## Setting initial value of variable to 1 ## ## Setting initial value of variable to 1 ##
SET @@global.concurrent_insert = 1; SET @@global.concurrent_insert = 1;
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
## locking table ## ## locking table ##
lock table t1 read local; LOCK TABLE t1 READ LOCAL;
## Creating new connection to insert some rows in table ## ## Creating new connection to insert some rows in table ##
connection test_con1;
## New records should come at the end of all rows ## ## New records should come at the end of all rows ##
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_2 Record_2
Record_3 Record_3
Record_4 Record_4
## unlocking tables ## ## unlocking tables ##
unlock tables; connection default;
UNLOCK TABLES;
## deleting record to create hole in table ## ## deleting record to create hole in table ##
DELETE from t1 where name ='Record_2'; DELETE FROM t1 WHERE name ='Record_2';
'#--------------------FN_DYNVARS_018_02-------------------------#' '#--------------------FN_DYNVARS_018_02-------------------------#'
LOCK TABLE t1 READ LOCAL;
connection test_con1;
SET @@global.concurrent_insert=1;
## send INSERT which should be blocked until unlock of the table ##
INSERT INTO t1(name) VALUES('Record_7');
connection default;
## show processlist info and state ##
SELECT state,info FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE state= "Locked" AND info LIKE "INSERT INTO t1%";
state info
Locked INSERT INTO t1(name) VALUES('Record_7')
## table contents befor UNLOCK ##
SELECT * FROM t1;
name
Record_1
Record_3
Record_4
UNLOCK TABLES;
## table contens after UNLOCK ##
SELECT * FROM t1;
name
Record_1
Record_7
Record_3
Record_4
INSERT INTO t1(name) VALUES('Record_6');
connection test_con1;
SELECT * FROM t1;
name
Record_1
Record_7
Record_3
Record_4
Record_6
connection default;
'#--------------------FN_DYNVARS_018_03-------------------------#' '#--------------------FN_DYNVARS_018_03-------------------------#'
## lock table and connect with connection1 ## ## lock table and connect with connection1 ##
lock table t1 read local; LOCK TABLE t1 READ LOCAL;
connection test_con1;
## setting value of concurrent_insert to 2 ## ## setting value of concurrent_insert to 2 ##
SET @@global.concurrent_insert=2; SET @@global.concurrent_insert=2;
## Inserting record in table, record should go at the end of the table ## ## Inserting record in table, record should go at the end of the table ##
INSERT into t1(name) values('Record_5'); INSERT INTO t1(name) VALUES('Record_5');
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_7
Record_3 Record_3
Record_4 Record_4
Record_6
Record_5 Record_5
SELECT @@concurrent_insert; SELECT @@concurrent_insert;
@@concurrent_insert @@concurrent_insert
2 2
## Switching to default connection ## connection default;
## Unlocking table ## ## Unlocking table ##
unlock tables; UNLOCK TABLES;
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_7
Record_3 Record_3
Record_4 Record_4
Record_6
Record_5 Record_5
## Inserting new row, this should go in the hole ## ## Inserting new row, this should go in the hole ##
INSERT into t1(name) values('Record_6'); INSERT INTO t1(name) VALUES('Record_6');
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_6 Record_7
Record_3 Record_3
Record_4 Record_4
Record_6
Record_5 Record_5
Record_6
## connection test_con1 ## ## connection test_con1 ##
DELETE from t1 where name ='Record_3'; DELETE FROM t1 WHERE name ='Record_3';
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_6 Record_7
Record_4 Record_4
Record_6
Record_5 Record_5
Record_6
## Dropping table ## ## Dropping table ##
DROP table t1; DROP TABLE t1;
## Disconnecting connection ## ## Disconnecting connection ##
SET @@global.concurrent_insert= @start_value;
'#--------------------FN_DYNVARS_023_01-------------------------#' '#--------------------FN_DYNVARS_023_01-------------------------#'
SET @start_value= @@global.delay_key_write;
SET @@global.delay_key_write = ON; SET @@global.delay_key_write = ON;
SELECT @@global.delay_key_write; SELECT @@global.delay_key_write;
@@global.delay_key_write @@global.delay_key_write
...@@ -28,8 +29,8 @@ Key_writes 9 ...@@ -28,8 +29,8 @@ Key_writes 9
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value Variable_name Value
Key_write_requests 9 Key_write_requests 9
select count(*) from t1; SELECT COUNT(*) FROM t1;
count(*) COUNT(*)
9 9
'----check when delay_key_write is ON---' '----check when delay_key_write is ON---'
SET @@global.delay_key_write = ON; SET @@global.delay_key_write = ON;
...@@ -44,8 +45,8 @@ Key_writes 0 ...@@ -44,8 +45,8 @@ Key_writes 0
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value Variable_name Value
Key_write_requests 9 Key_write_requests 9
select count(*) from t1; SELECT COUNT(*) FROM t1;
count(*) COUNT(*)
9 9
'----check when delay_key_write is ALL---' '----check when delay_key_write is ALL---'
SET @@global.delay_key_write = ALL; SET @@global.delay_key_write = ALL;
...@@ -60,8 +61,9 @@ Key_writes 0 ...@@ -60,8 +61,9 @@ Key_writes 0
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value Variable_name Value
Key_write_requests 9 Key_write_requests 9
select count(*) from t1; SELECT COUNT(*) FROM t1;
count(*) COUNT(*)
9 9
DROP PROCEDURE sp_addRecords; DROP PROCEDURE sp_addRecords;
DROP TABLE t1; DROP TABLE t1;
SET @@global.delay_key_write= @start_value;
...@@ -17,3 +17,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES ...@@ -17,3 +17,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='general_log_file'; WHERE VARIABLE_NAME='general_log_file';
@@global.general_log_file = VARIABLE_VALUE @@global.general_log_file = VARIABLE_VALUE
1 1
SET @@global.general_log_file= @start_value;
drop table if exists t1; DROP TABLE IF EXISTS t1;
## Creating new table ## ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
id INT NOT NULL auto_increment, id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id), PRIMARY KEY (id),
name VARCHAR(30) name VARCHAR(30)
); );
...@@ -10,10 +10,10 @@ name VARCHAR(30) ...@@ -10,10 +10,10 @@ name VARCHAR(30)
SELECT @@general_log_file; SELECT @@general_log_file;
@@general_log_file @@general_log_file
mysql-test.log mysql-test.log
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
## Verifying general log file ## ## Verifying general log file ##
## Dropping table ## ## Dropping table ##
DROP TABLE t1; DROP TABLE t1;
SET @global_start_value = @@global.innodb_autoextend_increment ; SET @global_start_value = @@global.innodb_autoextend_increment ;
SELECT @global_start_value;
@global_start_value
8
'#--------------------FN_DYNVARS_046_01------------------------#' '#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_autoextend_increment = 0; SET @@global.innodb_autoextend_increment = 0;
Warnings: Warnings:
...@@ -92,3 +89,4 @@ Warning 1292 Truncated incorrect autoextend_increment value: '0' ...@@ -92,3 +89,4 @@ Warning 1292 Truncated incorrect autoextend_increment value: '0'
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment @@global.innodb_autoextend_increment
1 1
SET @@global.innodb_autoextend_increment = @global_start_value;
...@@ -9,14 +9,15 @@ DROP TABLE IF EXISTS t1; ...@@ -9,14 +9,15 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1( CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY, a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR b CHAR
)ENGINE=INNODB, AUTO_INCREMENT=100; ) ENGINE=INNODB, AUTO_INCREMENT=100;
INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d'); INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d');
INSERT INTO t1 (a,b) VALUES (NULL,'e'); INSERT INTO t1 (a,b) VALUES (NULL,'e');
'the new auto incremented value should be 104' 'the new auto incremented value should be 104'
SELECT * from t1; SELECT * FROM t1;
a b a b
1 c 1 c
5 a 5 a
100 b 100 b
101 d 101 d
104 e 104 e
DROP TABLE t1;
...@@ -125,3 +125,7 @@ SET @@global.innodb_fast_shutdown = FALSE; ...@@ -125,3 +125,7 @@ SET @@global.innodb_fast_shutdown = FALSE;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown @@global.innodb_fast_shutdown
0 0
SET @@global.innodb_fast_shutdown = @global_start_value;
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
1
SET @start_value= @@global.innodb_max_dirty_pages_pct;
'#--------------------FN_DYNVARS_044_02-------------------------#' '#--------------------FN_DYNVARS_044_02-------------------------#'
SET @old_innodb_max_dirty_pages_pct= @@global.innodb_max_dirty_pages_pct;
SET @@global.innodb_max_dirty_pages_pct = 80; SET @@global.innodb_max_dirty_pages_pct = 80;
'connect (con1,localhost,root,,,,)' 'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.innodb_max_dirty_pages_pct; SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct @@global.innodb_max_dirty_pages_pct
80 80
SET @@global.innodb_max_dirty_pages_pct = 70; SET @@global.innodb_max_dirty_pages_pct = 70;
'connect (con2,localhost,root,,,,)' 'connect (con2,localhost,root,,,,)'
'connection con2'
SELECT @@global.innodb_max_dirty_pages_pct; SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct @@global.innodb_max_dirty_pages_pct
70 70
...@@ -20,7 +18,6 @@ FLUSH STATUS; ...@@ -20,7 +18,6 @@ FLUSH STATUS;
CALL add_until(10); CALL add_until(10);
FLUSH TABLES; FLUSH TABLES;
CALL add_records(500); CALL add_records(500);
'--sleep 5'
'We expect dirty pages pct to be BELOW_MAX' 'We expect dirty pages pct to be BELOW_MAX'
CALL check_pct(10); CALL check_pct(10);
PCT_VALUE PCT_VALUE
...@@ -30,4 +27,4 @@ DROP PROCEDURE add_until; ...@@ -30,4 +27,4 @@ DROP PROCEDURE add_until;
DROP PROCEDURE check_pct; DROP PROCEDURE check_pct;
DROP FUNCTION dirty_pct; DROP FUNCTION dirty_pct;
DROP TABLE t1; DROP TABLE t1;
SET @@global.innodb_max_dirty_pages_pct = @old_innodb_max_dirty_pages_pct; SET @@global.innodb_max_dirty_pages_pct= @start_value;
'#--------------------FN_DYNVARS_048_01-------------------------#' '#--------------------FN_DYNVARS_048_01-------------------------#'
SET @start_value= @@global.innodb_table_locks;
SELECT @start_value;
@start_value
1
SET @@global.innodb_table_locks = OFF; SET @@global.innodb_table_locks = OFF;
'connect (con1,localhost,root,,,,)' 'connect (con1,localhost,root,,,,)'
'connection con1' 'connection con1'
...@@ -30,3 +34,7 @@ COMMIT; ...@@ -30,3 +34,7 @@ COMMIT;
'CONNECTION con2' 'CONNECTION con2'
UNLOCK tables; UNLOCK tables;
DROP TABLE t1; DROP TABLE t1;
SET @@global.innodb_table_locks= @start_value;
SELECT @@global.innodb_table_locks;
@@global.innodb_table_locks
1
...@@ -393,6 +393,7 @@ id c1 cnt ...@@ -393,6 +393,7 @@ id c1 cnt
1 0 3 1 0 3
2 2 1 2 2 1
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2;
create table t1(f1 int primary key, create table t1(f1 int primary key,
f2 timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP); f2 timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP);
insert into t1(f1) values(1); insert into t1(f1) values(1);
......
drop table if exists t1; DROP TABLE IF EXISTS t1;
## Creating new table t1 ## ## Creating new table t1 ##
CREATE TABLE t1 CREATE TABLE t1
( (
id INT NOT NULL auto_increment, id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id), PRIMARY KEY (id),
rollno int NOT NULL, rollno INT NOT NULL,
name VARCHAR(30) name VARCHAR(30)
); );
SET @start_value= @@global.key_buffer_size;
FLUSH STATUS; FLUSH STATUS;
'#--------------------FN_DYNVARS_055_01-------------------------#' '#--------------------FN_DYNVARS_055_01-------------------------#'
## Setting initial value of variable to 131072 ## ## Setting initial value of variable to 131072 ##
...@@ -18,19 +19,43 @@ SELECT @@global.key_buffer_size; ...@@ -18,19 +19,43 @@ SELECT @@global.key_buffer_size;
@@global.key_buffer_size @@global.key_buffer_size
131072 131072
## Inserting some rows in table ## ## Inserting some rows in table ##
INSERT into t1(rollno, name) values(1, 'Record_1'); INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
INSERT into t1(rollno, name) values(2, 'Record_2'); INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
INSERT into t1(rollno, name) values(1, 'Record_3'); INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
INSERT into t1(rollno, name) values(3, 'Record_4'); INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
INSERT into t1(rollno, name) values(1, 'Record_5'); INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
INSERT into t1(rollno, name) values(3, 'Record_6'); INSERT INTO t1(rollno, name) VALUES(3, 'Record_6');
INSERT into t1(rollno, name) values(4, 'Record_7'); INSERT INTO t1(rollno, name) VALUES(4, 'Record_7');
INSERT into t1(rollno, name) values(4, 'Record_8'); INSERT INTO t1(rollno, name) VALUES(4, 'Record_8');
INSERT into t1(rollno, name) values(4, 'Record_9'); INSERT INTO t1(rollno, name) VALUES(4, 'Record_9');
INSERT into t1(rollno, name) values(4, 'Record_10'); INSERT INTO t1(rollno, name) VALUES(4, 'Record_10');
## Verifying status of reading & writing variables ## ## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
Variable_name Value
Key_reads 0
## Switching to connection test_con2 ## ## Switching to connection test_con2 ##
## Verifying status of reading & writing variables ## ## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
Variable_name Value
Key_reads 0
SET @@global.key_buffer_size = 36;
## Connecting with connection test_con1 ##
## Inserting some rows in table ##
INSERT INTO t1(rollno, name) VALUES(5, 'Record_11');
INSERT INTO t1(rollno, name) VALUES(6, 'Record_12');
INSERT INTO t1(rollno, name) VALUES(5, 'Record_13');
INSERT INTO t1(rollno, name) VALUES(7, 'Record_14');
INSERT INTO t1(rollno, name) VALUES(5, 'Record_15');
INSERT INTO t1(rollno, name) VALUES(7, 'Record_16');
INSERT INTO t1(rollno, name) VALUES(8, 'Record_17');
INSERT INTO t1(rollno, name) VALUES(8, 'Record_18');
INSERT INTO t1(rollno, name) VALUES(8, 'Record_19');
INSERT INTO t1(rollno, name) VALUES(8, 'Record_20');
## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
Variable_name Value
Key_reads 10
## Dropping table ## ## Dropping table ##
DROP table if exists t1; DROP TABLE IF EXISTS t1;
## Disconnecting both the connections ## ## Disconnecting both the connections ##
SET @@global.key_buffer_size= @start_value;
'#--------------------FN_DYNVARS_062_01------------------#' '#--------------------FN_DYNVARS_062_01------------------#'
SET @start_log= @@global.log;
SELECT @@global.log AS INIT_VALUE; SELECT @@global.log AS INIT_VALUE;
INIT_VALUE INIT_VALUE
1 1
...@@ -15,3 +16,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES ...@@ -15,3 +16,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='log'; WHERE VARIABLE_NAME='log';
VARIABLE_VALUE VARIABLE_VALUE
OFF OFF
SET @@global.log= @start_log;
drop table if exists t1; drop table if exists t1;
'#--------------------FN_DYNVARS_063_01-------------------------#' '#--------------------FN_DYNVARS_063_01-------------------------#'
SET @start_value= @@global.log_bin_trust_function_creators;
## Creating new user tt ## ## Creating new user tt ##
CREATE user tt@localhost; CREATE USER tt@localhost;
## Setting value of variable to 0 ## ## Setting value of variable to 0 ##
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET @@global.log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators = 0;
## Creating new table t2 ## ## Creating new table t2 ##
create table t2 (a INT); CREATE TABLE t2 (a INT);
## Creating & connecting with new connection test_con1 ## ## Creating & connecting with new connection test_con1 ##
SELECT @@log_bin_trust_function_creators; SELECT @@log_bin_trust_function_creators;
@@log_bin_trust_function_creators @@log_bin_trust_function_creators
...@@ -34,8 +34,8 @@ f1(a) ...@@ -34,8 +34,8 @@ f1(a)
1 1
1 1
## Dropping function f1 & table t1 ## ## Dropping function f1 & table t1 ##
drop function f1; DROP FUNCTION f1;
drop table t1; DROP TABLE t1;
'#--------------------FN_DYNVARS_063_02-------------------------#' '#--------------------FN_DYNVARS_063_02-------------------------#'
## Switching to default connection ## ## Switching to default connection ##
## Setting value of variable to 1 ## ## Setting value of variable to 1 ##
...@@ -66,9 +66,9 @@ f1(a) ...@@ -66,9 +66,9 @@ f1(a)
1 1
1 1
## Dropping function f1 ## ## Dropping function f1 ##
drop function f1; DROP FUNCTION f1;
## Dropping table t1 & t2 ## ## Dropping table t1 & t2 ##
drop table t1,t2; DROP TABLE t1,t2;
## Disconnecting both the connections ## ## Disconnecting test_con2##
DROP USER tt@localhost; DROP USER tt@localhost;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; SET @@global.log_bin_trust_function_creators= @start_value;
'#---------------------BS_STVARS_041_01----------------------#' SET @start_value= @@global.log_queries_not_using_indexes;
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes); SET @@global.log_queries_not_using_indexes= DEFAULT;
COUNT(@@GLOBAL.log_queries_not_using_indexes) SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
SET @@global.log_queries_not_using_indexes= TRUE;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
1 1
1 Expected SET @@global.log_queries_not_using_indexes= true;
'#---------------------BS_STVARS_041_02----------------------#' SELECT @@global.log_queries_not_using_indexes;
SET @@GLOBAL.log_queries_not_using_indexes=1; @@global.log_queries_not_using_indexes
Expected error 'Read only variable'
"BUG:It should give error on setting this variable as it is readonly variable"
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
COUNT(@@GLOBAL.log_queries_not_using_indexes)
1 1
1 Expected SET @@global.log_queries_not_using_indexes= 0;
'#---------------------BS_STVARS_041_03----------------------#' SELECT @@global.log_queries_not_using_indexes;
SELECT @@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE @@global.log_queries_not_using_indexes
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 0
WHERE VARIABLE_NAME='log_queries_not_using_indexes'; SET @@global.log_queries_not_using_indexes= 1;
@@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE SELECT @@global.log_queries_not_using_indexes;
0 @@global.log_queries_not_using_indexes
1 Expected
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
COUNT(@@GLOBAL.log_queries_not_using_indexes)
1 1
1 Expected SET @goodvar= TRUE;
SELECT COUNT(VARIABLE_VALUE) SET @@global.log_queries_not_using_indexes= @goodvar;
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES SELECT @@global.log_queries_not_using_indexes;
WHERE VARIABLE_NAME='log_queries_not_using_indexes'; @@global.log_queries_not_using_indexes
COUNT(VARIABLE_VALUE)
1 1
1 Expected SET GLOBAL log_queries_not_using_indexes= DEFAULT;
'#---------------------BS_STVARS_041_04----------------------#' SELECT @@global.log_queries_not_using_indexes;
SELECT @@log_queries_not_using_indexes = @@GLOBAL.log_queries_not_using_indexes; @@global.log_queries_not_using_indexes
@@log_queries_not_using_indexes = @@GLOBAL.log_queries_not_using_indexes 0
SET GLOBAL log_queries_not_using_indexes= ON;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
1 1
1 Expected SET GLOBAL log_queries_not_using_indexes= OFF;
'#---------------------BS_STVARS_041_05----------------------#' SELECT @@global.log_queries_not_using_indexes;
SELECT COUNT(@@log_queries_not_using_indexes); @@global.log_queries_not_using_indexes
COUNT(@@log_queries_not_using_indexes) 0
SET GLOBAL log_queries_not_using_indexes= -0;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
SET GLOBAL log_queries_not_using_indexes= 0.00;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
SET GLOBAL log_queries_not_using_indexes= -0.0;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
SET GLOBAL log_queries_not_using_indexes= 001.00;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
1 1
1 Expected SET GLOBAL log_queries_not_using_indexes= +1.0;
SELECT COUNT(@@local.log_queries_not_using_indexes); SELECT @@global.log_queries_not_using_indexes;
ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable @@global.log_queries_not_using_indexes
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.log_queries_not_using_indexes);
ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
COUNT(@@GLOBAL.log_queries_not_using_indexes)
1 1
1 Expected SET GLOBAL log_queries_not_using_indexes= +0;
SELECT log_queries_not_using_indexes = @@SESSION.log_queries_not_using_indexes; SELECT @@global.log_queries_not_using_indexes;
ERROR 42S22: Unknown column 'log_queries_not_using_indexes' in 'field list' @@global.log_queries_not_using_indexes
Expected error 'Readonly variable' 0
SET GLOBAL log_queries_not_using_indexes= +0.000000;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
SET GLOBAL log_queries_not_using_indexes= 0000.00000;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
SET GLOBAL log_queries_not_using_indexes= .0;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
SET @@global.log_queries_not_using_indexes= 'DEFAULT';
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'DEFAULT'
SET @@global.log_queries_not_using_indexes= 'true';
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'true'
SET @@global.log_queries_not_using_indexes= BLABLA;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'BLABLA'
SET @@global.log_queries_not_using_indexes= 25;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '25'
SET @@global.log_queries_not_using_indexes= 12.34;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '12'
SET GLOBAL log_queries_not_using_indexes= -1;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '-1'
SET @badvar= 'true';
SET @@global.log_queries_not_using_indexes= @badvar;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'true'
SET GLOBAL log_queries_not_using_indexes= 'DEFAULT';
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'DEFAULT'
SET log_queries_not_using_indexes= TRUE;
ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION log_queries_not_using_indexes= TRUE;
ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
SET @@session.log_queries_not_using_indexes= TRUE;
ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
SET LOCAL log_queries_not_using_indexes= TRUE;
ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
SET @@global log_queries_not_using_indexes= TRUE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_queries_not_using_indexes= TRUE' at line 1
SET @@SESSION log_queries_not_using_indexes= TRUE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_queries_not_using_indexes= TRUE' at line 1
SET @@global.log_queries_not_using_indexes= @start_value;
set @start_general_log= @@global.general_log;
set @start_slow_query_log= @@global.slow_query_log;
set @start_general_log_file= @@global.general_log_file;
set global general_log= OFF; set global general_log= OFF;
truncate table mysql.general_log; truncate table mysql.general_log;
truncate table mysql.slow_log; truncate table mysql.slow_log;
...@@ -271,3 +274,6 @@ SET GLOBAL slow_query_log_file = @slow_query_log_file_saved; ...@@ -271,3 +274,6 @@ SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
# -- End of Bug#32748. # -- End of Bug#32748.
End of 5.1 tests End of 5.1 tests
set @@global.general_log= @start_general_log;
set @@global.slow_query_log= @start_slow_query_log;
set @@global.general_log_file= @start_general_log_file;
SET @old_general_log_state = @@global.general_log;
SET @old_slow_log_state = @@global.slow_query_log;
use mysql; use mysql;
truncate table general_log; truncate table general_log;
select * from general_log; select * from general_log;
...@@ -354,6 +356,7 @@ slow_log ...@@ -354,6 +356,7 @@ slow_log
slow_log_new slow_log_new
drop table slow_log_new, general_log_new; drop table slow_log_new, general_log_new;
use test; use test;
SET @my_log_output= @@global.log_output;
SET GLOBAL LOG_OUTPUT = 'TABLE'; SET GLOBAL LOG_OUTPUT = 'TABLE';
SET GLOBAL general_log = 0; SET GLOBAL general_log = 0;
FLUSH LOGS; FLUSH LOGS;
...@@ -422,6 +425,8 @@ SET SESSION long_query_time =@old_long_query_time; ...@@ -422,6 +425,8 @@ SET SESSION long_query_time =@old_long_query_time;
FLUSH LOGS; FLUSH LOGS;
ALTER TABLE mysql.slow_log DROP COLUMN seq; ALTER TABLE mysql.slow_log DROP COLUMN seq;
ALTER TABLE mysql.slow_log ENGINE = CSV; ALTER TABLE mysql.slow_log ENGINE = CSV;
SET GLOBAL general_log = @old_general_log_state;
SET GLOBAL slow_query_log = @old_slow_log_state;
drop procedure if exists proc25422_truncate_slow; drop procedure if exists proc25422_truncate_slow;
drop procedure if exists proc25422_truncate_general; drop procedure if exists proc25422_truncate_general;
drop procedure if exists proc25422_alter_slow; drop procedure if exists proc25422_alter_slow;
...@@ -725,6 +730,8 @@ execute long_query using @lparam; ...@@ -725,6 +730,8 @@ execute long_query using @lparam;
set global general_log = off; set global general_log = off;
select command_type, argument from mysql.general_log where thread_id = @thread_id; select command_type, argument from mysql.general_log where thread_id = @thread_id;
command_type argument command_type argument
Query set @old_general_log_state = @@global.general_log
Query set global general_log = on
Query set @lparam = "000 001 002 003 004 005 006 007 008 009" Query set @lparam = "000 001 002 003 004 005 006 007 008 009"
"010 011 012 013 014 015 016 017 018 019" "010 011 012 013 014 015 016 017 018 019"
"020 021 022 023 024 025 026 027 028 029" "020 021 022 023 024 025 026 027 028 029"
...@@ -858,5 +865,6 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1 ...@@ -858,5 +865,6 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1
TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2 TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2
DROP TABLE t1; DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log; TRUNCATE TABLE mysql.slow_log;
SET GLOBAL log_output= @my_log_output;
SET GLOBAL slow_query_log = @old_slow_log_state; SET GLOBAL slow_query_log = @old_slow_log_state;
SET SESSION long_query_time =@old_long_query_time; SET SESSION long_query_time =@old_long_query_time;
1048576 SET @start_max_allowed_packet= @@global.max_allowed_packet;
SET @start_value= @@global.net_buffer_length;
drop table if exists t1; drop table if exists t1;
## Creating new table t1 ## ## Creating new table t1 ##
CREATE TABLE t1 CREATE TABLE t1
...@@ -42,6 +43,5 @@ SELECT @@global.net_buffer_length; ...@@ -42,6 +43,5 @@ SELECT @@global.net_buffer_length;
## Inserting and fetching data of length greater than 1024 ## ## Inserting and fetching data of length greater than 1024 ##
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"); INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
drop table t1; drop table t1;
SET @@global.max_allowed_packet = 1048576; SET @@global.max_allowed_packet= @start_max_allowed_packet;
## Server disconnects after this case and error occurs that Server ## SET @@global.net_buffer_length= @start_value;
## has gone away ##
drop table if exists t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 CREATE TABLE t1
(a int auto_increment primary key, (a INT AUTO_INCREMENT PRIMARY KEY,
b char(20) b CHAR(20)
); );
SET @start_value= @@global.max_seeks_for_key;
'#--------------------FN_DYNVARS_084_01-------------------------#' '#--------------------FN_DYNVARS_084_01-------------------------#'
SELECT @@global.max_seeks_for_key = 10; SELECT @@global.max_seeks_for_key = 10;
@@global.max_seeks_for_key = 10 @@global.max_seeks_for_key = 10
...@@ -14,8 +15,8 @@ SET @@global.max_seeks_for_key = 20; ...@@ -14,8 +15,8 @@ SET @@global.max_seeks_for_key = 20;
SELECT @@global.max_seeks_for_key; SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key @@global.max_seeks_for_key
20 20
INSERT into t1(b) values("AREc"); INSERT INTO t1(b) VALUES("AREc");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 1 SIMPLE t1 system NULL NULL NULL NULL 1
1 SIMPLE t2 system NULL NULL NULL NULL 1 1 SIMPLE t2 system NULL NULL NULL NULL 1
...@@ -23,9 +24,9 @@ SET @@session.max_seeks_for_key = 2; ...@@ -23,9 +24,9 @@ SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key; SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key @@session.max_seeks_for_key
2 2
INSERT into t1(b) values("BREc"); INSERT INTO t1(b) VALUES("BREc");
INSERT into t1(b) values("CRec"); INSERT INTO t1(b) VALUES("CRec");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 1 SIMPLE t1 ALL NULL NULL NULL NULL 3
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer
...@@ -40,8 +41,8 @@ SET @@global.max_seeks_for_key = 20; ...@@ -40,8 +41,8 @@ SET @@global.max_seeks_for_key = 20;
SELECT @@global.max_seeks_for_key; SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key @@global.max_seeks_for_key
20 20
INSERT into t1(b) values("AREc"); INSERT INTO t1(b) VALUES("AREc");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 1 SIMPLE t1 ALL NULL NULL NULL NULL 4
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer 1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer
...@@ -49,27 +50,28 @@ SET @@session.max_seeks_for_key = 2; ...@@ -49,27 +50,28 @@ SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key; SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key @@session.max_seeks_for_key
2 2
INSERT into t1(b) values("BREc"); INSERT INTO t1(b) VALUES("BREc");
INSERT into t1(b) values("CRec"); INSERT INTO t1(b) VALUES("CRec");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 1 SIMPLE t1 ALL NULL NULL NULL NULL 6
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
INSERT INTO t1 values(null,"test"); INSERT INTO t1 VALUES(null,"test");
INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"), INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a"),(null,"a"), (null,"a"),(null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a"); (null,"a"),(null,"a"),(null,"a");
explain SELECT STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 17 1 SIMPLE t1 ALL NULL NULL NULL NULL 17
1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer 1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer
analyze table t1; ANALYZE TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 analyze status OK test.t1 analyze status OK
SET MAX_SEEKS_FOR_KEY=1; SET MAX_SEEKS_FOR_KEY=1;
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 17 1 SIMPLE t1 ALL NULL NULL NULL NULL 17
1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer 1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer
SET MAX_SEEKS_FOR_KEY=DEFAULT; SET MAX_SEEKS_FOR_KEY=DEFAULT;
drop table t1; DROP TABLE t1;
SET @@global.max_seeks_for_key= @start_value;
SET @start_value= @@global.max_sort_length;
SET @session_max_sort_length = @@Session.max_sort_length; SET @session_max_sort_length = @@Session.max_sort_length;
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
** creating tables ** ** creating tables **
...@@ -296,3 +297,4 @@ SET @@SESSION.max_sort_length = @session_max_sort_length; ...@@ -296,3 +297,4 @@ SET @@SESSION.max_sort_length = @session_max_sort_length;
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t2;
SET @@global.max_sort_length= @start_value;
'#--------------------FN_DYNVARS_093_01-------------------------#' '#--------------------FN_DYNVARS_093_01-------------------------#'
SET @start_value= @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 2; SET @@global.myisam_data_pointer_size = 2;
'connect (con1,localhost,root,,,,)' 'connect (con1,localhost,root,,,,)'
'connection con1' 'connection con1'
...@@ -40,3 +41,4 @@ count(*) ...@@ -40,3 +41,4 @@ count(*)
65536 65536
DROP PROCEDURE sp_addRec; DROP PROCEDURE sp_addRec;
DROP TABLE t1; DROP TABLE t1;
SET @@global.myisam_data_pointer_size= @start_value;
'#--------------------FN_DYNVARS_097_01-------------------------#' '#--------------------FN_DYNVARS_097_01-------------------------#'
SET @start_value = @@global.myisam_stats_method;
SET @@global.myisam_stats_method = nulls_equal; SET @@global.myisam_stats_method = nulls_equal;
'connect (con1,localhost,root,,,,)' 'connect (con1,localhost,root,,,,)'
'connection con1' 'connection con1'
...@@ -11,11 +12,11 @@ nulls_equal ...@@ -11,11 +12,11 @@ nulls_equal
'#--------------------FN_DYNVARS_097_02-------------------------#' '#--------------------FN_DYNVARS_097_02-------------------------#'
'connection default' 'connection default'
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a int, key (a)); CREATE TABLE t1 (a INT, KEY (a));
INSERT INTO t1 VALUES (0),(1),(2),(3),(4); INSERT INTO t1 VALUES (0),(1),(2),(3),(4);
INSERT INTO t1 SELECT NULL FROM t1; INSERT INTO t1 SELECT NULL FROM t1;
'default: NULLs considered unequal' 'default: NULLs considered unequal'
SET myisam_stats_method=nulls_unequal; SET myisam_stats_method = nulls_unequal;
ANALYZE TABLE t1; ANALYZE TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 analyze status OK test.t1 analyze status OK
...@@ -23,7 +24,7 @@ SHOW INDEX FROM t1; ...@@ -23,7 +24,7 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 10 NULL NULL YES BTREE t1 1 a 1 a A 10 NULL NULL YES BTREE
INSERT INTO t1 VALUES (11); INSERT INTO t1 VALUES (11);
DELETE FROM t1 WHERE a=11; DELETE FROM t1 WHERE a = 11;
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -31,9 +32,9 @@ SHOW INDEX FROM t1; ...@@ -31,9 +32,9 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 10 NULL NULL YES BTREE t1 1 a 1 a A 10 NULL NULL YES BTREE
'Set nulls to be equal' 'Set nulls to be equal'
SET myisam_stats_method=nulls_equal; SET myisam_stats_method = nulls_equal;
INSERT INTO t1 VALUES (11); INSERT INTO t1 VALUES (11);
DELETE FROM t1 WHERE a=11; DELETE FROM t1 WHERE a = 11;
ANALYZE TABLE t1; ANALYZE TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 analyze status OK test.t1 analyze status OK
...@@ -41,7 +42,7 @@ SHOW INDEX FROM t1; ...@@ -41,7 +42,7 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 5 NULL NULL YES BTREE t1 1 a 1 a A 5 NULL NULL YES BTREE
INSERT INTO t1 VALUES (11); INSERT INTO t1 VALUES (11);
DELETE FROM t1 WHERE a=11; DELETE FROM t1 WHERE a = 11;
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -49,14 +50,14 @@ SHOW INDEX FROM t1; ...@@ -49,14 +50,14 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 5 NULL NULL YES BTREE t1 1 a 1 a A 5 NULL NULL YES BTREE
'Set nulls to be ignored' 'Set nulls to be ignored'
SET myisam_stats_method=nulls_ignored; SET myisam_stats_method = nulls_ignored;
SHOW variables LIKE 'myisam_stats_method'; SHOW VARIABLES LIKE 'myisam_stats_method';
Variable_name Value Variable_name Value
myisam_stats_method nulls_ignored myisam_stats_method nulls_ignored
drop TABLE t1; DROP TABLE t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a char(3), b char(4), c char(5), d char(6), a CHAR(3), b CHAR(4), c CHAR(5), d CHAR(6),
key(a,b,c,d) KEY(a,b,c,d)
); );
INSERT INTO t1 VALUES ('bcd','def1', NULL, 'zz'); INSERT INTO t1 VALUES ('bcd','def1', NULL, 'zz');
INSERT INTO t1 VALUES ('bcd','def2', NULL, 'zz'); INSERT INTO t1 VALUES ('bcd','def2', NULL, 'zz');
...@@ -81,5 +82,6 @@ t1 1 a 1 a A 0 NULL NULL YES BTREE ...@@ -81,5 +82,6 @@ t1 1 a 1 a A 0 NULL NULL YES BTREE
t1 1 a 2 b A 0 NULL NULL YES BTREE t1 1 a 2 b A 0 NULL NULL YES BTREE
t1 1 a 3 c A 0 NULL NULL YES BTREE t1 1 a 3 c A 0 NULL NULL YES BTREE
t1 1 a 4 d A 0 NULL NULL YES BTREE t1 1 a 4 d A 0 NULL NULL YES BTREE
SET myisam_stats_method=DEFAULT; SET myisam_stats_method = DEFAULT;
DROP TABLE t1; DROP TABLE t1;
SET @@global.myisam_stats_method= @start_value;
...@@ -11,6 +11,7 @@ select @@profiling; ...@@ -11,6 +11,7 @@ select @@profiling;
0 0
set global profiling = ON; set global profiling = ON;
ERROR HY000: Variable 'profiling' is a SESSION variable and can't be used with SET GLOBAL ERROR HY000: Variable 'profiling' is a SESSION variable and can't be used with SET GLOBAL
set @start_value= @@global.profiling_history_size;
set global profiling_history_size=100; set global profiling_history_size=100;
show global variables like 'profil%'; show global variables like 'profil%';
Variable_name Value Variable_name Value
...@@ -412,4 +413,5 @@ Warnings: ...@@ -412,4 +413,5 @@ Warnings:
Note 1051 Unknown table 'test.v1' Note 1051 Unknown table 'test.v1'
drop function if exists f1; drop function if exists f1;
set session profiling = OFF; set session profiling = OFF;
set global profiling_history_size= @start_value;
End of 5.0 tests End of 5.0 tests
** Setup ** ** Setup **
SET @global_query_cache_limit = @@global.query_cache_limit; SET @global_query_cache_limit = @@global.query_cache_limit;
SET @global_query_cache_size = @@global.query_cache_size;
SET @global_query_cache_type = @@global.query_cache_type;
** warnings ** ** warnings **
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
** creating table ** ** creating table **
...@@ -48,7 +50,7 @@ Qcache_queries_in_cache 1 ...@@ -48,7 +50,7 @@ Qcache_queries_in_cache 1
FLUSH STATUS; FLUSH STATUS;
RESET QUERY CACHE; RESET QUERY CACHE;
** set cache limit ** ** set cache limit **
SET @@GLOBAL.query_cache_limit=0; SET @@GLOBAL.query_cache_limit = 0;
** fetching results ** ** fetching results **
SELECT * FROM t; SELECT * FROM t;
id c id c
...@@ -67,7 +69,7 @@ Qcache_queries_in_cache 0 ...@@ -67,7 +69,7 @@ Qcache_queries_in_cache 0
0 Expected 0 Expected
'#---------------------FN_DYNVARS_132_03----------------------#' '#---------------------FN_DYNVARS_132_03----------------------#'
** set cache limit ** ** set cache limit **
SET @@GLOBAL.query_cache_limit=DEFAULT; SET @@GLOBAL.query_cache_limit = DEFAULT;
** Reset cache values ** ** Reset cache values **
FLUSH STATUS; FLUSH STATUS;
RESET QUERY CACHE; RESET QUERY CACHE;
...@@ -86,7 +88,7 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache'; ...@@ -86,7 +88,7 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
Variable_name Value Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1
1 Expected 1 Expected
SET @@GLOBAL.query_cache_limit=0; SET @@GLOBAL.query_cache_limit = 0;
SHOW STATUS LIKE 'Qcache_not_cached'; SHOW STATUS LIKE 'Qcache_not_cached';
Variable_name Value Variable_name Value
Qcache_not_cached 0 Qcache_not_cached 0
...@@ -112,4 +114,6 @@ Variable_name Value ...@@ -112,4 +114,6 @@ Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1
1 Expected 1 Expected
SET @@GLOBAL.query_cache_limit = @global_query_cache_limit; SET @@GLOBAL.query_cache_limit = @global_query_cache_limit;
SET GLOBAL query_cache_size = @global_query_cache_size;
SET GLOBAL query_cache_type = @global_query_cache_type;
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
** Connection con0 ** ** Connection con0 **
SET @start_global_value = @@GLOBAL.query_cache_type; SET @start_global_value = @@GLOBAL.query_cache_type;
SET @start_session_value = @@SESSION.query_cache_type; SET @start_session_value = @@SESSION.query_cache_type;
SET @start_query_cache_size= @@global.query_cache_size;
CREATE TABLE t1(id int, value varchar(10)); CREATE TABLE t1(id int, value varchar(10));
INSERT INTO t1 VALUES(1, 'val1'); INSERT INTO t1 VALUES(1, 'val1');
INSERT INTO t1 VALUES(2, 'val2'); INSERT INTO t1 VALUES(2, 'val2');
...@@ -216,6 +217,7 @@ Disconnecting con1,con2,con3 ...@@ -216,6 +217,7 @@ Disconnecting con1,con2,con3
** Connection con0 ** ** Connection con0 **
SET @@GLOBAL.query_cache_type = @start_global_value; SET @@GLOBAL.query_cache_type = @start_global_value;
SET @@SESSION.query_cache_type = @start_session_value; SET @@SESSION.query_cache_type = @start_session_value;
SET GLOBAL query_cache_size = @start_query_cache_size;
DROP TABLE t1; DROP TABLE t1;
DROP PROCEDURE testProcHit; DROP PROCEDURE testProcHit;
Disconnecting con0 Disconnecting con0
** Setup ** ** Setup **
CREATE TABLE t1 (id int auto_increment primary key, val text(200)); SET @start_value = @@global.query_prealloc_size;
INSERT INTO t1 values(NULL,'a'); CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY, val TEXT(200));
INSERT INTO t1 values(NULL,'b'); INSERT INTO t1 VALUES(NULL,'a');
INSERT INTO t1 values(NULL,'c'); INSERT INTO t1 VALUES(NULL,'b');
INSERT INTO t1 values(NULL,'d'); INSERT INTO t1 VALUES(NULL,'c');
INSERT INTO t1 VALUES(NULL,'d');
SELECT * FROM t1 ORDER BY val; SELECT * FROM t1 ORDER BY val;
id val id val
1 a 1 a
...@@ -36,3 +37,5 @@ SELECT @@GLOBAL.query_prealloc_size; ...@@ -36,3 +37,5 @@ SELECT @@GLOBAL.query_prealloc_size;
@@GLOBAL.query_prealloc_size @@GLOBAL.query_prealloc_size
8192 8192
Expected Value : 8192; Expected Value : 8192;
DROP TABLE t1;
SET @@global.query_prealloc_size = @start_value;
SET @start_value = @@global.slow_query_log_file; SET @start_value = @@global.slow_query_log_file;
SELECT @start_value;
@start_value
slowtest.log
'#---------------------FN_DYNVARS_004_01-------------------------#' '#---------------------FN_DYNVARS_004_01-------------------------#'
SET @@global.slow_query_log_file = DEFAULT; SET @@global.slow_query_log_file = DEFAULT;
SELECT RIGHT(@@global.slow_query_log_file,15); SELECT RIGHT(@@global.slow_query_log_file,15);
...@@ -17,3 +14,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES ...@@ -17,3 +14,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slow_query_log_file'; WHERE VARIABLE_NAME='slow_query_log_file';
@@global.slow_query_log_file = VARIABLE_VALUE @@global.slow_query_log_file = VARIABLE_VALUE
1 1
SET @@global.slow_query_log_file= @start_value;
'#--------------------FN_DYNVARS_018_01-------------------------#' '#--------------------FN_DYNVARS_018_01-------------------------#'
## Checking if my_slow_test.log exist in servers datadir ## ## Checking if my_slow_test.log exists in servers datadir ##
## This case should pass because we have set this filename in opt file ## ## This case should pass because we have set this filename in opt file ##
...@@ -15,3 +15,4 @@ slave_skip_errors 3,100,137,643,1752 ...@@ -15,3 +15,4 @@ slave_skip_errors 3,100,137,643,1752
---- Clean Up ---- ---- Clean Up ----
set global slave_net_timeout=default; set global slave_net_timeout=default;
set global sql_slave_skip_counter= 0; set global sql_slave_skip_counter= 0;
set @@global.slave_net_timeout= @my_slave_net_timeout;
...@@ -15,6 +15,7 @@ set @my_max_heap_table_size =@@global.max_heap_table_size; ...@@ -15,6 +15,7 @@ set @my_max_heap_table_size =@@global.max_heap_table_size;
set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads; set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads;
set @my_max_join_size =@@global.max_join_size; set @my_max_join_size =@@global.max_join_size;
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size; set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
set @my_myisam_max_sort_file_size =@@global.myisam_max_sort_file_size;
set @my_net_buffer_length =@@global.net_buffer_length; set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout; set @my_net_write_timeout =@@global.net_write_timeout;
set @my_net_read_timeout =@@global.net_read_timeout; set @my_net_read_timeout =@@global.net_read_timeout;
...@@ -988,7 +989,7 @@ set global delayed_queue_size =@my_delayed_queue_size; ...@@ -988,7 +989,7 @@ set global delayed_queue_size =@my_delayed_queue_size;
set global flush =@my_flush; set global flush =@my_flush;
set global flush_time =@my_flush_time; set global flush_time =@my_flush_time;
set global key_buffer_size =@my_key_buffer_size; set global key_buffer_size =@my_key_buffer_size;
set global max_binlog_cache_size =default; set global max_binlog_cache_size =@my_max_binlog_cache_size;
set global max_binlog_size =@my_max_binlog_size; set global max_binlog_size =@my_max_binlog_size;
set global max_connect_errors =@my_max_connect_errors; set global max_connect_errors =@my_max_connect_errors;
set global max_connections =@my_max_connections; set global max_connections =@my_max_connections;
...@@ -999,6 +1000,7 @@ set global max_join_size =@my_max_join_size; ...@@ -999,6 +1000,7 @@ set global max_join_size =@my_max_join_size;
set global max_user_connections =default; set global max_user_connections =default;
set global max_write_lock_count =default; set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size; set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size;
set global net_buffer_length =@my_net_buffer_length; set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout; set global net_write_timeout =@my_net_write_timeout;
set global net_read_timeout =@my_net_read_timeout; set global net_read_timeout =@my_net_read_timeout;
......
################## mysql-test\t\binlog_format_basic.test ###################### ################## mysql-test\t\binlog_format_basic.test ######################
# # # #
# Variable Name: binlog_format # # Variable Name: binlog_format #
...@@ -17,8 +15,8 @@ ...@@ -17,8 +15,8 @@
# * Value Check # # * Value Check #
# * Scope Check # # * Scope Check #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -26,6 +24,8 @@ ...@@ -26,6 +24,8 @@
#################################################################### ####################################################################
# Displaying default value # # Displaying default value #
#################################################################### ####################################################################
SET @start_value= @@global.binlog_format;
SELECT COUNT(@@GLOBAL.binlog_format); SELECT COUNT(@@GLOBAL.binlog_format);
--echo 1 Expected --echo 1 Expected
...@@ -36,24 +36,11 @@ SELECT COUNT(@@SESSION.binlog_format); ...@@ -36,24 +36,11 @@ SELECT COUNT(@@SESSION.binlog_format);
#################################################################### ####################################################################
# Check if Value can set # # Check if Value can set #
#################################################################### ####################################################################
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.binlog_format=1; SET @@GLOBAL.binlog_format=1;
--echo Expected error 'Read only variable' SELECT @@GLOBAL.binlog_format;
--echo Bug: Writeable static variable
SELECT COUNT(@@GLOBAL.binlog_format);
--echo 1 Expected
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@SESSION.binlog_format=1; SET @@SESSION.binlog_format=1;
--echo Expected error 'Read only variable' SELECT @@SESSION.binlog_format;
--echo Bug: Writeable static variable
SELECT COUNT(@@SESSION.binlog_format);
--echo 1 Expected
--echo '#---------------------BS_STVARS_002_03----------------------#' --echo '#---------------------BS_STVARS_002_03----------------------#'
################################################################# #################################################################
...@@ -93,8 +80,6 @@ WHERE VARIABLE_NAME='binlog_format'; ...@@ -93,8 +80,6 @@ WHERE VARIABLE_NAME='binlog_format';
--echo 1 Expected --echo 1 Expected
--echo '#---------------------BS_STVARS_002_05----------------------#' --echo '#---------------------BS_STVARS_002_05----------------------#'
################################################################################ ################################################################################
# Check if binlog_format can be accessed with and without @@ sign # # Check if binlog_format can be accessed with and without @@ sign #
...@@ -109,5 +94,5 @@ SELECT COUNT(@@SESSION.binlog_format); ...@@ -109,5 +94,5 @@ SELECT COUNT(@@SESSION.binlog_format);
SELECT COUNT(@@GLOBAL.binlog_format); SELECT COUNT(@@GLOBAL.binlog_format);
--echo 1 Expected --echo 1 Expected
SET @@global.binlog_format= @start_value;
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
# Description: Test Cases of Dynamic System Variable character_set_connection # # Description: Test Cases of Dynamic System Variable character_set_connection #
# that checks the behavior of this variable # # that checks the behavior of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -51,7 +51,7 @@ connection default; ...@@ -51,7 +51,7 @@ connection default;
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
CREATE TABLE t1(b CHAR(40) character set utf8); CREATE TABLE t1(b CHAR(40) CHARACTER SET utf8);
#============================================================================== #==============================================================================
--echo '--verify that character_set_connection converts character_set_client--' --echo '--verify that character_set_connection converts character_set_client--'
#============================================================================== #==============================================================================
...@@ -90,13 +90,16 @@ INSERT INTO t1 VALUES('ЁЂЃЄ'); ...@@ -90,13 +90,16 @@ INSERT INTO t1 VALUES('ЁЂЃЄ');
SELECT * FROM t1; SELECT * FROM t1;
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
#restore
#save # Cleanup
SET @@global.character_set_connection = @global_character_set_connection; SET @@global.character_set_connection = @global_character_set_connection;
SET @@session.character_set_connection = @session_character_set_connection; SET @@session.character_set_connection = @session_character_set_connection;
SET @@session.character_set_client = @session_character_set_client; SET @@session.character_set_client = @session_character_set_client;
SET @@session.character_set_results = @session_character_set_results; SET @@session.character_set_results = @session_character_set_results;
DROP TABLE t1;
############################################################# #############################################################
# End of functionality Testing for character_set_connection # # End of functionality Testing for character_set_connection #
############################################################# #############################################################
############## mysql-test\t\completion_type_func.test ######################### ############## mysql-test\t\completion_type_func.test ##########################
# # # #
# Variable Name: completion_type # # Variable Name: completion_type #
# Scope: GLOBAL & SESSION # # Scope: GLOBAL & SESSION #
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# Author: Salman Rawala # # Author: Salman Rawala #
# # # #
# Description: Test Cases of Dynamic System Variable "completion_type" # # Description: Test Cases of Dynamic System Variable "completion_type" #
# that checks functinality of this variable # # that checks functionality of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_completion_type # # server-system-variables.html#option_mysqld_completion_type #
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
######################### #########################
...@@ -32,9 +32,9 @@ drop table if exists t1; ...@@ -32,9 +32,9 @@ drop table if exists t1;
--echo ## Creating new table ## --echo ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
id INT NOT NULL auto_increment, id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id), PRIMARY KEY (id),
name varchar(30) name VARCHAR(30)
) ENGINE = INNODB; ) ENGINE = INNODB;
--echo '#--------------------FN_DYNVARS_017_01-------------------------#' --echo '#--------------------FN_DYNVARS_017_01-------------------------#'
...@@ -46,27 +46,27 @@ name varchar(30) ...@@ -46,27 +46,27 @@ name varchar(30)
connect (test_con1,localhost,root,,); connect (test_con1,localhost,root,,);
connection test_con1; connection test_con1;
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
SET @@autocommit = 0; SET @@autocommit = 0;
SELECT * from t1; SELECT * FROM t1;
--echo ## Setting value of variable to 0 ## --echo ## Setting value of variable to 0 ##
SET @@session.completion_type = 0; SET @@session.completion_type = 0;
--echo ## Here commit & rollback should work normally ## --echo ## Here commit & rollback should work normally ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
SELECT * from t1; SELECT * FROM t1;
DELETE FROM t1 where id = 2; DELETE FROM t1 WHERE id = 2;
SELECT * from t1; SELECT * FROM t1;
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
INSERT into t1(name) values('Record_5'); INSERT INTO t1(name) VALUES('Record_5');
COMMIT; COMMIT;
...@@ -79,15 +79,15 @@ SET @@session.completion_type = 2; ...@@ -79,15 +79,15 @@ SET @@session.completion_type = 2;
--echo ## Here commit should work as COMMIT RELEASE ## --echo ## Here commit should work as COMMIT RELEASE ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
INSERT into t1(name) values('Record_6'); INSERT INTO t1(name) VALUES('Record_6');
INSERT into t1(name) values('Record_7'); INSERT INTO t1(name) VALUES('Record_7');
COMMIT; COMMIT;
--echo ## Inserting rows should give error here because connection should ## --echo ## Inserting rows should give error here because connection should ##
--echo ## disconnect after using COMMIT ## --echo ## disconnect after using COMMIT ##
--Error 2006,2013,1053 --Error 2006,2013,1053
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
--echo ## Creating new connection test_con2 ## --echo ## Creating new connection test_con2 ##
connect (test_con2,localhost,root,,); connect (test_con2,localhost,root,,);
...@@ -96,11 +96,17 @@ SET @@session.completion_type = 2; ...@@ -96,11 +96,17 @@ SET @@session.completion_type = 2;
--echo ## Inserting rows and using Rollback which should Rollback & release ## --echo ## Inserting rows and using Rollback which should Rollback & release ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
INSERT into t1(name) values('Record_8'); INSERT INTO t1(name) VALUES('Record_8');
INSERT into t1(name) values('Record_9'); INSERT INTO t1(name) VALUES('Record_9');
ROLLBACK; ROLLBACK;
--Error 2006,2013,1053 --Error 2006,2013,1053
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
connection default;
disconnect test_con1;
disconnect test_con2;
DROP TABLE t1;
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
# Description: Test Cases of Dynamic System Variable "concurrent_insert" # # Description: Test Cases of Dynamic System Variable "concurrent_insert" #
# that checks functionality of this variable # # that checks functionality of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html#option_mysqld_concurrent_insert # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
################################################################################ ################################################################################
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
######################### #########################
...@@ -31,7 +31,7 @@ drop table if exists t1; ...@@ -31,7 +31,7 @@ drop table if exists t1;
--echo ## Creating new table ## --echo ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
name varchar(30) name VARCHAR(30)
); );
--echo '#--------------------FN_DYNVARS_018_01-------------------------#' --echo '#--------------------FN_DYNVARS_018_01-------------------------#'
...@@ -41,30 +41,34 @@ name varchar(30) ...@@ -41,30 +41,34 @@ name varchar(30)
# for MyISAM tables that don't have holes # for MyISAM tables that don't have holes
#################################################################### ####################################################################
SET @start_value= @@global.concurrent_insert;
--echo ## Setting initial value of variable to 1 ## --echo ## Setting initial value of variable to 1 ##
SET @@global.concurrent_insert = 1; SET @@global.concurrent_insert = 1;
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
--echo ## locking table ## --echo ## locking table ##
lock table t1 read local; LOCK TABLE t1 READ LOCAL;
--echo ## Creating new connection to insert some rows in table ## --echo ## Creating new connection to insert some rows in table ##
connect (test_con1,localhost,root,,); connect (test_con1,localhost,root,,);
--echo connection test_con1;
connection test_con1; connection test_con1;
--echo ## New records should come at the end of all rows ## --echo ## New records should come at the end of all rows ##
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
SELECT * from t1; SELECT * FROM t1;
--echo ## unlocking tables ## --echo ## unlocking tables ##
--echo connection default;
connection default; connection default;
unlock tables; UNLOCK TABLES;
--echo ## deleting record to create hole in table ## --echo ## deleting record to create hole in table ##
DELETE from t1 where name ='Record_2'; DELETE FROM t1 WHERE name ='Record_2';
--echo '#--------------------FN_DYNVARS_018_02-------------------------#' --echo '#--------------------FN_DYNVARS_018_02-------------------------#'
...@@ -73,68 +77,85 @@ DELETE from t1 where name ='Record_2'; ...@@ -73,68 +77,85 @@ DELETE from t1 where name ='Record_2';
# concurrent_insert = 1 and trying to insert some values # concurrent_insert = 1 and trying to insert some values
# in MyISAM tables that have holes # in MyISAM tables that have holes
#################################################################### ####################################################################
# lock table and connect with connection1 # lock table and connect with connection1
#lock table t1 read local; LOCK TABLE t1 READ LOCAL;
#connection test_con1; --echo connection test_con1;
connection test_con1;
# setting value of concurrent_insert to 1 # setting value of concurrent_insert to 1
#SET @@global.concurrent_insert=1; SET @@global.concurrent_insert=1;
#INSERT into t1(name) values('Record_7');
#SELECT * from t1;
#connection default;
#unlock tables;
#SELECT * from t1;
#INSERT into t1(name) values('Record_6');
# On inserting rows in hole while the value of concurrent_insert is 1
# MySQL server hangs.
--echo ## send INSERT which should be blocked until unlock of the table ##
send
INSERT INTO t1(name) VALUES('Record_7');
--echo connection default;
connection default;
# wait until INSERT will be locked (low performance)
let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE state= "Locked" AND info LIKE "INSERT INTO t1%";
--source include/wait_condition.inc
--echo ## show processlist info and state ##
SELECT state,info FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE state= "Locked" AND info LIKE "INSERT INTO t1%";
--echo ## table contents befor UNLOCK ##
SELECT * FROM t1;
UNLOCK TABLES;
--echo ## table contens after UNLOCK ##
SELECT * FROM t1;
INSERT INTO t1(name) VALUES('Record_6');
--echo connection test_con1;
connection test_con1;
# to complete the send above^
reap;
SELECT * FROM t1;
--echo connection default;
connection default;
--echo '#--------------------FN_DYNVARS_018_03-------------------------#' --echo '#--------------------FN_DYNVARS_018_03-------------------------#'
############################################################################### ################################################################################
# Setting value of concurrent_insert to 2 to verify values after inserting # Setting value of concurrent_insert to 2 to verify values after inserting
# it into table with holes # it into table with holes
# concurrent_insert = 2 means Enables concurrent insert # concurrent_insert = 2 means Enables concurrent insert
# for MyISAM tables that have holes but inserts values at the end of all rows # for MyISAM tables that have holes but inserts values at the end of all rows
############################################################################### ################################################################################
--echo ## lock table and connect with connection1 ## --echo ## lock table and connect with connection1 ##
lock table t1 read local; LOCK TABLE t1 READ LOCAL;
--echo connection test_con1;
connection test_con1; connection test_con1;
--echo ## setting value of concurrent_insert to 2 ## --echo ## setting value of concurrent_insert to 2 ##
SET @@global.concurrent_insert=2; SET @@global.concurrent_insert=2;
--echo ## Inserting record in table, record should go at the end of the table ## --echo ## Inserting record in table, record should go at the end of the table ##
INSERT into t1(name) values('Record_5'); INSERT INTO t1(name) VALUES('Record_5');
SELECT * from t1; SELECT * FROM t1;
SELECT @@concurrent_insert; SELECT @@concurrent_insert;
--echo ## Switching to default connection ## --echo connection default;
connection default; connection default;
--echo ## Unlocking table ## --echo ## Unlocking table ##
unlock tables; UNLOCK TABLES;
SELECT * from t1; SELECT * FROM t1;
--echo ## Inserting new row, this should go in the hole ## --echo ## Inserting new row, this should go in the hole ##
INSERT into t1(name) values('Record_6'); INSERT INTO t1(name) VALUES('Record_6');
SELECT * from t1; SELECT * FROM t1;
--echo ## connection test_con1 ## --echo ## connection test_con1 ##
DELETE from t1 where name ='Record_3'; DELETE FROM t1 WHERE name ='Record_3';
SELECT * from t1; SELECT * FROM t1;
--echo ## Dropping table ## --echo ## Dropping table ##
DROP table t1; DROP TABLE t1;
--echo ## Disconnecting connection ## --echo ## Disconnecting connection ##
disconnect test_con1; disconnect test_con1;
SET @@global.concurrent_insert= @start_value;
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
# Description: Test Cases of Dynamic System Variable delay_key_write # # Description: Test Cases of Dynamic System Variable delay_key_write #
# that checks the behavior of this variable # # that checks the behavior of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
# Check if setting delay_key_write is changed in every new connection # # Check if setting delay_key_write is changed in every new connection #
####################################################################### #######################################################################
SET @start_value= @@global.delay_key_write;
SET @@global.delay_key_write = ON; SET @@global.delay_key_write = ON;
SELECT @@global.delay_key_write; SELECT @@global.delay_key_write;
...@@ -77,7 +78,7 @@ CREATE TABLE t1( ...@@ -77,7 +78,7 @@ CREATE TABLE t1(
a INT PRIMARY KEY, a INT PRIMARY KEY,
b VARCHAR(512), b VARCHAR(512),
c DOUBLE c DOUBLE
)delay_key_write = 1; ) DELAY_KEY_WRITE = 1;
--enable_query_log --enable_query_log
...@@ -88,7 +89,7 @@ CALL sp_addRecords(1,10); ...@@ -88,7 +89,7 @@ CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_reads';
SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_writes';
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
select count(*) from t1; SELECT COUNT(*) FROM t1;
#============================================================================== #==============================================================================
--echo '----check when delay_key_write is ON---' --echo '----check when delay_key_write is ON---'
...@@ -105,7 +106,7 @@ CREATE TABLE t1( ...@@ -105,7 +106,7 @@ CREATE TABLE t1(
a INT PRIMARY KEY, a INT PRIMARY KEY,
b VARCHAR(512), b VARCHAR(512),
c DOUBLE c DOUBLE
)delay_key_write = 1; ) DELAY_KEY_WRITE = 1;
--enable_query_log --enable_query_log
FLUSH STATUS; FLUSH STATUS;
...@@ -114,7 +115,7 @@ CALL sp_addRecords(1,10); ...@@ -114,7 +115,7 @@ CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_reads';
SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_writes';
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
select count(*) from t1; SELECT COUNT(*) FROM t1;
#============================================================================== #==============================================================================
--echo '----check when delay_key_write is ALL---' --echo '----check when delay_key_write is ALL---'
...@@ -130,7 +131,7 @@ CREATE TABLE t1( ...@@ -130,7 +131,7 @@ CREATE TABLE t1(
a INT PRIMARY KEY, a INT PRIMARY KEY,
b VARCHAR(512), b VARCHAR(512),
c DOUBLE c DOUBLE
)delay_key_write = 0; ) DELAY_KEY_WRITE = 0;
--enable_query_log --enable_query_log
FLUSH STATUS; FLUSH STATUS;
...@@ -139,11 +140,16 @@ CALL sp_addRecords(1,10); ...@@ -139,11 +140,16 @@ CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_reads';
SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_writes';
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
select count(*) from t1; SELECT COUNT(*) FROM t1;
DROP PROCEDURE sp_addRecords; DROP PROCEDURE sp_addRecords;
DROP TABLE t1; DROP TABLE t1;
disconnect user1;
connection default;
SET @@global.delay_key_write= @start_value;
#################################################### ####################################################
# End of functionality testing for delay_key_write # # End of functionality testing for delay_key_write #
#################################################### ####################################################
...@@ -16,7 +16,6 @@ log_tables.test : Bug #37798: main.log_tables fails random ...@@ -16,7 +16,6 @@ log_tables.test : Bug #37798: main.log_tables fails random
wait_timeout_func : BUG#36873 2008-07-06 sven wait_timeout_func.test fails randomly wait_timeout_func : BUG#36873 2008-07-06 sven wait_timeout_func.test fails randomly
delayed_insert_limit_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions delayed_insert_limit_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
event_scheduler_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions event_scheduler_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
innodb_max_dirty_pages_pct_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
interactive_timeout_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions interactive_timeout_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
query_cache_wlock_invalidate_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions query_cache_wlock_invalidate_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
rpl_init_slave_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions rpl_init_slave_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
...@@ -25,3 +24,4 @@ slow_query_log_func : BUG#37962 2008-07-08 sven *_func tests c ...@@ -25,3 +24,4 @@ slow_query_log_func : BUG#37962 2008-07-08 sven *_func tests c
sql_low_priority_updates_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions sql_low_priority_updates_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
timestamp_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions timestamp_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
log_output_func : BUG#37766 2008-07-10 sven main.log_output_func randomly fails in pushbuild log_output_func : BUG#37766 2008-07-10 sven main.log_output_func randomly fails in pushbuild
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
# # # #
# Creation Date: 2008-03-16 # # Creation Date: 2008-03-16 #
# Author: Salman Rawala # # Author: Salman Rawala #
# Modified: HHunger 2008-09-11 Set system variable back to the start value #
# # # #
# Description: Test Cases of Dynamic System Variable "general_log_file" # # Description: Test Cases of Dynamic System Variable "general_log_file" #
# that checks behavior of this variable in the following ways # # that checks behavior of this variable in the following ways #
...@@ -18,8 +19,8 @@ ...@@ -18,8 +19,8 @@
# * Scope & Access method # # * Scope & Access method #
# * Data Integrity # # * Data Integrity #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html#option_mysqld_general_log_file # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
################################################################################ ################################################################################
...@@ -67,7 +68,9 @@ SELECT @@global.general_log_file = VARIABLE_VALUE ...@@ -67,7 +68,9 @@ SELECT @@global.general_log_file = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='general_log_file'; WHERE VARIABLE_NAME='general_log_file';
SET @@global.general_log_file= @start_value;
##################################################### #####################################################
# END OF general_log_file TESTS # # END OF general_log_file TESTS #
##################################################### #####################################################
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
######################### #########################
...@@ -31,7 +31,7 @@ drop table if exists t1; ...@@ -31,7 +31,7 @@ drop table if exists t1;
--echo ## Creating new table ## --echo ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
id INT NOT NULL auto_increment, id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id), PRIMARY KEY (id),
name VARCHAR(30) name VARCHAR(30)
); );
...@@ -40,14 +40,12 @@ name VARCHAR(30) ...@@ -40,14 +40,12 @@ name VARCHAR(30)
#################################################################### ####################################################################
# Verifying general log as we have initialized in opt file # # Verifying general log as we have initialized in opt file #
#################################################################### ####################################################################
SELECT @@general_log_file; SELECT @@general_log_file;
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
--echo ## Verifying general log file ## --echo ## Verifying general log file ##
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
......
################# mysql-test\t\innodb_autoextend_increment _basic.test ################### ################# mysql-test\t\innodb_autoextend_increment _basic.test ###########
# # # #
# Variable Name: innodb_autoextend_increment # # Variable Name: innodb_autoextend_increment #
# Scope: GLOBAL # # Scope: GLOBAL #
...@@ -11,17 +11,17 @@ ...@@ -11,17 +11,17 @@
# Creation Date: 2008-02-07 # # Creation Date: 2008-02-07 #
# Author: Rizwan # # Author: Rizwan #
# # # #
#Description:Test Cases of Dynamic System Variable innodb_autoextend_increment# # Description: #
# that checks the behavior of this variable in the following ways # # Test Cases of Dynamic System Variable innodb_autoextend_increment that #
# checks the behavior of this variable in the following ways #
# * Default Value # # * Default Value #
# * Valid & Invalid values # # * Valid & Invalid values #
# * Scope & Access method # # * Scope & Access method #
# * Data Integrity # # * Data Integrity #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# server-system-variables.html #
# # # #
############################################################################### ##################################################################################
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/load_sysvars.inc --source include/load_sysvars.inc
...@@ -31,23 +31,18 @@ ...@@ -31,23 +31,18 @@
######################################################################## ########################################################################
################################################################################ ###############################################################################
# Saving initial value of innodb_autoextend_increment in a temporary variable# # Saving initial value of innodb_autoextend_increment in a temporary variable #
################################################################################ ###############################################################################
SET @global_start_value = @@global.innodb_autoextend_increment ; SET @global_start_value = @@global.innodb_autoextend_increment ;
SELECT @global_start_value;
--echo '#--------------------FN_DYNVARS_046_01------------------------#' --echo '#--------------------FN_DYNVARS_046_01------------------------#'
######################################################################## ########################################################################
# Display the DEFAULT value of innodb_autoextend_increment # # Display the DEFAULT value of innodb_autoextend_increment #
######################################################################## ########################################################################
SET @@global.innodb_autoextend_increment = 0; SET @@global.innodb_autoextend_increment = 0;
SET @@global.innodb_autoextend_increment = DEFAULT; SET @@global.innodb_autoextend_increment = DEFAULT;
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
...@@ -61,11 +56,9 @@ SELECT @@global.innodb_autoextend_increment ; ...@@ -61,11 +56,9 @@ SELECT @@global.innodb_autoextend_increment ;
SET innodb_autoextend_increment = 1; SET innodb_autoextend_increment = 1;
SELECT @@innodb_autoextend_increment ; SELECT @@innodb_autoextend_increment ;
--Error ER_UNKNOWN_TABLE --Error ER_UNKNOWN_TABLE
SELECT local.innodb_autoextend_increment ; SELECT local.innodb_autoextend_increment ;
SET global innodb_autoextend_increment = 0; SET global innodb_autoextend_increment = 0;
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
...@@ -75,25 +68,20 @@ SELECT @@global.innodb_autoextend_increment ; ...@@ -75,25 +68,20 @@ SELECT @@global.innodb_autoextend_increment ;
# change the value of innodb_autoextend_increment to a valid value # # change the value of innodb_autoextend_increment to a valid value #
########################################################################## ##########################################################################
SET @@global.innodb_autoextend_increment = 1; SET @@global.innodb_autoextend_increment = 1;
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
SET @@global.innodb_autoextend_increment = 1000; SET @@global.innodb_autoextend_increment = 1000;
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
--echo '#--------------------FN_DYNVARS_046_04-------------------------#' --echo '#--------------------FN_DYNVARS_046_04-------------------------#'
########################################################################### ###########################################################################
# Change the value of innodb_autoextend_increment to invalid value # # Change the value of innodb_autoextend_increment to invalid value #
########################################################################### ###########################################################################
SET @@global.innodb_autoextend_increment = -1; SET @@global.innodb_autoextend_increment = -1;
SELECT @@global.innodb_autoextend_increment; SELECT @@global.innodb_autoextend_increment;
--Error ER_WRONG_TYPE_FOR_VAR --Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_autoextend_increment = "T"; SET @@global.innodb_autoextend_increment = "T";
SELECT @@global.innodb_autoextend_increment; SELECT @@global.innodb_autoextend_increment;
...@@ -102,13 +90,10 @@ SELECT @@global.innodb_autoextend_increment; ...@@ -102,13 +90,10 @@ SELECT @@global.innodb_autoextend_increment;
SET @@global.innodb_autoextend_increment = "Y"; SET @@global.innodb_autoextend_increment = "Y";
SELECT @@global.innodb_autoextend_increment; SELECT @@global.innodb_autoextend_increment;
SET @@global.innodb_autoextend_increment = 1001; SET @@global.innodb_autoextend_increment = 1001;
SELECT @@global.innodb_autoextend_increment; SELECT @@global.innodb_autoextend_increment;
--echo '#----------------------FN_DYNVARS_046_05------------------------#' --echo '#----------------------FN_DYNVARS_046_05------------------------#'
######################################################################### #########################################################################
# Check if the value in GLOBAL Table matches value in variable # # Check if the value in GLOBAL Table matches value in variable #
...@@ -136,25 +121,25 @@ SELECT @@global.innodb_autoextend_increment ; ...@@ -136,25 +121,25 @@ SELECT @@global.innodb_autoextend_increment ;
SET @@global.innodb_autoextend_increment = ON; SET @@global.innodb_autoextend_increment = ON;
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
--echo '#---------------------FN_DYNVARS_046_07----------------------#' --echo '#---------------------FN_DYNVARS_046_07----------------------#'
################################################################### ###################################################################
# Check if TRUE and FALSE values can be used on variable # # Check if TRUE and FALSE values can be used on variable #
################################################################### ###################################################################
SET @@global.innodb_autoextend_increment = TRUE; SET @@global.innodb_autoextend_increment = TRUE;
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
SET @@global.innodb_autoextend_increment = FALSE; SET @@global.innodb_autoextend_increment = FALSE;
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
############################## ##############################
# Restore initial value # # Restore initial value #
############################## ##############################
SET @@global.innodb_autoextend_increment = @global_start_value;
#SET @@global.innodb_autoextend_increment = @global_start_value;
#SELECT @@global.innodb_autoextend_increment ;
############################################################### ###############################################################
# END OF innodb_autoextend_increment TESTS # # END OF innodb_autoextend_increment TESTS #
############################################################### ###############################################################
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
# Creation Date: 2008-03-08 # # Creation Date: 2008-03-08 #
# Author: Rizwan Maredia # # Author: Rizwan Maredia #
# # # #
#Description:Test Cases of Dynamic System Variable innodb_autoextend_increment# # Description: #
# that checks the behavior of this variable # # Test Cases of Dynamic System Variable innodb_autoextend_increment that #
# checks the behavior of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -43,12 +44,14 @@ DROP TABLE IF EXISTS t1; ...@@ -43,12 +44,14 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1( CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY, a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR b CHAR
)ENGINE=INNODB, AUTO_INCREMENT=100; ) ENGINE=INNODB, AUTO_INCREMENT=100;
INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d'); INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d');
INSERT INTO t1 (a,b) VALUES (NULL,'e'); INSERT INTO t1 (a,b) VALUES (NULL,'e');
--echo 'the new auto incremented value should be 104' --echo 'the new auto incremented value should be 104'
SELECT * from t1; SELECT * FROM t1;
DROP TABLE t1;
############################################################### ###############################################################
# End of functionality Testing for innodb_autoinc_lock_mode # # End of functionality Testing for innodb_autoinc_lock_mode #
......
...@@ -11,15 +11,16 @@ ...@@ -11,15 +11,16 @@
# Creation Date: 2008-02-20 # # Creation Date: 2008-02-20 #
# Author: Sharique Abdullah # # Author: Sharique Abdullah #
# # # #
# Description: Test Cases of Dynamic System Variable innodb_fast_shutdown # # Description: #
# that checks the behavior of this variable in the following ways# # Test Cases of Dynamic System Variable innodb_fast_shutdown that checks #
# the behavior of this variable in the following ways #
# * Default Value # # * Default Value #
# * Valid & Invalid values # # * Valid & Invalid values #
# * Scope & Access method # # * Scope & Access method #
# * Data Integrity # # * Data Integrity #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -35,8 +36,6 @@ ...@@ -35,8 +36,6 @@
# Saving initial value of innodb_fast_shutdown in a temporary variable # # Saving initial value of innodb_fast_shutdown in a temporary variable #
############################################################################## ##############################################################################
SET @global_start_value = @@global.innodb_fast_shutdown; SET @global_start_value = @@global.innodb_fast_shutdown;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
...@@ -51,13 +50,11 @@ SET @@global.innodb_fast_shutdown = DEFAULT; ...@@ -51,13 +50,11 @@ SET @@global.innodb_fast_shutdown = DEFAULT;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
--echo '#---------------------FN_DYNVARS_042_02-------------------------#' --echo '#---------------------FN_DYNVARS_042_02-------------------------#'
############################################################################# #############################################################################
# Check if innodb_fast_shutdown can be accessed with and without @@ sign # # Check if innodb_fast_shutdown can be accessed with and without @@ sign #
############################################################################# #############################################################################
--ERROR ER_GLOBAL_VARIABLE --ERROR ER_GLOBAL_VARIABLE
SET innodb_fast_shutdown = 1; SET innodb_fast_shutdown = 1;
SELECT @@innodb_fast_shutdown; SELECT @@innodb_fast_shutdown;
...@@ -70,26 +67,27 @@ SELECT @@global.innodb_fast_shutdown; ...@@ -70,26 +67,27 @@ SELECT @@global.innodb_fast_shutdown;
--echo '#--------------------FN_DYNVARS_042_03------------------------#' --echo '#--------------------FN_DYNVARS_042_03------------------------#'
######################################################################## ##########################################################################
# Change the value of innodb_fast_shutdown to a valid value # # Change the value of innodb_fast_shutdown to a valid value #
######################################################################## ##########################################################################
SET @@global.innodb_fast_shutdown = 0; SET @@global.innodb_fast_shutdown = 0;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
SET @@global.innodb_fast_shutdown = 1; SET @@global.innodb_fast_shutdown = 1;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
## a value of 2 is used to just flush logs and then shutdown cold. Not supported on Netware ## A value of 2 is used to just flush logs and then shutdown cold.
## Not supported on Netware
SET @@global.innodb_fast_shutdown = 2; SET @@global.innodb_fast_shutdown = 2;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
--echo '#--------------------FN_DYNVARS_042_04-------------------------#' --echo '#--------------------FN_DYNVARS_042_04-------------------------#'
########################################################################### ###########################################################################
# Change the value of innodb_fast_shutdown to invalid value # # Change the value of innodb_fast_shutdown to invalid value #
########################################################################### ###########################################################################
SET @@global.innodb_fast_shutdown = -1; SET @@global.innodb_fast_shutdown = -1;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
--Error ER_WRONG_TYPE_FOR_VAR --Error ER_WRONG_TYPE_FOR_VAR
...@@ -121,7 +119,6 @@ SET @@global.innodb_fast_shutdown = "0"; ...@@ -121,7 +119,6 @@ SET @@global.innodb_fast_shutdown = "0";
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
--echo '#-------------------FN_DYNVARS_042_05----------------------------#' --echo '#-------------------FN_DYNVARS_042_05----------------------------#'
########################################################################### ###########################################################################
# Test if accessing session innodb_fast_shutdown gives error # # Test if accessing session innodb_fast_shutdown gives error #
...@@ -136,7 +133,6 @@ SET @@innodb_fast_shutdown = 0; ...@@ -136,7 +133,6 @@ SET @@innodb_fast_shutdown = 0;
SET @@local.innodb_fast_shutdown = 0; SET @@local.innodb_fast_shutdown = 0;
--echo '#----------------------FN_DYNVARS_042_06------------------------#' --echo '#----------------------FN_DYNVARS_042_06------------------------#'
######################################################################### #########################################################################
# Check if the value in SESSION Table contains variable value # # Check if the value in SESSION Table contains variable value #
...@@ -162,7 +158,6 @@ WHERE VARIABLE_NAME='innodb_fast_shutdown'; ...@@ -162,7 +158,6 @@ WHERE VARIABLE_NAME='innodb_fast_shutdown';
# Check if ON and OFF values can be used on variable # # Check if ON and OFF values can be used on variable #
################################################################### ###################################################################
--Error ER_WRONG_TYPE_FOR_VAR --Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_fast_shutdown = OFF; SET @@global.innodb_fast_shutdown = OFF;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
...@@ -171,6 +166,7 @@ SELECT @@global.innodb_fast_shutdown; ...@@ -171,6 +166,7 @@ SELECT @@global.innodb_fast_shutdown;
SET @@global.innodb_fast_shutdown = ON; SET @@global.innodb_fast_shutdown = ON;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
--echo '#---------------------FN_DYNVARS_042_09----------------------#' --echo '#---------------------FN_DYNVARS_042_09----------------------#'
################################################################### ###################################################################
# Check if TRUE and FALSE values can be used on variable # # Check if TRUE and FALSE values can be used on variable #
...@@ -181,12 +177,13 @@ SELECT @@global.innodb_fast_shutdown; ...@@ -181,12 +177,13 @@ SELECT @@global.innodb_fast_shutdown;
SET @@global.innodb_fast_shutdown = FALSE; SET @@global.innodb_fast_shutdown = FALSE;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
############################## ##############################
# Restore initial value # # Restore initial value #
############################## ##############################
#SET @@innodb_fast_shutdown = @global_start_value; SET @@global.innodb_fast_shutdown = @global_start_value;
#SELECT @@innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
######################################################################## ########################################################################
# END OF innodb_fast_shutdown TESTS # # END OF innodb_fast_shutdown TESTS #
......
...@@ -11,33 +11,31 @@ ...@@ -11,33 +11,31 @@
# Creation Date: 2008-03-08 # # Creation Date: 2008-03-08 #
# Author: Rizwan # # Author: Rizwan #
# # # #
#Description: Test Cases of Dynamic System Variable innodb_max_dirty_pages_pct# # Description: #
# that checks the behavior of this variable # # Test cases of Dynamic System Variable innodb_max_dirty_pages_pct that #
# checks the behavior of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
--source include/have_innodb.inc --source include/have_innodb.inc
--echo '#--------------------FN_DYNVARS_044_02-------------------------#'
###########################################################################
# Check if setting innodb_max_dirty_pages_pct is changed in new connection#
###########################################################################
SET @old_innodb_max_dirty_pages_pct= @@global.innodb_max_dirty_pages_pct; SET @start_value= @@global.innodb_max_dirty_pages_pct;
--echo '#--------------------FN_DYNVARS_044_02-------------------------#'
############################################################################
# Check if setting innodb_max_dirty_pages_pct is changed in new connection #
############################################################################
SET @@global.innodb_max_dirty_pages_pct = 80; SET @@global.innodb_max_dirty_pages_pct = 80;
--echo 'connect (con1,localhost,root,,,,)' --echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,); connect (con1,localhost,root,,,,);
--echo 'connection con1'
connection con1;
SELECT @@global.innodb_max_dirty_pages_pct; SELECT @@global.innodb_max_dirty_pages_pct;
SET @@global.innodb_max_dirty_pages_pct = 70; SET @@global.innodb_max_dirty_pages_pct = 70;
--echo 'connect (con2,localhost,root,,,,)' --echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,); connect (con2,localhost,root,,,,);
--echo 'connection con2'
connection con2;
SELECT @@global.innodb_max_dirty_pages_pct; SELECT @@global.innodb_max_dirty_pages_pct;
disconnect con2; disconnect con2;
disconnect con1; disconnect con1;
...@@ -60,6 +58,11 @@ DROP FUNCTION IF EXISTS dirty_pct; ...@@ -60,6 +58,11 @@ DROP FUNCTION IF EXISTS dirty_pct;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(200)
)ENGINE=INNODB;
DELIMITER //; DELIMITER //;
CREATE PROCEDURE add_records(IN NUM INT) CREATE PROCEDURE add_records(IN NUM INT)
BEGIN BEGIN
...@@ -104,7 +107,7 @@ BEGIN ...@@ -104,7 +107,7 @@ BEGIN
SET pct = dirty_pct(); SET pct = dirty_pct();
SET last = 0; SET last = 0;
WHILE (pct<NUM and pct<100) DO WHILE (pct>NUM and pct<100) DO
CALL add_records(500); CALL add_records(500);
SET pct = dirty_pct(); SET pct = dirty_pct();
IF (pct<last) THEN IF (pct<last) THEN
...@@ -126,11 +129,6 @@ END// ...@@ -126,11 +129,6 @@ END//
DELIMITER ;// DELIMITER ;//
CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(200)
)ENGINE=INNODB;
--enable_query_log --enable_query_log
#========================================================== #==========================================================
...@@ -141,26 +139,28 @@ SET @@global.innodb_max_dirty_pages_pct = 10; ...@@ -141,26 +139,28 @@ SET @@global.innodb_max_dirty_pages_pct = 10;
FLUSH STATUS; FLUSH STATUS;
# add rows until dirty pages pct is less than this value # Add rows until dirty pages pct is less than this value
CALL add_until(10); CALL add_until(10);
# give server some time to flush dirty pages # Give the server some time to flush dirty pages
FLUSH TABLES; FLUSH TABLES;
CALL add_records(500); CALL add_records(500);
--echo '--sleep 5'
--sleep 5 # Execute dirty_pct (wait) until dirty pages < 10%
# Use polling to execute dirty_pct ina loop
let $wait_condition= SELECT dirty_pct() < 10;
--source include/wait_condition.inc
--echo 'We expect dirty pages pct to be BELOW_MAX' --echo 'We expect dirty pages pct to be BELOW_MAX'
CALL check_pct(10); CALL check_pct(10);
#SHOW STATUS LIKE 'innodb%';
DROP PROCEDURE add_records; DROP PROCEDURE add_records;
DROP PROCEDURE add_until; DROP PROCEDURE add_until;
DROP PROCEDURE check_pct; DROP PROCEDURE check_pct;
DROP FUNCTION dirty_pct; DROP FUNCTION dirty_pct;
DROP TABLE t1; DROP TABLE t1;
SET @@global.innodb_max_dirty_pages_pct = @old_innodb_max_dirty_pages_pct;
SET @@global.innodb_max_dirty_pages_pct= @start_value;
################################################################## ##################################################################
# End of functionality Testing for innodb_max_dirty_pages_pct # # End of functionality Testing for innodb_max_dirty_pages_pct #
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
# Description: Test Cases of Dynamic System Variable innodb_table_locks # # Description: Test Cases of Dynamic System Variable innodb_table_locks #
# that checks the behavior of this variable # # that checks the behavior of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
# Check if setting innodb_table_locks is changed in new connection # # Check if setting innodb_table_locks is changed in new connection #
#################################################################### ####################################################################
SET @start_value= @@global.innodb_table_locks;
SELECT @start_value;
SET @@global.innodb_table_locks = OFF; SET @@global.innodb_table_locks = OFF;
--echo 'connect (con1,localhost,root,,,,)' --echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,); connect (con1,localhost,root,,,,);
...@@ -80,6 +83,9 @@ UNLOCK tables; ...@@ -80,6 +83,9 @@ UNLOCK tables;
DROP TABLE t1; DROP TABLE t1;
disconnect con2; disconnect con2;
connection default;
SET @@global.innodb_table_locks= @start_value;
SELECT @@global.innodb_table_locks;
########################################################## ##########################################################
# End of functionality Testing for innodb_table_locks # # End of functionality Testing for innodb_table_locks #
......
...@@ -76,7 +76,7 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100; ...@@ -76,7 +76,7 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100;
SELECT * FROM t1; SELECT * FROM t1;
INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
SELECT * FROM t1; SELECT * FROM t1;
--error 1052 --error ER_NON_UNIQ_ERROR
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a); INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a);
SELECT *, VALUES(a) FROM t1; SELECT *, VALUES(a) FROM t1;
...@@ -95,9 +95,9 @@ insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ; ...@@ -95,9 +95,9 @@ insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ;
select * from t1; select * from t1;
insert into t1 select 1 on duplicate key update a=2; insert into t1 select 1 on duplicate key update a=2;
select * from t1; select * from t1;
--error 1052 --error ER_NON_UNIQ_ERROR
insert into t1 select a from t1 on duplicate key update a=a+1 ; insert into t1 select a from t1 on duplicate key update a=a+1 ;
--error 1052 --error ER_NON_UNIQ_ERROR
insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ; insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ;
drop table t1; drop table t1;
...@@ -171,13 +171,13 @@ SET SQL_MODE = 'TRADITIONAL'; ...@@ -171,13 +171,13 @@ SET SQL_MODE = 'TRADITIONAL';
CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL); CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL);
--error 1364 --error ER_NO_DEFAULT_FOR_FIELD
INSERT INTO t1 (a) VALUES (1); INSERT INTO t1 (a) VALUES (1);
--error 1364 --error ER_NO_DEFAULT_FOR_FIELD
INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b; INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b;
--error 1364 --error ER_NO_DEFAULT_FOR_FIELD
INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b; INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b;
SELECT * FROM t1; SELECT * FROM t1;
...@@ -278,7 +278,7 @@ INSERT INTO t1 (id,c1) VALUES (1,10); ...@@ -278,7 +278,7 @@ INSERT INTO t1 (id,c1) VALUES (1,10);
SELECT * FROM t1; SELECT * FROM t1;
CREATE TABLE t2 (id INT, c1 INT); CREATE TABLE t2 (id INT, c1 INT);
INSERT INTO t2 VALUES (1,NULL), (2,2); INSERT INTO t2 VALUES (1,NULL), (2,2);
--error 1048 --error ER_BAD_NULL_ERROR
INSERT INTO t1 (id,c1) SELECT 1,NULL INSERT INTO t1 (id,c1) SELECT 1,NULL
ON DUPLICATE KEY UPDATE c1=NULL; ON DUPLICATE KEY UPDATE c1=NULL;
SELECT * FROM t1; SELECT * FROM t1;
...@@ -290,6 +290,7 @@ INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2 ...@@ -290,6 +290,7 @@ INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2;
# #
# Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it # Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
# Description: Test Cases of Dynamic System Variable key_buffer_size # # Description: Test Cases of Dynamic System Variable key_buffer_size #
# that checks the functionality of this variable # # that checks the functionality of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
######################### #########################
...@@ -30,12 +30,14 @@ drop table if exists t1; ...@@ -30,12 +30,14 @@ drop table if exists t1;
--echo ## Creating new table t1 ## --echo ## Creating new table t1 ##
CREATE TABLE t1 CREATE TABLE t1
( (
id INT NOT NULL auto_increment, id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id), PRIMARY KEY (id),
rollno int NOT NULL, rollno INT NOT NULL,
name VARCHAR(30) name VARCHAR(30)
); );
SET @start_value= @@global.key_buffer_size;
FLUSH STATUS; FLUSH STATUS;
--echo '#--------------------FN_DYNVARS_055_01-------------------------#' --echo '#--------------------FN_DYNVARS_055_01-------------------------#'
...@@ -64,37 +66,60 @@ SELECT @@global.key_buffer_size; ...@@ -64,37 +66,60 @@ SELECT @@global.key_buffer_size;
--echo ## Inserting some rows in table ## --echo ## Inserting some rows in table ##
INSERT into t1(rollno, name) values(1, 'Record_1'); INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
INSERT into t1(rollno, name) values(2, 'Record_2'); INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
INSERT into t1(rollno, name) values(1, 'Record_3'); INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
INSERT into t1(rollno, name) values(3, 'Record_4'); INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
INSERT into t1(rollno, name) values(1, 'Record_5'); INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
INSERT into t1(rollno, name) values(3, 'Record_6'); INSERT INTO t1(rollno, name) VALUES(3, 'Record_6');
INSERT into t1(rollno, name) values(4, 'Record_7'); INSERT INTO t1(rollno, name) VALUES(4, 'Record_7');
INSERT into t1(rollno, name) values(4, 'Record_8'); INSERT INTO t1(rollno, name) VALUES(4, 'Record_8');
INSERT into t1(rollno, name) values(4, 'Record_9'); INSERT INTO t1(rollno, name) VALUES(4, 'Record_9');
INSERT into t1(rollno, name) values(4, 'Record_10'); INSERT INTO t1(rollno, name) VALUES(4, 'Record_10');
--echo ## Verifying status of reading & writing variables ## --echo ## Key_reads must be zero (no disk access) ##
# Disabled due to differences in results show status like 'Key_reads';
#show status like 'Key%';
--echo ## Switching to connection test_con2 ## --echo ## Switching to connection test_con2 ##
connection test_con2; connection test_con2;
--echo ## Verifying status of reading & writing variables ## --echo ## Key_reads must be zero (no disk access) ##
# Disabled due to differences in results show status like 'Key_reads';
#show status like 'Key%';
CONNECTION default;
--disable_warnings
SET @@global.key_buffer_size = 36;
--enable_warnings
--echo ## Connecting with connection test_con1 ##
CONNECTION test_con1;
--echo ## Inserting some rows in table ##
INSERT INTO t1(rollno, name) VALUES(5, 'Record_11');
INSERT INTO t1(rollno, name) VALUES(6, 'Record_12');
INSERT INTO t1(rollno, name) VALUES(5, 'Record_13');
INSERT INTO t1(rollno, name) VALUES(7, 'Record_14');
INSERT INTO t1(rollno, name) VALUES(5, 'Record_15');
INSERT INTO t1(rollno, name) VALUES(7, 'Record_16');
INSERT INTO t1(rollno, name) VALUES(8, 'Record_17');
INSERT INTO t1(rollno, name) VALUES(8, 'Record_18');
INSERT INTO t1(rollno, name) VALUES(8, 'Record_19');
INSERT INTO t1(rollno, name) VALUES(8, 'Record_20');
--echo ## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
############################################################ ############################################################
# Disconnecting all connection & dropping table # # Disconnecting all connection & dropping table #
############################################################ ############################################################
--echo ## Dropping table ## --echo ## Dropping table ##
DROP table if exists t1; DROP TABLE IF EXISTS t1;
--echo ## Disconnecting both the connections ## --echo ## Disconnecting both the connections ##
DISCONNECT test_con2; DISCONNECT test_con2;
DISCONNECT test_con1; DISCONNECT test_con1;
connection default;
SET @@global.key_buffer_size= @start_value;
...@@ -11,15 +11,16 @@ ...@@ -11,15 +11,16 @@
# Creation Date: 2008-02-07 # # Creation Date: 2008-02-07 #
# Author: Rizwan # # Author: Rizwan #
# # # #
# Description: Test Cases of Dynamic System Variable log # # Description: #
# that checks the behavior of this variable in the following ways# # Test Cases of Dynamic System Variable log that checks the behavior of #
# this variable in the following ways #
# * Default Value # # * Default Value #
# * Valid & Invalid values # # * Valid & Invalid values #
# * Scope & Access method # # * Scope & Access method #
# * Data Integrity # # * Data Integrity #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -34,6 +35,8 @@ ...@@ -34,6 +35,8 @@
# Accessing variable # # Accessing variable #
############################################################# #############################################################
SET @start_log= @@global.log;
SELECT @@global.log AS INIT_VALUE; SELECT @@global.log AS INIT_VALUE;
SELECT @@log AS INIT_VALUE; SELECT @@log AS INIT_VALUE;
...@@ -47,14 +50,17 @@ SET global log = 0; ...@@ -47,14 +50,17 @@ SET global log = 0;
--echo '#--------------------FN_DYNVARS_062_02-------------------------#' --echo '#--------------------FN_DYNVARS_062_02-------------------------#'
################################################################################### ################################################################################
# Check if the value in GLOBAL Table matches value in variable # # Check if the value in GLOBAL Table matches value in variable #
################################################################################### ################################################################################
# We can only access log value from information schema global_variables table # We can only access log value from information schema global_variables table
SELECT VARIABLE_VALUE SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='log'; WHERE VARIABLE_NAME='log';
SET @@global.log= @start_log;
############################################ ############################################
# END OF log TESTS # # END OF log TESTS #
############################################ ############################################
...@@ -30,16 +30,16 @@ drop table if exists t1; ...@@ -30,16 +30,16 @@ drop table if exists t1;
# Setting initial value of variable to 0 and verifying whether user # Setting initial value of variable to 0 and verifying whether user
# is allowed to create function or not. # is allowed to create function or not.
######################################################################## ########################################################################
SET @start_value= @@global.log_bin_trust_function_creators;
--echo ## Creating new user tt ## --echo ## Creating new user tt ##
CREATE user tt@localhost; CREATE USER tt@localhost;
--echo ## Setting value of variable to 0 ## --echo ## Setting value of variable to 0 ##
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET @@global.log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators = 0;
--echo ## Creating new table t2 ## --echo ## Creating new table t2 ##
create table t2 (a INT); CREATE TABLE t2 (a INT);
--echo ## Creating & connecting with new connection test_con1 ## --echo ## Creating & connecting with new connection test_con1 ##
connect (test_con1,localhost,tt,,); connect (test_con1,localhost,tt,,);
...@@ -70,8 +70,8 @@ INSERT INTO t1 VALUES (1),(2),(3); ...@@ -70,8 +70,8 @@ INSERT INTO t1 VALUES (1),(2),(3);
SELECT f1(a) FROM t1; SELECT f1(a) FROM t1;
--echo ## Dropping function f1 & table t1 ## --echo ## Dropping function f1 & table t1 ##
drop function f1; DROP FUNCTION f1;
drop table t1; DROP TABLE t1;
--echo '#--------------------FN_DYNVARS_063_02-------------------------#' --echo '#--------------------FN_DYNVARS_063_02-------------------------#'
######################################################################## ########################################################################
...@@ -112,15 +112,16 @@ INSERT INTO t1 VALUES (1),(2),(3); ...@@ -112,15 +112,16 @@ INSERT INTO t1 VALUES (1),(2),(3);
SELECT f1(a) FROM t1; SELECT f1(a) FROM t1;
--echo ## Dropping function f1 ## --echo ## Dropping function f1 ##
drop function f1; DROP FUNCTION f1;
--echo ## Dropping table t1 & t2 ## --echo ## Dropping table t1 & t2 ##
drop table t1,t2; DROP TABLE t1,t2;
--echo ## Disconnecting both the connections ## --echo ## Disconnecting test_con2##
disconnect test_con2; disconnect test_con2;
connection default; connection default;
DROP USER tt@localhost; DROP USER tt@localhost;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; SET @@global.log_bin_trust_function_creators= @start_value;
################## mysql-test\t\log_queries_not_using_indexes_basic.test ###### ################## mysql-test\t\log_queries_not_using_indexes_basic.test ######
# # # #
# Variable Name: log_queries_not_using_indexes # # Variable Name: log_queries_not_using_indexes #
...@@ -11,93 +9,124 @@ ...@@ -11,93 +9,124 @@
# Creation Date: 2008-02-07 # # Creation Date: 2008-02-07 #
# Author : Sharique Abdullah # # Author : Sharique Abdullah #
# # # #
# # # Description:Test Cases of Dynamic System Variable #
# Description:Test Cases of Dynamic System Variable log_queries_not_using_indexes# # log_queries_not_using_indexes #
# that checks the behavior of this variable in the following ways # # that checks the behavior of this variable in the following ways #
# * Value Check # # * Value Check #
# * Scope Check # # * Scope Check #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
--echo '#---------------------BS_STVARS_041_01----------------------#' SET @start_value= @@global.log_queries_not_using_indexes;
#################################################################### ####################################################################
# Displaying default value # # Valid values for boolean #
#################################################################### ####################################################################
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes); SET @@global.log_queries_not_using_indexes= DEFAULT;
--echo 1 Expected SELECT @@global.log_queries_not_using_indexes;
SET @@global.log_queries_not_using_indexes= TRUE;
SELECT @@global.log_queries_not_using_indexes;
--echo '#---------------------BS_STVARS_041_02----------------------#' SET @@global.log_queries_not_using_indexes= true;
# SELECT @@global.log_queries_not_using_indexes;
# Test case for Bug #35433
# SET @@global.log_queries_not_using_indexes= 0;
#################################################################### SELECT @@global.log_queries_not_using_indexes;
# Check if Value can set #
#################################################################### SET @@global.log_queries_not_using_indexes= 1;
SELECT @@global.log_queries_not_using_indexes;
SET @goodvar= TRUE;
SET @@global.log_queries_not_using_indexes= @goodvar;
SELECT @@global.log_queries_not_using_indexes;
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR SET GLOBAL log_queries_not_using_indexes= DEFAULT;
SET @@GLOBAL.log_queries_not_using_indexes=1; SELECT @@global.log_queries_not_using_indexes;
--echo Expected error 'Read only variable'
--ECHO "BUG:It should give error on setting this variable as it is readonly variable"
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
--echo 1 Expected
SET GLOBAL log_queries_not_using_indexes= ON;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= OFF;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= -0;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= 0.00;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= -0.0;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= 001.00;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= +1.0;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= +0;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= +0.000000;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= 0000.00000;
SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= .0;
SELECT @@global.log_queries_not_using_indexes;
--echo '#---------------------BS_STVARS_041_03----------------------#'
################################################################# #################################################################
# Check if the value in GLOBAL Table matches value in variable # # Check if the value in GLOBAL Table matches value in variable #
################################################################# #################################################################
SELECT @@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE --error ER_WRONG_VALUE_FOR_VAR
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES SET @@global.log_queries_not_using_indexes= 'DEFAULT';
WHERE VARIABLE_NAME='log_queries_not_using_indexes';
--echo 1 Expected --error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_queries_not_using_indexes= 'true';
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes); --error ER_WRONG_VALUE_FOR_VAR
--echo 1 Expected SET @@global.log_queries_not_using_indexes= BLABLA;
SELECT COUNT(VARIABLE_VALUE) --error ER_WRONG_VALUE_FOR_VAR
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES SET @@global.log_queries_not_using_indexes= 25;
WHERE VARIABLE_NAME='log_queries_not_using_indexes';
--echo 1 Expected
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_queries_not_using_indexes= 12.34;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL log_queries_not_using_indexes= -1;
--echo '#---------------------BS_STVARS_041_04----------------------#' SET @badvar= 'true';
################################################################################ --error ER_WRONG_VALUE_FOR_VAR
# Check if accessing variable with and without GLOBAL point to same variable # SET @@global.log_queries_not_using_indexes= @badvar;
################################################################################
SELECT @@log_queries_not_using_indexes = @@GLOBAL.log_queries_not_using_indexes;
--echo 1 Expected
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL log_queries_not_using_indexes= 'DEFAULT';
--error ER_GLOBAL_VARIABLE
SET log_queries_not_using_indexes= TRUE;
--echo '#---------------------BS_STVARS_041_05----------------------#' --error ER_GLOBAL_VARIABLE
################################################################################ SET SESSION log_queries_not_using_indexes= TRUE;
# Check if log_queries_not_using_indexes can be accessed with and without @@ sign #
################################################################################
SELECT COUNT(@@log_queries_not_using_indexes); --error ER_GLOBAL_VARIABLE
--echo 1 Expected SET @@session.log_queries_not_using_indexes= TRUE;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR --error ER_GLOBAL_VARIABLE
SELECT COUNT(@@local.log_queries_not_using_indexes); SET LOCAL log_queries_not_using_indexes= TRUE;
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR --error ER_PARSE_ERROR
SELECT COUNT(@@SESSION.log_queries_not_using_indexes); SET @@global log_queries_not_using_indexes= TRUE;
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes); --error ER_PARSE_ERROR
--echo 1 Expected SET @@SESSION log_queries_not_using_indexes= TRUE;
--Error ER_BAD_FIELD_ERROR
SELECT log_queries_not_using_indexes = @@SESSION.log_queries_not_using_indexes;
--echo Expected error 'Readonly variable'
SET @@global.log_queries_not_using_indexes= @start_value;
# hhunger 08.22.2008: with check-testcases differences due to bug#38889 using
# slow_query_log_file or general_log_file
-- source include/not_embedded.inc -- source include/not_embedded.inc
--source include/have_csv.inc --source include/have_csv.inc
--disable_ps_protocol --disable_ps_protocol
# save default value to set them back at the end of the test
set @start_general_log= @@global.general_log;
set @start_slow_query_log= @@global.slow_query_log;
set @start_general_log_file= @@global.general_log_file;
set global general_log= OFF; set global general_log= OFF;
truncate table mysql.general_log; truncate table mysql.general_log;
truncate table mysql.slow_log; truncate table mysql.slow_log;
...@@ -71,16 +79,16 @@ show variables like 'slow_query_log_file'; ...@@ -71,16 +79,16 @@ show variables like 'slow_query_log_file';
show variables like 'log_output'; show variables like 'log_output';
# Can't set general_log_file to a non existing file # Can't set general_log_file to a non existing file
--error 1231 --error ER_WRONG_VALUE_FOR_VAR
set global general_log_file='/not exiting path/log.master'; set global general_log_file='/not exiting path/log.master';
# Can't set general_log_file to a directory # Can't set general_log_file to a directory
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1231 --error ER_WRONG_VALUE_FOR_VAR
eval set global general_log_file='$MYSQLTEST_VARDIR'; eval set global general_log_file='$MYSQLTEST_VARDIR';
# Can't set general_log_file to empty string # Can't set general_log_file to empty string
--error 1231 --error ER_WRONG_VALUE_FOR_VAR
set global general_log_file=''; set global general_log_file='';
--replace_column 2 # --replace_column 2 #
...@@ -219,13 +227,13 @@ SET GLOBAL slow_query_log = @old_slow_log_state; ...@@ -219,13 +227,13 @@ SET GLOBAL slow_query_log = @old_slow_log_state;
set @old_general_log_file= @@global.general_log_file; set @old_general_log_file= @@global.general_log_file;
set @old_slow_query_log_file= @@global.slow_query_log_file; set @old_slow_query_log_file= @@global.slow_query_log_file;
--error 1231 --error ER_WRONG_VALUE_FOR_VAR
set global general_log_file= concat('/not exiting path/log.maste', 'r'); set global general_log_file= concat('/not exiting path/log.maste', 'r');
--error 1231 --error ER_WRONG_VALUE_FOR_VAR
set global general_log_file= NULL; set global general_log_file= NULL;
--error 1231 --error ER_WRONG_VALUE_FOR_VAR
set global slow_query_log_file= concat('/not exiting path/log.maste', 'r'); set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
--error 1231 --error ER_WRONG_VALUE_FOR_VAR
set global slow_query_log_file= NULL; set global slow_query_log_file= NULL;
set global general_log_file= @old_general_log_file; set global general_log_file= @old_general_log_file;
...@@ -267,8 +275,14 @@ SET GLOBAL slow_query_log_file = @slow_query_log_file_saved; ...@@ -267,8 +275,14 @@ SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
# Cleanup (must be done last to avoid delayed 'Quit' message in general log) # Cleanup (must be done last to avoid delayed 'Quit' message in general log)
# #
disconnect con1; disconnect con1;
# set back the saved default values
connection default;
set @@global.general_log= @start_general_log;
set @@global.slow_query_log= @start_slow_query_log;
set @@global.general_log_file= @start_general_log_file;
# Remove the log files that was created in the "default location" # Remove the log files that was created in the "default location"
# i.e var/run # i.e var/run
--remove_file $MYSQLTEST_VARDIR/run/mysqld.log --remove_file $MYSQLTEST_VARDIR/run/mysqld.log
--remove_file $MYSQLTEST_VARDIR/run/mysqld-slow.log --remove_file $MYSQLTEST_VARDIR/run/mysqld-slow.log
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
# check that CSV engine was compiled in # check that CSV engine was compiled in
--source include/have_csv.inc --source include/have_csv.inc
SET @old_general_log_state = @@global.general_log;
SET @old_slow_log_state = @@global.slow_query_log;
--disable_ps_protocol --disable_ps_protocol
use mysql; use mysql;
...@@ -444,6 +447,7 @@ use test; ...@@ -444,6 +447,7 @@ use test;
# AUTO_INCREMENT numbers) # AUTO_INCREMENT numbers)
# #
SET @my_log_output= @@global.log_output;
SET GLOBAL LOG_OUTPUT = 'TABLE'; SET GLOBAL LOG_OUTPUT = 'TABLE';
## test the general log ## test the general log
...@@ -509,6 +513,9 @@ FLUSH LOGS; ...@@ -509,6 +513,9 @@ FLUSH LOGS;
ALTER TABLE mysql.slow_log DROP COLUMN seq; ALTER TABLE mysql.slow_log DROP COLUMN seq;
ALTER TABLE mysql.slow_log ENGINE = CSV; ALTER TABLE mysql.slow_log ENGINE = CSV;
SET GLOBAL general_log = @old_general_log_state;
SET GLOBAL slow_query_log = @old_slow_log_state;
# #
# Bug#25422 (Hang with log tables) # Bug#25422 (Hang with log tables)
# #
...@@ -964,5 +971,7 @@ DROP TABLE t1; ...@@ -964,5 +971,7 @@ DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log; TRUNCATE TABLE mysql.slow_log;
SET GLOBAL log_output= @my_log_output;
SET GLOBAL slow_query_log = @old_slow_log_state; SET GLOBAL slow_query_log = @old_slow_log_state;
SET SESSION long_query_time =@old_long_query_time; SET SESSION long_query_time =@old_long_query_time;
...@@ -14,16 +14,16 @@ ...@@ -14,16 +14,16 @@
# Description: Test Cases of Dynamic System Variable max_allowed_packet # # Description: Test Cases of Dynamic System Variable max_allowed_packet #
# that checks the functionality of this variable # # that checks the functionality of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
#due to lost connection on win64 #due to lost connection on win64
--source include/not_windows.inc --source include/not_windows.inc
let $start_global_value = `SELECT @@global.max_allowed_packet`; SET @start_max_allowed_packet= @@global.max_allowed_packet;
--echo $start_global_value SET @start_value= @@global.net_buffer_length;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
...@@ -43,8 +43,8 @@ name BLOB ...@@ -43,8 +43,8 @@ name BLOB
--echo '#--------------------FN_DYNVARS_070_01-------------------------#' --echo '#--------------------FN_DYNVARS_070_01-------------------------#'
############################################################################### ###############################################################################
# Setting initial value of max_allowed_packet to 1024 at session level and # Setting initial value of max_allowed_packet to 1024 at session level and #
# verifying its behavior after inserting data greater than 1024 bytes # verifying its behavior after inserting data greater than 1024 bytes #
############################################################################### ###############################################################################
--echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ## --echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ##
...@@ -87,9 +87,6 @@ INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfal ...@@ -87,9 +87,6 @@ INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfal
disconnect test_con1; disconnect test_con1;
connection default; connection default;
drop table t1; drop table t1;
eval SET @@global.max_allowed_packet = $start_global_value; SET @@global.max_allowed_packet= @start_max_allowed_packet;
SET @@global.net_buffer_length= @start_value;
--echo ## Server disconnects after this case and error occurs that Server ##
--echo ## has gone away ##
# Test for max_seeks_for_key #
#Test for max_seeks_for_key#
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
...@@ -14,11 +10,11 @@ drop table if exists t1; ...@@ -14,11 +10,11 @@ drop table if exists t1;
######################### #########################
CREATE TABLE t1 CREATE TABLE t1
(a int auto_increment primary key, (a INT AUTO_INCREMENT PRIMARY KEY,
b char(20) b CHAR(20)
); );
SET @start_value= @@global.max_seeks_for_key;
--echo '#--------------------FN_DYNVARS_084_01-------------------------#' --echo '#--------------------FN_DYNVARS_084_01-------------------------#'
########################################################## ##########################################################
...@@ -35,15 +31,15 @@ SELECT @@session.max_seeks_for_key = 10; ...@@ -35,15 +31,15 @@ SELECT @@session.max_seeks_for_key = 10;
# Setting global value of variable and inserting data in table # Setting global value of variable and inserting data in table
SET @@global.max_seeks_for_key = 20; SET @@global.max_seeks_for_key = 20;
SELECT @@global.max_seeks_for_key; SELECT @@global.max_seeks_for_key;
INSERT into t1(b) values("AREc"); INSERT INTO t1(b) VALUES("AREc");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
# Setting session value of variable and inserting data in table # Setting session value of variable and inserting data in table
SET @@session.max_seeks_for_key = 2; SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key; SELECT @@session.max_seeks_for_key;
INSERT into t1(b) values("BREc"); INSERT INTO t1(b) VALUES("BREc");
INSERT into t1(b) values("CRec"); INSERT INTO t1(b) VALUES("CRec");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
--echo '#--------------------FN_DYNVARS_084_02-------------------------#' --echo '#--------------------FN_DYNVARS_084_02-------------------------#'
...@@ -63,31 +59,26 @@ SELECT @@session.max_seeks_for_key = 10; ...@@ -63,31 +59,26 @@ SELECT @@session.max_seeks_for_key = 10;
# Setting global value of variable and inserting data in table # Setting global value of variable and inserting data in table
SET @@global.max_seeks_for_key = 20; SET @@global.max_seeks_for_key = 20;
SELECT @@global.max_seeks_for_key; SELECT @@global.max_seeks_for_key;
INSERT into t1(b) values("AREc"); INSERT INTO t1(b) VALUES("AREc");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
# Setting session value of variable and inserting data in table # Setting session value of variable and inserting data in table
SET @@session.max_seeks_for_key = 2; SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key; SELECT @@session.max_seeks_for_key;
INSERT into t1(b) values("BREc"); INSERT INTO t1(b) VALUES("BREc");
INSERT into t1(b) values("CRec"); INSERT INTO t1(b) VALUES("CRec");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
######################################################
#####################################################
# Inserting values in table t and analyzing table # # Inserting values in table t and analyzing table #
##################################################### ######################################################
INSERT INTO t1 values(null,"test"); INSERT INTO t1 VALUES(null,"test");
INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"), INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a"),(null,"a"), (null,"a"),(null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a"); (null,"a"),(null,"a"),(null,"a");
explain SELECT STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
analyze table t1; ANALYZE TABLE t1;
################################################################### ###################################################################
# Setting new value for max_seeks_for_key and anaylyzing table # # Setting new value for max_seeks_for_key and anaylyzing table #
...@@ -96,9 +87,14 @@ analyze table t1; ...@@ -96,9 +87,14 @@ analyze table t1;
SET MAX_SEEKS_FOR_KEY=1; SET MAX_SEEKS_FOR_KEY=1;
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
SET MAX_SEEKS_FOR_KEY=DEFAULT; SET MAX_SEEKS_FOR_KEY=DEFAULT;
drop table t1; connection default;
disconnect test_con1;
disconnect test_con2;
DROP TABLE t1;
SET @@global.max_seeks_for_key= @start_value;
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
# Creation Date: 2008-03-02 # # Creation Date: 2008-03-02 #
# Author: Sharique Abdullah # # Author: Sharique Abdullah #
# # # #
# Description: Test Cases of Dynamic System Variable max_prepared_stmt_count_fn# # Description: Test Cases of Dynamic System Variable max_sort_length #
# that checks behavior of this variable in the following ways # # that checks behavior of this variable in the following ways #
# * Functionality based on different values # # * Functionality based on different values #
# # # #
#Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html# # Reference: #
# option_mysqld_max_sort_length # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
################################################################################ ################################################################################
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
# Setup # Setup
# #
SET @start_value= @@global.max_sort_length;
SET @session_max_sort_length = @@Session.max_sort_length; SET @session_max_sort_length = @@Session.max_sort_length;
...@@ -186,7 +188,7 @@ SELECT c from t ORDER BY c, id; ...@@ -186,7 +188,7 @@ SELECT c from t ORDER BY c, id;
#Check if sorting is applied on BLOB type # #Check if sorting is applied on BLOB type #
########################################### ###########################################
--echo Testing type BLOB --echo Testing type BLOB
## Setting global value of variable and inserting data in table # Setting global value of variable and inserting data in table
SET @@global.max_sort_length = 30; SET @@global.max_sort_length = 30;
SELECT @@global.max_sort_length; SELECT @@global.max_sort_length;
INSERT INTO t1 set c = repeat('x',29); INSERT INTO t1 set c = repeat('x',29);
...@@ -211,7 +213,7 @@ SELECT c from t1 ORDER BY c, id; ...@@ -211,7 +213,7 @@ SELECT c from t1 ORDER BY c, id;
#Check if sorting is applied on CHAR type # #Check if sorting is applied on CHAR type #
########################################### ###########################################
--echo Testing type CHAR --echo Testing type CHAR
## Setting global value of variable and inserting data in table # Setting global value of variable and inserting data in table
SET @@global.max_sort_length = 30; SET @@global.max_sort_length = 30;
SELECT @@global.max_sort_length; SELECT @@global.max_sort_length;
INSERT INTO t2 set c = repeat('x',29); INSERT INTO t2 set c = repeat('x',29);
...@@ -251,3 +253,5 @@ DROP TABLE IF EXISTS t1; ...@@ -251,3 +253,5 @@ DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t2;
--enable_warnings --enable_warnings
SET @@global.max_sort_length= @start_value;
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
# Description: Test Cases of Dynamic System Variable myisam_data_pointer_size # # Description: Test Cases of Dynamic System Variable myisam_data_pointer_size #
# that checks the behavior of this variable # # that checks the behavior of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
################################################################################ ################################################################################
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
# Check if setting myisam_data_pointer_size is changed in every new connection# # Check if setting myisam_data_pointer_size is changed in every new connection#
############################################################################### ###############################################################################
SET @start_value= @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 2; SET @@global.myisam_data_pointer_size = 2;
# con1 will be default connection from now on # con1 will be default connection from now on
--echo 'connect (con1,localhost,root,,,,)' --echo 'connect (con1,localhost,root,,,,)'
...@@ -48,7 +49,6 @@ disconnect con2; ...@@ -48,7 +49,6 @@ disconnect con2;
--echo 'connection con1' --echo 'connection con1'
connection con1; connection con1;
#=========================================================== #===========================================================
# Checking myisam_data_pointer_size is 2 # Checking myisam_data_pointer_size is 2
#=========================================================== #===========================================================
...@@ -59,10 +59,7 @@ DROP PROCEDURE IF EXISTS sp_addRec; ...@@ -59,10 +59,7 @@ DROP PROCEDURE IF EXISTS sp_addRec;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
DELIMITER //; DELIMITER //;
CREATE PROCEDURE sp_addRec(IN count INT) CREATE PROCEDURE sp_addRec(IN count INT)
BEGIN BEGIN
WHILE (count>0) DO WHILE (count>0) DO
...@@ -70,7 +67,6 @@ BEGIN ...@@ -70,7 +67,6 @@ BEGIN
SET count = count -1; SET count = count -1;
END WHILE; END WHILE;
END // END //
DELIMITER ;// DELIMITER ;//
# setting 2 will allow data pointer to access files with size < 65536 # setting 2 will allow data pointer to access files with size < 65536
...@@ -105,6 +101,9 @@ SELECT count(*) from t1; ...@@ -105,6 +101,9 @@ SELECT count(*) from t1;
DROP PROCEDURE sp_addRec; DROP PROCEDURE sp_addRec;
DROP TABLE t1; DROP TABLE t1;
connection default;
SET @@global.myisam_data_pointer_size= @start_value;
################################################################ ################################################################
# End of functionality Testing for myisam_data_pointer_size # # End of functionality Testing for myisam_data_pointer_size #
################################################################ ################################################################
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
# Description: Test Cases of Dynamic System Variable myisam_stats_method # # Description: Test Cases of Dynamic System Variable myisam_stats_method #
# that checks the behavior of this variable # # that checks the behavior of this variable #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
# Check if Setting myisam_stats_method is changed in new connection # # Check if Setting myisam_stats_method is changed in new connection #
##################################################################### #####################################################################
SET @start_value = @@global.myisam_stats_method;
SET @@global.myisam_stats_method = nulls_equal; SET @@global.myisam_stats_method = nulls_equal;
--echo 'connect (con1,localhost,root,,,,)' --echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,); connect (con1,localhost,root,,,,);
...@@ -45,19 +47,19 @@ connection default; ...@@ -45,19 +47,19 @@ connection default;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
CREATE TABLE t1 (a int, key (a)); CREATE TABLE t1 (a INT, KEY (a));
INSERT INTO t1 VALUES (0),(1),(2),(3),(4); INSERT INTO t1 VALUES (0),(1),(2),(3),(4);
INSERT INTO t1 SELECT NULL FROM t1; INSERT INTO t1 SELECT NULL FROM t1;
#======================================= #=======================================
--echo 'default: NULLs considered unequal' --echo 'default: NULLs considered unequal'
#======================================= #=======================================
SET myisam_stats_method=nulls_unequal; SET myisam_stats_method = nulls_unequal;
ANALYZE TABLE t1; ANALYZE TABLE t1;
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
INSERT INTO t1 VALUES (11); INSERT INTO t1 VALUES (11);
DELETE FROM t1 WHERE a=11; DELETE FROM t1 WHERE a = 11;
CHECK TABLE t1; CHECK TABLE t1;
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
...@@ -65,14 +67,14 @@ SHOW INDEX FROM t1; ...@@ -65,14 +67,14 @@ SHOW INDEX FROM t1;
#===================================== #=====================================
--echo 'Set nulls to be equal' --echo 'Set nulls to be equal'
#===================================== #=====================================
SET myisam_stats_method=nulls_equal; SET myisam_stats_method = nulls_equal;
INSERT INTO t1 VALUES (11); INSERT INTO t1 VALUES (11);
DELETE FROM t1 WHERE a=11; DELETE FROM t1 WHERE a = 11;
ANALYZE TABLE t1; ANALYZE TABLE t1;
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
INSERT INTO t1 VALUES (11); INSERT INTO t1 VALUES (11);
DELETE FROM t1 WHERE a=11; DELETE FROM t1 WHERE a = 11;
CHECK TABLE t1; CHECK TABLE t1;
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
...@@ -80,13 +82,13 @@ SHOW INDEX FROM t1; ...@@ -80,13 +82,13 @@ SHOW INDEX FROM t1;
--echo 'Set nulls to be ignored' --echo 'Set nulls to be ignored'
#===================================== #=====================================
SET myisam_stats_method=nulls_ignored; SET myisam_stats_method = nulls_ignored;
SHOW variables LIKE 'myisam_stats_method'; SHOW VARIABLES LIKE 'myisam_stats_method';
drop TABLE t1; DROP TABLE t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a char(3), b char(4), c char(5), d char(6), a CHAR(3), b CHAR(4), c CHAR(5), d CHAR(6),
key(a,b,c,d) KEY(a,b,c,d)
); );
INSERT INTO t1 VALUES ('bcd','def1', NULL, 'zz'); INSERT INTO t1 VALUES ('bcd','def1', NULL, 'zz');
INSERT INTO t1 VALUES ('bcd','def2', NULL, 'zz'); INSERT INTO t1 VALUES ('bcd','def2', NULL, 'zz');
...@@ -98,9 +100,12 @@ DELETE FROM t1; ...@@ -98,9 +100,12 @@ DELETE FROM t1;
ANALYZE TABLE t1; ANALYZE TABLE t1;
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
SET myisam_stats_method=DEFAULT; SET myisam_stats_method = DEFAULT;
DROP TABLE t1; DROP TABLE t1;
SET @@global.myisam_stats_method= @start_value;
######################################################## ########################################################
# End of functionality Testing for myisam_stats_method # # End of functionality Testing for myisam_stats_method #
######################################################## ########################################################
...@@ -14,6 +14,7 @@ select @@profiling; ...@@ -14,6 +14,7 @@ select @@profiling;
set global profiling = ON; set global profiling = ON;
# But size is okay # But size is okay
set @start_value= @@global.profiling_history_size;
set global profiling_history_size=100; set global profiling_history_size=100;
show global variables like 'profil%'; show global variables like 'profil%';
...@@ -261,6 +262,6 @@ drop function if exists f1; ...@@ -261,6 +262,6 @@ drop function if exists f1;
## last thing in the file ## last thing in the file
set session profiling = OFF; set session profiling = OFF;
set global profiling_history_size= @start_value;
## ##
--echo End of 5.0 tests --echo End of 5.0 tests
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
# that checks behavior of this variable in the following ways # # that checks behavior of this variable in the following ways #
# * Functionality based on different values # # * Functionality based on different values #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en # # Reference: #
# /server-system-variables.html#option_mysqld_Query_cache_limit # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
# #
SET @global_query_cache_limit = @@global.query_cache_limit; SET @global_query_cache_limit = @@global.query_cache_limit;
SET @global_query_cache_size = @@global.query_cache_size;
SET @global_query_cache_type = @@global.query_cache_type;
--echo ** warnings ** --echo ** warnings **
--disable_warnings --disable_warnings
...@@ -105,7 +107,7 @@ RESET QUERY CACHE; ...@@ -105,7 +107,7 @@ RESET QUERY CACHE;
#set cache limit #set cache limit
--echo ** set cache limit ** --echo ** set cache limit **
SET @@GLOBAL.query_cache_limit=0; SET @@GLOBAL.query_cache_limit = 0;
#fetching results# #fetching results#
--echo ** fetching results ** --echo ** fetching results **
...@@ -113,7 +115,6 @@ SELECT * FROM t; ...@@ -113,7 +115,6 @@ SELECT * FROM t;
# Check status after setting value# # Check status after setting value#
--echo ** Check status after setting value ** --echo ** Check status after setting value **
#let $newcachevalue1= query_get_value(SHOW STATUS LIKE 'Qcache_queries_in_cache', Value, 1);
SHOW STATUS LIKE 'Qcache_not_cached'; SHOW STATUS LIKE 'Qcache_not_cached';
--echo 1 Expected --echo 1 Expected
SHOW STATUS LIKE 'Qcache_queries_in_cache'; SHOW STATUS LIKE 'Qcache_queries_in_cache';
...@@ -127,7 +128,7 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache'; ...@@ -127,7 +128,7 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
#set cache limit to default #set cache limit to default
--echo ** set cache limit ** --echo ** set cache limit **
SET @@GLOBAL.query_cache_limit=DEFAULT; SET @@GLOBAL.query_cache_limit = DEFAULT;
# Reset cache & flush status # Reset cache & flush status
--echo ** Reset cache values ** --echo ** Reset cache values **
...@@ -143,7 +144,7 @@ SHOW STATUS LIKE 'Qcache_not_cached'; ...@@ -143,7 +144,7 @@ SHOW STATUS LIKE 'Qcache_not_cached';
SHOW STATUS LIKE 'Qcache_queries_in_cache'; SHOW STATUS LIKE 'Qcache_queries_in_cache';
--echo 1 Expected --echo 1 Expected
SET @@GLOBAL.query_cache_limit=0; SET @@GLOBAL.query_cache_limit = 0;
SHOW STATUS LIKE 'Qcache_not_cached'; SHOW STATUS LIKE 'Qcache_not_cached';
--echo 0 Expected --echo 0 Expected
...@@ -167,7 +168,10 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache'; ...@@ -167,7 +168,10 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
# #
SET @@GLOBAL.query_cache_limit = @global_query_cache_limit; SET @@GLOBAL.query_cache_limit = @global_query_cache_limit;
SET GLOBAL query_cache_size = @global_query_cache_size;
SET GLOBAL query_cache_type = @global_query_cache_type;
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
--enable_warnings --enable_warnings
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
# Description: Test Cases of Dynamic System Variable "query_cache_type" # # Description: Test Cases of Dynamic System Variable "query_cache_type" #
# that checks behavior of this variable in the following ways # # that checks behavior of this variable in the following ways #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html#option_mysqld_query_cache_type # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -36,6 +36,7 @@ connection con0; ...@@ -36,6 +36,7 @@ connection con0;
SET @start_global_value = @@GLOBAL.query_cache_type; SET @start_global_value = @@GLOBAL.query_cache_type;
SET @start_session_value = @@SESSION.query_cache_type; SET @start_session_value = @@SESSION.query_cache_type;
SET @start_query_cache_size= @@global.query_cache_size;
# #
# Creating test table # Creating test table
...@@ -305,6 +306,7 @@ connection con0; ...@@ -305,6 +306,7 @@ connection con0;
SET @@GLOBAL.query_cache_type = @start_global_value; SET @@GLOBAL.query_cache_type = @start_global_value;
SET @@SESSION.query_cache_type = @start_session_value; SET @@SESSION.query_cache_type = @start_session_value;
SET GLOBAL query_cache_size = @start_query_cache_size;
DROP TABLE t1; DROP TABLE t1;
...@@ -312,3 +314,4 @@ DROP PROCEDURE testProcHit; ...@@ -312,3 +314,4 @@ DROP PROCEDURE testProcHit;
--echo Disconnecting con0 --echo Disconnecting con0
disconnect con0; disconnect con0;
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
# * Scope & Access method # # * Scope & Access method #
# * Cache behaviors # # * Cache behaviors #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html#option_mysqld_query_prealloc_size # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
############################################################################### ###############################################################################
...@@ -35,12 +35,14 @@ ...@@ -35,12 +35,14 @@
# Save initial value # Save initial value
# #
CREATE TABLE t1 (id int auto_increment primary key, val text(200)); SET @start_value = @@global.query_prealloc_size;
INSERT INTO t1 values(NULL,'a'); CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY, val TEXT(200));
INSERT INTO t1 values(NULL,'b');
INSERT INTO t1 values(NULL,'c'); INSERT INTO t1 VALUES(NULL,'a');
INSERT INTO t1 values(NULL,'d'); INSERT INTO t1 VALUES(NULL,'b');
INSERT INTO t1 VALUES(NULL,'c');
INSERT INTO t1 VALUES(NULL,'d');
SELECT * FROM t1 ORDER BY val; SELECT * FROM t1 ORDER BY val;
...@@ -84,3 +86,7 @@ connection default; ...@@ -84,3 +86,7 @@ connection default;
disconnect con_int1; disconnect con_int1;
disconnect con_int2; disconnect con_int2;
DROP TABLE t1;
SET @@global.query_prealloc_size = @start_value;
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
# # # #
# Creation Date: 2008-03-16 # # Creation Date: 2008-03-16 #
# Author: Salman Rawala # # Author: Salman Rawala #
# Modified: HHunger 2008-09-11 set system var back to start value #
# # # #
# Description: Test Cases of Dynamic System Variable "slow_query_log_file" # # Description: Test Cases of Dynamic System Variable "slow_query_log_file" #
# that checks behavior of this variable in the following ways # # that checks behavior of this variable in the following ways #
...@@ -18,8 +19,8 @@ ...@@ -18,8 +19,8 @@
# * Scope & Access method # # * Scope & Access method #
# * Data Integrity # # * Data Integrity #
# # # #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # Reference: #
# server-system-variables.html#option_mysqld_slow_query_log_file # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
# # # #
################################################################################ ################################################################################
...@@ -35,8 +36,6 @@ ...@@ -35,8 +36,6 @@
########################################################################### ###########################################################################
SET @start_value = @@global.slow_query_log_file; SET @start_value = @@global.slow_query_log_file;
SELECT @start_value;
--echo '#---------------------FN_DYNVARS_004_01-------------------------#' --echo '#---------------------FN_DYNVARS_004_01-------------------------#'
############################################### ###############################################
...@@ -66,7 +65,8 @@ SELECT @@global.slow_query_log_file = VARIABLE_VALUE ...@@ -66,7 +65,8 @@ SELECT @@global.slow_query_log_file = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slow_query_log_file'; WHERE VARIABLE_NAME='slow_query_log_file';
SET @@global.slow_query_log_file= @start_value;
##################################################### #####################################################
# END OF slow_query_log_file TESTS # # END OF slow_query_log_file TESTS #
##################################################### #####################################################
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#################################################################### ####################################################################
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
--echo ## Checking if my_slow_test.log exist in servers datadir ## --echo ## Checking if my_slow_test.log exists in servers datadir ##
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--file_exists $MYSQLD_DATADIR/my_slow_test.log --file_exists $MYSQLD_DATADIR/my_slow_test.log
......
...@@ -28,3 +28,5 @@ set global slave_net_timeout=default; ...@@ -28,3 +28,5 @@ set global slave_net_timeout=default;
# sql_slave_skip_counter is write-only, so we can't save previous # sql_slave_skip_counter is write-only, so we can't save previous
# value and restore it here. That's ok, because it's normally 0. # value and restore it here. That's ok, because it's normally 0.
set global sql_slave_skip_counter= 0; set global sql_slave_skip_counter= 0;
set @@global.slave_net_timeout= @my_slave_net_timeout;
...@@ -24,6 +24,7 @@ set @my_max_heap_table_size =@@global.max_heap_table_size; ...@@ -24,6 +24,7 @@ set @my_max_heap_table_size =@@global.max_heap_table_size;
set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads; set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads;
set @my_max_join_size =@@global.max_join_size; set @my_max_join_size =@@global.max_join_size;
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size; set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
set @my_myisam_max_sort_file_size =@@global.myisam_max_sort_file_size;
set @my_net_buffer_length =@@global.net_buffer_length; set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout; set @my_net_write_timeout =@@global.net_write_timeout;
set @my_net_read_timeout =@@global.net_read_timeout; set @my_net_read_timeout =@@global.net_read_timeout;
...@@ -34,7 +35,6 @@ set @my_server_id =@@global.server_id; ...@@ -34,7 +35,6 @@ set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time; set @my_slow_launch_time =@@global.slow_launch_time;
set @my_storage_engine =@@global.storage_engine; set @my_storage_engine =@@global.storage_engine;
set @my_thread_cache_size =@@global.thread_cache_size; set @my_thread_cache_size =@@global.thread_cache_size;
# case insensitivity tests (new in 5.0) # case insensitivity tests (new in 5.0)
set @`test`=1; set @`test`=1;
select @test, @`test`, @TEST, @`TEST`, @"teSt"; select @test, @`test`, @TEST, @`TEST`, @"teSt";
...@@ -750,7 +750,7 @@ set global delayed_queue_size =@my_delayed_queue_size; ...@@ -750,7 +750,7 @@ set global delayed_queue_size =@my_delayed_queue_size;
set global flush =@my_flush; set global flush =@my_flush;
set global flush_time =@my_flush_time; set global flush_time =@my_flush_time;
set global key_buffer_size =@my_key_buffer_size; set global key_buffer_size =@my_key_buffer_size;
set global max_binlog_cache_size =default; #@my_max_binlog_cache_size; set global max_binlog_cache_size =@my_max_binlog_cache_size;
set global max_binlog_size =@my_max_binlog_size; set global max_binlog_size =@my_max_binlog_size;
set global max_connect_errors =@my_max_connect_errors; set global max_connect_errors =@my_max_connect_errors;
set global max_connections =@my_max_connections; set global max_connections =@my_max_connections;
...@@ -761,6 +761,7 @@ set global max_join_size =@my_max_join_size; ...@@ -761,6 +761,7 @@ set global max_join_size =@my_max_join_size;
set global max_user_connections =default; set global max_user_connections =default;
set global max_write_lock_count =default; set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size; set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size;
set global net_buffer_length =@my_net_buffer_length; set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout; set global net_write_timeout =@my_net_write_timeout;
set global net_read_timeout =@my_net_read_timeout; set global net_read_timeout =@my_net_read_timeout;
...@@ -771,7 +772,6 @@ set global server_id =@my_server_id; ...@@ -771,7 +772,6 @@ set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time; set global slow_launch_time =@my_slow_launch_time;
set global storage_engine =@my_storage_engine; set global storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size; set global thread_cache_size =@my_thread_cache_size;
# #
# Bug#28580 Repeatation of status variables # Bug#28580 Repeatation of status variables
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment