mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
auto-merge
This commit is contained in:
@ -11,12 +11,12 @@
|
||||
#
|
||||
# Dump all global variables
|
||||
#
|
||||
show global variables;
|
||||
SHOW GLOBAL VARIABLES WHERE variable_name != 'timestamp';
|
||||
|
||||
#
|
||||
# Dump all databases
|
||||
#
|
||||
show databases;
|
||||
SHOW DATABASES;
|
||||
|
||||
#
|
||||
# Dump the "test" database, all it's tables and their data
|
||||
@ -29,23 +29,23 @@ show databases;
|
||||
#
|
||||
--exec $MYSQL_DUMP --skip-comments --skip-lock-tables --no-data mysql
|
||||
use mysql;
|
||||
select * from columns_priv;
|
||||
select * from db order by host, db, user;
|
||||
select * from func;
|
||||
select * from help_category;
|
||||
select * from help_keyword;
|
||||
select * from help_relation;
|
||||
select * from help_relation;
|
||||
select * from host;
|
||||
select * from proc;
|
||||
select * from procs_priv;
|
||||
select * from tables_priv;
|
||||
select * from time_zone;
|
||||
select * from time_zone_leap_second;
|
||||
select * from time_zone_name;
|
||||
select * from time_zone_transition;
|
||||
select * from time_zone_transition_type;
|
||||
select * from user;
|
||||
SELECT * FROM columns_priv;
|
||||
SELECT * FROM db ORDER BY host, db, user;
|
||||
SELECT * FROM func;
|
||||
SELECT * FROM help_category;
|
||||
SELECT * FROM help_keyword;
|
||||
SELECT * FROM help_relation;
|
||||
SELECT * FROM help_relation;
|
||||
SELECT * FROM host;
|
||||
SELECT * FROM proc;
|
||||
SELECT * FROM procs_priv;
|
||||
SELECT * FROM tables_priv;
|
||||
SELECT * FROM time_zone;
|
||||
SELECT * FROM time_zone_leap_second;
|
||||
SELECT * FROM time_zone_name;
|
||||
SELECT * FROM time_zone_transition;
|
||||
SELECT * FROM time_zone_transition_type;
|
||||
SELECT * FROM user;
|
||||
|
||||
|
||||
|
||||
|
40
mysql-test/r/csv_alter_table.result
Normal file
40
mysql-test/r/csv_alter_table.result
Normal file
@ -0,0 +1,40 @@
|
||||
# ===== csv_alter_table.1 =====
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
|
||||
ALTER TABLE t1 ADD COLUMN b CHAR(5) NOT NULL;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO NULL
|
||||
b char(5) NO NULL
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO NULL
|
||||
ALTER TABLE t1 MODIFY a BIGINT NOT NULL;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
a bigint(20) NO NULL
|
||||
ALTER TABLE t1 CHANGE a a INT NOT NULL;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO NULL
|
||||
DROP TABLE t1;
|
||||
# ===== csv_alter_table.2 =====
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
|
||||
ALTER TABLE t1 ADD COLUMN b CHAR(5);
|
||||
ERROR 42000: The storage engine for the table doesn't support nullable columns
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO NULL
|
||||
ALTER TABLE t1 MODIFY a BIGINT;
|
||||
ERROR 42000: The storage engine for the table doesn't support nullable columns
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO NULL
|
||||
ALTER TABLE t1 CHANGE a a INT;
|
||||
ERROR 42000: The storage engine for the table doesn't support nullable columns
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO NULL
|
||||
DROP TABLE t1;
|
11
mysql-test/r/ctype_filesystem.result
Normal file
11
mysql-test/r/ctype_filesystem.result
Normal file
@ -0,0 +1,11 @@
|
||||
SET CHARACTER SET utf8;
|
||||
SHOW VARIABLES like 'character_sets_dir';
|
||||
Variable_name Value
|
||||
character_sets_dir /ß/
|
||||
SHOW VARIABLES like 'character_set_filesystem';
|
||||
Variable_name Value
|
||||
character_set_filesystem latin1
|
||||
SHOW VARIABLES like 'character_set_client';
|
||||
Variable_name Value
|
||||
character_set_client utf8
|
||||
SET CHARACTER SET default;
|
@ -1848,3 +1848,35 @@ select hex(_utf8 B'001111111111');
|
||||
ERROR HY000: Invalid utf8 character string: 'FF'
|
||||
select (_utf8 X'616263FF');
|
||||
ERROR HY000: Invalid utf8 character string: 'FF'
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
|
||||
INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70002 1065
|
||||
70001 1085
|
||||
70000 1092
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70000 1092
|
||||
70001 1085
|
||||
70002 1065
|
||||
ALTER TABLE t1 ADD UNIQUE (b);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70002 1065
|
||||
70001 1085
|
||||
70000 1092
|
||||
DROP INDEX b ON t1;
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70002 1065
|
||||
70001 1085
|
||||
70000 1092
|
||||
ALTER TABLE t1 ADD INDEX (b);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70002 1065
|
||||
70001 1085
|
||||
70000 1092
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1,7 +1,8 @@
|
||||
CREATE DATABASE IF NOT EXISTS events_test;
|
||||
USE events_test;
|
||||
SET @event_scheduler=@@global.event_scheduler;
|
||||
SET GLOBAL event_scheduler=OFF;
|
||||
Try agian to make sure it's allowed
|
||||
Try again to make sure it's allowed
|
||||
SET GLOBAL event_scheduler=OFF;
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
@ -64,8 +65,8 @@ INSERT INTO table_4 VALUES (1);
|
||||
SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
|
||||
IF(SUM(a) >= 4, 'OK', 'ERROR')
|
||||
OK
|
||||
SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2;
|
||||
IF(SUM(a) >= 5, 'OK', 'ERROR')
|
||||
SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
|
||||
IF(SUM(a) >= 4, 'OK', 'ERROR')
|
||||
OK
|
||||
SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
|
||||
IF(SUM(a) >= 1, 'OK', 'ERROR')
|
||||
@ -94,4 +95,4 @@ DROP TABLE table_2;
|
||||
DROP TABLE table_3;
|
||||
DROP TABLE table_4;
|
||||
DROP DATABASE events_test;
|
||||
SET GLOBAL event_scheduler=OFF;
|
||||
SET GLOBAL event_scheduler=@event_scheduler;
|
||||
|
@ -14,6 +14,7 @@ RETURN FLOOR((i % (step * n) + 0.1) / step);
|
||||
END//
|
||||
SET @step3= @step * 3;
|
||||
SET @step6= @step * 6;
|
||||
SET @unix_time= UNIX_TIMESTAMP() - 1;
|
||||
SET @unix_time= @unix_time - @unix_time % @step6;
|
||||
INSERT INTO mysql.time_zone VALUES (NULL, 'N');
|
||||
SET @tzid= LAST_INSERT_ID();
|
||||
@ -21,7 +22,7 @@ INSERT INTO mysql.time_zone_transition_type
|
||||
VALUES (@tzid, 0, 0, 0, 'b16420_0');
|
||||
INSERT INTO mysql.time_zone_transition_type
|
||||
VALUES (@tzid, 1, @step3 - @step, 1, 'b16420_1');
|
||||
INSERT INTO mysql.time_zone_name VALUES ('bug16420', @tzid);
|
||||
INSERT INTO mysql.time_zone_name VALUES ('<TZ_NAME_1>', @tzid);
|
||||
CREATE TABLE t1 (count INT, unix_time INT, local_time INT, comment CHAR(80));
|
||||
CREATE TABLE t2 (count INT);
|
||||
INSERT INTO t2 VALUES (1);
|
||||
@ -48,7 +49,7 @@ END//
|
||||
SET TIME_ZONE= '+00:00';
|
||||
CREATE EVENT e1 ON SCHEDULE EVERY @step SECOND
|
||||
STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1("<e1>");
|
||||
SET TIME_ZONE= 'bug16420';
|
||||
SET TIME_ZONE= '<TZ_NAME_1>';
|
||||
CREATE EVENT e2 ON SCHEDULE EVERY @step SECOND
|
||||
STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1("<e2>");
|
||||
SET GLOBAL EVENT_SCHEDULER= ON;
|
||||
@ -86,6 +87,7 @@ DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid;
|
||||
ALTER TABLE mysql.time_zone AUTO_INCREMENT = 6;
|
||||
SET TIME_ZONE= '+00:00';
|
||||
CREATE TABLE t1 (event CHAR(2), dt DATE, offset INT);
|
||||
INSERT INTO mysql.time_zone VALUES (NULL, 'N');
|
||||
@ -111,8 +113,8 @@ INSERT INTO mysql.time_zone_transition
|
||||
VALUES (@tzid, @now + 7 * @step, 2);
|
||||
INSERT INTO mysql.time_zone_transition
|
||||
VALUES (@tzid, @now + 12 * @step, 3);
|
||||
INSERT INTO mysql.time_zone_name VALUES ('bug16420_2', @tzid);
|
||||
SET TIME_ZONE= 'bug16420_2';
|
||||
INSERT INTO mysql.time_zone_name VALUES ('<TZ_NAME_2>', @tzid);
|
||||
SET TIME_ZONE= '<TZ_NAME_2>';
|
||||
SET GLOBAL EVENT_SCHEDULER= ON;
|
||||
SET GLOBAL EVENT_SCHEDULER= OFF;
|
||||
Below we should see the following:
|
||||
@ -143,6 +145,7 @@ DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid;
|
||||
ALTER TABLE mysql.time_zone AUTO_INCREMENT = 6;
|
||||
DROP FUNCTION round_to_step;
|
||||
DROP TABLE t_step;
|
||||
DROP DATABASE mysqltest_db1;
|
||||
|
@ -68,7 +68,7 @@ Warnings:
|
||||
Error 1259 ZLIB: Input data corrupted
|
||||
Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
|
||||
drop table t1;
|
||||
set @@max_allowed_packet=1048576*100;
|
||||
set @@global.max_allowed_packet=1048576*100;
|
||||
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
|
||||
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
|
||||
0
|
||||
|
@ -1453,4 +1453,27 @@ LIMIT 1)
|
||||
1
|
||||
DROP TABLE derived1;
|
||||
DROP TABLE D;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1,1), (1,2), (1,3);
|
||||
SET SQL_MODE='ONLY_FULL_GROUP_BY';
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
3
|
||||
SELECT COUNT(*) FROM t1 where a=1;
|
||||
COUNT(*)
|
||||
3
|
||||
SELECT COUNT(*),a FROM t1;
|
||||
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a;
|
||||
COUNT(*)
|
||||
9
|
||||
SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a)
|
||||
FROM t1 outr;
|
||||
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
SELECT COUNT(*) FROM t1 a JOIN t1 outr
|
||||
ON a.a= (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a);
|
||||
COUNT(*)
|
||||
0
|
||||
SET SQL_MODE=default;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -256,3 +256,15 @@ a
|
||||
select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
|
||||
str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f")
|
||||
2003-01-02 10:11:12.001200
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00');
|
||||
timediff('2008-09-29 20:10:10','2008-09-30 20:10:10') time('00:00:00')
|
||||
-24:00:00 00:00:00
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00');
|
||||
timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00')
|
||||
0
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00');
|
||||
timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00')
|
||||
1
|
||||
SELECT CAST(time('-73:42:12') AS DECIMAL);
|
||||
CAST(time('-73:42:12') AS DECIMAL)
|
||||
-734212
|
||||
|
@ -1,31 +1,41 @@
|
||||
SET @save = @@global.group_concat_max_len;
|
||||
drop table if exists t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
## Creating new table t1 ##
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL auto_increment,
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id),
|
||||
rollno int NOT NULL,
|
||||
rollno INT NOT NULL,
|
||||
name VARCHAR(30)
|
||||
);
|
||||
'#--------------------FN_DYNVARS_034_01-------------------------#'
|
||||
## Setting initial value of variable to 4 ##
|
||||
## Setting initial value of variable to 4 ##
|
||||
SET @@global.group_concat_max_len = 4;
|
||||
## Inserting some rows in table ##
|
||||
INSERT into t1(rollno, name) values(1, 'Record_1');
|
||||
INSERT into t1(rollno, name) values(2, 'Record_2');
|
||||
INSERT into t1(rollno, name) values(1, 'Record_3');
|
||||
INSERT into t1(rollno, name) values(3, 'Record_4');
|
||||
INSERT into t1(rollno, name) values(1, 'Record_5');
|
||||
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_8');
|
||||
## Creating two new connections ##
|
||||
## Inserting some rows in table ##
|
||||
INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
|
||||
INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
|
||||
INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
|
||||
INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
|
||||
INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
|
||||
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_8');
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
id rollno name
|
||||
1 1 Record_1
|
||||
2 2 Record_2
|
||||
3 1 Record_3
|
||||
4 3 Record_4
|
||||
5 1 Record_5
|
||||
6 3 Record_6
|
||||
7 4 Record_7
|
||||
8 4 Record_8
|
||||
## Creating two new connections ##
|
||||
'#--------------------FN_DYNVARS_034_02-------------------------#'
|
||||
## Connecting with test_con1 ##
|
||||
## Accessing data and using group_concat on column whose value is greater than 4 ##
|
||||
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
id rollno group_concat(name)
|
||||
## Accessing data and using group_concat on column whose value is greater than 4 ##
|
||||
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
|
||||
id rollno GROUP_CONCAT(name)
|
||||
1 1 Reco
|
||||
2 2 Reco
|
||||
4 3 Reco
|
||||
@ -33,10 +43,10 @@ id rollno group_concat(name)
|
||||
Warnings:
|
||||
Warning 1260 4 line(s) were cut by GROUP_CONCAT()
|
||||
## Changing session value of variable and verifying its behavior, ##
|
||||
## warning should come here ##
|
||||
## warning should come here ##
|
||||
SET @@session.group_concat_max_len = 10;
|
||||
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
id rollno group_concat(name)
|
||||
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
|
||||
id rollno GROUP_CONCAT(name)
|
||||
1 1 Record_1,R
|
||||
2 2 Record_2
|
||||
4 3 Record_4,R
|
||||
@ -44,18 +54,18 @@ id rollno group_concat(name)
|
||||
Warnings:
|
||||
Warning 1260 3 line(s) were cut by GROUP_CONCAT()
|
||||
'#--------------------FN_DYNVARS_034_03-------------------------#'
|
||||
## Connecting with new connection test_con2 ##
|
||||
## Verifying initial value of variable. It should be 4 ##
|
||||
## Connecting with new connection test_con2 ##
|
||||
## Verifying initial value of variable. It should be 4 ##
|
||||
SELECT @@session.group_concat_max_len = 4;
|
||||
@@session.group_concat_max_len = 4
|
||||
1
|
||||
## Setting session value of variable to 20 and verifying variable is concating ##
|
||||
## column's value to 20 or not ##
|
||||
## Setting session value of variable to 20 and verifying variable is concating ##
|
||||
## column's value to 20 or not ##
|
||||
SET @@session.group_concat_max_len = 20;
|
||||
## Verifying value of name column, it should not me more than 20 characters ##
|
||||
## Warning should come here ##
|
||||
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
id rollno group_concat(name)
|
||||
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
|
||||
id rollno GROUP_CONCAT(name)
|
||||
1 1 Record_1,Record_3,Re
|
||||
2 2 Record_2
|
||||
4 3 Record_4,Record_6
|
||||
@ -63,17 +73,17 @@ id rollno group_concat(name)
|
||||
Warnings:
|
||||
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
|
||||
'#--------------------FN_DYNVARS_034_04-------------------------#'
|
||||
## Setting session value of variable to 26. No warning should appear here ##
|
||||
## because the value after concatination is less than 30 ##
|
||||
## Setting session value of variable to 26. No warning should appear here ##
|
||||
## because the value after concatination is less than 30 ##
|
||||
SET @@session.group_concat_max_len = 26;
|
||||
## Verifying value of name column, it should not give warning now ##
|
||||
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
id rollno group_concat(name)
|
||||
## Verifying value of name column, it should not give warning now ##
|
||||
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
|
||||
id rollno GROUP_CONCAT(name)
|
||||
1 1 Record_1,Record_3,Record_5
|
||||
2 2 Record_2
|
||||
4 3 Record_4,Record_6
|
||||
7 4 Record_7,Record_8
|
||||
## Dropping table t1 ##
|
||||
DROP table t1;
|
||||
DROP TABLE t1;
|
||||
## Disconnecting both the connection ##
|
||||
SET @@global.group_concat_max_len = @save;
|
||||
|
@ -1677,3 +1677,9 @@ select @@session.sql_log_bin, @@session.binlog_format, @@session.tx_isolation;
|
||||
CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
|
||||
CREATE INDEX i1 on t1 (a(3));
|
||||
SELECT * FROM t1 WHERE a = 'abcde';
|
||||
a
|
||||
DROP TABLE t1;
|
||||
|
@ -1,13 +1,11 @@
|
||||
SET @start_value= @@global.log_output;
|
||||
SET @start_general_log= @@global.general_log;
|
||||
SET @start_general_log_file= @@global.general_log_file;
|
||||
'#--------------------FN_DYNVARS_065_01-------------------------#'
|
||||
SET @@global.log_output = 'NONE';
|
||||
'connect (con1,localhost,root,,,,)'
|
||||
'connection con1'
|
||||
SELECT @@global.log_output;
|
||||
@@global.log_output
|
||||
NONE
|
||||
SET @@global.log_output = 'TABLE,FILE';
|
||||
'connect (con2,localhost,root,,,,)'
|
||||
'connection con2'
|
||||
SELECT @@global.log_output;
|
||||
@@global.log_output
|
||||
FILE,TABLE
|
||||
@ -18,7 +16,7 @@ SET @@global.log_output = 'NONE';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 value(1);
|
||||
INSERT INTO t1 VALUE(1);
|
||||
SELECT 'abc';
|
||||
abc
|
||||
abc
|
||||
@ -29,25 +27,33 @@ count(*)
|
||||
SET @@global.log_output = 'TABLE';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
create table t1(a int);
|
||||
INSERT INTO t1 value(1);
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUE(1);
|
||||
SELECT 'abc';
|
||||
abc
|
||||
abc
|
||||
SELECT count(*) from mysql.general_log;
|
||||
count(*)
|
||||
5
|
||||
'Bug#35371: Changing general_log file is crashing server'
|
||||
'SET @@global.general_log_file = @log_file;'
|
||||
SELECT count(*)>4 FROM mysql.general_log;
|
||||
count(*)>4
|
||||
1
|
||||
SET @@global.general_log = 'OFF';
|
||||
FLUSH LOGS;
|
||||
SET @@global.general_log_file = 'MYSQLTEST_VARDIR/run/mytest.log';
|
||||
SET @@global.general_log = 'ON';
|
||||
SET @@global.log_output = 'FILE';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
create table t1(a int);
|
||||
INSERT INTO t1 value(1);
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUE(1);
|
||||
SELECT 'abc';
|
||||
abc
|
||||
abc
|
||||
SELECT count(*) from mysql.general_log;
|
||||
SELECT count(*) FROM mysql.general_log;
|
||||
count(*)
|
||||
0
|
||||
DROP TABLE t1;
|
||||
connection default;
|
||||
SET @@global.general_log= 'OFF';
|
||||
SET @@global.general_log_file= @start_general_log_file;
|
||||
SET @@global.log_output= @start_value;
|
||||
SET @@global.general_log= @start_general_log;
|
||||
SET @@global.general_log= 'ON';
|
||||
|
@ -2,10 +2,7 @@ SET @start_global_value = @@global.max_allowed_packet;
|
||||
SELECT @start_global_value;
|
||||
@start_global_value
|
||||
1048576
|
||||
SET @start_session_value = @@session.max_allowed_packet;
|
||||
SELECT @start_session_value;
|
||||
@start_session_value
|
||||
1048576
|
||||
SET @@global.max_allowed_packet = DEFAULT;
|
||||
'#--------------------FN_DYNVARS_070_01-------------------------#'
|
||||
SET @@global.max_allowed_packet = 1000;
|
||||
Warnings:
|
||||
@ -15,7 +12,9 @@ SELECT @@global.max_allowed_packet;
|
||||
@@global.max_allowed_packet
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = 20000;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SET @@session.max_allowed_packet = DEFAULT;
|
||||
ERROR 42000: Variable 'max_allowed_packet' doesn't have a default value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1048576
|
||||
@ -24,10 +23,6 @@ SET @@global.max_allowed_packet = DEFAULT;
|
||||
SELECT @@global.max_allowed_packet = 1048576;
|
||||
@@global.max_allowed_packet = 1048576
|
||||
1
|
||||
SET @@session.max_allowed_packet = DEFAULT;
|
||||
SELECT @@session.max_allowed_packet = 1048576;
|
||||
@@session.max_allowed_packet = 1048576
|
||||
1
|
||||
'#--------------------FN_DYNVARS_070_03-------------------------#'
|
||||
SET @@global.max_allowed_packet = 1024;
|
||||
SELECT @@global.max_allowed_packet;
|
||||
@ -48,25 +43,30 @@ SELECT @@global.max_allowed_packet;
|
||||
1073740800
|
||||
'#--------------------FN_DYNVARS_070_04-------------------------#'
|
||||
SET @@session.max_allowed_packet = 1024;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1024
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = 1025;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1024
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = 65535;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
64512
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = 1073741824;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1073741824
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = 1073741823;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1073740800
|
||||
1048576
|
||||
'#------------------FN_DYNVARS_070_05-----------------------#'
|
||||
SET @@global.max_allowed_packet = 0;
|
||||
Warnings:
|
||||
@ -103,37 +103,33 @@ SELECT @@global.max_allowed_packet;
|
||||
@@global.max_allowed_packet
|
||||
1073741824
|
||||
SET @@session.max_allowed_packet = 0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '0'
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1024
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = 1023;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '1023'
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1024
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = -2;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '0'
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1024
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = 65530.34.;
|
||||
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 '.' at line 1
|
||||
SET @@session.max_allowed_packet = 10737418241;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '10737418241'
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1073741824
|
||||
1048576
|
||||
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
|
||||
SET @@session.max_allowed_packet = test;
|
||||
ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1073741824
|
||||
1048576
|
||||
'#------------------FN_DYNVARS_070_06-----------------------#'
|
||||
SELECT @@global.max_allowed_packet = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
@ -166,6 +162,7 @@ SELECT @@max_allowed_packet = @@global.max_allowed_packet;
|
||||
0
|
||||
'#---------------------FN_DYNVARS_070_10----------------------#'
|
||||
SET @@max_allowed_packet = 100000;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@max_allowed_packet = @@local.max_allowed_packet;
|
||||
@@max_allowed_packet = @@local.max_allowed_packet
|
||||
1
|
||||
@ -174,9 +171,10 @@ SELECT @@local.max_allowed_packet = @@session.max_allowed_packet;
|
||||
1
|
||||
'#---------------------FN_DYNVARS_070_11----------------------#'
|
||||
SET max_allowed_packet = 1024;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@max_allowed_packet;
|
||||
@@max_allowed_packet
|
||||
1024
|
||||
1048576
|
||||
SELECT local.max_allowed_packet;
|
||||
ERROR 42S02: Unknown table 'local' in field list
|
||||
SELECT session.max_allowed_packet;
|
||||
@ -187,7 +185,6 @@ SET @@global.max_allowed_packet = @start_global_value;
|
||||
SELECT @@global.max_allowed_packet;
|
||||
@@global.max_allowed_packet
|
||||
1048576
|
||||
SET @@session.max_allowed_packet = @start_session_value;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1048576
|
||||
|
@ -10,24 +10,15 @@ name BLOB
|
||||
'#--------------------FN_DYNVARS_070_01-------------------------#'
|
||||
## Setting value of max_allowed packet and net_buffer_length to 1024 ##
|
||||
SET @@session.max_allowed_packet = 1024;
|
||||
SET @@session.net_buffer_length = 1024;
|
||||
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.max_allowed_packet;
|
||||
@@session.max_allowed_packet
|
||||
1024
|
||||
1048576
|
||||
SET @@session.net_buffer_length = 1024;
|
||||
ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1024
|
||||
## Inserting and fetching data of length greater than 1024 ##
|
||||
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
||||
SELECT length("aaaaaasssssssssssdddddddfffffgggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk") as len;
|
||||
len
|
||||
1470
|
||||
## Verifying record in table t1 ##
|
||||
SELECT * from t1;
|
||||
id name
|
||||
1 aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|
||||
'Bug#35381: Error is not coming on inserting and fetching data of length'
|
||||
'greater than max_allowed_packet size at session level';
|
||||
16384
|
||||
'#--------------------FN_DYNVARS_070_02-------------------------#'
|
||||
## Setting value of max_allowed packet and net_buffer_length to 1024 ##
|
||||
SET @@global.max_allowed_packet = 1024;
|
||||
|
@ -378,29 +378,6 @@ where 0=1;
|
||||
delete t1, t2 from t2,t1
|
||||
where t1.id1=t2.id2 and 0=1;
|
||||
drop table t1,t2;
|
||||
create table t1 ( a int not null, b int not null) ;
|
||||
alter table t1 add index i1(a);
|
||||
delete from t1 where a > 2000000;
|
||||
create table t2 like t1;
|
||||
insert into t2 select * from t1;
|
||||
select 't2 rows before small delete', count(*) from t1;
|
||||
t2 rows before small delete count(*)
|
||||
t2 rows before small delete 2000000
|
||||
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
|
||||
select 't2 rows after small delete', count(*) from t2;
|
||||
t2 rows after small delete count(*)
|
||||
t2 rows after small delete 1999999
|
||||
select 't1 rows after small delete', count(*) from t1;
|
||||
t1 rows after small delete count(*)
|
||||
t1 rows after small delete 1999999
|
||||
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
|
||||
select 't2 rows after big delete', count(*) from t2;
|
||||
t2 rows after big delete count(*)
|
||||
t2 rows after big delete 1900001
|
||||
select 't1 rows after big delete', count(*) from t1;
|
||||
t1 rows after big delete count(*)
|
||||
t1 rows after big delete 1900001
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 ( a int );
|
||||
CREATE TABLE t2 ( a int );
|
||||
DELETE t1 FROM t1, t2 AS t3;
|
||||
|
25
mysql-test/r/multi_update2.result
Normal file
25
mysql-test/r/multi_update2.result
Normal file
@ -0,0 +1,25 @@
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL) ;
|
||||
# The protocolling of many inserts into t1 is suppressed.
|
||||
ALTER TABLE t1 ADD INDEX i1(a);
|
||||
DELETE FROM t1 WHERE a > 2000000;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT 't2 rows before small delete', COUNT(*) FROM t1;
|
||||
t2 rows before small delete COUNT(*)
|
||||
t2 rows before small delete 2000000
|
||||
DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 2;
|
||||
SELECT 't2 rows after small delete', COUNT(*) FROM t2;
|
||||
t2 rows after small delete COUNT(*)
|
||||
t2 rows after small delete 1999999
|
||||
SELECT 't1 rows after small delete', COUNT(*) FROM t1;
|
||||
t1 rows after small delete COUNT(*)
|
||||
t1 rows after small delete 1999999
|
||||
DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 100*1000;
|
||||
SELECT 't2 rows after big delete', COUNT(*) FROM t2;
|
||||
t2 rows after big delete COUNT(*)
|
||||
t2 rows after big delete 1900001
|
||||
SELECT 't1 rows after big delete', COUNT(*) FROM t1;
|
||||
t1 rows after big delete COUNT(*)
|
||||
t1 rows after big delete 1900001
|
||||
DROP TABLE t1,t2;
|
@ -1,5 +1,5 @@
|
||||
SET @start_global_value = @@global.net_buffer_length;
|
||||
SET @start_session_value = @@session.net_buffer_length;
|
||||
SET @@global.net_buffer_length = DEFAULT;
|
||||
'#--------------------FN_DYNVARS_109_01-------------------------#'
|
||||
SET @@global.net_buffer_length = 10000;
|
||||
SET @@global.net_buffer_length = DEFAULT;
|
||||
@ -7,7 +7,9 @@ SELECT @@global.net_buffer_length;
|
||||
@@global.net_buffer_length
|
||||
16384
|
||||
SET @@session.net_buffer_length = 20000;
|
||||
ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value
|
||||
SET @@session.net_buffer_length = DEFAULT;
|
||||
ERROR 42000: Variable 'net_buffer_length' doesn't have a default value
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
16384
|
||||
@ -16,10 +18,6 @@ SET @@global.net_buffer_length = DEFAULT;
|
||||
SELECT @@global.net_buffer_length = 16384;
|
||||
@@global.net_buffer_length = 16384
|
||||
1
|
||||
SET @@session.net_buffer_length = DEFAULT;
|
||||
SELECT @@session.net_buffer_length = 16384;
|
||||
@@session.net_buffer_length = 16384
|
||||
1
|
||||
'#--------------------FN_DYNVARS_109_03-------------------------#'
|
||||
SET @@global.net_buffer_length = 1024;
|
||||
SELECT @@global.net_buffer_length;
|
||||
@ -43,27 +41,6 @@ SELECT @@global.net_buffer_length;
|
||||
64512
|
||||
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
|
||||
'#--------------------FN_DYNVARS_109_04-------------------------#'
|
||||
SET @@session.net_buffer_length = 1024;
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1024
|
||||
SET @@session.net_buffer_length = 1025;
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1024
|
||||
SET @@session.net_buffer_length = 1048576;
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1048576
|
||||
SET @@session.net_buffer_length = 1048575;
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1047552
|
||||
SET @@session.net_buffer_length = 65535;
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
64512
|
||||
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
|
||||
'#------------------FN_DYNVARS_109_05-----------------------#'
|
||||
SET @@global.net_buffer_length = 0;
|
||||
Warnings:
|
||||
@ -105,42 +82,12 @@ ERROR 42000: Incorrect argument type to variable 'net_buffer_length'
|
||||
SELECT @@global.net_buffer_length;
|
||||
@@global.net_buffer_length
|
||||
1048576
|
||||
SET @@session.net_buffer_length = 0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '0'
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1024
|
||||
SET @@session.net_buffer_length = -2;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '0'
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1024
|
||||
SET @@session.net_buffer_length = 1048577;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '1048577'
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1048576
|
||||
SET @@session.net_buffer_length = 1048576002;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '1048576002'
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
1048576
|
||||
SET @@session.net_buffer_length = 65530.34.;
|
||||
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 '.' at line 1
|
||||
SET @@session.net_buffer_length = 65550;
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
65536
|
||||
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
|
||||
SET @@session.net_buffer_length = test;
|
||||
ERROR 42000: Incorrect argument type to variable 'net_buffer_length'
|
||||
SELECT @@session.net_buffer_length;
|
||||
@@session.net_buffer_length
|
||||
65536
|
||||
16384
|
||||
'#------------------FN_DYNVARS_109_06-----------------------#'
|
||||
SELECT @@global.net_buffer_length = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
@ -172,18 +119,10 @@ SELECT @@net_buffer_length = @@global.net_buffer_length;
|
||||
@@net_buffer_length = @@global.net_buffer_length
|
||||
0
|
||||
'#---------------------FN_DYNVARS_109_10----------------------#'
|
||||
SET @@net_buffer_length = 100000;
|
||||
SELECT @@net_buffer_length = @@local.net_buffer_length;
|
||||
@@net_buffer_length = @@local.net_buffer_length
|
||||
1
|
||||
SELECT @@local.net_buffer_length = @@session.net_buffer_length;
|
||||
@@local.net_buffer_length = @@session.net_buffer_length
|
||||
1
|
||||
'#---------------------FN_DYNVARS_109_11----------------------#'
|
||||
SET net_buffer_length = 1024;
|
||||
SELECT @@net_buffer_length;
|
||||
@@net_buffer_length
|
||||
1024
|
||||
16384
|
||||
SELECT local.net_buffer_length;
|
||||
ERROR 42S02: Unknown table 'local' in field list
|
||||
SELECT session.net_buffer_length;
|
||||
@ -191,4 +130,3 @@ ERROR 42S02: Unknown table 'session' in field list
|
||||
SELECT net_buffer_length = @@session.net_buffer_length;
|
||||
ERROR 42S22: Unknown column 'net_buffer_length' in 'field list'
|
||||
SET @@global.net_buffer_length = @start_global_value;
|
||||
SET @@session.net_buffer_length = @start_session_value;
|
||||
|
@ -1,32 +1,22 @@
|
||||
set global max_allowed_packet=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
|
||||
set max_allowed_packet=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
|
||||
set global net_buffer_length=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '100'
|
||||
set net_buffer_length=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '100'
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
len
|
||||
1024
|
||||
select repeat('a',2000);
|
||||
repeat('a',2000)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (1024) - truncated
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
select @@net_buffer_length, @@max_allowed_packet;
|
||||
@@net_buffer_length @@max_allowed_packet
|
||||
1024 1024
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes
|
||||
set global max_allowed_packet=default;
|
||||
set max_allowed_packet=default;
|
||||
set global net_buffer_length=default;
|
||||
set net_buffer_length=default;
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
len
|
||||
100
|
||||
|
@ -1,4 +1,16 @@
|
||||
drop table if exists t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (pk)
|
||||
)
|
||||
/*!50100 PARTITION BY HASH (pk)
|
||||
PARTITIONS 2 */;
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
|
||||
pk
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT NOT NULL, KEY(a))
|
||||
PARTITION BY RANGE(a)
|
||||
(PARTITION p1 VALUES LESS THAN (200), PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
6
mysql-test/r/perror-win.result
Normal file
6
mysql-test/r/perror-win.result
Normal file
@ -0,0 +1,6 @@
|
||||
MySQL error code 150: Foreign key constraint is incorrectly formed
|
||||
Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
|
||||
OS error code 23: Too many open files in system
|
||||
Win32 error code 23: Data error (cyclic redundancy check).
|
||||
Win32 error code 1062: The service has not been started.
|
||||
Illegal error code: 30000
|
@ -4448,4 +4448,34 @@ SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT
|
||||
a incorrect
|
||||
1 1
|
||||
DROP TABLE t1,t2,t3;
|
||||
CREATE TABLE t1 (id int);
|
||||
CREATE TABLE t2 (id int, c int);
|
||||
INSERT INTO t1 (id) VALUES (1);
|
||||
INSERT INTO t2 (id) VALUES (1);
|
||||
INSERT INTO t1 (id) VALUES (1);
|
||||
INSERT INTO t2 (id) VALUES (1);
|
||||
CREATE VIEW v1 AS
|
||||
SELECT t2.c AS c FROM t1, t2
|
||||
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
UPDATE v1 SET c=1;
|
||||
CREATE VIEW v2 (a,b) AS
|
||||
SELECT t2.id, t2.c AS c FROM t1, t2
|
||||
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
INSERT INTO v2(a,b) VALUES (2,2);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v2'
|
||||
INSERT INTO v2(a,b) VALUES (1,2);
|
||||
SELECT * FROM v1;
|
||||
c
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
CREATE VIEW v3 AS
|
||||
SELECT t2.c AS c FROM t2
|
||||
WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
DELETE FROM v3;
|
||||
DROP VIEW v1,v2,v3;
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.1 tests.
|
||||
|
@ -148,16 +148,16 @@ DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE t1(a INT)
|
||||
INDEX DIRECTORY='TEST_DIR/master-data/mysql';
|
||||
ERROR HY000: Incorrect arguments to INDEX DIRECTORY
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT)
|
||||
DATA DIRECTORY='TEST_DIR/master-data/test';
|
||||
ERROR HY000: Incorrect arguments to DATA DIRECTORY
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT)
|
||||
DATA DIRECTORY='TEST_DIR/master-data/';
|
||||
ERROR HY000: Incorrect arguments to DATA DIRECTORY
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT)
|
||||
INDEX DIRECTORY='TEST_DIR/master-data';
|
||||
ERROR HY000: Incorrect arguments to INDEX DIRECTORY
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT)
|
||||
INDEX DIRECTORY='TEST_DIR/master-data_var';
|
||||
ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errcode: 2)
|
||||
|
@ -1,33 +1,25 @@
|
||||
** Setup **
|
||||
|
||||
** Connecting con0 using root **
|
||||
** Connecting con1 using root **
|
||||
'#-----------------------------FN_DYNVARS_179_01------------------#'
|
||||
** Connection con0 **
|
||||
SET @ts_old = @@SESSION.timestamp;
|
||||
waiting 1 sec
|
||||
SET @ts_new = @@SESSION.timestamp;
|
||||
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
|
||||
Timestamp Difference
|
||||
SELECT date(now()) = date(sysdate());
|
||||
date(now()) = date(sysdate())
|
||||
1
|
||||
SET @@session.timestamp = 1100000000;
|
||||
SELECT date(now()) != date(sysdate());
|
||||
date(now()) != date(sysdate())
|
||||
1
|
||||
** Connecting con0 using root **
|
||||
SELECT @@session.timestamp != 1100000000;
|
||||
@@session.timestamp != 1100000000
|
||||
1
|
||||
SET @@session.timestamp = 1000000000;
|
||||
SELECT date(now()) != date(sysdate());
|
||||
date(now()) != date(sysdate())
|
||||
1
|
||||
1 means >=1 expected is true
|
||||
** Connection con1 **
|
||||
SET @ts_old = @@SESSION.timestamp;
|
||||
waiting 4 sec
|
||||
SET @ts_new = @@SESSION.timestamp;
|
||||
SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
|
||||
Timestamp Difference
|
||||
SELECT @@session.timestamp != 1000000000;
|
||||
@@session.timestamp != 1000000000
|
||||
1
|
||||
1 means >=4 expected is true
|
||||
'#-----------------------------FN_DYNVARS_179_02---------------------#'
|
||||
SET @ts_old = @@SESSION.timestamp;
|
||||
Changing time zone
|
||||
SET time_zone = 'MET';
|
||||
SET @ts_new = @@SESSION.timestamp;
|
||||
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
|
||||
Timestamp Difference
|
||||
SELECT @@session.timestamp = 1100000000;
|
||||
@@session.timestamp = 1100000000
|
||||
1
|
||||
1 means >=1 expected is true
|
||||
** Cleanup **
|
||||
** Connection default **
|
||||
Disconnecting Connections con0, con1
|
||||
|
25
mysql-test/r/timestamp_sysdate_is_now_func.result
Normal file
25
mysql-test/r/timestamp_sysdate_is_now_func.result
Normal file
@ -0,0 +1,25 @@
|
||||
** Connecting con1 using root **
|
||||
SELECT date(now()) = date(sysdate());
|
||||
date(now()) = date(sysdate())
|
||||
1
|
||||
SET @@session.timestamp = 1100000000;
|
||||
SELECT date(now()) != date(sysdate());
|
||||
date(now()) != date(sysdate())
|
||||
0
|
||||
** Connecting con0 using root **
|
||||
SELECT @@session.timestamp != 1100000000;
|
||||
@@session.timestamp != 1100000000
|
||||
1
|
||||
SET @@session.timestamp = 1000000000;
|
||||
SELECT date(now()) != date(sysdate());
|
||||
date(now()) != date(sysdate())
|
||||
0
|
||||
** Connection con1 **
|
||||
SELECT @@session.timestamp != 1000000000;
|
||||
@@session.timestamp != 1000000000
|
||||
1
|
||||
SELECT @@session.timestamp = 1100000000;
|
||||
@@session.timestamp = 1100000000
|
||||
1
|
||||
** Connection default **
|
||||
Disconnecting Connections con0, con1
|
@ -1343,10 +1343,10 @@ t3 CREATE TABLE `t3` (
|
||||
`left(a,100000000)` longtext
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop tables t1,t2,t3;
|
||||
SELECT @tmp_max:= @@max_allowed_packet;
|
||||
@tmp_max:= @@max_allowed_packet
|
||||
SELECT @tmp_max:= @@global.max_allowed_packet;
|
||||
@tmp_max:= @@global.max_allowed_packet
|
||||
1048576
|
||||
SET max_allowed_packet=25000000;
|
||||
SET @@global.max_allowed_packet=25000000;
|
||||
CREATE TABLE t1 (a mediumtext);
|
||||
CREATE TABLE t2 (b varchar(20));
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
@ -1384,7 +1384,7 @@ t3 CREATE TABLE `t3` (
|
||||
`a` varbinary(510) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLES t1,t2,t3;
|
||||
SET max_allowed_packet:= @tmp_max;
|
||||
SET @@global.max_allowed_packet:= @tmp_max;
|
||||
create table t1 ( id int not null auto_increment, primary key (id), col1 int);
|
||||
insert into t1 (col1) values (2),(3),(4),(5),(6);
|
||||
select 99 union all select id from t1 order by 1;
|
||||
|
@ -491,4 +491,15 @@ update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
|
||||
affected rows: 127
|
||||
info: Rows matched: 128 Changed: 127 Warnings: 0
|
||||
drop table t1,t2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
CREATE FUNCTION f1() RETURNS INT RETURN f1();
|
||||
CREATE TABLE t1 (i INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
UPDATE t1 SET i = 3 WHERE f1();
|
||||
ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
UPDATE t1 SET i = f1();
|
||||
ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
End of 5.0 tests
|
||||
|
@ -15,3 +15,95 @@ slave_skip_errors 3,100,137,643,1752
|
||||
---- Clean Up ----
|
||||
set global slave_net_timeout=default;
|
||||
set global sql_slave_skip_counter= 0;
|
||||
|
||||
#
|
||||
SHOW VARIABLES like 'log_slave_updates';
|
||||
Variable_name Value
|
||||
log_slave_updates OFF
|
||||
SELECT @@session.log_slave_updates;
|
||||
ERROR HY000: Variable 'log_slave_updates' is a GLOBAL variable
|
||||
SELECT @@global.log_slave_updates;
|
||||
@@global.log_slave_updates
|
||||
0
|
||||
SET @@session.log_slave_updates= true;
|
||||
ERROR HY000: Variable 'log_slave_updates' is a read only variable
|
||||
SET @@global.log_slave_updates= true;
|
||||
ERROR HY000: Variable 'log_slave_updates' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'relay_log';
|
||||
Variable_name Value
|
||||
relay_log
|
||||
SELECT @@session.relay_log;
|
||||
ERROR HY000: Variable 'relay_log' is a GLOBAL variable
|
||||
SELECT @@global.relay_log;
|
||||
@@global.relay_log
|
||||
NULL
|
||||
SET @@session.relay_log= 'x';
|
||||
ERROR HY000: Variable 'relay_log' is a read only variable
|
||||
SET @@global.relay_log= 'x';
|
||||
ERROR HY000: Variable 'relay_log' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'relay_log_index';
|
||||
Variable_name Value
|
||||
relay_log_index
|
||||
SELECT @@session.relay_log_index;
|
||||
ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
|
||||
SELECT @@global.relay_log_index;
|
||||
@@global.relay_log_index
|
||||
NULL
|
||||
SET @@session.relay_log_index= 'x';
|
||||
ERROR HY000: Variable 'relay_log_index' is a read only variable
|
||||
SET @@global.relay_log_index= 'x';
|
||||
ERROR HY000: Variable 'relay_log_index' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'relay_log_info_file';
|
||||
Variable_name Value
|
||||
relay_log_info_file relay-log.info
|
||||
SELECT @@session.relay_log_info_file;
|
||||
ERROR HY000: Variable 'relay_log_info_file' is a GLOBAL variable
|
||||
SELECT @@global.relay_log_info_file;
|
||||
@@global.relay_log_info_file
|
||||
relay-log.info
|
||||
SET @@session.relay_log_info_file= 'x';
|
||||
ERROR HY000: Variable 'relay_log_info_file' is a read only variable
|
||||
SET @@global.relay_log_info_file= 'x';
|
||||
ERROR HY000: Variable 'relay_log_info_file' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'relay_log_space_limit';
|
||||
Variable_name Value
|
||||
relay_log_space_limit 0
|
||||
SELECT @@session.relay_log_space_limit;
|
||||
ERROR HY000: Variable 'relay_log_space_limit' is a GLOBAL variable
|
||||
SELECT @@global.relay_log_space_limit;
|
||||
@@global.relay_log_space_limit
|
||||
0
|
||||
SET @@session.relay_log_space_limit= 7;
|
||||
ERROR HY000: Variable 'relay_log_space_limit' is a read only variable
|
||||
SET @@global.relay_log_space_limit= 7;
|
||||
ERROR HY000: Variable 'relay_log_space_limit' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'slave_load_tmpdir';
|
||||
Variable_name Value
|
||||
slave_load_tmpdir #
|
||||
SELECT @@session.slave_load_tmpdir;
|
||||
ERROR HY000: Variable 'slave_load_tmpdir' is a GLOBAL variable
|
||||
SELECT @@global.slave_load_tmpdir;
|
||||
@@global.slave_load_tmpdir
|
||||
#
|
||||
SET @@session.slave_load_tmpdir= 'x';
|
||||
ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
|
||||
SET @@global.slave_load_tmpdir= 'x';
|
||||
ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'slave_skip_errors';
|
||||
Variable_name Value
|
||||
slave_skip_errors 3,100,137,643,1752
|
||||
SELECT @@session.slave_skip_errors;
|
||||
ERROR HY000: Variable 'slave_skip_errors' is a GLOBAL variable
|
||||
SELECT @@global.slave_skip_errors;
|
||||
@@global.slave_skip_errors
|
||||
3,100,137,643,1752
|
||||
SET @@session.slave_skip_errors= 7;
|
||||
ERROR HY000: Variable 'slave_skip_errors' is a read only variable
|
||||
SET @@global.slave_skip_errors= 7;
|
||||
ERROR HY000: Variable 'slave_skip_errors' is a read only variable
|
||||
|
@ -228,7 +228,6 @@ VARIABLE_NAME VARIABLE_VALUE
|
||||
MYISAM_MAX_SORT_FILE_SIZE FILE_SIZE
|
||||
set global net_retry_count=10, session net_retry_count=10;
|
||||
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
|
||||
set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
|
||||
show global variables like 'net_%';
|
||||
Variable_name Value
|
||||
net_buffer_length 1024
|
||||
@ -243,57 +242,45 @@ NET_RETRY_COUNT 10
|
||||
NET_WRITE_TIMEOUT 200
|
||||
show session variables like 'net_%';
|
||||
Variable_name Value
|
||||
net_buffer_length 2048
|
||||
net_read_timeout 600
|
||||
net_buffer_length 16384
|
||||
net_read_timeout 30
|
||||
net_retry_count 10
|
||||
net_write_timeout 500
|
||||
net_write_timeout 60
|
||||
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 2048
|
||||
NET_READ_TIMEOUT 600
|
||||
NET_BUFFER_LENGTH 16384
|
||||
NET_READ_TIMEOUT 30
|
||||
NET_RETRY_COUNT 10
|
||||
NET_WRITE_TIMEOUT 500
|
||||
set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
|
||||
NET_WRITE_TIMEOUT 60
|
||||
set global net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
|
||||
show global variables like 'net_%';
|
||||
Variable_name Value
|
||||
net_buffer_length 1024
|
||||
net_buffer_length 7168
|
||||
net_read_timeout 900
|
||||
net_retry_count 10
|
||||
net_write_timeout 1000
|
||||
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 1024
|
||||
NET_BUFFER_LENGTH 7168
|
||||
NET_READ_TIMEOUT 900
|
||||
NET_RETRY_COUNT 10
|
||||
NET_WRITE_TIMEOUT 1000
|
||||
show session variables like 'net_%';
|
||||
Variable_name Value
|
||||
net_buffer_length 7168
|
||||
net_read_timeout 600
|
||||
net_retry_count 10
|
||||
net_write_timeout 500
|
||||
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 7168
|
||||
NET_READ_TIMEOUT 600
|
||||
NET_RETRY_COUNT 10
|
||||
NET_WRITE_TIMEOUT 500
|
||||
set net_buffer_length=1;
|
||||
set global net_buffer_length=1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '1'
|
||||
show variables like 'net_buffer_length';
|
||||
show global variables like 'net_buffer_length';
|
||||
Variable_name Value
|
||||
net_buffer_length 1024
|
||||
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
|
||||
select * from information_schema.global_variables where variable_name like 'net_buffer_length';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 1024
|
||||
set net_buffer_length=2000000000;
|
||||
set global net_buffer_length=2000000000;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '2000000000'
|
||||
show variables like 'net_buffer_length';
|
||||
show global variables like 'net_buffer_length';
|
||||
Variable_name Value
|
||||
net_buffer_length 1048576
|
||||
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
|
||||
select * from information_schema.global_variables where variable_name like 'net_buffer_length';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
NET_BUFFER_LENGTH 1048576
|
||||
set character set cp1251_koi8;
|
||||
@ -461,7 +448,7 @@ select @@long_query_time;
|
||||
@@long_query_time
|
||||
100.000001
|
||||
set low_priority_updates=1;
|
||||
set max_allowed_packet=100;
|
||||
set global max_allowed_packet=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
|
||||
set global max_binlog_cache_size=100;
|
||||
@ -485,7 +472,7 @@ select @@max_user_connections;
|
||||
100
|
||||
set global max_write_lock_count=100;
|
||||
set myisam_sort_buffer_size=100;
|
||||
set net_buffer_length=100;
|
||||
set global net_buffer_length=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '100'
|
||||
set net_read_timeout=100;
|
||||
@ -1024,3 +1011,329 @@ SET GLOBAL log_output = 0;
|
||||
ERROR 42000: Variable 'log_output' can't be set to the value of '0'
|
||||
|
||||
# -- End of Bug#34820.
|
||||
|
||||
#
|
||||
SHOW VARIABLES like 'ft_max_word_len';
|
||||
Variable_name Value
|
||||
ft_max_word_len 84
|
||||
SELECT @@session.ft_max_word_len;
|
||||
ERROR HY000: Variable 'ft_max_word_len' is a GLOBAL variable
|
||||
SELECT @@global.ft_max_word_len;
|
||||
@@global.ft_max_word_len
|
||||
84
|
||||
SET @@session.ft_max_word_len= 7;
|
||||
ERROR HY000: Variable 'ft_max_word_len' is a read only variable
|
||||
SET @@global.ft_max_word_len= 7;
|
||||
ERROR HY000: Variable 'ft_max_word_len' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'ft_min_word_len';
|
||||
Variable_name Value
|
||||
ft_min_word_len 4
|
||||
SELECT @@session.ft_min_word_len;
|
||||
ERROR HY000: Variable 'ft_min_word_len' is a GLOBAL variable
|
||||
SELECT @@global.ft_min_word_len;
|
||||
@@global.ft_min_word_len
|
||||
4
|
||||
SET @@session.ft_min_word_len= 7;
|
||||
ERROR HY000: Variable 'ft_min_word_len' is a read only variable
|
||||
SET @@global.ft_min_word_len= 7;
|
||||
ERROR HY000: Variable 'ft_min_word_len' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'ft_query_expansion_limit';
|
||||
Variable_name Value
|
||||
ft_query_expansion_limit 20
|
||||
SELECT @@session.ft_query_expansion_limit;
|
||||
ERROR HY000: Variable 'ft_query_expansion_limit' is a GLOBAL variable
|
||||
SELECT @@global.ft_query_expansion_limit;
|
||||
@@global.ft_query_expansion_limit
|
||||
20
|
||||
SET @@session.ft_query_expansion_limit= 7;
|
||||
ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
|
||||
SET @@global.ft_query_expansion_limit= 7;
|
||||
ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'ft_stopword_file';
|
||||
Variable_name Value
|
||||
ft_stopword_file (built-in)
|
||||
SELECT @@session.ft_stopword_file;
|
||||
ERROR HY000: Variable 'ft_stopword_file' is a GLOBAL variable
|
||||
SELECT @@global.ft_stopword_file;
|
||||
@@global.ft_stopword_file
|
||||
(built-in)
|
||||
SET @@session.ft_stopword_file= 'x';
|
||||
ERROR HY000: Variable 'ft_stopword_file' is a read only variable
|
||||
SET @@global.ft_stopword_file= 'x';
|
||||
ERROR HY000: Variable 'ft_stopword_file' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'back_log';
|
||||
Variable_name Value
|
||||
back_log 50
|
||||
SELECT @@session.back_log;
|
||||
ERROR HY000: Variable 'back_log' is a GLOBAL variable
|
||||
SELECT @@global.back_log;
|
||||
@@global.back_log
|
||||
50
|
||||
SET @@session.back_log= 7;
|
||||
ERROR HY000: Variable 'back_log' is a read only variable
|
||||
SET @@global.back_log= 7;
|
||||
ERROR HY000: Variable 'back_log' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'large_files_support';
|
||||
Variable_name Value
|
||||
large_files_support #
|
||||
SELECT @@session.large_files_support;
|
||||
ERROR HY000: Variable 'large_files_support' is a GLOBAL variable
|
||||
SELECT @@global.large_files_support;
|
||||
@@global.large_files_support
|
||||
#
|
||||
SET @@session.large_files_support= true;
|
||||
ERROR HY000: Variable 'large_files_support' is a read only variable
|
||||
SET @@global.large_files_support= true;
|
||||
ERROR HY000: Variable 'large_files_support' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'character_sets_dir';
|
||||
Variable_name Value
|
||||
character_sets_dir #
|
||||
SELECT @@session.character_sets_dir;
|
||||
ERROR HY000: Variable 'character_sets_dir' is a GLOBAL variable
|
||||
SELECT @@global.character_sets_dir;
|
||||
@@global.character_sets_dir
|
||||
#
|
||||
SET @@session.character_sets_dir= 'x';
|
||||
ERROR HY000: Variable 'character_sets_dir' is a read only variable
|
||||
SET @@global.character_sets_dir= 'x';
|
||||
ERROR HY000: Variable 'character_sets_dir' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'init_file';
|
||||
Variable_name Value
|
||||
init_file #
|
||||
SELECT @@session.init_file;
|
||||
ERROR HY000: Variable 'init_file' is a GLOBAL variable
|
||||
SELECT @@global.init_file;
|
||||
@@global.init_file
|
||||
#
|
||||
SET @@session.init_file= 'x';
|
||||
ERROR HY000: Variable 'init_file' is a read only variable
|
||||
SET @@global.init_file= 'x';
|
||||
ERROR HY000: Variable 'init_file' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'language';
|
||||
Variable_name Value
|
||||
language #
|
||||
SELECT @@session.language;
|
||||
ERROR HY000: Variable 'language' is a GLOBAL variable
|
||||
SELECT @@global.language;
|
||||
@@global.language
|
||||
#
|
||||
SET @@session.language= 'x';
|
||||
ERROR HY000: Variable 'language' is a read only variable
|
||||
SET @@global.language= 'x';
|
||||
ERROR HY000: Variable 'language' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'large_page_size';
|
||||
Variable_name Value
|
||||
large_page_size #
|
||||
SELECT @@session.large_page_size;
|
||||
ERROR HY000: Variable 'large_page_size' is a GLOBAL variable
|
||||
SELECT @@global.large_page_size;
|
||||
@@global.large_page_size
|
||||
#
|
||||
SET @@session.large_page_size= 7;
|
||||
ERROR HY000: Variable 'large_page_size' is a read only variable
|
||||
SET @@global.large_page_size= 7;
|
||||
ERROR HY000: Variable 'large_page_size' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'large_pages';
|
||||
Variable_name Value
|
||||
large_pages #
|
||||
SELECT @@session.large_pages;
|
||||
ERROR HY000: Variable 'large_pages' is a GLOBAL variable
|
||||
SELECT @@global.large_pages;
|
||||
@@global.large_pages
|
||||
#
|
||||
SET @@session.large_pages= true;
|
||||
ERROR HY000: Variable 'large_pages' is a read only variable
|
||||
SET @@global.large_pages= true;
|
||||
ERROR HY000: Variable 'large_pages' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'log_bin';
|
||||
Variable_name Value
|
||||
log_bin OFF
|
||||
SELECT @@session.log_bin;
|
||||
ERROR HY000: Variable 'log_bin' is a GLOBAL variable
|
||||
SELECT @@global.log_bin;
|
||||
@@global.log_bin
|
||||
0
|
||||
SET @@session.log_bin= true;
|
||||
ERROR HY000: Variable 'log_bin' is a read only variable
|
||||
SET @@global.log_bin= true;
|
||||
ERROR HY000: Variable 'log_bin' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'log_error';
|
||||
Variable_name Value
|
||||
log_error #
|
||||
SELECT @@session.log_error;
|
||||
ERROR HY000: Variable 'log_error' is a GLOBAL variable
|
||||
SELECT @@global.log_error;
|
||||
@@global.log_error
|
||||
#
|
||||
SET @@session.log_error= 'x';
|
||||
ERROR HY000: Variable 'log_error' is a read only variable
|
||||
SET @@global.log_error= 'x';
|
||||
ERROR HY000: Variable 'log_error' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'lower_case_file_system';
|
||||
Variable_name Value
|
||||
lower_case_file_system #
|
||||
SELECT @@session.lower_case_file_system;
|
||||
ERROR HY000: Variable 'lower_case_file_system' is a GLOBAL variable
|
||||
SELECT @@global.lower_case_file_system;
|
||||
@@global.lower_case_file_system
|
||||
#
|
||||
SET @@session.lower_case_file_system= true;
|
||||
ERROR HY000: Variable 'lower_case_file_system' is a read only variable
|
||||
SET @@global.lower_case_file_system= true;
|
||||
ERROR HY000: Variable 'lower_case_file_system' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'lower_case_table_names';
|
||||
Variable_name Value
|
||||
lower_case_table_names #
|
||||
SELECT @@session.lower_case_table_names;
|
||||
ERROR HY000: Variable 'lower_case_table_names' is a GLOBAL variable
|
||||
SELECT @@global.lower_case_table_names;
|
||||
@@global.lower_case_table_names
|
||||
#
|
||||
SET @@session.lower_case_table_names= 7;
|
||||
ERROR HY000: Variable 'lower_case_table_names' is a read only variable
|
||||
SET @@global.lower_case_table_names= 7;
|
||||
ERROR HY000: Variable 'lower_case_table_names' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'myisam_recover_options';
|
||||
Variable_name Value
|
||||
myisam_recover_options OFF
|
||||
SELECT @@session.myisam_recover_options;
|
||||
ERROR HY000: Variable 'myisam_recover_options' is a GLOBAL variable
|
||||
SELECT @@global.myisam_recover_options;
|
||||
@@global.myisam_recover_options
|
||||
OFF
|
||||
SET @@session.myisam_recover_options= 'x';
|
||||
ERROR HY000: Variable 'myisam_recover_options' is a read only variable
|
||||
SET @@global.myisam_recover_options= 'x';
|
||||
ERROR HY000: Variable 'myisam_recover_options' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'open_files_limit';
|
||||
Variable_name Value
|
||||
open_files_limit #
|
||||
SELECT @@session.open_files_limit;
|
||||
ERROR HY000: Variable 'open_files_limit' is a GLOBAL variable
|
||||
SELECT @@global.open_files_limit;
|
||||
@@global.open_files_limit
|
||||
#
|
||||
SET @@session.open_files_limit= 7;
|
||||
ERROR HY000: Variable 'open_files_limit' is a read only variable
|
||||
SET @@global.open_files_limit= 7;
|
||||
ERROR HY000: Variable 'open_files_limit' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'pid_file';
|
||||
Variable_name Value
|
||||
pid_file #
|
||||
SELECT @@session.pid_file;
|
||||
ERROR HY000: Variable 'pid_file' is a GLOBAL variable
|
||||
SELECT @@global.pid_file;
|
||||
@@global.pid_file
|
||||
#
|
||||
SET @@session.pid_file= 'x';
|
||||
ERROR HY000: Variable 'pid_file' is a read only variable
|
||||
SET @@global.pid_file= 'x';
|
||||
ERROR HY000: Variable 'pid_file' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'plugin_dir';
|
||||
Variable_name Value
|
||||
plugin_dir #
|
||||
SELECT @@session.plugin_dir;
|
||||
ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable
|
||||
SELECT @@global.plugin_dir;
|
||||
@@global.plugin_dir
|
||||
#
|
||||
SET @@session.plugin_dir= 'x';
|
||||
ERROR HY000: Variable 'plugin_dir' is a read only variable
|
||||
SET @@global.plugin_dir= 'x';
|
||||
ERROR HY000: Variable 'plugin_dir' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'port';
|
||||
Variable_name Value
|
||||
port #
|
||||
SELECT @@session.port;
|
||||
ERROR HY000: Variable 'port' is a GLOBAL variable
|
||||
SELECT @@global.port;
|
||||
@@global.port
|
||||
#
|
||||
SET @@session.port= 7;
|
||||
ERROR HY000: Variable 'port' is a read only variable
|
||||
SET @@global.port= 7;
|
||||
ERROR HY000: Variable 'port' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'protocol_version';
|
||||
Variable_name Value
|
||||
protocol_version 10
|
||||
SELECT @@session.protocol_version;
|
||||
ERROR HY000: Variable 'protocol_version' is a GLOBAL variable
|
||||
SELECT @@global.protocol_version;
|
||||
@@global.protocol_version
|
||||
10
|
||||
SET @@session.protocol_version= 7;
|
||||
ERROR HY000: Variable 'protocol_version' is a read only variable
|
||||
SET @@global.protocol_version= 7;
|
||||
ERROR HY000: Variable 'protocol_version' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'skip_external_locking';
|
||||
Variable_name Value
|
||||
skip_external_locking ON
|
||||
SELECT @@session.skip_external_locking;
|
||||
ERROR HY000: Variable 'skip_external_locking' is a GLOBAL variable
|
||||
SELECT @@global.skip_external_locking;
|
||||
@@global.skip_external_locking
|
||||
1
|
||||
SET @@session.skip_external_locking= true;
|
||||
ERROR HY000: Variable 'skip_external_locking' is a read only variable
|
||||
SET @@global.skip_external_locking= true;
|
||||
ERROR HY000: Variable 'skip_external_locking' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'skip_networking';
|
||||
Variable_name Value
|
||||
skip_networking OFF
|
||||
SELECT @@session.skip_networking;
|
||||
ERROR HY000: Variable 'skip_networking' is a GLOBAL variable
|
||||
SELECT @@global.skip_networking;
|
||||
@@global.skip_networking
|
||||
0
|
||||
SET @@session.skip_networking= true;
|
||||
ERROR HY000: Variable 'skip_networking' is a read only variable
|
||||
SET @@global.skip_networking= true;
|
||||
ERROR HY000: Variable 'skip_networking' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'skip_show_database';
|
||||
Variable_name Value
|
||||
skip_show_database OFF
|
||||
SELECT @@session.skip_show_database;
|
||||
ERROR HY000: Variable 'skip_show_database' is a GLOBAL variable
|
||||
SELECT @@global.skip_show_database;
|
||||
@@global.skip_show_database
|
||||
0
|
||||
SET @@session.skip_show_database= true;
|
||||
ERROR HY000: Variable 'skip_show_database' is a read only variable
|
||||
SET @@global.skip_show_database= true;
|
||||
ERROR HY000: Variable 'skip_show_database' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'thread_stack';
|
||||
Variable_name Value
|
||||
thread_stack #
|
||||
SELECT @@session.thread_stack;
|
||||
ERROR HY000: Variable 'thread_stack' is a GLOBAL variable
|
||||
SELECT @@global.thread_stack;
|
||||
@@global.thread_stack
|
||||
#
|
||||
SET @@session.thread_stack= 7;
|
||||
ERROR HY000: Variable 'thread_stack' is a read only variable
|
||||
SET @@global.thread_stack= 7;
|
||||
ERROR HY000: Variable 'thread_stack' is a read only variable
|
||||
|
@ -625,7 +625,7 @@ drop table t1;
|
||||
create table t1 (a int, b int);
|
||||
create view v1 as select a, sum(b) from t1 group by a;
|
||||
select b from v1 use index (some_index) where b=1;
|
||||
ERROR HY000: Incorrect usage of index hints and VIEW
|
||||
ERROR 42000: Key 'some_index' doesn't exist in table 'v1'
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create table t1 (col1 char(5),col2 char(5));
|
||||
@ -3562,11 +3562,11 @@ CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SELECT * FROM v1 USE KEY(non_existant);
|
||||
ERROR HY000: Incorrect usage of index hints and VIEW
|
||||
ERROR 42000: Key 'non_existant' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 FORCE KEY(non_existant);
|
||||
ERROR HY000: Incorrect usage of index hints and VIEW
|
||||
ERROR 42000: Key 'non_existant' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 IGNORE KEY(non_existant);
|
||||
ERROR HY000: Incorrect usage of index hints and VIEW
|
||||
ERROR 42000: Key 'non_existant' doesn't exist in table 'v1'
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b INT NOT NULL DEFAULT 0,
|
||||
@ -3674,6 +3674,31 @@ DROP VIEW v1;
|
||||
|
||||
CREATE VIEW v1 AS SELECT 1;
|
||||
DROP VIEW v1;
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2));
|
||||
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
|
||||
SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2;
|
||||
c1 c2
|
||||
2 2
|
||||
SELECT * FROM t1 USE INDEX (c2) WHERE c2=2;
|
||||
c1 c2
|
||||
2 2
|
||||
CREATE VIEW v1 AS SELECT c1, c2 FROM t1;
|
||||
SHOW INDEX FROM v1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2;
|
||||
ERROR 42000: Key 'PRIMARY' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2;
|
||||
ERROR 42000: Key 'PRIMARY' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2;
|
||||
ERROR 42000: Key 'PRIMARY' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 USE INDEX (c2) WHERE c2=2;
|
||||
ERROR 42000: Key 'c2' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2;
|
||||
ERROR 42000: Key 'c2' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
|
||||
ERROR 42000: Key 'c2' doesn't exist in table 'v1'
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
# -----------------------------------------------------------------
|
||||
# -- End of 5.0 tests.
|
||||
# -----------------------------------------------------------------
|
||||
|
@ -1,30 +1,32 @@
|
||||
drop table if exists t1;
|
||||
## Creating new table t1 ##
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL auto_increment,
|
||||
PRIMARY KEY (id),
|
||||
name VARCHAR(30)
|
||||
);
|
||||
SET @start_value= @@global.wait_timeout;
|
||||
'#--------------------FN_DYNVARS_186_01-------------------------#'
|
||||
## Creating new connection test_con1 ##
|
||||
## Setting value of variable to 5 ##
|
||||
SET @@session.wait_timeout = 5;
|
||||
## Inserting record in table t1 ##
|
||||
INSERT into t1(name) values('Record_1');
|
||||
## Using sleep to check timeout ##
|
||||
'#--------------------FN_DYNVARS_186_02-------------------------#'
|
||||
## Setting value of variable ##
|
||||
SET @@global.wait_timeout = 5;
|
||||
## Creating new connection test_con2 ##
|
||||
INSERT into t1(name) values('Record_2');
|
||||
## Using sleep to check timeout ##
|
||||
SET @start_time= UNIX_TIMESTAMP();
|
||||
connect (test_con1, localhost, root,,);
|
||||
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
|
||||
Expect 1
|
||||
1
|
||||
SET @@session.wait_timeout = <session_value>;
|
||||
connect (test_con2, localhost, root,,);
|
||||
SET @@session.wait_timeout = <session_value> - 1;
|
||||
connection default;
|
||||
wait until connections ready
|
||||
SELECT info FROM information_schema.processlist;
|
||||
info
|
||||
SELECT info FROM information_schema.processlist
|
||||
'#--------------------FN_DYNVARS_186_03-------------------------#'
|
||||
## Setting value of variable to 1 ##
|
||||
SET @@global.wait_timeout = 1;
|
||||
## Creating new connection ##
|
||||
INSERT into t1(name) values('Record_3');
|
||||
## Using sleep to check timeout ##
|
||||
## We cannot test it further because the server stops due to wait_timeout ##
|
||||
SELECT * from t1;
|
||||
ERROR HY000: MySQL server has gone away
|
||||
SET @@global.wait_timeout= <global_value>;
|
||||
SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
|
||||
Expect 1
|
||||
1
|
||||
connect (test_con3, localhost, root,,);
|
||||
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
|
||||
Expect 1
|
||||
1
|
||||
connection default;
|
||||
SELECT info FROM information_schema.processlist;
|
||||
info
|
||||
SELECT info FROM information_schema.processlist
|
||||
SELECT UNIX_TIMESTAMP() - @start_time >= <global_value> + <session_value>;;
|
||||
UNIX_TIMESTAMP() - @start_time >= <global_value> + <session_value>;
|
||||
1
|
||||
SET @@global.wait_timeout= @start_value;
|
||||
|
@ -185,7 +185,7 @@ let $message= use db with trigger privilege on db level and without...:;
|
||||
select f1 from t1 order by f1;
|
||||
--disable_warnings
|
||||
disconnect no_privs;
|
||||
--enable warnings
|
||||
--enable_warnings
|
||||
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
|
2
mysql-test/t/ctype_filesystem-master.opt
Normal file
2
mysql-test/t/ctype_filesystem-master.opt
Normal file
@ -0,0 +1,2 @@
|
||||
--character-sets-dir=/<2F>
|
||||
--character-set-filesystem=latin1
|
5
mysql-test/t/ctype_filesystem.test
Normal file
5
mysql-test/t/ctype_filesystem.test
Normal file
@ -0,0 +1,5 @@
|
||||
SET CHARACTER SET utf8;
|
||||
SHOW VARIABLES like 'character_sets_dir';
|
||||
SHOW VARIABLES like 'character_set_filesystem';
|
||||
SHOW VARIABLES like 'character_set_client';
|
||||
SET CHARACTER SET default;
|
@ -1439,3 +1439,20 @@ select hex(_utf8 X'616263FF');
|
||||
select hex(_utf8 B'001111111111');
|
||||
--error ER_INVALID_CHARACTER_STRING
|
||||
select (_utf8 X'616263FF');
|
||||
|
||||
#
|
||||
# Bug #36772: When using UTF8, CONVERT with GROUP BY returns truncated results
|
||||
#
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
|
||||
INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
|
||||
ALTER TABLE t1 ADD UNIQUE (b);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
DROP INDEX b ON t1;
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
ALTER TABLE t1 ADD INDEX (b);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -10,6 +10,5 @@
|
||||
#
|
||||
##############################################################################
|
||||
federated_transactions : Bug#29523 Transactions do not work
|
||||
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
|
||||
log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows
|
||||
slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions
|
||||
|
@ -1,11 +1,12 @@
|
||||
# Can't test with embedded server that doesn't support grants
|
||||
# Can't test with embedded server that doesn't support events
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS events_test;
|
||||
USE events_test;
|
||||
|
||||
SET @event_scheduler=@@global.event_scheduler;
|
||||
SET GLOBAL event_scheduler=OFF;
|
||||
--echo Try agian to make sure it's allowed
|
||||
--echo Try again to make sure it's allowed
|
||||
SET GLOBAL event_scheduler=OFF;
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
SET GLOBAL event_scheduler=1;
|
||||
@ -57,34 +58,44 @@ ON COMPLETION PRESERVE
|
||||
DO
|
||||
INSERT INTO table_4 VALUES (1);
|
||||
|
||||
# Wait for the events to fire and check the data afterwards
|
||||
|
||||
# Let event_1 insert at least 4 records into the table
|
||||
let $wait_condition=select count(*) >= 4 from table_1;
|
||||
--source include/wait_condition.inc
|
||||
# Minimum of passed time is 6 seconds assuming
|
||||
# - event executions starts immediate after creation
|
||||
# - 4 times event_1 means an insert at ect, ect+2, ect+4, ect+6
|
||||
# ect = event creation time
|
||||
|
||||
# Let event_2 reach the end of its execution interval
|
||||
# Let event_2 reach the end of its execution interval
|
||||
let $wait_condition=select count(*) = 0 from information_schema.events
|
||||
where event_name='event_2' and status='enabled';
|
||||
--source include/wait_condition.inc
|
||||
# Minimum of passed time is 6 seconds.
|
||||
# See wait_condition for event_1 above and ENDS condition for event_2.
|
||||
|
||||
# Let event_3, which is ON COMPLETION NOT PRESERVE execute and drop itself
|
||||
# Let event_3, which is ON COMPLETION NOT PRESERVE execute and drop itself
|
||||
let $wait_condition=select count(*) = 0 from information_schema.events
|
||||
where event_name='event_3';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# Let event_4 reach the end of its execution interval
|
||||
# Let event_4 reach the end of its execution interval
|
||||
let $wait_condition=select count(*) = 0 from information_schema.events
|
||||
where event_name='event_4' and status='enabled';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# Wait for the events to fire and check the data afterwards
|
||||
|
||||
let $wait_condition=SELECT SUM(a) >= 4 FROM table_1;
|
||||
source include/wait_condition.inc;
|
||||
SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
|
||||
|
||||
let $wait_condition=SELECT SUM(a) >= 5 FROM table_2;
|
||||
# In case of a testing box under heavy load it cannot be guaranteed that
|
||||
# it is really often enough checked if event_2 has to be executed.
|
||||
# -> Bug#39854 events_scheduling fails sporadically on pushbuild
|
||||
# Therefore we lowered here the original expectation of 5 to 4.
|
||||
let $wait_condition=SELECT SUM(a) >= 4 FROM table_2;
|
||||
source include/wait_condition.inc;
|
||||
SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2;
|
||||
SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
|
||||
|
||||
let $wait_condition=SELECT SUM(a) >= 1 FROM table_3;
|
||||
source include/wait_condition.inc;
|
||||
@ -112,9 +123,9 @@ DROP TABLE table_2;
|
||||
DROP TABLE table_3;
|
||||
DROP TABLE table_4;
|
||||
DROP DATABASE events_test;
|
||||
SET GLOBAL event_scheduler=OFF;
|
||||
SET GLOBAL event_scheduler=@event_scheduler;
|
||||
|
||||
#
|
||||
#
|
||||
# End of tests
|
||||
#
|
||||
|
||||
|
@ -1,11 +1,40 @@
|
||||
# This test case is sensitive to execution timing. You may control
|
||||
# this sensitivity by the parameter below. Small values will result
|
||||
# in fast but more unstable execution, large values will improve
|
||||
# stability at the cost of speed. Basically, N is a number of seconds
|
||||
# to wait for operation to complete. Should be positive. Test runs
|
||||
# about 25*N seconds (it sleeps most of the time, so CPU speed is not
|
||||
# relevant).
|
||||
# 1. This test case is sensitive to execution timing. You may control
|
||||
# this sensitivity by the parameter below. Small values will result
|
||||
# in fast but more unstable execution, large values will improve
|
||||
# stability at the cost of speed. Basically, N is a number of seconds
|
||||
# to wait for operation to complete. Should be positive. Test runs
|
||||
# about 25*N seconds (it sleeps most of the time, so CPU speed is not
|
||||
# relevant).
|
||||
let $N = 5;
|
||||
#
|
||||
# 2. Some subtests
|
||||
# - create a new time zone
|
||||
# - run some statements
|
||||
# - delete the new time zone.
|
||||
# But the time zone name used gets somewhere cached and it cannot be
|
||||
# "reused" later in the same or another session for a new time zone.
|
||||
# Experiments (2008-11 MySQL 5.1) showed that none of the available
|
||||
# RESET/FLUSH commands removes these entries.
|
||||
# 2008-11 MySQL 5.1 Bug#39979 main.events_time_zone does not clean up
|
||||
# second bad effect
|
||||
# Therefore we compute unique and unusual timezone names to minimize
|
||||
# the likelihood that a later test uses the same name.
|
||||
#
|
||||
# 3. The subtests mentioned in 2. cause that the AUTO_INCREMENT value
|
||||
# within "SHOW CREATE TABLE mysql.timezone" differ from the initial one.
|
||||
# (Bug#39979 main.events_time_zone does not clean up)
|
||||
# Therefore we reset this value after each of these subtests.
|
||||
#
|
||||
# Note(mleich):
|
||||
# There is a significant likelihood that future improvements of the server
|
||||
# cause that the solutions for the issues mentioned in 2. and 3. will no
|
||||
# more work.
|
||||
# A mysql-test-run.pl feature which allows to enforce
|
||||
# 1. Server shutdown (-> Problem mentioned in 2. disappears)
|
||||
# 2. Reset all data to initial state (-> Problem mentioned in 3. disappears)
|
||||
# 3. Server start
|
||||
# after a tests would be a perfect replacement.
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
|
||||
@ -73,19 +102,15 @@ delimiter ;//
|
||||
SET @step3= @step * 3;
|
||||
SET @step6= @step * 6;
|
||||
|
||||
# Disable query log to hide current time.
|
||||
--disable_query_log
|
||||
SET @unix_time= UNIX_TIMESTAMP() - 1;
|
||||
--enable_query_log
|
||||
|
||||
SET @unix_time= @unix_time - @unix_time % @step6;
|
||||
|
||||
INSERT INTO mysql.time_zone VALUES (NULL, 'N');
|
||||
SET @tzid= LAST_INSERT_ID();
|
||||
INSERT INTO mysql.time_zone_transition_type
|
||||
VALUES (@tzid, 0, 0, 0, 'b16420_0');
|
||||
VALUES (@tzid, 0, 0, 0, 'b16420_0');
|
||||
INSERT INTO mysql.time_zone_transition_type
|
||||
VALUES (@tzid, 1, @step3 - @step, 1, 'b16420_1');
|
||||
VALUES (@tzid, 1, @step3 - @step, 1, 'b16420_1');
|
||||
|
||||
let $transition_unix_time= `SELECT @unix_time`;
|
||||
let $count= 30;
|
||||
@ -99,7 +124,9 @@ while ($count)
|
||||
dec $count;
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO mysql.time_zone_name VALUES ('bug16420', @tzid);
|
||||
let $tz_name = `SELECT CONCAT('b16420_a',UNIX_TIMESTAMP())`;
|
||||
--replace_result $tz_name <TZ_NAME_1>
|
||||
eval INSERT INTO mysql.time_zone_name VALUES ('$tz_name', @tzid);
|
||||
|
||||
CREATE TABLE t1 (count INT, unix_time INT, local_time INT, comment CHAR(80));
|
||||
CREATE TABLE t2 (count INT);
|
||||
@ -135,7 +162,8 @@ SET TIME_ZONE= '+00:00';
|
||||
CREATE EVENT e1 ON SCHEDULE EVERY @step SECOND
|
||||
STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1("<e1>");
|
||||
|
||||
SET TIME_ZONE= 'bug16420';
|
||||
--replace_result $tz_name <TZ_NAME_1>
|
||||
eval SET TIME_ZONE= '$tz_name';
|
||||
CREATE EVENT e2 ON SCHEDULE EVERY @step SECOND
|
||||
STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1("<e2>");
|
||||
|
||||
@ -196,6 +224,8 @@ DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid;
|
||||
let $time_zone_auto_inc = `SELECT MAX(Time_zone_id) + 1 FROM mysql.time_zone`;
|
||||
eval ALTER TABLE mysql.time_zone AUTO_INCREMENT = $time_zone_auto_inc;
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
@ -216,13 +246,13 @@ SET @offset_month_03= UNIX_TIMESTAMP('2030-03-31 12:00:00') - @now - 5*@step;
|
||||
SET @offset_month_04= UNIX_TIMESTAMP('2030-04-30 12:00:00') - @now - 13*@step;
|
||||
|
||||
INSERT INTO mysql.time_zone_transition_type
|
||||
VALUES (@tzid, 0, @offset_month_01, 0, 'b16420_0');
|
||||
VALUES (@tzid, 0, @offset_month_01, 0, 'b16420_0');
|
||||
INSERT INTO mysql.time_zone_transition_type
|
||||
VALUES (@tzid, 1, @offset_month_02, 1, 'b16420_1');
|
||||
VALUES (@tzid, 1, @offset_month_02, 1, 'b16420_1');
|
||||
INSERT INTO mysql.time_zone_transition_type
|
||||
VALUES (@tzid, 2, @offset_month_03, 1, 'b16420_2');
|
||||
VALUES (@tzid, 2, @offset_month_03, 1, 'b16420_2');
|
||||
INSERT INTO mysql.time_zone_transition_type
|
||||
VALUES (@tzid, 3, @offset_month_04, 1, 'b16420_3');
|
||||
VALUES (@tzid, 3, @offset_month_04, 1, 'b16420_3');
|
||||
INSERT INTO mysql.time_zone_transition
|
||||
VALUES (@tzid, @now, 0);
|
||||
INSERT INTO mysql.time_zone_transition
|
||||
@ -231,11 +261,12 @@ INSERT INTO mysql.time_zone_transition
|
||||
VALUES (@tzid, @now + 7 * @step, 2);
|
||||
INSERT INTO mysql.time_zone_transition
|
||||
VALUES (@tzid, @now + 12 * @step, 3);
|
||||
# We have to user a new time zone name, because 'bug16420' has been
|
||||
# cached already.
|
||||
INSERT INTO mysql.time_zone_name VALUES ('bug16420_2', @tzid);
|
||||
let $tz_name = `SELECT CONCAT('b16420_b',UNIX_TIMESTAMP())`;
|
||||
--replace_result $tz_name <TZ_NAME_2>
|
||||
eval INSERT INTO mysql.time_zone_name VALUES ('$tz_name', @tzid);
|
||||
|
||||
SET TIME_ZONE= 'bug16420_2';
|
||||
--replace_result $tz_name <TZ_NAME_2>
|
||||
eval SET TIME_ZONE= '$tz_name';
|
||||
|
||||
SET GLOBAL EVENT_SCHEDULER= ON;
|
||||
|
||||
@ -280,6 +311,8 @@ DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid;
|
||||
DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid;
|
||||
let $time_zone_auto_inc = `SELECT MAX(Time_zone_id) + 1 FROM mysql.time_zone`;
|
||||
eval ALTER TABLE mysql.time_zone AUTO_INCREMENT = $time_zone_auto_inc;
|
||||
|
||||
DROP FUNCTION round_to_step;
|
||||
DROP TABLE t_step;
|
||||
@ -291,8 +324,8 @@ eval USE $old_db;
|
||||
|
||||
--enable_query_log
|
||||
let $wait_condition=
|
||||
select count(*) = 0 from information_schema.processlist
|
||||
where db='mysqltest_db1' and command = 'Connect' and user=current_user();
|
||||
SELECT COUNT(*) = 0 FROM information_schema.processlist
|
||||
WHERE db='mysqltest_db1' AND command = 'Connect' AND user=current_user();
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo End of 5.1 tests.
|
||||
|
@ -43,8 +43,11 @@ drop table t1;
|
||||
# note that when LOW_MEMORY is set the "test" below is meaningless
|
||||
#
|
||||
|
||||
set @@max_allowed_packet=1048576*100;
|
||||
set @@global.max_allowed_packet=1048576*100;
|
||||
--replace_result "''" XXX "'1'" XXX
|
||||
|
||||
# reconnect to make the new max packet size take effect
|
||||
--connect (newconn, localhost, root,,)
|
||||
eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null;
|
||||
|
||||
#
|
||||
|
@ -973,5 +973,34 @@ GROUP BY int_nokey LIMIT 1;
|
||||
DROP TABLE derived1;
|
||||
DROP TABLE D;
|
||||
|
||||
#
|
||||
# Bug #39656: Behaviour different for agg functions with & without where -
|
||||
# ONLY_FULL_GROUP_BY
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1,1), (1,2), (1,3);
|
||||
|
||||
SET SQL_MODE='ONLY_FULL_GROUP_BY';
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
SELECT COUNT(*) FROM t1 where a=1;
|
||||
|
||||
--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
|
||||
SELECT COUNT(*),a FROM t1;
|
||||
|
||||
SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a;
|
||||
|
||||
--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
|
||||
SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a)
|
||||
FROM t1 outr;
|
||||
|
||||
SELECT COUNT(*) FROM t1 a JOIN t1 outr
|
||||
ON a.a= (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a);
|
||||
|
||||
SET SQL_MODE=default;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
###
|
||||
--echo End of 5.0 tests
|
||||
|
@ -135,3 +135,20 @@ select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
|
||||
--enable_ps_protocol
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Bug#37553: MySql Error Compare TimeDiff & Time
|
||||
#
|
||||
|
||||
# calculations involving negative time values ignored sign
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00');
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00');
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00');
|
||||
|
||||
# show that conversion to DECIMAL no longer drops sign
|
||||
SELECT CAST(time('-73:42:12') AS DECIMAL);
|
||||
|
||||
|
||||
# End of 5.0 tests
|
||||
|
@ -11,18 +11,23 @@
|
||||
# Creation Date: 2008-03-07 #
|
||||
# Author: Salman Rawala #
|
||||
# #
|
||||
# Last modification: #
|
||||
# 2008-11-14 mleich Fix Bug#40644 main.group_concat_max_len_func random #
|
||||
# failures #
|
||||
# + minor improvements #
|
||||
# #
|
||||
# Description: Test Cases of Dynamic System Variable group_concat_max_len #
|
||||
# that checks the functionality of this variable #
|
||||
# #
|
||||
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
|
||||
# server-system-variables.html #
|
||||
# Reference: #
|
||||
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
SET @save = @@global.group_concat_max_len;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
#########################
|
||||
@ -32,34 +37,38 @@ drop table if exists t1;
|
||||
--echo ## Creating new table t1 ##
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL auto_increment,
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id),
|
||||
rollno int NOT NULL,
|
||||
rollno INT NOT NULL,
|
||||
name VARCHAR(30)
|
||||
);
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_034_01-------------------------#'
|
||||
########################################################################
|
||||
# Setting initial value of group_concat_max_len, inserting some rows
|
||||
# & creating 2 new connections
|
||||
# & creating 2 new connections
|
||||
########################################################################
|
||||
|
||||
--echo ## Setting initial value of variable to 4 ##
|
||||
--echo ## Setting initial value of variable to 4 ##
|
||||
SET @@global.group_concat_max_len = 4;
|
||||
|
||||
--echo ## Inserting some rows in table ##
|
||||
INSERT into t1(rollno, name) values(1, 'Record_1');
|
||||
INSERT into t1(rollno, name) values(2, 'Record_2');
|
||||
INSERT into t1(rollno, name) values(1, 'Record_3');
|
||||
INSERT into t1(rollno, name) values(3, 'Record_4');
|
||||
INSERT into t1(rollno, name) values(1, 'Record_5');
|
||||
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_8');
|
||||
--echo ## Inserting some rows in table ##
|
||||
INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
|
||||
INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
|
||||
INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
|
||||
INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
|
||||
INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
|
||||
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_8');
|
||||
# The following "auxiliary" select ensures that all records are on disk
|
||||
# = result sets got by parallel sessions cannot suffer from effects
|
||||
# caused by the MyISAM feature "concurrent_inserts".
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
|
||||
--echo ## Creating two new connections ##
|
||||
CONNECT (test_con1,localhost,root,,);
|
||||
CONNECT (test_con2,localhost,root,,);
|
||||
--echo ## Creating two new connections ##
|
||||
connect (test_con1,localhost,root,,);
|
||||
connect (test_con2,localhost,root,,);
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_034_02-------------------------#'
|
||||
@ -68,16 +77,16 @@ CONNECT (test_con2,localhost,root,,);
|
||||
###############################################################################
|
||||
|
||||
--echo ## Connecting with test_con1 ##
|
||||
CONNECTION test_con1;
|
||||
connection test_con1;
|
||||
|
||||
--echo ## Accessing data and using group_concat on column whose value is greater than 4 ##
|
||||
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
--echo ## Accessing data and using group_concat on column whose value is greater than 4 ##
|
||||
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
|
||||
|
||||
--echo ## Changing session value of variable and verifying its behavior, ##
|
||||
--echo ## warning should come here ##
|
||||
--echo ## warning should come here ##
|
||||
|
||||
SET @@session.group_concat_max_len = 10;
|
||||
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_034_03-------------------------#'
|
||||
@ -85,19 +94,19 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
# Verifying behavior of variable by increasing session value of variable #
|
||||
##############################################################################
|
||||
|
||||
--echo ## Connecting with new connection test_con2 ##
|
||||
--echo ## Connecting with new connection test_con2 ##
|
||||
connection test_con2;
|
||||
|
||||
--echo ## Verifying initial value of variable. It should be 4 ##
|
||||
--echo ## Verifying initial value of variable. It should be 4 ##
|
||||
SELECT @@session.group_concat_max_len = 4;
|
||||
|
||||
--echo ## Setting session value of variable to 20 and verifying variable is concating ##
|
||||
--echo ## column's value to 20 or not ##
|
||||
--echo ## Setting session value of variable to 20 and verifying variable is concating ##
|
||||
--echo ## column's value to 20 or not ##
|
||||
SET @@session.group_concat_max_len = 20;
|
||||
|
||||
--echo ## Verifying value of name column, it should not me more than 20 characters ##
|
||||
--echo ## Warning should come here ##
|
||||
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_034_04-------------------------#'
|
||||
@ -106,12 +115,12 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
# greater than the maximum concat length of name column #
|
||||
###############################################################################
|
||||
|
||||
--echo ## Setting session value of variable to 26. No warning should appear here ##
|
||||
--echo ## because the value after concatination is less than 30 ##
|
||||
--echo ## Setting session value of variable to 26. No warning should appear here ##
|
||||
--echo ## because the value after concatination is less than 30 ##
|
||||
SET @@session.group_concat_max_len = 26;
|
||||
|
||||
--echo ## Verifying value of name column, it should not give warning now ##
|
||||
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
--echo ## Verifying value of name column, it should not give warning now ##
|
||||
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
|
||||
|
||||
|
||||
############################################################
|
||||
@ -119,11 +128,11 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
|
||||
############################################################
|
||||
|
||||
--echo ## Dropping table t1 ##
|
||||
DROP table t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo ## Disconnecting both the connection ##
|
||||
DISCONNECT test_con2;
|
||||
DISCONNECT test_con1;
|
||||
disconnect test_con2;
|
||||
disconnect test_con1;
|
||||
|
||||
connection default;
|
||||
|
||||
|
@ -8,7 +8,9 @@
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
|
||||
SET @@max_allowed_packet=16777216;
|
||||
# set packet size and reconnect
|
||||
SET @@global.max_allowed_packet=16777216;
|
||||
--connect (newconn, localhost, root,,)
|
||||
|
||||
DROP TABLE IF EXISTS bug34300;
|
||||
CREATE TABLE bug34300 (
|
||||
|
@ -43,3 +43,13 @@ CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#37284 Crash in Field_string::type()
|
||||
#
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
|
||||
CREATE INDEX i1 on t1 (a(3));
|
||||
SELECT * FROM t1 WHERE a = 'abcde';
|
||||
DROP TABLE t1;
|
||||
|
@ -10,12 +10,13 @@
|
||||
# #
|
||||
# Creation Date: 2008-03-08 #
|
||||
# Author: Rizwan #
|
||||
# Modified: HHunger 2008-08-29
|
||||
# #
|
||||
# Description: Test Cases of Dynamic System Variable log_output #
|
||||
# that checks the behavior of this variable #
|
||||
# #
|
||||
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
|
||||
# server-system-variables.html #
|
||||
# Reference: #
|
||||
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
@ -23,6 +24,10 @@
|
||||
# ps-protocol. So, it is switched off.
|
||||
--disable_ps_protocol
|
||||
|
||||
SET @start_value= @@global.log_output;
|
||||
SET @start_general_log= @@global.general_log;
|
||||
SET @start_general_log_file= @@global.general_log_file;
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_065_01-------------------------#'
|
||||
##################################################################
|
||||
# Check if setting log_output is changed in every new connection #
|
||||
@ -32,17 +37,12 @@ SET @@global.log_output = 'NONE';
|
||||
# con1 will be default connection from now on
|
||||
--echo 'connect (con1,localhost,root,,,,)'
|
||||
connect (con1,localhost,root,,,,);
|
||||
--echo 'connection con1'
|
||||
connection con1;
|
||||
SELECT @@global.log_output;
|
||||
SET @@global.log_output = 'TABLE,FILE';
|
||||
|
||||
# Test that the effect is global
|
||||
--echo 'connect (con2,localhost,root,,,,)'
|
||||
connect (con2,localhost,root,,,,);
|
||||
--echo 'connection con2'
|
||||
connection con2;
|
||||
SELECT @@global.log_output;
|
||||
disconnect con2;
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_065_02-------------------------#'
|
||||
####################################################
|
||||
@ -52,10 +52,9 @@ disconnect con2;
|
||||
--echo 'connection con1'
|
||||
connection con1;
|
||||
|
||||
|
||||
#=======================================================================
|
||||
#===============================================================
|
||||
--echo '---Checking general_log when log_output is NONE---'
|
||||
#=======================================================================
|
||||
#===============================================================
|
||||
|
||||
SET @@global.log_output = 'NONE';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
@ -64,13 +63,13 @@ TRUNCATE TABLE mysql.general_log;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 value(1);
|
||||
INSERT INTO t1 VALUE(1);
|
||||
SELECT 'abc';
|
||||
SELECT count(*) FROM mysql.general_log;
|
||||
|
||||
#==============================================================================
|
||||
#===============================================================
|
||||
--echo '---Checking general_log when log_output is TABLE---'
|
||||
#==============================================================================
|
||||
#===============================================================
|
||||
|
||||
SET @@global.log_output = 'TABLE';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
@ -78,35 +77,49 @@ TRUNCATE TABLE mysql.general_log;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
create table t1(a int);
|
||||
INSERT INTO t1 value(1);
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUE(1);
|
||||
SELECT 'abc';
|
||||
SELECT count(*) from mysql.general_log;
|
||||
# At least the last 4 statement should be logged.
|
||||
SELECT count(*)>4 FROM mysql.general_log;
|
||||
|
||||
#===========================================================
|
||||
#===============================================================
|
||||
# Checking general_log when log_output is FILE
|
||||
#===========================================================
|
||||
|
||||
#SET @log_file = "mytest.log";
|
||||
#SET @@global.general_log = 0;
|
||||
#FLUSH LOGS;
|
||||
#SET @@global.general_log_file = @log_file;
|
||||
--echo 'Bug#35371: Changing general_log file is crashing server'
|
||||
--echo 'SET @@global.general_log_file = @log_file;'
|
||||
#===============================================================
|
||||
|
||||
SET @@global.general_log = 'OFF';
|
||||
FLUSH LOGS;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval SET @@global.general_log_file = '$MYSQLTEST_VARDIR/run/mytest.log';
|
||||
SET @@global.general_log = 'ON';
|
||||
SET @@global.log_output = 'FILE';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
create table t1(a int);
|
||||
INSERT INTO t1 value(1);
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUE(1);
|
||||
SELECT 'abc';
|
||||
SELECT count(*) from mysql.general_log;
|
||||
SELECT count(*) FROM mysql.general_log;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
file_exists $MYSQLTEST_VARDIR/run/mytest.log ;
|
||||
|
||||
#==============================================================
|
||||
# Clean up
|
||||
#==============================================================
|
||||
|
||||
--echo connection default;
|
||||
connection default;
|
||||
SET @@global.general_log= 'OFF';
|
||||
SET @@global.general_log_file= @start_general_log_file;
|
||||
SET @@global.log_output= @start_value;
|
||||
SET @@global.general_log= @start_general_log;
|
||||
SET @@global.general_log= 'ON';
|
||||
|
||||
--enable_ps_protocol
|
||||
####################################################
|
||||
# Endo of functionality Testing for log_output #
|
||||
# End of functionality Testing for log_output #
|
||||
####################################################
|
||||
|
||||
|
@ -36,8 +36,13 @@
|
||||
|
||||
SET @start_global_value = @@global.max_allowed_packet;
|
||||
SELECT @start_global_value;
|
||||
SET @start_session_value = @@session.max_allowed_packet;
|
||||
SELECT @start_session_value;
|
||||
|
||||
# give a known value to @@session.max_allowed_packet by assigning to
|
||||
# @@global and setting up a new connection (for deterministic result
|
||||
# file diffing)
|
||||
SET @@global.max_allowed_packet = DEFAULT;
|
||||
connect (conn1, localhost, root,,);
|
||||
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_070_01-------------------------#'
|
||||
@ -49,7 +54,9 @@ SET @@global.max_allowed_packet = 1000;
|
||||
SET @@global.max_allowed_packet = DEFAULT;
|
||||
SELECT @@global.max_allowed_packet;
|
||||
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 20000;
|
||||
--Error ER_NO_DEFAULT
|
||||
SET @@session.max_allowed_packet = DEFAULT;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
|
||||
@ -62,9 +69,6 @@ SELECT @@session.max_allowed_packet;
|
||||
SET @@global.max_allowed_packet = DEFAULT;
|
||||
SELECT @@global.max_allowed_packet = 1048576;
|
||||
|
||||
SET @@session.max_allowed_packet = DEFAULT;
|
||||
SELECT @@session.max_allowed_packet = 1048576;
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_070_03-------------------------#'
|
||||
############################################################################
|
||||
@ -86,14 +90,19 @@ SELECT @@global.max_allowed_packet;
|
||||
# Change the value of max_allowed_packet to a valid value for SESSION Scope #
|
||||
#############################################################################
|
||||
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 1024;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 1025;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 65535;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 1073741824;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 1073741823;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
|
||||
@ -118,14 +127,18 @@ SELECT @@global.max_allowed_packet;
|
||||
SET @@global.max_allowed_packet = test;
|
||||
SELECT @@global.max_allowed_packet;
|
||||
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 0;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 1023;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = -2;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
--Error ER_PARSE_ERROR
|
||||
SET @@session.max_allowed_packet = 65530.34.;
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 10737418241;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
|
||||
@ -180,6 +193,7 @@ SELECT @@max_allowed_packet = @@global.max_allowed_packet;
|
||||
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
|
||||
########################################################################################################
|
||||
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@max_allowed_packet = 100000;
|
||||
SELECT @@max_allowed_packet = @@local.max_allowed_packet;
|
||||
SELECT @@local.max_allowed_packet = @@session.max_allowed_packet;
|
||||
@ -190,6 +204,7 @@ SELECT @@local.max_allowed_packet = @@session.max_allowed_packet;
|
||||
# Check if max_allowed_packet can be accessed with and without @@ sign #
|
||||
#############################################################################
|
||||
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET max_allowed_packet = 1024;
|
||||
SELECT @@max_allowed_packet;
|
||||
--Error ER_UNKNOWN_TABLE
|
||||
@ -204,9 +219,9 @@ SELECT max_allowed_packet = @@session.max_allowed_packet;
|
||||
# Restore initial value #
|
||||
####################################
|
||||
|
||||
connection default;
|
||||
SET @@global.max_allowed_packet = @start_global_value;
|
||||
SELECT @@global.max_allowed_packet;
|
||||
SET @@session.max_allowed_packet = @start_session_value;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
|
||||
|
||||
|
@ -43,26 +43,19 @@ name BLOB
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_070_01-------------------------#'
|
||||
###############################################################################
|
||||
# Setting initial value of max_allowed_packet to 1024 at session level and
|
||||
# verifying its behavior after inserting data greater than 1024 bytes
|
||||
# Setting initial value of max_allowed_packet to 1024 at session level
|
||||
# should result in an error (session variable is readonly)
|
||||
###############################################################################
|
||||
|
||||
--echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ##
|
||||
--error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.max_allowed_packet = 1024;
|
||||
SET @@session.net_buffer_length = 1024;
|
||||
SELECT @@session.max_allowed_packet;
|
||||
|
||||
--error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.net_buffer_length = 1024;
|
||||
SELECT @@session.net_buffer_length;
|
||||
|
||||
--echo ## Inserting and fetching data of length greater than 1024 ##
|
||||
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
||||
|
||||
SELECT length("aaaaaasssssssssssdddddddfffffgggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk") as len;
|
||||
|
||||
--echo ## Verifying record in table t1 ##
|
||||
SELECT * from t1;
|
||||
|
||||
--echo 'Bug#35381: Error is not coming on inserting and fetching data of length'
|
||||
--echo 'greater than max_allowed_packet size at session level';
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_070_02-------------------------#'
|
||||
###############################################################################
|
||||
|
@ -10,9 +10,9 @@ source include/have_log_bin.inc;
|
||||
drop table if exists t1,t2,t3;
|
||||
drop database if exists mysqltest;
|
||||
drop view if exists v1;
|
||||
--error 0,1141,1147
|
||||
--error 0,ER_NONEXISTING_GRANT,ER_NONEXISTING_TABLE_GRANT
|
||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||
--error 0,1141,1147
|
||||
--error 0,ER_NONEXISTING_GRANT,ER_NONEXISTING_TABLE_GRANT
|
||||
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
|
||||
delete from mysql.user where user=_binary'mysqltest_1';
|
||||
--enable_warnings
|
||||
@ -160,9 +160,9 @@ create table t2 (n int(10) not null primary key, d int(10));
|
||||
insert into t1 values(1,1);
|
||||
insert into t2 values(1,10),(2,20);
|
||||
LOCK TABLES t1 write, t2 read;
|
||||
--error 1099
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
DELETE t1.*, t2.* FROM t1,t2 where t1.n=t2.n;
|
||||
--error 1099
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
|
||||
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
|
||||
unlock tables;
|
||||
@ -183,7 +183,7 @@ create table t1 (n int(10), d int(10));
|
||||
create table t2 (n int(10), d int(10));
|
||||
insert into t1 values(1,1);
|
||||
insert into t2 values(1,10),(2,20);
|
||||
--error 1175
|
||||
--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
|
||||
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
|
||||
set sql_safe_updates=0;
|
||||
drop table t1,t2;
|
||||
@ -196,7 +196,7 @@ set timestamp=1038000000;
|
||||
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
|
||||
select n,d,unix_timestamp(t) from t1;
|
||||
select n,d,unix_timestamp(t) from t2;
|
||||
--error 1064
|
||||
--error ER_PARSE_ERROR
|
||||
UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
|
||||
drop table t1,t2;
|
||||
set timestamp=0;
|
||||
@ -323,41 +323,6 @@ delete t1, t2 from t2,t1
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Test for bug #1820.
|
||||
#
|
||||
|
||||
create table t1 ( a int not null, b int not null) ;
|
||||
--disable_query_log
|
||||
insert into t1 values (1,1),(2,2),(3,3),(4,4);
|
||||
let $1=19;
|
||||
set @d=4;
|
||||
while ($1)
|
||||
{
|
||||
eval insert into t1 select a+@d,b+@d from t1;
|
||||
eval set @d=@d*2;
|
||||
dec $1;
|
||||
}
|
||||
|
||||
--enable_query_log
|
||||
alter table t1 add index i1(a);
|
||||
delete from t1 where a > 2000000;
|
||||
create table t2 like t1;
|
||||
insert into t2 select * from t1;
|
||||
|
||||
select 't2 rows before small delete', count(*) from t1;
|
||||
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
|
||||
select 't2 rows after small delete', count(*) from t2;
|
||||
select 't1 rows after small delete', count(*) from t1;
|
||||
|
||||
## Try deleting many rows
|
||||
|
||||
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
|
||||
select 't2 rows after big delete', count(*) from t2;
|
||||
select 't1 rows after big delete', count(*) from t1;
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Test alias (this is not correct in 4.0)
|
||||
#
|
||||
@ -367,7 +332,7 @@ CREATE TABLE t2 ( a int );
|
||||
DELETE t1 FROM t1, t2 AS t3;
|
||||
DELETE t4 FROM t1, t1 AS t4;
|
||||
DELETE t3 FROM t1 AS t3, t1 AS t4;
|
||||
--error 1109
|
||||
--error ER_UNKNOWN_TABLE
|
||||
DELETE t1 FROM t1 AS t3, t2 AS t4;
|
||||
INSERT INTO t1 values (1),(2);
|
||||
INSERT INTO t2 values (1),(2);
|
||||
@ -422,7 +387,7 @@ drop database mysqltest;
|
||||
create table t1 (a int, primary key (a));
|
||||
create table t2 (a int, primary key (a));
|
||||
create table t3 (a int, primary key (a));
|
||||
-- error 1109
|
||||
-- error ER_UNKNOWN_TABLE
|
||||
delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a);
|
||||
drop table t1, t2, t3;
|
||||
|
||||
@ -431,9 +396,9 @@ drop table t1, t2, t3;
|
||||
#
|
||||
create table t1 (col1 int);
|
||||
create table t2 (col1 int);
|
||||
-- error 1093
|
||||
-- error ER_UPDATE_TABLE_USED
|
||||
update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
|
||||
-- error 1093
|
||||
-- error ER_UPDATE_TABLE_USED
|
||||
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
|
||||
drop table t1,t2;
|
||||
|
||||
@ -458,7 +423,7 @@ drop table t1, t2;
|
||||
#
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
--error 1093
|
||||
--error ER_UPDATE_TABLE_USED
|
||||
delete from t1,t2 using t1,t2 where t1.a=(select a from t1);
|
||||
drop table t1, t2;
|
||||
# End of 4.1 tests
|
||||
|
1
mysql-test/t/multi_update2-master.opt
Normal file
1
mysql-test/t/multi_update2-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--set-variable=tmp_table_size=1024
|
43
mysql-test/t/multi_update2.test
Normal file
43
mysql-test/t/multi_update2.test
Normal file
@ -0,0 +1,43 @@
|
||||
#
|
||||
# Test of update statement that uses many tables.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug#1820 Rows not deleted from second table on multi-table delete
|
||||
#
|
||||
|
||||
CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL) ;
|
||||
--echo # The protocolling of many inserts into t1 is suppressed.
|
||||
--disable_query_log
|
||||
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4);
|
||||
let $1=19;
|
||||
set @d=4;
|
||||
while ($1)
|
||||
{
|
||||
eval INSERT INTO t1 SELECT a+@d,b+@d FROM t1;
|
||||
eval SET @d=@d*2;
|
||||
dec $1;
|
||||
}
|
||||
|
||||
--enable_query_log
|
||||
ALTER TABLE t1 ADD INDEX i1(a);
|
||||
DELETE FROM t1 WHERE a > 2000000;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
|
||||
SELECT 't2 rows before small delete', COUNT(*) FROM t1;
|
||||
DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 2;
|
||||
SELECT 't2 rows after small delete', COUNT(*) FROM t2;
|
||||
SELECT 't1 rows after small delete', COUNT(*) FROM t1;
|
||||
|
||||
## Try deleting many rows
|
||||
|
||||
DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 100*1000;
|
||||
SELECT 't2 rows after big delete', COUNT(*) FROM t2;
|
||||
SELECT 't1 rows after big delete', COUNT(*) FROM t1;
|
||||
|
||||
DROP TABLE t1,t2;
|
@ -38,9 +38,13 @@
|
||||
SET @start_global_value = @@global.net_buffer_length;
|
||||
# Due to differences in results of linux and windows
|
||||
#SELECT @start_global_value;
|
||||
SET @start_session_value = @@session.net_buffer_length;
|
||||
#SELECT @start_session_value;
|
||||
|
||||
# give a known value to @@session.net_buffer_length by assigning to
|
||||
# @@global and setting up a new connection (for deterministic result
|
||||
# file diffing)
|
||||
SET @@global.net_buffer_length = DEFAULT;
|
||||
connect(con1,localhost,root,,);
|
||||
connection con1;
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_109_01-------------------------#'
|
||||
#################################################################
|
||||
@ -51,7 +55,9 @@ SET @@global.net_buffer_length = 10000;
|
||||
SET @@global.net_buffer_length = DEFAULT;
|
||||
SELECT @@global.net_buffer_length;
|
||||
|
||||
--Error ER_VARIABLE_IS_READONLY
|
||||
SET @@session.net_buffer_length = 20000;
|
||||
--Error ER_NO_DEFAULT
|
||||
SET @@session.net_buffer_length = DEFAULT;
|
||||
SELECT @@session.net_buffer_length;
|
||||
|
||||
@ -64,9 +70,6 @@ SELECT @@session.net_buffer_length;
|
||||
SET @@global.net_buffer_length = DEFAULT;
|
||||
SELECT @@global.net_buffer_length = 16384;
|
||||
|
||||
SET @@session.net_buffer_length = DEFAULT;
|
||||
SELECT @@session.net_buffer_length = 16384;
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_109_03-------------------------#'
|
||||
###########################################################################
|
||||
@ -91,17 +94,7 @@ SELECT @@global.net_buffer_length;
|
||||
# Change the value of net_buffer_length to a valid value for SESSION Scope #
|
||||
############################################################################
|
||||
|
||||
SET @@session.net_buffer_length = 1024;
|
||||
SELECT @@session.net_buffer_length;
|
||||
SET @@session.net_buffer_length = 1025;
|
||||
SELECT @@session.net_buffer_length;
|
||||
SET @@session.net_buffer_length = 1048576;
|
||||
SELECT @@session.net_buffer_length;
|
||||
SET @@session.net_buffer_length = 1048575;
|
||||
SELECT @@session.net_buffer_length;
|
||||
SET @@session.net_buffer_length = 65535;
|
||||
SELECT @@session.net_buffer_length;
|
||||
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
|
||||
# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
|
||||
|
||||
|
||||
--echo '#------------------FN_DYNVARS_109_05-----------------------#'
|
||||
@ -126,18 +119,8 @@ SELECT @@global.net_buffer_length;
|
||||
SET @@global.net_buffer_length = test;
|
||||
SELECT @@global.net_buffer_length;
|
||||
|
||||
SET @@session.net_buffer_length = 0;
|
||||
SELECT @@session.net_buffer_length;
|
||||
SET @@session.net_buffer_length = -2;
|
||||
SELECT @@session.net_buffer_length;
|
||||
SET @@session.net_buffer_length = 1048577;
|
||||
SELECT @@session.net_buffer_length;
|
||||
SET @@session.net_buffer_length = 1048576002;
|
||||
SELECT @@session.net_buffer_length;
|
||||
--Error ER_PARSE_ERROR
|
||||
SET @@session.net_buffer_length = 65530.34.;
|
||||
SET @@session.net_buffer_length = 65550;
|
||||
SELECT @@session.net_buffer_length;
|
||||
# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
|
||||
|
||||
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
|
||||
|
||||
--Error ER_WRONG_TYPE_FOR_VAR
|
||||
@ -190,9 +173,7 @@ SELECT @@net_buffer_length = @@global.net_buffer_length;
|
||||
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
|
||||
########################################################################################################
|
||||
|
||||
SET @@net_buffer_length = 100000;
|
||||
SELECT @@net_buffer_length = @@local.net_buffer_length;
|
||||
SELECT @@local.net_buffer_length = @@session.net_buffer_length;
|
||||
# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
|
||||
|
||||
|
||||
--echo '#---------------------FN_DYNVARS_109_11----------------------#'
|
||||
@ -200,7 +181,7 @@ SELECT @@local.net_buffer_length = @@session.net_buffer_length;
|
||||
# Check if net_buffer_length can be accessed with and without @@ sign #
|
||||
############################################################################
|
||||
|
||||
SET net_buffer_length = 1024;
|
||||
# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
|
||||
SELECT @@net_buffer_length;
|
||||
--Error ER_UNKNOWN_TABLE
|
||||
SELECT local.net_buffer_length;
|
||||
@ -214,11 +195,11 @@ SELECT net_buffer_length = @@session.net_buffer_length;
|
||||
# Restore initial value #
|
||||
####################################
|
||||
|
||||
connection default;
|
||||
|
||||
SET @@global.net_buffer_length = @start_global_value;
|
||||
# Due to differences in results of linux and windows
|
||||
#SELECT @@global.net_buffer_length;
|
||||
SET @@session.net_buffer_length = @start_session_value;
|
||||
#SELECT @@session.net_buffer_length;
|
||||
|
||||
|
||||
######################################################
|
||||
|
@ -8,30 +8,30 @@
|
||||
# Check protocol handling
|
||||
#
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
|
||||
connection con1;
|
||||
# setting values below minimum threshold of 1024 will cause truncating
|
||||
set global max_allowed_packet=100;
|
||||
set max_allowed_packet=100;
|
||||
set global net_buffer_length=100;
|
||||
set net_buffer_length=100;
|
||||
# Have to be > 1024 as min value of net_buffer_length is 1024
|
||||
|
||||
# is not yet in effect
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
# Should return NULL as 2000 is bigger than max_allowed_packet
|
||||
select repeat('a',2000);
|
||||
|
||||
#
|
||||
# Connection 2 should get error for too big packets
|
||||
# Connection 1 should get error for too big packets
|
||||
#
|
||||
connect (con2,localhost,root,,);
|
||||
connection con2;
|
||||
connect (con1,localhost,root,,);
|
||||
connection con1;
|
||||
select @@net_buffer_length, @@max_allowed_packet;
|
||||
--error 1153
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
|
||||
#
|
||||
# Reset to default values and reconnect
|
||||
#
|
||||
set global max_allowed_packet=default;
|
||||
set max_allowed_packet=default;
|
||||
set global net_buffer_length=default;
|
||||
set net_buffer_length=default;
|
||||
connect (con2,localhost,root,,);
|
||||
connection con2;
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
select length(repeat('a',2000));
|
||||
|
||||
|
@ -14,6 +14,21 @@
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug#40954: Crash if range search and order by.
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (pk)
|
||||
)
|
||||
/*!50100 PARTITION BY HASH (pk)
|
||||
PARTITIONS 2 */;
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#40494: Crash MYSQL server crashes on range access with partitioning
|
||||
# and order by
|
||||
|
14
mysql-test/t/perror-win.test
Normal file
14
mysql-test/t/perror-win.test
Normal file
@ -0,0 +1,14 @@
|
||||
# Windows-specific tests
|
||||
--source include/windows.inc
|
||||
--require r/have_perror.require
|
||||
disable_query_log;
|
||||
eval select LENGTH("$MY_PERROR") > 0 as "have_perror";
|
||||
enable_query_log;
|
||||
|
||||
|
||||
--exec $MY_PERROR 150 2>&1
|
||||
--exec $MY_PERROR 23 2>&1
|
||||
--exec $MY_PERROR 1062 2>&1
|
||||
--error 1
|
||||
--exec $MY_PERROR 30000 2>&1
|
||||
|
@ -3355,4 +3355,40 @@ SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT
|
||||
SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a;
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# Bug#37460 Assertion failed:
|
||||
# !table->file || table->file->inited == handler::NONE
|
||||
#
|
||||
CREATE TABLE t1 (id int);
|
||||
CREATE TABLE t2 (id int, c int);
|
||||
|
||||
INSERT INTO t1 (id) VALUES (1);
|
||||
INSERT INTO t2 (id) VALUES (1);
|
||||
INSERT INTO t1 (id) VALUES (1);
|
||||
INSERT INTO t2 (id) VALUES (1);
|
||||
|
||||
CREATE VIEW v1 AS
|
||||
SELECT t2.c AS c FROM t1, t2
|
||||
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
UPDATE v1 SET c=1;
|
||||
|
||||
CREATE VIEW v2 (a,b) AS
|
||||
SELECT t2.id, t2.c AS c FROM t1, t2
|
||||
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
|
||||
--error 1369
|
||||
INSERT INTO v2(a,b) VALUES (2,2);
|
||||
INSERT INTO v2(a,b) VALUES (1,2);
|
||||
SELECT * FROM v1;
|
||||
|
||||
CREATE VIEW v3 AS
|
||||
SELECT t2.c AS c FROM t2
|
||||
WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
|
||||
DELETE FROM v3;
|
||||
|
||||
DROP VIEW v1,v2,v3;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo End of 5.1 tests.
|
||||
|
@ -194,26 +194,49 @@ DROP TABLE t1;
|
||||
#
|
||||
# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY
|
||||
#
|
||||
# With Bug#41002 (symlink.test fails on symlinked datadir) it was
|
||||
# decided that the below statements may also succeed if the data
|
||||
# home directory is symlinked, e.g. mysql-test-run --mem.
|
||||
# This will be fixed in 6.0 only.
|
||||
#
|
||||
--replace_result $MYSQLTEST_VARDIR TEST_DIR
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
--error 0,ER_WRONG_ARGUMENTS
|
||||
eval CREATE TABLE t1(a INT)
|
||||
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
#
|
||||
--replace_result $MYSQLTEST_VARDIR TEST_DIR
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
--error 0,ER_WRONG_ARGUMENTS
|
||||
eval CREATE TABLE t1(a INT)
|
||||
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test';
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
#
|
||||
--replace_result $MYSQLTEST_VARDIR TEST_DIR
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
--error 0,ER_WRONG_ARGUMENTS
|
||||
eval CREATE TABLE t1(a INT)
|
||||
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/';
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
#
|
||||
--replace_result $MYSQLTEST_VARDIR TEST_DIR
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
--error 0,ER_WRONG_ARGUMENTS
|
||||
eval CREATE TABLE t1(a INT)
|
||||
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data';
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
#
|
||||
--replace_result $MYSQLTEST_VARDIR TEST_DIR
|
||||
--error 1
|
||||
eval CREATE TABLE t1(a INT)
|
||||
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data_var';
|
||||
|
||||
#
|
||||
# BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is
|
||||
# silently ignored
|
||||
#
|
||||
|
@ -9,6 +9,8 @@
|
||||
# Creation Date: 2008-02-25 #
|
||||
# Author: Sharique Abdullah #
|
||||
# #
|
||||
# Modified: HHunger 2008-08-28 Reimplemented the test completely. #
|
||||
# #
|
||||
# Description: Test Cases of Dynamic System Variable "timestamp" #
|
||||
# that checks behavior of this variable in the following ways #
|
||||
# * Functionality based on different values #
|
||||
@ -17,63 +19,32 @@
|
||||
# #
|
||||
############################################################################
|
||||
|
||||
--echo ** Setup **
|
||||
--echo
|
||||
#
|
||||
# Setup
|
||||
#
|
||||
# Change timestamp which must have an effect on now(), but not on sysdate().
|
||||
# Use Unix epoch timestamp
|
||||
# All comparisons must deliver true(1)
|
||||
# Exception: --sysdate-is-now switches off this behaviour and must not be set.
|
||||
|
||||
--echo ** Connecting con1 using root **
|
||||
connect (con1,localhost,root,,);
|
||||
SELECT date(now()) = date(sysdate());
|
||||
SET @@session.timestamp = 1100000000;
|
||||
SELECT date(now()) != date(sysdate());
|
||||
|
||||
# Assure that setting of the variable has no effect on other session.
|
||||
--echo ** Connecting con0 using root **
|
||||
connect (con0,localhost,root,,);
|
||||
--echo ** Connecting con1 using root **
|
||||
connect (con1, localhost, root,,);
|
||||
SELECT @@session.timestamp != 1100000000;
|
||||
SET @@session.timestamp = 1000000000;
|
||||
SELECT date(now()) != date(sysdate());
|
||||
|
||||
--echo '#-----------------------------FN_DYNVARS_179_01------------------#'
|
||||
#
|
||||
# Checking for connection 1
|
||||
#
|
||||
|
||||
--echo ** Connection con0 **
|
||||
connection con0;
|
||||
SET @ts_old = @@SESSION.timestamp;
|
||||
--echo waiting 1 sec
|
||||
--sleep 1
|
||||
SET @ts_new = @@SESSION.timestamp;
|
||||
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
|
||||
--echo 1 means >=1 expected is true
|
||||
|
||||
|
||||
#
|
||||
# Checking for connection 2
|
||||
#
|
||||
--echo ** Connection con1 **
|
||||
connection con1;
|
||||
SET @ts_old = @@SESSION.timestamp;
|
||||
--echo waiting 4 sec
|
||||
--sleep 4
|
||||
SET @ts_new = @@SESSION.timestamp;
|
||||
SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
|
||||
--echo 1 means >=4 expected is true
|
||||
|
||||
--echo '#-----------------------------FN_DYNVARS_179_02---------------------#'
|
||||
#
|
||||
# Testing timezone change effect
|
||||
#
|
||||
|
||||
SET @ts_old = @@SESSION.timestamp;
|
||||
--sleep 1
|
||||
--echo Changing time zone
|
||||
SET time_zone = 'MET';
|
||||
SET @ts_new = @@SESSION.timestamp;
|
||||
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
|
||||
--echo 1 means >=1 expected is true
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
--echo ** Cleanup **
|
||||
SELECT @@session.timestamp != 1000000000;
|
||||
SELECT @@session.timestamp = 1100000000;
|
||||
|
||||
--echo ** Connection default **
|
||||
connection default;
|
||||
--echo Disconnecting Connections con0, con1
|
||||
disconnect con0;
|
||||
disconnect con1;
|
||||
|
||||
|
1
mysql-test/t/timestamp_sysdate_is_now_func-master.opt
Normal file
1
mysql-test/t/timestamp_sysdate_is_now_func-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--sysdate-is-now
|
47
mysql-test/t/timestamp_sysdate_is_now_func.test
Normal file
47
mysql-test/t/timestamp_sysdate_is_now_func.test
Normal file
@ -0,0 +1,47 @@
|
||||
############################################################################
|
||||
# #
|
||||
# Variable Name: timestamp with sysdate-is-now #
|
||||
# Scope: GLOBAL #
|
||||
# Access Type: Dynamic #
|
||||
# Data Type: INTEGER #
|
||||
# #
|
||||
# #
|
||||
# Creation Date: 2008-11-25 #
|
||||
# Author: Horst Hunger #
|
||||
# #
|
||||
# Description: Test Cases of Dynamic System Variable "timestamp" #
|
||||
# that checks behavior of this variable in the following ways #
|
||||
# * Like timstamp_func, but with set "sysdate-is-now". #
|
||||
# #
|
||||
# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
|
||||
# #
|
||||
############################################################################
|
||||
|
||||
# Use Unix epoch timestamp
|
||||
# Due to "--sysdate-is-now" timestamp must have an effect on both.
|
||||
# See also timestamp_func.test.
|
||||
|
||||
--echo ** Connecting con1 using root **
|
||||
connect (con1,localhost,root,,);
|
||||
SELECT date(now()) = date(sysdate());
|
||||
SET @@session.timestamp = 1100000000;
|
||||
SELECT date(now()) != date(sysdate());
|
||||
|
||||
# Assure that setting of the variable has no effect on other session.
|
||||
--echo ** Connecting con0 using root **
|
||||
connect (con0,localhost,root,,);
|
||||
SELECT @@session.timestamp != 1100000000;
|
||||
SET @@session.timestamp = 1000000000;
|
||||
SELECT date(now()) != date(sysdate());
|
||||
|
||||
--echo ** Connection con1 **
|
||||
connection con1;
|
||||
SELECT @@session.timestamp != 1000000000;
|
||||
SELECT @@session.timestamp = 1100000000;
|
||||
|
||||
--echo ** Connection default **
|
||||
connection default;
|
||||
--echo Disconnecting Connections con0, con1
|
||||
disconnect con0;
|
||||
disconnect con1;
|
||||
|
@ -861,8 +861,10 @@ drop tables t1,t2,t3;
|
||||
# exceeds mediumtext maximum length
|
||||
#
|
||||
|
||||
SELECT @tmp_max:= @@max_allowed_packet;
|
||||
SET max_allowed_packet=25000000;
|
||||
SELECT @tmp_max:= @@global.max_allowed_packet;
|
||||
SET @@global.max_allowed_packet=25000000;
|
||||
# switching connection to allow the new max_allowed_packet take effect
|
||||
--connect (newconn, localhost, root,,)
|
||||
CREATE TABLE t1 (a mediumtext);
|
||||
CREATE TABLE t2 (b varchar(20));
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
@ -884,7 +886,9 @@ INSERT INTO t1 VALUES ('a');
|
||||
CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
|
||||
SHOW CREATE TABLE t3;
|
||||
DROP TABLES t1,t2,t3;
|
||||
SET max_allowed_packet:= @tmp_max;
|
||||
--connection default
|
||||
SET @@global.max_allowed_packet:= @tmp_max;
|
||||
--disconnect newconn
|
||||
|
||||
#
|
||||
# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
|
||||
|
@ -430,4 +430,25 @@ drop table t1,t2;
|
||||
connection default;
|
||||
disconnect con1;
|
||||
|
||||
#
|
||||
# Bug #40745: Error during WHERE clause calculation in UPDATE
|
||||
# leads to an assertion failure
|
||||
#
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE FUNCTION f1() RETURNS INT RETURN f1();
|
||||
CREATE TABLE t1 (i INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--error ER_SP_NO_RECURSION
|
||||
UPDATE t1 SET i = 3 WHERE f1();
|
||||
--error ER_SP_NO_RECURSION
|
||||
UPDATE t1 SET i = f1();
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -28,3 +28,83 @@ set global slave_net_timeout=default;
|
||||
# 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.
|
||||
set global sql_slave_skip_counter= 0;
|
||||
|
||||
#
|
||||
# Bug#28234 - global/session scope - documentation vs implementation
|
||||
#
|
||||
--echo
|
||||
#
|
||||
# Additional variables fixed from sql_repl.cc.
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'log_slave_updates';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.log_slave_updates;
|
||||
SELECT @@global.log_slave_updates;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.log_slave_updates= true;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.log_slave_updates= true;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'relay_log';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.relay_log;
|
||||
SELECT @@global.relay_log;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.relay_log= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.relay_log= 'x';
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'relay_log_index';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.relay_log_index;
|
||||
SELECT @@global.relay_log_index;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.relay_log_index= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.relay_log_index= 'x';
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'relay_log_info_file';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.relay_log_info_file;
|
||||
SELECT @@global.relay_log_info_file;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.relay_log_info_file= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.relay_log_info_file= 'x';
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'relay_log_space_limit';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.relay_log_space_limit;
|
||||
SELECT @@global.relay_log_space_limit;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.relay_log_space_limit= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.relay_log_space_limit= 7;
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'slave_load_tmpdir';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.slave_load_tmpdir;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.slave_load_tmpdir;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.slave_load_tmpdir= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.slave_load_tmpdir= 'x';
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'slave_skip_errors';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.slave_skip_errors;
|
||||
SELECT @@global.slave_skip_errors;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.slave_skip_errors= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.slave_skip_errors= 7;
|
||||
#
|
||||
|
@ -146,25 +146,23 @@ show global variables like 'myisam_max_sort_file_size';
|
||||
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
|
||||
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
|
||||
|
||||
# bug#22891: modified to take read-only SESSION net_buffer_length into account
|
||||
set global net_retry_count=10, session net_retry_count=10;
|
||||
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
|
||||
set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
|
||||
show global variables like 'net_%';
|
||||
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
|
||||
show session variables like 'net_%';
|
||||
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
|
||||
set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
|
||||
set global net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
|
||||
show global variables like 'net_%';
|
||||
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
|
||||
show session variables like 'net_%';
|
||||
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
|
||||
set net_buffer_length=1;
|
||||
show variables like 'net_buffer_length';
|
||||
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
|
||||
set global net_buffer_length=1;
|
||||
show global variables like 'net_buffer_length';
|
||||
select * from information_schema.global_variables where variable_name like 'net_buffer_length';
|
||||
#warning 1292
|
||||
set net_buffer_length=2000000000;
|
||||
show variables like 'net_buffer_length';
|
||||
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
|
||||
set global net_buffer_length=2000000000;
|
||||
show global variables like 'net_buffer_length';
|
||||
select * from information_schema.global_variables where variable_name like 'net_buffer_length';
|
||||
|
||||
set character set cp1251_koi8;
|
||||
show variables like "character_set_client";
|
||||
@ -274,7 +272,7 @@ select @@long_query_time;
|
||||
set long_query_time=100.000001;
|
||||
select @@long_query_time;
|
||||
set low_priority_updates=1;
|
||||
set max_allowed_packet=100;
|
||||
set global max_allowed_packet=100;
|
||||
set global max_binlog_cache_size=100;
|
||||
set global max_binlog_size=100;
|
||||
set global max_connect_errors=100;
|
||||
@ -288,7 +286,7 @@ set global max_user_connections=100;
|
||||
select @@max_user_connections;
|
||||
set global max_write_lock_count=100;
|
||||
set myisam_sort_buffer_size=100;
|
||||
set net_buffer_length=100;
|
||||
set global net_buffer_length=100;
|
||||
set net_read_timeout=100;
|
||||
set net_write_timeout=100;
|
||||
set global query_cache_limit=100;
|
||||
@ -795,3 +793,287 @@ SET GLOBAL log_output = 0;
|
||||
--echo
|
||||
--echo # -- End of Bug#34820.
|
||||
|
||||
#
|
||||
# Bug#28234 - global/session scope - documentation vs implementation
|
||||
#
|
||||
--echo
|
||||
--echo #
|
||||
SHOW VARIABLES like 'ft_max_word_len';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.ft_max_word_len;
|
||||
SELECT @@global.ft_max_word_len;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.ft_max_word_len= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.ft_max_word_len= 7;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'ft_min_word_len';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.ft_min_word_len;
|
||||
SELECT @@global.ft_min_word_len;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.ft_min_word_len= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.ft_min_word_len= 7;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'ft_query_expansion_limit';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.ft_query_expansion_limit;
|
||||
SELECT @@global.ft_query_expansion_limit;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.ft_query_expansion_limit= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.ft_query_expansion_limit= 7;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'ft_stopword_file';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.ft_stopword_file;
|
||||
SELECT @@global.ft_stopword_file;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.ft_stopword_file= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.ft_stopword_file= 'x';
|
||||
#
|
||||
# Additional variables fixed.
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'back_log';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.back_log;
|
||||
SELECT @@global.back_log;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.back_log= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.back_log= 7;
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'large_files_support';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.large_files_support;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.large_files_support;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.large_files_support= true;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.large_files_support= true;
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'character_sets_dir';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.character_sets_dir;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.character_sets_dir;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.character_sets_dir= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.character_sets_dir= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'init_file';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.init_file;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.init_file;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.init_file= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.init_file= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'language';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.language;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.language;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.language= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.language= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'large_page_size';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.large_page_size;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.large_page_size;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.large_page_size= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.large_page_size= 7;
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'large_pages';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.large_pages;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.large_pages;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.large_pages= true;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.large_pages= true;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'log_bin';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.log_bin;
|
||||
SELECT @@global.log_bin;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.log_bin= true;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.log_bin= true;
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'log_error';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.log_error;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.log_error;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.log_error= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.log_error= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'lower_case_file_system';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.lower_case_file_system;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.lower_case_file_system;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.lower_case_file_system= true;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.lower_case_file_system= true;
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'lower_case_table_names';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.lower_case_table_names;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.lower_case_table_names;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.lower_case_table_names= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.lower_case_table_names= 7;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'myisam_recover_options';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.myisam_recover_options;
|
||||
SELECT @@global.myisam_recover_options;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.myisam_recover_options= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.myisam_recover_options= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'open_files_limit';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.open_files_limit;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.open_files_limit;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.open_files_limit= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.open_files_limit= 7;
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'pid_file';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.pid_file;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.pid_file;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.pid_file= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.pid_file= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'plugin_dir';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.plugin_dir;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.plugin_dir;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.plugin_dir= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.plugin_dir= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'port';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.port;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.port;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.port= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.port= 7;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'protocol_version';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.protocol_version;
|
||||
SELECT @@global.protocol_version;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.protocol_version= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.protocol_version= 7;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'skip_external_locking';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.skip_external_locking;
|
||||
SELECT @@global.skip_external_locking;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.skip_external_locking= true;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.skip_external_locking= true;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'skip_networking';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.skip_networking;
|
||||
SELECT @@global.skip_networking;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.skip_networking= true;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.skip_networking= true;
|
||||
#
|
||||
--echo #
|
||||
SHOW VARIABLES like 'skip_show_database';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.skip_show_database;
|
||||
SELECT @@global.skip_show_database;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.skip_show_database= true;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.skip_show_database= true;
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'thread_stack';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.thread_stack;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.thread_stack;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.thread_stack= 7;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.thread_stack= 7;
|
||||
#
|
||||
|
@ -510,7 +510,7 @@ drop table t1;
|
||||
#
|
||||
create table t1 (a int, b int);
|
||||
create view v1 as select a, sum(b) from t1 group by a;
|
||||
--error ER_WRONG_USAGE
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
select b from v1 use index (some_index) where b=1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
@ -3421,11 +3421,11 @@ drop table t1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
--error ER_WRONG_USAGE
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 USE KEY(non_existant);
|
||||
--error ER_WRONG_USAGE
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 FORCE KEY(non_existant);
|
||||
--error ER_WRONG_USAGE
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 IGNORE KEY(non_existant);
|
||||
|
||||
DROP VIEW v1;
|
||||
@ -3564,6 +3564,32 @@ DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT 1;
|
||||
DROP VIEW v1;
|
||||
|
||||
#
|
||||
# Bug #33461: SELECT ... FROM <view> USE INDEX (...) throws an error
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2));
|
||||
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
|
||||
SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2;
|
||||
SELECT * FROM t1 USE INDEX (c2) WHERE c2=2;
|
||||
|
||||
CREATE VIEW v1 AS SELECT c1, c2 FROM t1;
|
||||
SHOW INDEX FROM v1;
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2;
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2;
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2;
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 USE INDEX (c2) WHERE c2=2;
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2;
|
||||
--error ER_KEY_DOES_NOT_EXITS
|
||||
SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- End of 5.0 tests.
|
||||
|
@ -11,93 +11,87 @@
|
||||
# Creation Date: 2008-03-07 #
|
||||
# Author: Salman Rawala #
|
||||
# #
|
||||
# Modified: HHunger 2008-08-27 Simplified the test and replaced the sleeps. #
|
||||
# #
|
||||
# Description: Test Cases of Dynamic System Variable wait_timeout #
|
||||
# that checks the functionality of this variable #
|
||||
# #
|
||||
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
|
||||
# server-system-variables.html#option_mysqld_wait_timeouts #
|
||||
# Reference: #
|
||||
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
--source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
##############################
|
||||
# Creating two new tables #
|
||||
##############################
|
||||
|
||||
--echo ## Creating new table t1 ##
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL auto_increment,
|
||||
PRIMARY KEY (id),
|
||||
name VARCHAR(30)
|
||||
);
|
||||
SET @start_value= @@global.wait_timeout;
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_186_01-------------------------#'
|
||||
#######################################################################
|
||||
# Setting initial value of interactive_timeout greater than sleep and
|
||||
# verifying its behavior on session scope
|
||||
# 1. test of scope session
|
||||
#######################################################################
|
||||
|
||||
--echo ## Creating new connection test_con1 ##
|
||||
SET @start_time= UNIX_TIMESTAMP();
|
||||
--echo connect (test_con1, localhost, root,,);
|
||||
connect (test_con1, localhost, root,,);
|
||||
connection test_con1;
|
||||
|
||||
--echo ## Setting value of variable to 5 ##
|
||||
SET @@session.wait_timeout = 5;
|
||||
# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
|
||||
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
|
||||
|
||||
--echo ## Inserting record in table t1 ##
|
||||
INSERT into t1(name) values('Record_1');
|
||||
# Find a small value <> @@global.wait_timeout.
|
||||
let $session_value =
|
||||
`SELECT IF(@@global.wait_timeout <> 2 OR @@global.wait_timeout IS NULL, 2, 3)`;
|
||||
--replace_result $session_value <session_value>
|
||||
eval SET @@session.wait_timeout = $session_value;
|
||||
|
||||
--echo ## Using sleep to check timeout ##
|
||||
sleep 4;
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_186_02-------------------------#'
|
||||
#######################################################################
|
||||
# Setting initial value of interactive_timeout greater than sleep and
|
||||
# verifying its behavior on global scope
|
||||
#######################################################################
|
||||
|
||||
--echo ## Setting value of variable ##
|
||||
SET @@global.wait_timeout = 5;
|
||||
|
||||
--echo ## Creating new connection test_con2 ##
|
||||
--echo connect (test_con2, localhost, root,,);
|
||||
connect (test_con2, localhost, root,,);
|
||||
connection test_con2;
|
||||
|
||||
INSERT into t1(name) values('Record_2');
|
||||
|
||||
--echo ## Using sleep to check timeout ##
|
||||
sleep 4;
|
||||
|
||||
--replace_result $session_value <session_value>
|
||||
eval SET @@session.wait_timeout = $session_value - 1;
|
||||
|
||||
--echo connection default;
|
||||
connection default;
|
||||
|
||||
--echo wait until connections ready
|
||||
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
|
||||
--source include/wait_condition.inc
|
||||
SELECT info FROM information_schema.processlist;
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_186_03-------------------------#'
|
||||
#######################################################################
|
||||
# Setting initial value of interactive_timeout less than sleep and
|
||||
# verifying its behavior on global scope
|
||||
# 2. test of scope global
|
||||
#######################################################################
|
||||
|
||||
--echo ## Setting value of variable to 1 ##
|
||||
SET @@global.wait_timeout = 1;
|
||||
# Find a small value <> @@global.wait_timeout.
|
||||
let $global_value = $session_value + 1;
|
||||
--replace_result $global_value <global_value>
|
||||
eval SET @@global.wait_timeout= $global_value;
|
||||
|
||||
--echo ## Creating new connection ##
|
||||
# Changing the @@global.wait_timeout has no influence on the
|
||||
# @@session.wait_timeout of already established sessions.
|
||||
SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
|
||||
|
||||
--echo connect (test_con3, localhost, root,,);
|
||||
connect (test_con3, localhost, root,,);
|
||||
connection test_con3;
|
||||
|
||||
INSERT into t1(name) values('Record_3');
|
||||
# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
|
||||
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
|
||||
|
||||
--echo ## Using sleep to check timeout ##
|
||||
sleep 5;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
# We can be sure that the connections test_con1 and test_con2 must be
|
||||
# established because both have already executed a SET @@session.wait_timeout.
|
||||
# This means they are or at least were visible within the processlist.
|
||||
# Therefore we can now simply wait till both disappear from the processlist.
|
||||
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
|
||||
--source include/wait_condition.inc
|
||||
SELECT info FROM information_schema.processlist;
|
||||
|
||||
--echo ## We cannot test it further because the server stops due to wait_timeout ##
|
||||
--Error 2006
|
||||
SELECT * from t1;
|
||||
--replace_result $global_value <global_value> $session_value <session_value>;
|
||||
eval SELECT UNIX_TIMESTAMP() - @start_time >= $global_value + $session_value;
|
||||
SET @@global.wait_timeout= @start_value;
|
||||
|
||||
|
Reference in New Issue
Block a user