1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

auto-merge

This commit is contained in:
Tatiana A. Nurnberg
2008-12-30 12:48:38 +01:00
213 changed files with 5398 additions and 3963 deletions

View File

@ -671,8 +671,11 @@ call p_verify_status_increment(2, 2, 2, 2);
savepoint a;
call p_verify_status_increment(0, 0, 0, 0);
insert t1 set a=4;
--echo # Sic: a bug. Binlog did not register itself this time.
call p_verify_status_increment(1, 0, 1, 0);
--echo # Binlog does not register itself this time for other than the 1st
--echo # statement of the transaction with MIXED/STATEMENT binlog_format.
--echo # It needs registering with the ROW format. Therefore 1,0,2,2 are
--echo # the correct arguments to this test after bug#40221 fixed.
call p_verify_status_increment(1, 0, 2, 2);
release savepoint a;
rollback;
call p_verify_status_increment(0, 0, 0, 0);

View File

@ -0,0 +1,16 @@
#
# Check if server has support for loading udf's
# i.e it will support dlopen
#
--require r/have_dynamic_loading.require
disable_query_log;
show variables like 'have_dynamic_loading';
enable_query_log;
#
# Check if the variable SIMPLE_PARSER is set
#
--require r/have_simple_parser.require
disable_query_log;
eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
enable_query_log;

View File

@ -501,4 +501,30 @@ SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
DROP TABLE t1;
--echo #
--echo # BUG#40974: Incorrect query results when using clause evaluated using range check
--echo #
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int);
insert into t1 values (1),(2);
create table t2(a int, b int);
insert into t2 values (1,1), (2, 1000);
create table t3 (a int, b int, filler char(100), key(a), key(b));
insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
insert into t3 values (1,1,'data');
insert into t3 values (1,1,'data');
-- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
explain select * from t1
where exists (select 1 from t2, t3
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
select * from t1
where exists (select 1 from t2, t3
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
drop table t0, t1, t2, t3;
--echo End of 5.0 tests

View File

@ -9,7 +9,6 @@ SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size = 131072;
SET @min_key_buffer_size = 36;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;

View File

@ -0,0 +1,62 @@
# include/wait_condition.inc
#
# SUMMARY
#
# Waits until the passed statement returns true, or the operation
# times out.
#
# USAGE
#
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
#
# OR
#
# let $wait_timeout= 60; # Override default 30 seconds with 60.
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
# --echo Executed the test condition $wait_condition_reps times
#
# EXAMPLE
# events_bugs.test, events_time_zone.test
#
--disable_query_log
let $wait_counter= 300;
if ($wait_timeout)
{
let $wait_counter= `SELECT $wait_timeout * 10`;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;
# Keep track of how many times the wait condition is tested
# This is used by some tests (e.g., main.status)
let $wait_condition_reps= 0;
while ($wait_counter)
{
let $success= `$wait_condition`;
inc $wait_condition_reps;
if ($success)
{
let $wait_counter= 0;
}
if (!$success)
{
real_sleep 0.1;
dec $wait_counter;
}
}
if (!$success)
{
echo Timeout in wait_condition.inc for $wait_condition;
show master status;
show slave status;
}
--enable_query_log

View File

@ -6,7 +6,7 @@
let $counter= 500;
while ($mysql_errno)
{
--error 0,2002,2006
--error 0,2002,2003,2006,2013
show status;
dec $counter;

View File

@ -9,7 +9,6 @@ SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size= 131072;
SET @min_key_buffer_size= 8;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;

View File

@ -412,7 +412,10 @@ sub mtr_report_stats ($) {
# When trying to set lower_case_table_names = 2
# on a case sensitive file system. Bug#37402.
/lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./
/lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or
# this test is expected to print warnings
($testname eq 'main.innodb_bug39438')
)
{
next; # Skip these lines

View File

@ -163,6 +163,7 @@ our $exe_my_print_defaults;
our $exe_perror;
our $lib_udf_example;
our $lib_example_plugin;
our $lib_simple_parser;
our $exe_libtool;
our $opt_bench= 0;
@ -1717,6 +1718,10 @@ sub executable_setup () {
mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
"$glob_basedir/storage/example/.libs/ha_example.so",);
# Look for the simple_parser library
$lib_simple_parser=
mtr_file_exists(vs_config_dirs('plugin/fulltext', 'mypluglib.dll'),
"$glob_basedir/plugin/fulltext/.libs/mypluglib.so",);
}
# Look for mysqltest executable
@ -2199,6 +2204,14 @@ sub environment_setup () {
$ENV{'EXAMPLE_PLUGIN_OPT'}=
($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
# ----------------------------------------------------
# Add the path where mysqld will find mypluglib.so
# ----------------------------------------------------
$ENV{'SIMPLE_PARSER'}=
($lib_simple_parser ? basename($lib_simple_parser) : "");
$ENV{'SIMPLE_PARSER_OPT'}=
($lib_simple_parser ? "--plugin_dir=" . dirname($lib_simple_parser) : "");
# ----------------------------------------------------
# Setup env so childs can execute myisampack and myisamchk
# ----------------------------------------------------
@ -2386,6 +2399,9 @@ sub remove_stale_vardir () {
mtr_verbose("Removing $opt_vardir/");
mtr_rmtree("$opt_vardir/");
}
# Remove the "tmp" dir
mtr_verbose("Removing $opt_tmpdir/");
mtr_rmtree("$opt_tmpdir/");
}
#

View File

@ -996,6 +996,22 @@ SELECT * FROM t1;
v b
abc 5
DROP TABLE t1;
create table t1 (a tinytext character set latin1);
alter table t1 convert to character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8
drop table t1;
create table t1 (a mediumtext character set latin1);
alter table t1 convert to character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` longtext
) ENGINE=MyISAM DEFAULT CHARSET=utf8
drop table t1;
End of 5.0 tests
drop table if exists t1, t2, t3;
create table t1 (i int);

View File

@ -21,6 +21,7 @@ flush logs;
*** must be a warning master-bin.000001 was not found ***
Warnings:
Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
*** must show one record, of the active binlog, left in the index file after PURGE ***
show binary logs;
Log_name File_size

View File

@ -770,8 +770,11 @@ call p_verify_status_increment(0, 0, 0, 0);
SUCCESS
insert t1 set a=4;
# Sic: a bug. Binlog did not register itself this time.
call p_verify_status_increment(1, 0, 1, 0);
# Binlog does not register itself this time for other than the 1st
# statement of the transaction with MIXED/STATEMENT binlog_format.
# It needs registering with the ROW format. Therefore 1,0,2,2 are
# the correct arguments to this test after bug#40221 fixed.
call p_verify_status_increment(1, 0, 2, 2);
SUCCESS
release savepoint a;

View File

@ -1890,5 +1890,7 @@ c1 c2
DROP TABLE t1;
# -- End of Bug#34274
create table `me:i`(id int);
drop table `me:i`;
End of 5.1 tests

View File

@ -5394,4 +5394,17 @@ select * from t1;
ERROR HY000: File './test/t1.CSV' not found (Errcode: 2)
unlock tables;
drop table t1;
create table t1(a enum ('a') not null) engine=csv;
insert into t1 values (2);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
select * from t1 limit 1;
ERROR HY000: Table 't1' is marked as crashed and should be repaired
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair Warning Data truncated for column 'a' at row 1
test.t1 repair status OK
select * from t1 limit 1;
a
drop table t1;
End of 5.1 tests

View File

@ -1157,4 +1157,57 @@ set names latin1;
select hex(char(0x41 using ucs2));
hex(char(0x41 using ucs2))
0041
SET character_set_connection=ucs2;
SELECT CHARSET(DAYNAME(19700101));
CHARSET(DAYNAME(19700101))
ucs2
SELECT CHARSET(MONTHNAME(19700101));
CHARSET(MONTHNAME(19700101))
ucs2
SELECT LOWER(DAYNAME(19700101));
LOWER(DAYNAME(19700101))
thursday
SELECT LOWER(MONTHNAME(19700101));
LOWER(MONTHNAME(19700101))
january
SELECT UPPER(DAYNAME(19700101));
UPPER(DAYNAME(19700101))
THURSDAY
SELECT UPPER(MONTHNAME(19700101));
UPPER(MONTHNAME(19700101))
JANUARY
SELECT HEX(MONTHNAME(19700101));
HEX(MONTHNAME(19700101))
004A0061006E0075006100720079
SELECT HEX(DAYNAME(19700101));
HEX(DAYNAME(19700101))
00540068007500720073006400610079
SET LC_TIME_NAMES=ru_RU;
SET NAMES utf8;
SET character_set_connection=ucs2;
SELECT CHARSET(DAYNAME(19700101));
CHARSET(DAYNAME(19700101))
ucs2
SELECT CHARSET(MONTHNAME(19700101));
CHARSET(MONTHNAME(19700101))
ucs2
SELECT LOWER(DAYNAME(19700101));
LOWER(DAYNAME(19700101))
четверг
SELECT LOWER(MONTHNAME(19700101));
LOWER(MONTHNAME(19700101))
января
SELECT UPPER(DAYNAME(19700101));
UPPER(DAYNAME(19700101))
ЧЕТВЕРГ
SELECT UPPER(MONTHNAME(19700101));
UPPER(MONTHNAME(19700101))
ЯНВАРЯ
SELECT HEX(MONTHNAME(19700101));
HEX(MONTHNAME(19700101))
042F043D043204300440044F
SELECT HEX(DAYNAME(19700101));
HEX(DAYNAME(19700101))
0427043504420432043504400433
SET character_set_connection=latin1;
End of 5.0 tests

View File

@ -62,18 +62,6 @@ CREATE EVENT event_4 ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND
ON COMPLETION PRESERVE
DO
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) >= 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')
OK
SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4;
IF(SUM(a) >= 1, 'OK', 'ERROR')
OK
SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';

View File

@ -522,3 +522,12 @@ WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 const 4 Using where
DROP TABLE t1;
CREATE TABLE t1(a CHAR(10));
INSERT INTO t1 VALUES('aaa15');
SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE)
1
SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
2
DROP TABLE t1;

View File

@ -0,0 +1,5 @@
INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
DROP TABLE t1;
UNINSTALL PLUGIN simple_parser;

View File

@ -176,4 +176,13 @@ IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((R
DROP TABLE t1;
CREATE TABLE t1 (c LONGTEXT);
INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890');
SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
MAX(IF(1, CAST(c AS UNSIGNED), 0))
12345678901234567890
SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
MAX(IFNULL(CAST(c AS UNSIGNED), 0))
12345678901234567890
DROP TABLE t1;
End of 5.0 tests

View File

@ -717,8 +717,6 @@ insert(_latin2'abcd',2,3,_latin2'ef'),
replace(_latin2'abcd',_latin2'b',_latin2'B'),
encode('abcd','ab')
;
Warnings:
Warning 1265 Data truncated for column 'format(130,10)' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@ -727,7 +725,7 @@ t1 CREATE TABLE `t1` (
`conv(130,16,10)` varchar(64) DEFAULT NULL,
`hex(130)` varchar(6) NOT NULL DEFAULT '',
`char(130)` varbinary(4) NOT NULL DEFAULT '',
`format(130,10)` varchar(4) NOT NULL DEFAULT '',
`format(130,10)` varchar(37) NOT NULL DEFAULT '',
`left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
`right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
`lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
@ -2513,4 +2511,12 @@ SELECT HEX(c1) from v1;
HEX(c1)
414243
DROP VIEW v1;
create table t1(a float);
insert into t1 values (1.33);
select format(a, 2) from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def format(a, 2) 253 49 4 Y 0 31 8
format(a, 2)
1.33
drop table t1;
End of 5.0 tests

View File

@ -592,6 +592,21 @@ unix_timestamp('1970-01-01 03:00:01')
select unix_timestamp('2038-01-19 07:14:07');
unix_timestamp('2038-01-19 07:14:07')
0
SELECT CHARSET(DAYNAME(19700101));
CHARSET(DAYNAME(19700101))
latin1
SELECT CHARSET(MONTHNAME(19700101));
CHARSET(MONTHNAME(19700101))
latin1
SELECT LOWER(DAYNAME(19700101));
LOWER(DAYNAME(19700101))
thursday
SELECT LOWER(MONTHNAME(19700101));
LOWER(MONTHNAME(19700101))
january
SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01'));
COERCIBILITY(MONTHNAME('1970-01-01')) COERCIBILITY(DAYNAME('1970-01-01'))
4 4
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time);
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08");
SELECT * from t1;

View File

@ -1246,6 +1246,11 @@ drop user 'greg'@'localhost';
drop view v1;
drop table test;
drop function test_function;
SELECT CURRENT_USER();
CURRENT_USER()
root@localhost
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
End of 5.0 tests
set names utf8;
grant select on test.* to юзер_юзер@localhost;

View File

@ -0,0 +1,2 @@
have_simple_parser
1

View File

@ -529,6 +529,34 @@ b a
y
z
DROP TABLE t1;
#
# BUG#40974: Incorrect query results when using clause evaluated using range check
#
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int);
insert into t1 values (1),(2);
create table t2(a int, b int);
insert into t2 values (1,1), (2, 1000);
create table t3 (a int, b int, filler char(100), key(a), key(b));
insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
insert into t3 values (1,1,'data');
insert into t3 values (1,1,'data');
The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
explain select * from t1
where exists (select 1 from t2, t3
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t3 ALL a,b NULL NULL NULL 1002 Range checked for each record (index map: 0x3)
select * from t1
where exists (select 1 from t2, t3
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
a
1
2
drop table t0, t1, t2, t3;
End of 5.0 tests
#---------------- ROR-index_merge tests -----------------------
SET SESSION STORAGE_ENGINE = MyISAM;

View File

@ -1707,4 +1707,9 @@ where a.VARIABLE_NAME = b.VARIABLE_NAME;
a.VARIABLE_VALUE - b.VARIABLE_VALUE
2
drop table t0;
CREATE TABLE t1(a INT) KEY_BLOCK_SIZE=1;
SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
CREATE_OPTIONS
KEY_BLOCK_SIZE=1
DROP TABLE t1;
End of 5.1 tests.

View File

@ -169,3 +169,413 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL, 1);
DELETE FROM t1 WHERE c1 = 1;
INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (NULL,8);
SELECT * FROM t1;
c1 c2
2 1
3 8
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL, 1);
DELETE FROM t1 WHERE c1 = 1;
INSERT INTO t1 VALUES (2,1), (NULL, 8);
INSERT INTO t1 VALUES (NULL,9);
SELECT * FROM t1;
c1 c2
2 1
3 8
5 9
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(5),(NULL);
INSERT INTO t1 VALUES (250),(NULL);
SELECT * FROM t1;
c1
5
10
110
250
310
INSERT INTO t1 VALUES (1000);
SET @@INSERT_ID=400;
INSERT INTO t1 VALUES(NULL),(NULL);
SELECT * FROM t1;
c1
5
10
110
250
310
400
410
1000
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(0);
SELECT * FROM t1;
c1
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL);
INSERT INTO t1 VALUES (250),(NULL);
SELECT * FROM t1;
c1
-1
1
2
10
110
250
410
SET @@INSERT_ID=400;
INSERT INTO t1 VALUES(NULL),(NULL);
Got one of the listed errors
SELECT * FROM t1;
c1
-1
1
2
10
110
250
410
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
SELECT * FROM t1;
c1
-1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
INSERT INTO t1 VALUES (250),(NULL);
SELECT * FROM t1;
c1
-2
-1
1
2
10
250
310
INSERT INTO t1 VALUES (1000);
SET @@INSERT_ID=400;
INSERT INTO t1 VALUES(NULL),(NULL);
SELECT * FROM t1;
c1
-2
-1
1
2
10
250
310
400
410
1000
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t1;
c1
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
INSERT INTO t1 VALUES (-2);
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (250);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1;
c1
1
2
10
110
210
250
310
INSERT INTO t1 VALUES (1000);
SET @@INSERT_ID=400;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES(NULL);
SELECT * FROM t1;
c1
1
2
10
110
210
250
310
400
1000
1010
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t1;
c1
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
INSERT INTO t1 VALUES (250),(NULL);
SELECT * FROM t1;
c1
1
2
10
110
210
250
410
INSERT INTO t1 VALUES (1000);
SET @@INSERT_ID=400;
INSERT INTO t1 VALUES(NULL),(NULL);
Got one of the listed errors
SELECT * FROM t1;
c1
1
2
10
110
210
250
410
1000
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (9223372036854775794);
SELECT * FROM t1;
c1
1
9223372036854775794
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 2
auto_increment_offset 10
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
SELECT * FROM t1;
c1
1
9223372036854775794
9223372036854775796
9223372036854775798
9223372036854775800
9223372036854775802
9223372036854775804
9223372036854775806
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551603);
SELECT * FROM t1;
c1
1
18446744073709551603
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 2
auto_increment_offset 10
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
SELECT * FROM t1;
c1
1
18446744073709551603
18446744073709551604
18446744073709551606
18446744073709551608
18446744073709551610
18446744073709551612
18446744073709551614
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551603);
SELECT * FROM t1;
c1
1
18446744073709551603
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 5
auto_increment_offset 7
INSERT INTO t1 VALUES (NULL),(NULL);
SELECT * FROM t1;
c1
1
18446744073709551603
18446744073709551607
18446744073709551612
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES(-9223372036854775806);
INSERT INTO t1 VALUES(-9223372036854775807);
INSERT INTO t1 VALUES(-9223372036854775808);
SELECT * FROM t1;
c1
-9223372036854775808
-9223372036854775807
-9223372036854775806
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 3
auto_increment_offset 3
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
SELECT * FROM t1;
c1
-9223372036854775808
-9223372036854775807
-9223372036854775806
1
3
6
9
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551610);
SELECT * FROM t1;
c1
1
18446744073709551610
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
Warnings:
Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976'
Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976'
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 65535
auto_increment_offset 65535
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1;
c1
1
18446744073709551610
18446744073709551615
DROP TABLE t1;

View File

@ -3295,3 +3295,11 @@ info: Records: 5 Duplicates: 0 Warnings: 0
TRUNCATE TABLE t1;
affected rows: 0
DROP TABLE t1;
Variable_name Value
Handler_update 0
Variable_name Value
Handler_delete 0
Variable_name Value
Handler_update 1
Variable_name Value
Handler_delete 1

View File

@ -0,0 +1,11 @@
SET storage_engine=InnoDB;
INSERT INTO bug38231 VALUES (1), (10), (300);
SET autocommit=0;
SELECT * FROM bug38231 FOR UPDATE;
a
1
10
300
TRUNCATE TABLE bug38231;
COMMIT;
DROP TABLE bug38231;

View File

@ -0,0 +1 @@
SET storage_engine=InnoDB;

View File

@ -1683,3 +1683,88 @@ CREATE INDEX i1 on t1 (a(3));
SELECT * FROM t1 WHERE a = 'abcde';
a
DROP TABLE t1;
CREATE TABLE foo (a int, b int, c char(10),
PRIMARY KEY (c(3)),
KEY b (b)
) engine=innodb;
CREATE TABLE foo2 (a int, b int, c char(10),
PRIMARY KEY (c),
KEY b (b)
) engine=innodb;
CREATE TABLE bar (a int, b int, c char(10),
PRIMARY KEY (c(3)),
KEY b (b)
) engine=myisam;
INSERT INTO foo VALUES
(1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
(4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
INSERT INTO bar SELECT * FROM foo;
INSERT INTO foo2 SELECT * FROM foo;
EXPLAIN SELECT c FROM bar WHERE b>2;;
id 1
select_type SIMPLE
table bar
type ALL
possible_keys b
key NULL
key_len NULL
ref NULL
rows 6
Extra Using where
EXPLAIN SELECT c FROM foo WHERE b>2;;
id 1
select_type SIMPLE
table foo
type ALL
possible_keys b
key NULL
key_len NULL
ref NULL
rows 6
Extra Using where
EXPLAIN SELECT c FROM foo2 WHERE b>2;;
id 1
select_type SIMPLE
table foo2
type range
possible_keys b
key b
key_len 5
ref NULL
rows 3
Extra Using where; Using index
EXPLAIN SELECT c FROM bar WHERE c>2;;
id 1
select_type SIMPLE
table bar
type ALL
possible_keys PRIMARY
key NULL
key_len NULL
ref NULL
rows 6
Extra Using where
EXPLAIN SELECT c FROM foo WHERE c>2;;
id 1
select_type SIMPLE
table foo
type ALL
possible_keys PRIMARY
key NULL
key_len NULL
ref NULL
rows 6
Extra Using where
EXPLAIN SELECT c FROM foo2 WHERE c>2;;
id 1
select_type SIMPLE
table foo2
type index
possible_keys PRIMARY
key b
key_len 5
ref NULL
rows 6
Extra Using where; Using index
DROP TABLE foo, bar, foo2;
End of 5.1 tests

View File

@ -10,10 +10,7 @@ create table t2 (a INT);
SELECT @@log_bin_trust_function_creators;
@@log_bin_trust_function_creators
0
SELECT @@sql_log_bin;
@@sql_log_bin
1
## Creating new function f1 ##
## Creating new function f1 fails because no DETERMINISTIC ###
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
IF (a < 3) THEN
@ -21,8 +18,24 @@ INSERT INTO t2 VALUES (a);
END IF;
RETURN 1;
END|
'Bug: Create Function should give error here because non-super user';
'is creating function here';
ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
## Creating new function f1 fails because non-super user ##
CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
BEGIN
IF (a < 3) THEN
INSERT INTO t2 VALUES (a);
END IF;
RETURN 1;
END|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
## Creating new function f1 succeeds ##
CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
BEGIN
IF (a < 3) THEN
INSERT INTO t2 VALUES (a);
END IF;
RETURN 1;
END|
## Creating new table t1 ##
CREATE TABLE t1 (a INT);
## Inserting some records in t1 ##

View File

@ -0,0 +1,9 @@
set names utf8;
create table `Ö` (id int);
show tables from test like 'Ö';
Tables_in_test (Ö)
ö
show tables from test like 'ö';
Tables_in_test (ö)
ö
drop table `Ö`;

View File

@ -40,3 +40,4 @@ count(*)
65536
DROP PROCEDURE sp_addRec;
DROP TABLE t1;
SET @@global.myisam_data_pointer_size = default;

View File

@ -27,3 +27,25 @@ CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
drop table if exists t1;
create table t1(f1 int, f2 char(255));
insert into t1 values(1, 'foo'), (2, 'bar');
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
flush tables;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize error Table 'test.t1' is read only
Warnings:
Error 1036 Table 't1' is read only
drop table t1;

View File

@ -180,6 +180,12 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
1
This is a file starting with UTF8 BOM 0xEFBBBF
This is a file starting with UTF8 BOM 0xEFBBBF
delimiter
1
2
2
2
2
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent'

View File

@ -324,7 +324,7 @@ partition by hash (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(27) NOT NULL DEFAULT '\0\0\0\0',
`a` bit(27) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)

View File

@ -0,0 +1,128 @@
drop table if exists t1;
set binlog_format=mixed;
set session transaction isolation level read committed;
create table t1(a int not null)
engine=innodb
DEFAULT CHARSET=latin1
PARTITION BY RANGE(a)
(PARTITION p0 VALUES LESS THAN (20),
PARTITION p1 VALUES LESS THAN MAXVALUE);
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
set autocommit=0;
select * from t1 where a=3 lock in share mode;
a
3
set binlog_format=mixed;
set session transaction isolation level read committed;
set autocommit=0;
update t1 set a=10 where a=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
update t1 set a=10 where a=5;
select * from t1 where a=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1 where a=2 limit 1 for update;
a
2
update t1 set a=11 where a=6;
update t1 set a=12 where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t1 set a=13 where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
update t1 set a=14 where a=1;
commit;
select * from t1;
a
10
11
14
2
3
4
7
drop table t1;
SET SESSION AUTOCOMMIT = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
set binlog_format=mixed;
# Switch to connection con1
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (300),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1,2);
# 1. test for locking:
BEGIN;
UPDATE t1 SET b = 12 WHERE a = 1;
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
1 12
# Switch to connection con2
UPDATE t1 SET b = 21 WHERE a = 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# Switch to connection con1
SELECT * FROM t1;
a b
1 12
ROLLBACK;
# 2. test for serialized update:
CREATE TABLE t2 (a INT);
TRUNCATE t1;
INSERT INTO t1 VALUES (1,'init');
CREATE PROCEDURE p1()
BEGIN
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
INSERT INTO t2 VALUES ();
END|
BEGIN;
UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
1 init+con1
# Switch to connection con2
CALL p1;;
# Switch to connection con1
SELECT * FROM t1;
a b
1 init+con1
COMMIT;
SELECT * FROM t1;
a b
1 init+con1
# Switch to connection con2
SELECT * FROM t1;
a b
1 init+con1+con2
# Switch to connection con1
# 3. test for updated key column:
TRUNCATE t1;
TRUNCATE t2;
INSERT INTO t1 VALUES (1,'init');
BEGIN;
UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
2 init+con1
# Switch to connection con2
CALL p1;;
# Switch to connection con1
SELECT * FROM t1;
a b
2 init+con1
COMMIT;
SELECT * FROM t1;
a b
2 init+con1
# Switch to connection con2
SELECT * FROM t1;
a b
2 init+con1
DROP PROCEDURE p1;
DROP TABLE t1, t2;

View File

@ -1,4 +1,11 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT PRIMARY KEY)
ENGINE MYISAM
PARTITION BY HASH (a)
PARTITIONS 1;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
ALTER TABLE t1 REORGANIZE PARTITION;
DROP TABLE t1;
create table t1 (a int)
partition by range (a)
subpartition by key (a)

View File

@ -1116,12 +1116,13 @@ create procedure `p1`()
begin
select a, f1() from t1;
end//
SET @log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
call p1()//
a f1()
1 2
2 2
SET GLOBAL log_bin_trust_function_creators = 0;
SET GLOBAL log_bin_trust_function_creators = @log_bin_trust_function_creators;
drop procedure p1//
drop function f1//
drop table t1//
@ -1615,41 +1616,6 @@ id
DROP PROCEDURE proc29856;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
set GLOBAL query_cache_type=1;
set GLOBAL query_cache_limit=10000;
set GLOBAL query_cache_min_res_unit=0;
set GLOBAL query_cache_size= 100000;
flush tables;
drop table if exists t1, t2;
create table t1 (a int);
create table t2 (a int);
insert into t1 values (1),(2),(3);
Locking table T2 with a write lock.
lock table t2 write;
Select blocked by write lock.
select *, (select count(*) from t2) from t1;;
Sleeing is ok, because selecting should be done very fast.
Inserting into table T1.
insert into t1 values (4);
Unlocking the tables.
unlock tables;
Collecting result from previously blocked select.
Next select should contain 4 rows, as the insert is long finished.
select *, (select count(*) from t2) from t1;
a (select count(*) from t2)
1 0
2 0
3 0
4 0
reset query cache;
select *, (select count(*) from t2) from t1;
a (select count(*) from t2)
1 0
2 0
3 0
4 0
drop table t1,t2;
#
# Bug#25132 disabled query cache: Qcache_free_blocks = 1
#

View File

@ -0,0 +1,62 @@
SET @query_cache_type= @@global.query_cache_type;
SET @query_cache_limit= @@global.query_cache_limit;
SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit;
SET @query_cache_size= @@global.query_cache_size;
# Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
# Establish connections user1,user2,user3 (user=root)
# Switch to connection user1
SET GLOBAL query_cache_type=1;
SET GLOBAL query_cache_limit=10000;
SET GLOBAL query_cache_min_res_unit=0;
SET GLOBAL query_cache_size= 100000;
FLUSH TABLES;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
# Switch to connection user2
LOCK TABLE t2 WRITE;
# Switch to connection user1
# "send" the next select, "reap" the result later.
# The select will be blocked by the write lock on the t1.
SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
# Switch to connection user3
# Poll till the select of connection user1 is blocked by the write lock on t1.
SELECT user,command,state,info FROM information_schema.processlist
WHERE state = 'Locked'
AND info = 'SELECT *, (SELECT COUNT(*) FROM t2) FROM t1';
user command state info
root Query Locked SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
INSERT INTO t1 VALUES (4);
# Switch to connection user2
UNLOCK TABLES;
# Switch to connection user1
# Collecting ("reap") the result from the previously blocked select.
# The printing of the result (varies between 3 and 4 rows) set has to be suppressed.
# Switch to connection user3
# The next select enforces that effects of "concurrent_inserts" like the
# record with a = 4 is missing in result sets can no more happen.
SELECT 1 FROM t1 WHERE a = 4;
1
1
# Switch to connection user1
# The next result set must contain 4 rows.
SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
a (SELECT COUNT(*) FROM t2)
1 0
2 0
3 0
4 0
RESET QUERY CACHE;
SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
a (SELECT COUNT(*) FROM t2)
1 0
2 0
3 0
4 0
DROP TABLE t1,t2;
# Switch to connection default + close connections user1,user2,user3
SET GLOBAL query_cache_type= @query_cache_type;
SET GLOBAL query_cache_limit= @query_cache_limit;
SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit;
SET GLOBAL query_cache_size= @query_cache_size;

View File

@ -4,44 +4,43 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
'#--------------------FN_DYNVARS_037_01-------------------------#'
SET @@global.init_slave = "SET @a = 10";
'connect (con1,localhost,root,,)'
'connection con1'
SELECT @@global.init_slave;
@@global.init_slave
SET @a = 10
'connection master'
'#--------------------FN_DYNVARS_037_02-------------------------#'
'check if value in slave opt file is executed'
'connection slave'
show variables like 'init_slave';
Variable_name Value
init_slave set global max_connections=500
show variables like 'max_connections';
Variable_name Value
max_connections 500
reset master;
'check if value in slave opt file doesnt apply to master'
'connection master'
show variables like 'init_slave';
Variable_name Value
init_slave SET @a = 10
show variables like 'max_connections';
Variable_name Value
max_connections 151
'connection slave'
'try creating a temporary variable in init_slave'
connection slave
SET @start_max_connections= @@global.max_connections;
SET @start_init_slave= @@global.init_slave;
SET @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column;
DESCRIBE t1;
Field Type Null Key Default Extra
my_column longtext NO NULL
DROP TABLE t1;
SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
@@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1'
1
Expect 1
SELECT @@global.max_connections= @start_max_connections;
@@global.max_connections= @start_max_connections
1
Expect 1
STOP SLAVE;
RESET MASTER;
RESET SLAVE;
START SLAVE;
SELECT @@global.max_connections = @start_max_connections + 1;
@@global.max_connections = @start_max_connections + 1
1
Expect 1
SET @@global.init_slave = "SET @a=5";
stop slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
RESET MASTER;
RESET SLAVE;
START SLAVE;
SHOW VARIABLES LIKE 'init_slave';
Variable_name Value
init_slave SET @a=5
SELECT @a;
@a
NULL
'Bug#35365 SET statement in init_slave not execute if slave is restarted'
set global max_connections= default;
Expect NULL
SET @@global.max_connections= @start_max_connections;
SET @@global.init_slave= @start_init_slave;

View File

@ -4340,6 +4340,39 @@ Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 6
DROP TABLE t1, t2;
CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
f2 int(11) NOT NULL default '0',
f3 bigint(20) NOT NULL default '0',
f4 varchar(255) NOT NULL default '',
PRIMARY KEY (f1),
KEY key1 (f4),
KEY key2 (f2));
CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
f2 enum('A1','A2','A3') NOT NULL default 'A1',
f3 int(11) NOT NULL default '0',
PRIMARY KEY (f1),
KEY key1 (f3));
CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
f2 datetime NOT NULL default '1980-01-01 00:00:00',
PRIMARY KEY (f1));
insert into t1 values (1, 1, 1, 'abc');
insert into t1 values (2, 1, 2, 'def');
insert into t1 values (3, 1, 2, 'def');
insert into t2 values (1, 'A1', 1);
insert into t3 values (1, '1980-01-01');
SELECT a.f3, cr.f4, count(*) count
FROM t2 a
STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1
LEFT JOIN
(t1 cr2
JOIN t3 ae2 ON cr2.f3 = ae2.f1
) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND
cr.f4 = cr2.f4
GROUP BY a.f3, cr.f4;
f3 f4 count
1 abc 1
1 def 2
drop table t1, t2, t3;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
@ -4358,3 +4391,29 @@ a
4
5
DROP TABLE t1;
CREATE TABLE A (date_key date);
CREATE TABLE C (
pk int,
int_nokey int,
int_key int,
date_key date NOT NULL,
date_nokey date,
varchar_key varchar(1)
);
INSERT INTO C VALUES
(1,1,1,'0000-00-00',NULL,NULL),
(1,1,1,'0000-00-00',NULL,NULL);
SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C);
1
SELECT COUNT(DISTINCT 1) FROM C
WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk;
COUNT(DISTINCT 1)
SELECT date_nokey FROM C
WHERE int_key IN (SELECT 1 FROM A)
HAVING date_nokey = '10:41:7'
ORDER BY date_key;
date_nokey
Warnings:
Warning 1292 Incorrect date value: '10:41:7' for column 'date_nokey' at row 1
DROP TABLE A,C;
End of 5.1 tests

View File

@ -209,4 +209,29 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table '
drop database db37908;
drop procedure proc37908;
drop function func37908;
DROP PROCEDURE IF EXISTS p1;
DROP FUNCTION IF EXISTS f1;
CREATE FUNCTION f1() RETURNS INTEGER
BEGIN
DECLARE foo INTEGER;
DECLARE bar INTEGER;
SET foo=1;
SET bar=2;
RETURN foo;
END $$
CREATE PROCEDURE p1()
BEGIN
SELECT 1;
END $$
SELECT f1();
f1()
1
CALL p1();
1
1
SELECT 9;
9
9
DROP PROCEDURE p1;
DROP FUNCTION f1;
set @@global.concurrent_insert= @old_concurrent_insert;

View File

@ -0,0 +1,73 @@
#
# Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
#
FLUSH STATUS;
CREATE FUNCTION testQuestion() RETURNS INTEGER
BEGIN
DECLARE foo INTEGER;
DECLARE bar INTEGER;
SET foo=1;
SET bar=2;
RETURN foo;
END $$
CREATE PROCEDURE testQuestion2()
BEGIN
SELECT 1;
END $$
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES(1);
Assert Questions == 7
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 7
SELECT testQuestion();
testQuestion()
1
Assert Questions == 9
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 9
CALL testQuestion2();
1
1
Assert Questions == 11
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 11
SELECT 1;
1
1
Assert Questions == 13
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 13
SELECT 1;
1
1
Assert Questions == 14
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 14
CREATE TRIGGER trigg1 AFTER INSERT ON t1
FOR EACH ROW BEGIN
INSERT INTO t2 VALUES (1);
END;
$$
Assert Questions == 16
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 16
INSERT INTO t1 VALUES (1);
Assert Questions == 18
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 18
DROP PROCEDURE testQuestion2;
DROP TRIGGER trigg1;
DROP FUNCTION testQuestion;
DROP EVENT ev1;
DROP TABLE t1,t2;
End of 6.0 tests

View File

@ -708,6 +708,47 @@ HEX(b1) HEX(b2) i2
1 0 100
1 0 200
DROP TABLE t1, t2;
CREATE TABLE IF NOT EXISTS t1 (
f1 bit(2) NOT NULL default b'10',
f2 bit(14) NOT NULL default b'11110000111100'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` bit(2) NOT NULL DEFAULT b'10',
`f2` bit(14) NOT NULL DEFAULT b'11110000111100'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
DROP TABLE t1;
CREATE TABLE IF NOT EXISTS t1 (
f1 bit(2) NOT NULL default b''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
ERROR 42000: Invalid default value for 'f1'
create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
create table t2bit7 (b1 bit(7)) engine=MyISAM;
insert into t1bit7 values (b'1100000');
insert into t1bit7 values (b'1100001');
insert into t1bit7 values (b'1100010');
insert into t2bit7 values (b'1100001');
insert into t2bit7 values (b'1100010');
insert into t2bit7 values (b'1100110');
select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
bin(a1)
1100001
1100010
drop table t1bit7, t2bit7;
create table t1bit7 (a1 bit(15) not null) engine=MyISAM;
create table t2bit7 (b1 bit(15)) engine=MyISAM;
insert into t1bit7 values (b'110000011111111');
insert into t1bit7 values (b'110000111111111');
insert into t1bit7 values (b'110001011111111');
insert into t2bit7 values (b'110000111111111');
insert into t2bit7 values (b'110001011111111');
insert into t2bit7 values (b'110011011111111');
select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
bin(a1)
110000111111111
110001011111111
drop table t1bit7, t2bit7;
End of 5.0 tests
create table t1(a bit(7));
insert into t1 values(0x40);

View File

@ -392,4 +392,13 @@ f1 + 0e0
1.0000000150475e+30
-1.0000000150475e+30
drop table t1;
create table t1(d double, u bigint unsigned);
insert into t1(d) values (9.22337203685479e18),
(1.84e19);
update t1 set u = d;
select u from t1;
u
9223372036854790144
18400000000000000000
drop table t1;
End of 5.0 tests

View File

@ -1,7 +1,15 @@
create table t1 (id int) engine=NDB;
Warnings:
Warning 1286 Unknown table engine 'NDB'
Warning 1266 Using storage engine MyISAM for table 't1'
alter table t1 engine=NDB;
Warnings:
Warning 1266 Using storage engine MyISAM for table 't1'
Warning 1286 Unknown table engine 'NDB'
drop table t1;
SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster';
ENGINE SUPPORT
ndbcluster NO
SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE
PLUGIN_NAME='ndbcluster';
PLUGIN_NAME PLUGIN_STATUS
ndbcluster DISABLED

View File

@ -1029,4 +1029,28 @@ SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
1
1
DROP TABLE t1;
SET @xml=
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Title - document with document declaration</title>
</head>
<body> Hi, Im a webpage with document a declaration </body>
</html>';
SELECT ExtractValue(@xml, 'html/head/title');
ExtractValue(@xml, 'html/head/title')
Title - document with document declaration
SELECT ExtractValue(@xml, 'html/body');
ExtractValue(@xml, 'html/body')
Hi, Im a webpage with document a declaration
SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml');
ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml')
NULL
Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 11: STRING unexpected ('>' wanted)'
SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml')
NULL
Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 17: STRING unexpected ('>' wanted)'
End of 5.1 tests

View File

@ -115,14 +115,14 @@ master-bin.000001 # Xid # # COMMIT /* XID */
DROP TABLE t1;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 15
Binlog_cache_use 13
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 16
Binlog_cache_use 14
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
@ -131,7 +131,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 17
Binlog_cache_use 15
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1

View File

@ -0,0 +1,31 @@
CREATE TABLE t1 (i int unique) ENGINE=innodb;
reset master;
begin;
insert into t1 values (1),(2);
*** the following UPDATE query wont generate any updates for the binlog ***
update t1 set i = 3 where i < 3;
ERROR 23000: Duplicate entry '3' for key 'i'
commit;
*** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
delete from t1;
reset master;
begin;
insert into t1 values (1),(2);
*** the following UPDATE query wont generate any updates for the binlog ***
insert into t1 values (3),(4),(1),(2);
ERROR 23000: Duplicate entry '1' for key 'i'
commit;
*** Results of the test: the binlog must have only one Write_rows event not two ***
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
drop table t1;

View File

@ -133,10 +133,6 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
insert into t1 values(11);
commit;
show binlog events from <binlog_start>;
@ -148,8 +144,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@ -278,10 +272,6 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; drop table t1,t2
master-bin.000001 # Query # # use `test`; create table t0 (n int)
master-bin.000001 # Query # # use `test`; BEGIN
@ -382,7 +372,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 # Query # # use `test`; BEGIN
@ -400,7 +390,9 @@ master-bin.000001 # Query # # use `test`; DROP TABLE t2
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
@ -408,11 +400,7 @@ master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
master-bin.000001 # Query # # use `test`; COMMIT

View File

@ -0,0 +1,42 @@
#
# Tests of innodb/binlog with the row binlog format
#
source include/have_innodb.inc;
source include/have_log_bin.inc;
source include/have_binlog_format_row.inc;
#
# Bug #40221 Replication failure on RBR + UPDATE the primary key
#
CREATE TABLE t1 (i int unique) ENGINE=innodb;
reset master;
# part 1: update can cause the dup key
begin;
insert into t1 values (1),(2);
--echo *** the following UPDATE query wont generate any updates for the binlog ***
--error ER_DUP_ENTRY
update t1 set i = 3 where i < 3;
commit;
--echo *** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
source include/show_binlog_events.inc;
# part 2: insert can cause the dup key
delete from t1;
reset master;
begin;
insert into t1 values (1),(2);
--echo *** the following UPDATE query wont generate any updates for the binlog ***
--error ER_DUP_ENTRY
insert into t1 values (3),(4),(1),(2);
commit;
--echo *** Results of the test: the binlog must have only one Write_rows event not two ***
source include/show_binlog_events.inc;
drop table t1;

View File

@ -43,10 +43,10 @@ NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL N
NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
NULL information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ENGINES SAVEPOINTS 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema ENGINES TRANSACTIONS 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema ENGINES XA 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select

View File

@ -31,27 +31,27 @@ Field Type Null Key Default Extra
ENGINE varchar(64) NO
SUPPORT varchar(8) NO
COMMENT varchar(80) NO
TRANSACTIONS varchar(3) NO
XA varchar(3) NO
SAVEPOINTS varchar(3) NO
TRANSACTIONS varchar(3) YES NULL
XA varchar(3) YES NULL
SAVEPOINTS varchar(3) YES NULL
SHOW CREATE TABLE information_schema.ENGINES;
Table Create Table
ENGINES CREATE TEMPORARY TABLE `ENGINES` (
`ENGINE` varchar(64) NOT NULL DEFAULT '',
`SUPPORT` varchar(8) NOT NULL DEFAULT '',
`COMMENT` varchar(80) NOT NULL DEFAULT '',
`TRANSACTIONS` varchar(3) NOT NULL DEFAULT '',
`XA` varchar(3) NOT NULL DEFAULT '',
`SAVEPOINTS` varchar(3) NOT NULL DEFAULT ''
`TRANSACTIONS` varchar(3) DEFAULT NULL,
`XA` varchar(3) DEFAULT NULL,
`SAVEPOINTS` varchar(3) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.ENGINES;
Field Type Null Key Default Extra
ENGINE varchar(64) NO
SUPPORT varchar(8) NO
COMMENT varchar(80) NO
TRANSACTIONS varchar(3) NO
XA varchar(3) NO
SAVEPOINTS varchar(3) NO
TRANSACTIONS varchar(3) YES NULL
XA varchar(3) YES NULL
SAVEPOINTS varchar(3) YES NULL
########################################################################
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
# DDL on INFORMATION_SCHEMA tables are not supported

File diff suppressed because it is too large Load Diff

View File

@ -16,15 +16,32 @@
# Created:
# 2008-08-27 mleich
#
# Modified:
# 2008-11-17 pcrews
# added --disable / --enable_warning statements to minimize differences
# between platforms (Bug#40177 Test funcs_1.storedproc failing on Pushbuild)
#
# TODO: (After 5.1 GA)
# 1) Examine reordering statements in this file to minimize the number of
# --disable / --enable_warning statements. Unsure if performance gains
# warrant the working time
# 2) We could probably add a comparison of the # of warnings before the
# assignment of @v1_proc and @v1_func to the # of warnings after assignment
# The difference of these values should be zero
# Refer to Bug#40177 - http://bugs.mysql.com/bug.php?id=40177 for notes as well
eval UPDATE t1_aux SET f1 = NULL;
# Enforce that all user variables have the same data type and initial value.
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
--disable_warnings
eval UPDATE t1_aux SET f1 = $test_value;
--enable_warnings
SELECT f1 INTO @v1_tab FROM t1_aux;
--disable_warnings
eval CALL sproc_1($test_value, @v1_proc);
eval SET @v1_func = func_1($test_value);
--enable_warnings
if (`SELECT @v1_tab <> @v1_proc OR @v1_tab <> @v2_proc OR @v1_tab <> @v1_func`)
{

View File

@ -1,6 +1,6 @@
# Disabled by hhunger (2008-03-03) due to WL4204
innodb_charset : Due to bug#20447
myisam_charset : Due to bug#20477
memory_charset : Due to bug#20447
ndb_charset : Due to bug#20447
innodb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
myisam_charset : Bug#20447 Problem with prefix keys with contractions and expansions
memory_charset : Bug#20447 Problem with prefix keys with contractions and expansions
ndb_charset : Bug#20447 Problem with prefix keys with contractions and expansions

View File

@ -9,8 +9,7 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open

View File

@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
`a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
@ -18,7 +18,7 @@ partition pa2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
`a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -30,7 +30,7 @@ partition by key (a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
`a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
`a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -88,7 +88,7 @@ partition by key (a) partitions 4;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0',
`a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -102,7 +102,7 @@ alter table t2 drop primary key;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0'
`a` bit(1) NOT NULL DEFAULT b'0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 4 */
@ -114,7 +114,7 @@ alter table t2 add primary key (a);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0',
`a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -133,7 +133,7 @@ partition pa4 values less than (256));
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` bit(8) NOT NULL DEFAULT '\0',
`a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` bit(8) NOT NULL DEFAULT '\0',
`a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)

View File

@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='MyISAM' partition by key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
`a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
@ -18,7 +18,7 @@ partition pa2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
`a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -30,7 +30,7 @@ partition by key (a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
`a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
`a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -88,7 +88,7 @@ partition by key (a) partitions 4;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0',
`a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -102,7 +102,7 @@ alter table t2 drop primary key;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0'
`a` bit(1) NOT NULL DEFAULT b'0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 4 */
@ -114,7 +114,7 @@ alter table t2 add primary key (a);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0',
`a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@ -133,7 +133,7 @@ partition pa4 values less than (256));
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` bit(8) NOT NULL DEFAULT '\0',
`a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` bit(8) NOT NULL DEFAULT '\0',
`a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)

View File

@ -1,126 +0,0 @@
SET @max_row = 20;
create table t1 (a bit(65), primary key (a)) partition by key (a);
ERROR 42000: Display width out of range for column 'a' (max = 64)
create table t1 (a bit(0), primary key (a)) partition by key (a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
drop table t1;
create table t1 (a bit(0), primary key (a)) partition by key (a) (
partition pa1 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp',
partition pa2 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
/*!50100 PARTITION BY KEY (a)
(PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
drop table t1;
create table t1 (a bit(64), primary key (a)) partition by key (a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
insert into t1 values
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
(b'0000000000000000000000000000000000000000000000000000000000000001'),
(b'1010101010101010101010101010101010101010101010101010101010101010'),
(b'0101010101010101010101010101010101010101010101010101010101010101');
select hex(a) from t1;
hex(a)
1
5555555555555555
8000000000000000
AAAAAAAAAAAAAAAA
FFFFFFFFFFFFFFFF
drop table t1;
create table t1 (a bit(64), primary key (a)) partition by key (a)(
partition pa1 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp' max_rows=20 min_rows=2,
partition pa2 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp' max_rows=30 min_rows=3,
partition pa3 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp' max_rows=30 min_rows=4,
partition pa4 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp' max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
/*!50100 PARTITION BY KEY (a)
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
insert into t1 values
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
(b'0000000000000000000000000000000000000000000000000000000000000001'),
(b'1010101010101010101010101010101010101010101010101010101010101010'),
(b'0101010101010101010101010101010101010101010101010101010101010101');
select hex(a) from t1;
hex(a)
1
5555555555555555
8000000000000000
AAAAAAAAAAAAAAAA
FFFFFFFFFFFFFFFF
drop table t1;
create table t1 (a bit, primary key (a)) partition by key (a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
insert into t1 values (b'0'), (b'1');
select hex(a) from t1;
hex(a)
0
1
alter table t1 drop primary key;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
select hex(a) from t1;
hex(a)
0
1
alter table t1 add primary key (a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
select hex(a) from t1;
hex(a)
0
1
drop table t1;

View File

@ -213,5 +213,10 @@ START TRANSACTION;
INSERT INTO t1 VALUES (NULL, 'first row t2');
SET autocommit=OFF;
ALTER TABLE t1 AUTO_INCREMENT = 10;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t1 VALUES (NULL, 'second row t2');
SELECT a,b FROM t1 ORDER BY a;
a b
1 first row t2
2 second row t2
DROP TABLE t1;

View File

@ -1,8 +1,3 @@
partition_basic_ndb : Bug#19899 Crashing the server
# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
partition_bit_ndb : NDB does not support bit column in index
partition_sessions : needs system_3_init.inc
partition_syntax_ndb : Bug#36735 Not supported
partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_ndb : Bug#30581 partition_value tests use disallowed CAST() function

View File

@ -1,60 +0,0 @@
################################################################################
# t/partition_bit_ndb.test #
# #
# Purpose: #
# Tests around bit type #
# NDB branch #
# #
#------------------------------------------------------------------------------#
# Original Author: HH #
# Original Date: 2006-08-01 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
#
# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
# THE SOURCED FILES ONLY.
#
# Please read the README at the end of inc/partition.pre before changing
# any of the variables.
#
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
##### Options, for debugging support #####
let $debug= 0;
let $with_partitioning= 1;
##### Option, for displaying files #####
let $ls= 1;
##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
# on partioned tables
SET @max_row = 20;
# The server must support partitioning.
--source include/have_partition.inc
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
##### Storage engine to be tested
--source include/have_ndb.inc
let $engine= 'NDB';
connection default;
# range, list and hash partitioning in ndb requires new_mode
--disable_query_log
set new=on;
--enable_query_log
##### Assign a big number smaller than the maximum value for partitions #####
# and smaller than the maximum value of SIGNED INTEGER
let $MAX_VALUE= (2147483646);
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
--source suite/parts/inc/partition_bit.inc

View File

@ -1,391 +0,0 @@
#--------------------------------------------------
# Initialize system_3 test variables
#--------------------------------------------------
--source suite/system_3/include/system_3_init.inc
let $NUM_VAL=`SELECT @NUM_VAL`;
let $LOAD_LINES=`SELECT @LOAD_LINES`;
let $LOG_UPPER=`SELECT @LOG_UPPER`;
let $LOG_LOWER=`SELECT @LOG_LOWER`;
#let $ENG1=`SELECT @ENG1`;
let $ENG2=`SELECT @ENG2`;
let $ENG_LOG=`SELECT @ENG_LOG`;
let $CLIENT_HOST=`SELECT @CLIENT_HOST`;
let $ENG=innodb;
let $ENG1=innodb;
#---------------------------------------------------------
# Column list with definition for all tables to be checked
#---------------------------------------------------------
let $column_list= f1 int,
f2 char (15),
f3 decimal (5,3),
f4 datetime;
let $col_access_list = f1,f2,f3,f4 ;
let $col_new_list = new.f1,new.f2,new.f3 new.f4 ;
#---------------------------------------------------
# Setting the parameters to use during testing
#---------------------------------------------------
# Set number of variations of the f1 variable (used to segment the rows
# being updated/deleted by a user at a time. The higher the number, the
# more smaller segments used with each query.
--replace_result $NUM_VAL NUM_VAL
eval set @f1_nums=$NUM_VAL;
# The following sets the number controls the size of the log table.
# Once a size of '@threshold' is reached, the first rows are removed
# sunch that the table is down to '@shrink_to' lines
--replace_result $LOG_LOWER LOG_LOWER
eval set @shrink_to=$LOG_LOWER;
--replace_result $LOG_UPPER LOG_UPPER
eval set @threshold=$LOG_UPPER;
#---------------------------------------------------
# Creating the database tables and loading the data
#---------------------------------------------------
--disable_warnings
drop database if exists systest1;
--enable_warnings
create database systest1;
--disable_abort_on_error
--replace_result $CLIENT_HOST CLIENT_HOST
eval create user systuser@'$CLIENT_HOST';
--enable_abort_on_error
--replace_result $CLIENT_HOST CLIENT_HOST
eval set password for systuser@'$CLIENT_HOST' = password('systpass');
--replace_result $CLIENT_HOST CLIENT_HOST
eval grant ALL on systest1.* to systuser@'$CLIENT_HOST';
use systest1;
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (systuser,localhost,systuser,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK);
create table tb1_master (
f1 int,
f2 char(15),
f3 decimal (5,3),
f4 datetime
);
#--replace_result $ENG_LOG ENG_LOG
eval create table tb1_logs (
i1 int NOT NULL auto_increment, primary key (i1),
dt1 datetime NOT NULL,
entry_dsc char(100),
f4 int
) engine=$ENG_LOG
;
#PARTITION BY HASH (i1) PARTITIONS 8;
if ($debug)
{
SHOW CREATE TABLE tb1_logs;
}
#--replace_result $ENG_LOG ENG_LOG
eval create table ddl_logs (
i1 int NOT NULL auto_increment, primary key (i1),
dt1 datetime NOT NULL,
entry_dsc char(100),
errno int
) engine=$ENG_LOG;
#PARTITION BY HASH (i1) PARTITIONS 8;
if ($debug)
{
SHOW CREATE TABLE tb1_logs;
}
create table test_stat (
dt1 datetime,
table_name char(20),
row_count int,
start_row int,
end_row int
);
#----------------------------------------------------------------------
# tb3_eng1: key partitioning
#----------------------------------------------------------------------
#--replace_result $ENG1 ENG1
eval create table tb3_eng1 (
i1 int NOT NULL auto_increment, primary key (i1),
$column_list
) engine=$ENG1
PARTITION BY KEY (i1) PARTITIONS 4
(PARTITION part1,
PARTITION part2,
PARTITION part3,
PARTITION part4);
#--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/suite/system_3/data/tb1.txt'
into table tb3_eng1 ($col_access_list);
if ($WITH_TRIGGERS)
{
delimiter //;
Create trigger tb3_eng1_ins after insert on tb3_eng1 for each row
BEGIN
insert into tb1_logs (dt1, entry_dsc, f4)
values (now(), concat('Insert row ', new.f1,' ',
new.f2, ' ', new.f3, ' (tb3_eng1)'), new.f1);
END//
Create trigger tb3_eng1_upd after update on tb3_eng1 for each row
BEGIN
insert into tb1_logs (dt1, entry_dsc, f4)
values (now(), concat('Update row ', old.f1,' ', old.f2, '->',
new.f2, ' ', old.f3, '->', new.f3, ' (tb3_eng1)'), new.f1);
END//
Create trigger tb3_eng1_del after delete on tb3_eng1 for each row
BEGIN
insert into tb1_logs (dt1, entry_dsc, f4)
values (now(), concat('Delete row ', old.f1,' ', old.f2, ' ',
old.f3, ' (tb3_eng1)'), old.f1);
END//
delimiter ;//
}
delimiter //;
# This functions returns a random integer number
# between zero and 'num'
#-----------------------------------------------
create function int_rand(num int) returns int
BEGIN
return round(num*rand()+0.5);
END//
# This function returns a string in the length 'len' of
# random letters (ascii range of 65-122)
#------------------------------------------------------
create function str_rand (len int) returns char(12)
BEGIN
declare tmp_letter char(1);
declare tmp_word char(12);
declare word_str char(12) default '';
wl_loop: WHILE len DO
set tmp_letter=char(round(57*rand()+65));
set tmp_word=concat(word_str,tmp_letter);
set word_str=tmp_word;
set len=len-1;
END WHILE wl_loop;
return word_str;
END//
# This procedure scans 'tb1_master' table for rows where f1='num_pr'
# and for each row inserts a row in 'tb3_eng1'
#------------------------------------------------------------------
eval create procedure ins_tb3_eng1 (num_pr int, str_pr char(15))
BEGIN
declare done int default 0;
declare v3 decimal(5,3);
declare cur1 cursor for
select f3 from tb1_master where f1=num_pr;
declare continue handler for sqlstate '01000' set done = 1;
declare continue handler for sqlstate '02000' set done = 1;
open cur1;
fetch cur1 into v3;
wl_loop: WHILE NOT done DO
insert into tb3_eng1 ($col_access_list) values
(int_rand(@f1_nums), concat('I:',str_pr,'-',num_pr), v3, now());
fetch cur1 into v3;
END WHILE wl_loop;
close cur1;
END//
# This procedure does selects from the 'tb1_logs' and inserts the
# count into the table
#------------------------------------------------------------------
create procedure slct_tb1_logs ()
BEGIN
declare done int default 0;
declare v4 int;
declare v_count int default 0;
declare str_val char(15) default ELT(int_rand(3),
'Insert', 'Update', 'Delete');
declare cur1 cursor for
select f4 from tb1_logs where entry_dsc like concat('%',str_val,'%');
declare continue handler for sqlstate '01000' set done = 1;
declare continue handler for sqlstate '02000' set done = 1;
open cur1;
fetch cur1 into v4;
wl_loop: WHILE NOT done DO
set v_count=v_count+1;
fetch cur1 into v4;
END WHILE wl_loop;
close cur1;
insert into tb1_logs (dt1, entry_dsc, f4)
values (now(), concat('Number of \'', str_val, '\' rows is: ',
v_count, ' (tb1_log)'),0);
END//
delimiter ;//
--disable_abort_on_error
insert into systest1.tb3_eng1 values (NULL,50,'init_val',12.345,'2005-01-01 00:00:00');
insert into systest1.tb3_eng1 values (NULL,70,'init_val',12.345,'2005-01-01 00:00:00');
--enable_abort_on_error
connection default;0.
--disable_abort_on_error
--replace_result $CLIENT_HOST CLIENT_HOST
eval create user syst1user@'$CLIENT_HOST';
--enable_abort_on_error
--replace_result $CLIENT_HOST CLIENT_HOST
eval set password for syst1user@'$CLIENT_HOST' = password('systpass');
--replace_result $CLIENT_HOST CLIENT_HOST
eval grant ALL on systest1.* to syst1user@'$CLIENT_HOST';
use systest1;
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (syst1user,localhost,syst1user,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK);
--source suite/system_3/include/system_3_init.inc
use systest1;
let $NUM_VAL=`SELECT @NUM_VAL`;
eval SET @f1_nums=$NUM_VAL;
SET @tmp_num=int_rand(@f1_nums);
SET @tmp_word=str_rand(4);
# DEBUG select @tmp_num, @tmp_word;
# Insert rows replacing the deleted rows using a strored procedure
# that reads the rows from a master table
CALL ins_tb3_eng1 (@tmp_num, @tmp_word);
connection syst1user;
--source suite/system_3/include/system_3_init.inc
use systest1;
let $NUM_VAL=`SELECT @NUM_VAL`;
eval SET @f1_nums=$NUM_VAL;
SET @tmp_num=int_rand(@f1_nums);
SET @tmp_word=str_rand(4);
# DEBUG select @tmp_num, @tmp_word;
# Insert rows replacing the deleted rows using a strored procedure
# that reads the rows from a master table
CALL ins_tb3_eng1 (@tmp_num, @tmp_word);
connection systuser;
--source suite/system_3/include/system_3_init.inc
use systest1;
call slct_tb1_logs();
connection syst1user;
--source suite/system_3/include/system_3_init.inc
use systest1;
let $NUM_VAL=`SELECT @NUM_VAL`;
eval set @f1_nums=$NUM_VAL;
set @tmp_num=int_rand(@f1_nums);
set @tmp_word=str_rand(4);
select @tmp_num, @tmp_word;
# Update all rows in the table where f1 is one less the random number
update tb3_eng1
set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
where f1=@tmp_num-1;
connection systuser;
--source suite/system_3/include/system_3_init.inc
use systest1;
let $NUM_VAL=`SELECT @NUM_VAL`;
eval set @f1_nums=$NUM_VAL;
set @tmp_num=int_rand(@f1_nums);
set @tmp_word=str_rand(4);
select @tmp_num, @tmp_word;
# Update all rows in the table where f1 is one less the random number
update tb3_eng1
set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
where f1=@tmp_num-1;
connection syst1user;
--source suite/system_3/include/system_3_init.inc
use systest1;
call slct_tb1_logs();
connection systuser;
--source suite/system_3/include/system_3_init.inc
use systest1;
let $NUM_VAL=`SELECT @NUM_VAL`;
eval set @f1_nums=$NUM_VAL;
set @tmp_num=int_rand(@f1_nums);
set @tmp_word=str_rand(4);
select @tmp_num, @tmp_word;
# Update all rows in the table where f1 is one less the random number
update tb3_eng1
set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
where f1=@tmp_num-1;
connection syst1user;
--source suite/system_3/include/system_3_init.inc
use systest1;
#--replace_result $NUM_VAL <NUM_VAL>
let $NUM_VAL=`SELECT @NUM_VAL`;
eval set @f1_nums=$NUM_VAL;
set @tmp_num=int_rand(@f1_nums);
select @tmp_num;
# DEBUG select @tmp_num, @tmp_word;
# Delete all rows from the table where f1 is equal to the above number
delete from tb3_eng1 where f1=@tmp_num;
connection systuser;
--source suite/system_3/include/system_3_init.inc
use systest1;
select * from tb3_eng1 where f1>40;
connection syst1user;
--source suite/system_3/include/system_3_init.inc
use systest1;
let $NUM_VAL=`SELECT @NUM_VAL`;
eval set @f1_nums=$NUM_VAL;
set @tmp_num=int_rand(@f1_nums);
select @tmp_num;
# DEBUG select @tmp_num, @tmp_word;
# Delete all rows from the table where f1 is equal to the above number
delete from tb3_eng1 where f1=@tmp_num;
connection systuser;
--source suite/system_3/include/system_3_init.inc
use systest1;
select * from tb3_eng1 where f1>40;
connection syst1user;
--source suite/system_3/include/system_3_init.inc
use systest1;
let $NUM_VAL=`SELECT @NUM_VAL`;
eval set @f1_nums=$NUM_VAL;
set @tmp_num=int_rand(@f1_nums);
select @tmp_num;
select @tmp_num, @tmp_word;
# Delete all rows from the table where f1 is equal to the above number
delete from tb3_eng1 where f1=@tmp_num;
connection systuser;
--source suite/system_3/include/system_3_init.inc
use systest1;
select * from tb3_eng1 where f1>40;

View File

@ -68,10 +68,12 @@ INSERT INTO t1 VALUES (NULL, 'first row t2');
--connection con2
SET autocommit=OFF;
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 AUTO_INCREMENT = 10;
--connection con1
INSERT INTO t1 VALUES (NULL, 'second row t2');
SELECT a,b FROM t1 ORDER BY a;
--disconnect con2
--disconnect con1
--connection default

View File

@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
# Change Author: #
# Change Date: #
# Change: #
# Change Author: mleich #
# Change Date: 2008-12-08 #
# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@ -22,6 +22,12 @@
# any of the variables.
#
#
# CAST() within the partitioning function si no more supported, but we get
# this functionality probably soon again. Therefor we do not delete this test.
--skip # CAST() in partitioning function is currently not supported.
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements

View File

@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
# Change Author: #
# Change Date: #
# Change: #
# Change Author: mleich #
# Change Date: 2008-12-08 #
# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@ -22,6 +22,12 @@
# any of the variables.
#
#
# CAST() within the partitioning function si no more supported, but we get
# this functionality probably soon again. Therefor we do not delete this test.
--skip # CAST() in partitioning function is currently not supported.
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements

View File

@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
# Change Author: #
# Change Date: #
# Change: #
# Change Author: mleich #
# Change Date: 2008-12-08 #
# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@ -22,6 +22,12 @@
# any of the variables.
#
#
# CAST() within the partitioning function si no more supported, but we get
# this functionality probably soon again. Therefor we do not delete this test.
--skip # CAST() in partitioning function is currently not supported.
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements

View File

@ -29,44 +29,9 @@ SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
STOP SLAVE;
START SLAVE;
CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running No
Slave_SQL_Running #
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Slave_IO_Running = No (expect No)
==== clean up ====
DROP TABLE t1;
DROP TABLE t1;

View File

@ -4,34 +4,39 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
**** Resetting master and slave ****
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
SHOW BINLOG EVENTS FROM 216;
SHOW BINLOG EVENTS FROM 106;
Log_name #
Pos 216
Pos 106
Event_type Query
Server_id #
End_log_pos 309
End_log_pos 199
Info use `test`; CREATE TABLE t1 (a INT, b INT)
Log_name #
Pos 309
Pos 199
Event_type Query
Server_id #
End_log_pos 415
End_log_pos 305
Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
Log_name #
Pos 415
Pos 305
Event_type Query
Server_id #
End_log_pos 521
End_log_pos 411
Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
Log_name #
Pos 521
Pos 411
Event_type Query
Server_id #
End_log_pos 640
End_log_pos 530
Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
**** On Master ****
SHOW CREATE TABLE t1;
@ -125,9 +130,14 @@ NULL 3 6
NULL 4 2
NULL 5 10
NULL 6 12
**** Resetting master and slave ****
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
ERROR 23000: Duplicate entry '2' for key 'b'
SHOW BINLOG EVENTS FROM 1374;
SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
CREATE TABLE t7 (a INT, b INT UNIQUE);
INSERT INTO t7 SELECT a,b FROM tt3;
@ -137,18 +147,23 @@ a b
1 2
2 4
3 6
SHOW BINLOG EVENTS FROM 1374;
SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
# 1374 Query # 1474 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
# 1474 Query # 1542 use `test`; BEGIN
# 1542 Table_map # 1584 table_id: # (test.t7)
# 1584 Write_rows # 1640 table_id: # flags: STMT_END_F
# 1640 Query # 1711 use `test`; ROLLBACK
# 106 Query # 206 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
# 206 Query # 274 use `test`; BEGIN
# 274 Table_map # 316 table_id: # (test.t7)
# 316 Write_rows # 372 table_id: # flags: STMT_END_F
# 372 Query # 443 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
2 4
3 6
**** Resetting master and slave ****
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
BEGIN;
@ -156,12 +171,12 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SHOW BINLOG EVENTS FROM 1711;
SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
# 1711 Query # 1779 use `test`; BEGIN
# 1779 Table_map # 1821 table_id: # (test.t7)
# 1821 Write_rows # 1877 table_id: # flags: STMT_END_F
# 1877 Query # 1946 use `test`; COMMIT
# 106 Query # 174 use `test`; BEGIN
# 174 Table_map # 216 table_id: # (test.t7)
# 216 Write_rows # 272 table_id: # flags: STMT_END_F
# 272 Query # 343 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@ -178,6 +193,11 @@ a b
4 8
5 10
6 12
**** Resetting master and slave ****
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
CREATE TEMPORARY TABLE tt5 LIKE t4;
@ -196,10 +216,10 @@ Create Table CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW BINLOG EVENTS FROM 1946;
SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
# 1946 Query # 2032 use `test`; CREATE TABLE t8 LIKE t4
# 2032 Query # 2171 use `test`; CREATE TABLE `t9` (
# 106 Query # 192 use `test`; CREATE TABLE t8 LIKE t4
# 192 Query # 331 use `test`; CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
)
@ -276,9 +296,8 @@ a
1
2
3
SHOW BINLOG EVENTS;
SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
# 192 Query # 260 use `test`; BEGIN
# 260 Table_map # 301 table_id: # (test.t1)
@ -308,7 +327,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
# 1329 Query # 1397 use `test`; BEGIN
# 1397 Table_map # 1438 table_id: # (test.t1)
# 1438 Write_rows # 1482 table_id: # flags: STMT_END_F
# 1482 Query # 1551 use `test`; COMMIT
# 1482 Query # 1553 use `test`; ROLLBACK
SHOW TABLES;
Tables_in_test
t1
@ -371,9 +390,8 @@ a
4
6
9
SHOW BINLOG EVENTS;
SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
# 192 Query # 260 use `test`; BEGIN
# 260 Table_map # 301 table_id: # (test.t1)
@ -394,6 +412,11 @@ a
6
9
TRUNCATE TABLE t2;
**** Resetting master and slave ****
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@ -406,14 +429,14 @@ Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * FROM t2 ORDER BY a;
a
SHOW BINLOG EVENTS FROM 949;
SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
# 949 Query # 1017 use `test`; BEGIN
# 1017 Table_map # 1058 table_id: # (test.t2)
# 1058 Write_rows # 1102 table_id: # flags: STMT_END_F
# 1102 Table_map # 1143 table_id: # (test.t2)
# 1143 Write_rows # 1182 table_id: # flags: STMT_END_F
# 1182 Query # 1253 use `test`; ROLLBACK
# 106 Query # 174 use `test`; BEGIN
# 174 Table_map # 215 table_id: # (test.t2)
# 215 Write_rows # 259 table_id: # flags: STMT_END_F
# 259 Table_map # 300 table_id: # (test.t2)
# 300 Write_rows # 339 table_id: # flags: STMT_END_F
# 339 Query # 410 use `test`; ROLLBACK
SELECT * FROM t2 ORDER BY a;
a
DROP TABLE t1,t2;

View File

@ -174,6 +174,7 @@ DROP TRIGGER tr2;
INSERT INTO t1 VALUES (3,'master/slave');
INSERT INTO t2 VALUES (3,'master/slave');
INSERT INTO t3 VALUES (3,'master/slave');
COMMIT;
SELECT * FROM t1 ORDER BY a;
a b
2 master only

View File

@ -975,3 +975,22 @@ a b
2 b
3 c
drop table t1;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 ( f int ) engine = innodb;
create table log ( r int ) engine = myisam;
create trigger tr
after insert on t1
for each row insert into log values ( new.f );
set autocommit = 0;
insert into t1 values ( 1 );
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
Comparing tables master:test.t1 and slave:test.t1
Comparing tables master:test.log and slave:test.log
drop table t1, log;

View File

@ -75,16 +75,25 @@ disconnect master;
connect (master, localhost, root);
connection master;
CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
sync_slave_with_master;
connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
# The slave I/O thread must stop after trying to read the above event
connection slave;
--source include/wait_for_slave_io_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_MYPORT
# import is only the 11th column Slave_IO_Running
--replace_column 1 # 7 # 8 # 9 # 12 # 22 # 23 # 33 #
query_vertical show slave status;
--source include/wait_for_slave_io_to_stop.inc
let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
--echo Slave_IO_Running = $slave_io_running (expect No)
--echo ==== clean up ====
connection master;
DROP TABLE t1;
# slave is stopped
connection slave;
DROP TABLE t1;
# End of tests

View File

@ -29,6 +29,8 @@ SET GLOBAL storage_engine=memory;
START SLAVE;
--enable_query_log
--source include/reset_master_and_slave.inc
connection master;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
@ -36,7 +38,7 @@ CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--query_vertical SHOW BINLOG EVENTS FROM 216
--query_vertical SHOW BINLOG EVENTS FROM 106
--echo **** On Master ****
--query_vertical SHOW CREATE TABLE t1
--query_vertical SHOW CREATE TABLE t2
@ -65,6 +67,8 @@ SELECT * FROM t5 ORDER BY a,b,c;
--query_vertical SHOW CREATE TABLE t6
SELECT * FROM t6 ORDER BY a,b,c;
--source include/reset_master_and_slave.inc
connection master;
# Test for erroneous constructions
--error ER_DUP_ENTRY
@ -72,7 +76,7 @@ CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
# Shouldn't be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS FROM 1374;
SHOW BINLOG EVENTS FROM 106;
# Test that INSERT-SELECT works the same way as for SBR.
CREATE TABLE t7 (a INT, b INT UNIQUE);
@ -82,10 +86,12 @@ SELECT * FROM t7 ORDER BY a,b;
# Should be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS FROM 1374;
SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
--source include/reset_master_and_slave.inc
connection master;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
@ -94,11 +100,13 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS FROM 1711;
SHOW BINLOG EVENTS FROM 106;
SELECT * FROM t7 ORDER BY a,b;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
--source include/reset_master_and_slave.inc
connection master;
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
@ -110,7 +118,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1;
--query_vertical SHOW CREATE TABLE t9
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS FROM 1946;
SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
--echo **** On Slave ****
--query_vertical SHOW CREATE TABLE t8
@ -162,7 +170,7 @@ SELECT * FROM t3 ORDER BY a;
SELECT * FROM t4 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS;
SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SHOW TABLES;
SELECT TABLE_NAME,ENGINE
@ -208,13 +216,17 @@ COMMIT;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS;
SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
connection master;
TRUNCATE TABLE t2;
sync_slave_with_master;
--source include/reset_master_and_slave.inc
connection master;
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@ -227,7 +239,7 @@ ROLLBACK;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS FROM 949;
SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;

View File

@ -121,6 +121,7 @@ DROP TRIGGER tr2;
INSERT INTO t1 VALUES (3,'master/slave');
INSERT INTO t2 VALUES (3,'master/slave');
INSERT INTO t3 VALUES (3,'master/slave');
COMMIT;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;

View File

@ -467,20 +467,48 @@ drop trigger if exists t1_bi;
insert into t1 values (3, "c");
select * from t1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
#
# Bug#40116: Uncommited changes are replicated and stay on slave after
# rollback on master
#
connection master;
source include/master-slave-reset.inc;
source include/have_innodb.inc;
connection slave;
source include/have_innodb.inc;
connection master;
create table t1 ( f int ) engine = innodb;
create table log ( r int ) engine = myisam;
create trigger tr
after insert on t1
for each row insert into log values ( new.f );
set autocommit = 0;
insert into t1 values ( 1 );
rollback;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
--source include/diff_tables.inc
let $diff_table_1=master:test.log;
let $diff_table_2=slave:test.log;
--source include/diff_tables.inc
connection master;
drop table t1, log;
sync_slave_with_master;
#
# End of tests
#
save_master_pos;
connection slave;
sync_with_master;

View File

@ -10,7 +10,7 @@
#
##############################################################################
rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication.
rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication.
rpl_ndb_circular : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
rpl_ndb_circular_simplex : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open

View File

@ -17,14 +17,14 @@
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# Modified: Horst Hunger 2008-11-27 #
# Due to OS depending values the check has been changed #
# from concrete values to ranges. #
# #
# 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 #
# #
###############################################################################
# Changes: #
# 2008-03-06 hhunger Got "lost connections with 5.1.24 #
########################################################################
--source include/load_sysvars.inc
@ -38,8 +38,6 @@
########################################################################
SET @start_value = @@global.key_buffer_size;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_055_01------------------------#'
########################################################################
@ -49,9 +47,7 @@ SELECT @start_value;
SET @@global.key_buffer_size = 99;
--Error ER_NO_DEFAULT
SET @@global.key_buffer_size = DEFAULT;
--echo 'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--echo '#---------------------FN_DYNVARS_055_02-------------------------#'
###############################################
@ -66,26 +62,25 @@ SELECT @@global.key_buffer_size = @start_value;
# Change the value of key_buffer_size to a valid value #
########################################################################
SET @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size= @min_key_buffer_size;
SET @@global.key_buffer_size = 8 ;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--disable_warnings
#Due to "lost connection"
#Due to increasing the runtime significantly and allocating the buffer instantly.
#SET @@global.key_buffer_size = 4294967295;
--enable_warnings
#SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 1800;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--echo '#--------------------FN_DYNVARS_055_04-------------------------#'
###########################################################################
# Change the value of key_buffer_size to invalid value #
###########################################################################
# Due to "lost connection"
# Due to increasing the runtime significantly and allocating the buffer instantly
# with a size of 18446744073709551615 bytes with 32bit exec.
#SET @@global.key_buffer_size = -1;
#SELECT @@global.key_buffer_size;
#SET @@global.key_buffer_size = 100000000000;
@ -96,16 +91,14 @@ SELECT @@global.key_buffer_size;
#SET @@global.key_buffer_size = -1024;
#SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = ON;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = 'test';
SELECT @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--echo '#-------------------FN_DYNVARS_055_05----------------------------#'
###########################################################################
@ -114,8 +107,7 @@ SELECT @@global.key_buffer_size = @min_key_buffer_size;
--Error ER_GLOBAL_VARIABLE
SET @@session.key_buffer_size = 0;
SELECT @@key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--echo '#----------------------FN_DYNVARS_055_06------------------------#'
##############################################################################
@ -130,17 +122,15 @@ SELECT @@key_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='key_buffer_size';
--echo '#---------------------FN_DYNVARS_055_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.key_buffer_size = TRUE;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
SET @@global.key_buffer_size = FALSE;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--echo '#---------------------FN_DYNVARS_055_08----------------------#'
#####################################################################
@ -150,7 +140,7 @@ SELECT @@global.key_buffer_size = @min_key_buffer_size;
# due to differences in contents of the warnings
--disable_warnings
SET @@global.key_buffer_size = @min_key_buffer_size;
SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
--enable_warnings
@ -160,8 +150,8 @@ SELECT @@key_buffer_size = @@global.key_buffer_size;
##########################################################################
--Error ER_GLOBAL_VARIABLE
SET key_buffer_size = @min_key_buffer_size;
SELECT @@key_buffer_size = @min_key_buffer_size;
SET key_buffer_size = 8 ;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--Error ER_PARSE_ERROR
SET local.key_buffer_size = 10;
--Error ER_UNKNOWN_TABLE
@ -179,9 +169,9 @@ SELECT key_buffer_size = @@session.key_buffer_size;
##############################
SET @@global.key_buffer_size = @start_value;
SELECT @@global.key_buffer_size;
--enable_warnings
#######################################################################
# END OF key_buffer_size TESTS #
#######################################################################

View File

@ -17,9 +17,12 @@
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# Modified: Horst Hunger, 2008-11-28 #
# disabled warnings as they contain the values of this variable, #
# modified the check of the value only checking a range. #
# #
# 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 #
# #
###############################################################################
@ -29,7 +32,7 @@
######################################################################
# START OF sort_buffer_size TESTS #
# START OF sort_buffer_size TESTS #
######################################################################
@ -37,65 +40,63 @@
# Save initial value #
#############################################################
# due to difference when running on Windows (bug filed)
# due to differences when running on Windows (bug filed)
--source include/not_windows.inc
SET @start_global_value = @@global.sort_buffer_size;
SELECT @start_global_value;
SET @start_session_value = @@session.sort_buffer_size;
SELECT @start_session_value;
--disable_warnings
SET @start_global_value = @@global.sort_buffer_size;
SET @start_session_value = @@session.sort_buffer_size;
--echo '#--------------------FN_DYNVARS_151_01-------------------------#'
######################################################################
# Display the DEFAULT value of sort_buffer_size #
# Display the DEFAULT value of sort_buffer_size #
######################################################################
SET @@global.sort_buffer_size = 1000;
SET @@global.sort_buffer_size = DEFAULT;
SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
SET @@session.sort_buffer_size = 2000;
SET @@session.sort_buffer_size = DEFAULT;
SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
--echo '#--------------------FN_DYNVARS_151_02-------------------------#'
######################################################################
# Check the DEFAULT value of sort_buffer_size #
# Check the DEFAULT value of sort_buffer_size #
######################################################################
SET @@global.sort_buffer_size = DEFAULT;
SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
SET @@session.sort_buffer_size = DEFAULT;
SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
--echo '#--------------------FN_DYNVARS_151_03-------------------------#'
################################################################################
# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
################################################################################
SET @@global.sort_buffer_size = 32776;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = 32777;
SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
--echo 'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
--echo '#--------------------FN_DYNVARS_151_04-------------------------#'
###################################################################################
# Change the value of sort_buffer_size to a valid value for SESSION Scope #
# Change the value of sort_buffer_size to a valid value for SESSION Scope #
###################################################################################
SET @@session.sort_buffer_size = 32776;
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
SET @@session.sort_buffer_size = 32777;
SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = 4294967294;
@ -104,13 +105,13 @@ SELECT @@session.sort_buffer_size;
--echo '#------------------FN_DYNVARS_151_05-----------------------#'
##################################################################
# Change the value of sort_buffer_size to an invalid value #
# Change the value of sort_buffer_size to an invalid value #
##################################################################
SET @@global.sort_buffer_size = 32775;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = -1024;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
--Error ER_PARSE_ERROR
@ -121,19 +122,16 @@ SET @@global.sort_buffer_size = test;
SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = 32775;
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
SET @@session.sort_buffer_size = -2;
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
--Error ER_PARSE_ERROR
SET @@session.sort_buffer_size = 65530.34.;
SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.sort_buffer_size = test;
SELECT @@session.sort_buffer_size;
--echo '#------------------FN_DYNVARS_151_06-----------------------#'
####################################################################
@ -141,14 +139,16 @@ SELECT @@session.sort_buffer_size;
####################################################################
SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
--echo '#------------------FN_DYNVARS_151_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
--echo '#------------------FN_DYNVARS_151_08-----------------------#'
@ -157,25 +157,22 @@ SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSI
####################################################################
SET @@global.sort_buffer_size = TRUE;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = FALSE;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
echo 'Bug: Errors should be displayed on assigning TRUE/FALSE to variable';
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
--echo '#---------------------FN_DYNVARS_151_09----------------------#'
####################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
SET @@global.sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
--echo '#---------------------FN_DYNVARS_151_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
###################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable#
###################################################################################################
SET @@sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@ -184,12 +181,11 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
--echo '#---------------------FN_DYNVARS_151_11----------------------#'
###################################################################################
# Check if sort_buffer_size can be accessed with and without @@ sign #
# Check if sort_buffer_size can be accessed with and without @@ sign #
###################################################################################
SET sort_buffer_size = 9100;
SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
SELECT @@sort_buffer_size;
SELECT @@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000;
--Error ER_UNKNOWN_TABLE
SELECT local.sort_buffer_size;
--Error ER_UNKNOWN_TABLE
@ -203,11 +199,11 @@ SELECT sort_buffer_size = @@session.sort_buffer_size;
####################################
SET @@global.sort_buffer_size = @start_global_value;
SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = @start_session_value;
SELECT @@session.sort_buffer_size;
--enable_warnings
#############################################################
# END OF sort_buffer_size TESTS #
# END OF sort_buffer_size TESTS #
#############################################################

View File

@ -1,14 +1,10 @@
SET @start_value = @@global.key_buffer_size;
SELECT @start_value;
@start_value
1048576
'#--------------------FN_DYNVARS_055_01------------------------#'
SET @@global.key_buffer_size = 99;
SET @@global.key_buffer_size = DEFAULT;
ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#---------------------FN_DYNVARS_055_02-------------------------#'
SET @@global.key_buffer_size = @start_value;
@ -16,21 +12,20 @@ SELECT @@global.key_buffer_size = @start_value;
@@global.key_buffer_size = @start_value
1
'#--------------------FN_DYNVARS_055_03------------------------#'
SET @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size= @min_key_buffer_size;
@@global.key_buffer_size= @min_key_buffer_size
SET @@global.key_buffer_size = 8 ;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 1800;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1800'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
61440
'Bug # 34837: Errors are not coming on assigning invalid values to variable'
'#--------------------FN_DYNVARS_055_04-------------------------#'
SET @@global.key_buffer_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
@ -40,25 +35,24 @@ SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '4'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.key_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 'test';
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#-------------------FN_DYNVARS_055_05----------------------------#'
SET @@session.key_buffer_size = 0;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@key_buffer_size = @min_key_buffer_size;
@@key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#----------------------FN_DYNVARS_055_06------------------------#'
SELECT @@global.key_buffer_size = VARIABLE_VALUE
@ -75,25 +69,25 @@ WHERE VARIABLE_NAME='key_buffer_size';
SET @@global.key_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = FALSE;
Warnings:
Warning 1438 Cannot drop default keycache
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#---------------------FN_DYNVARS_055_08----------------------#'
SET @@global.key_buffer_size = @min_key_buffer_size;
SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
@@key_buffer_size = @@global.key_buffer_size
1
'#---------------------FN_DYNVARS_055_09----------------------#'
SET key_buffer_size = @min_key_buffer_size;
SET key_buffer_size = 8 ;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@key_buffer_size = @min_key_buffer_size;
@@key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET local.key_buffer_size = 10;
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 'key_buffer_size = 10' at line 1
@ -106,6 +100,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT key_buffer_size = @@session.key_buffer_size;
ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
SET @@global.key_buffer_size = @start_value;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
1048576

View File

@ -1,14 +1,10 @@
SET @start_value = @@global.key_buffer_size;
SELECT @start_value;
@start_value
1048576
'#--------------------FN_DYNVARS_055_01------------------------#'
SET @@global.key_buffer_size = 99;
SET @@global.key_buffer_size = DEFAULT;
ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#---------------------FN_DYNVARS_055_02-------------------------#'
SET @@global.key_buffer_size = @start_value;
@ -16,21 +12,20 @@ SELECT @@global.key_buffer_size = @start_value;
@@global.key_buffer_size = @start_value
1
'#--------------------FN_DYNVARS_055_03------------------------#'
SET @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size= @min_key_buffer_size;
@@global.key_buffer_size= @min_key_buffer_size
SET @@global.key_buffer_size = 8 ;
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 1800;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1800'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
61440
'Bug # 34837: Errors are not coming on assigning invalid values to variable'
'#--------------------FN_DYNVARS_055_04-------------------------#'
SET @@global.key_buffer_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
@ -40,25 +35,24 @@ SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '4'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.key_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 'test';
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#-------------------FN_DYNVARS_055_05----------------------------#'
SET @@session.key_buffer_size = 0;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@key_buffer_size = @min_key_buffer_size;
@@key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#----------------------FN_DYNVARS_055_06------------------------#'
SELECT @@global.key_buffer_size = VARIABLE_VALUE
@ -75,25 +69,25 @@ WHERE VARIABLE_NAME='key_buffer_size';
SET @@global.key_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1'
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = FALSE;
Warnings:
Warning 1438 Cannot drop default keycache
SELECT @@global.key_buffer_size = @min_key_buffer_size;
@@global.key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#---------------------FN_DYNVARS_055_08----------------------#'
SET @@global.key_buffer_size = @min_key_buffer_size;
SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
@@key_buffer_size = @@global.key_buffer_size
1
'#---------------------FN_DYNVARS_055_09----------------------#'
SET key_buffer_size = @min_key_buffer_size;
SET key_buffer_size = 8 ;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@key_buffer_size = @min_key_buffer_size;
@@key_buffer_size = @min_key_buffer_size
SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET local.key_buffer_size = 10;
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 'key_buffer_size = 10' at line 1
@ -106,6 +100,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT key_buffer_size = @@session.key_buffer_size;
ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
SET @@global.key_buffer_size = @start_value;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
1048576

View File

@ -1,47 +1,33 @@
SET @start_global_value = @@global.sort_buffer_size;
SELECT @start_global_value;
@start_global_value
262144
SET @start_session_value = @@session.sort_buffer_size;
SELECT @start_session_value;
@start_session_value
262144
'#--------------------FN_DYNVARS_151_01-------------------------#'
SET @@global.sort_buffer_size = 1000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '1000'
SET @@global.sort_buffer_size = DEFAULT;
SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
@@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000
1
SET @@session.sort_buffer_size = 2000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '2000'
SET @@session.sort_buffer_size = DEFAULT;
SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
@@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000
1
'#--------------------FN_DYNVARS_151_02-------------------------#'
SET @@global.sort_buffer_size = DEFAULT;
SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
@@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000
1
SET @@session.sort_buffer_size = DEFAULT;
SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
@@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000
1
'#--------------------FN_DYNVARS_151_03-------------------------#'
SET @@global.sort_buffer_size = 32776;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 32777;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
@ -51,19 +37,14 @@ SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967294
'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
'#--------------------FN_DYNVARS_151_04-------------------------#'
SET @@session.sort_buffer_size = 32776;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 32777;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@ -75,20 +56,14 @@ SELECT @@session.sort_buffer_size;
4294967294
'#------------------FN_DYNVARS_151_05-----------------------#'
SET @@global.sort_buffer_size = 32775;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '0'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 4294967296;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296'
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
@ -103,64 +78,47 @@ SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
SET @@session.sort_buffer_size = 32775;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '0'
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 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.sort_buffer_size = 4294967296;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296'
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
4294967295
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.sort_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
4294967295
'#------------------FN_DYNVARS_151_06-----------------------#'
SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@global.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_07-----------------------#'
SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@session.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_08-----------------------#'
SET @@global.sort_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '1'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '0'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
'#---------------------FN_DYNVARS_151_09----------------------#'
SET @@global.sort_buffer_size = 9000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
@@sort_buffer_size = @@global.sort_buffer_size
0
'#---------------------FN_DYNVARS_151_10----------------------#'
SET @@sort_buffer_size = 9000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@@sort_buffer_size = @@local.sort_buffer_size
1
@ -169,14 +127,9 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
1
'#---------------------FN_DYNVARS_151_11----------------------#'
SET sort_buffer_size = 9100;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '9100'
SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
SELECT @@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000;
@@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000
1
SELECT @@sort_buffer_size;
@@sort_buffer_size
32804
SELECT local.sort_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.sort_buffer_size;
@ -184,10 +137,4 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT sort_buffer_size = @@session.sort_buffer_size;
ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
SET @@global.sort_buffer_size = @start_global_value;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
262144
SET @@session.sort_buffer_size = @start_session_value;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
262144

View File

@ -1,47 +1,33 @@
SET @start_global_value = @@global.sort_buffer_size;
SELECT @start_global_value;
@start_global_value
262144
SET @start_session_value = @@session.sort_buffer_size;
SELECT @start_session_value;
@start_session_value
262144
'#--------------------FN_DYNVARS_151_01-------------------------#'
SET @@global.sort_buffer_size = 1000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '1000'
SET @@global.sort_buffer_size = DEFAULT;
SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
@@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000
1
SET @@session.sort_buffer_size = 2000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '2000'
SET @@session.sort_buffer_size = DEFAULT;
SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
@@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000
1
'#--------------------FN_DYNVARS_151_02-------------------------#'
SET @@global.sort_buffer_size = DEFAULT;
SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
@@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000
1
SET @@session.sort_buffer_size = DEFAULT;
SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
@@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000
1
'#--------------------FN_DYNVARS_151_03-------------------------#'
SET @@global.sort_buffer_size = 32776;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 32777;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
@ -51,19 +37,14 @@ SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967294
'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
'#--------------------FN_DYNVARS_151_04-------------------------#'
SET @@session.sort_buffer_size = 32776;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 32777;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@ -75,16 +56,12 @@ SELECT @@session.sort_buffer_size;
4294967294
'#------------------FN_DYNVARS_151_05-----------------------#'
SET @@global.sort_buffer_size = 32775;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '0'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
@ -101,16 +78,12 @@ SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967296
SET @@session.sort_buffer_size = 32775;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '0'
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 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
@ -118,45 +91,34 @@ SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
4294967296
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.sort_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
4294967296
'#------------------FN_DYNVARS_151_06-----------------------#'
SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@global.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_07-----------------------#'
SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@session.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_08-----------------------#'
SET @@global.sort_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '1'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '0'
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
'#---------------------FN_DYNVARS_151_09----------------------#'
SET @@global.sort_buffer_size = 9000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
@@sort_buffer_size = @@global.sort_buffer_size
0
'#---------------------FN_DYNVARS_151_10----------------------#'
SET @@sort_buffer_size = 9000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@@sort_buffer_size = @@local.sort_buffer_size
1
@ -165,14 +127,9 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
1
'#---------------------FN_DYNVARS_151_11----------------------#'
SET sort_buffer_size = 9100;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '9100'
SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
SELECT @@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000;
@@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000
1
SELECT @@sort_buffer_size;
@@sort_buffer_size
32804
SELECT local.sort_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.sort_buffer_size;
@ -180,10 +137,4 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT sort_buffer_size = @@session.sort_buffer_size;
ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
SET @@global.sort_buffer_size = @start_global_value;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
262144
SET @@session.sort_buffer_size = @start_session_value;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
262144

View File

@ -1,39 +1,21 @@
SET @start_global_value = @@global.tmp_table_size;
SELECT @start_global_value;
@start_global_value
16777216
SET @start_session_value = @@session.tmp_table_size;
SELECT @start_session_value;
@start_session_value
16777216
'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.tmp_table_size = 100;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '100'
SET @@global.tmp_table_size = DEFAULT;
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
16777216
'Bug# 34876: This variable has invalid default value as compared to documentation';
SET @@session.tmp_table_size = 200;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '200'
SET @@session.tmp_table_size = DEFAULT;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
16777216
'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_02-------------------------#'
SET @@global.tmp_table_size = DEFAULT;
SELECT @@global.tmp_table_size = 33554432;
@@global.tmp_table_size = 33554432
0
SET @@session.tmp_table_size = DEFAULT;
SELECT @@session.tmp_table_size = 33554432;
@@session.tmp_table_size = 33554432
0
'Bug# 34876: This variable has invalid default value as compared to documentation';
SELECT @@global.tmp_table_size >= 16777216;
@@global.tmp_table_size >= 16777216
1
SELECT @@session.tmp_table_size >= 16777216;
@@session.tmp_table_size >= 16777216
1
'#--------------------FN_DYNVARS_005_03-------------------------#'
SET @@global.tmp_table_size = 1024;
SELECT @@global.tmp_table_size;
@ -52,7 +34,7 @@ SET @@session.tmp_table_size = 1024;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
1024
SET @@session.tmp_table_size =4294967295;
SET @@session.tmp_table_size = 4294967295;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
4294967295
@ -79,7 +61,6 @@ Warning 1292 Truncated incorrect tmp_table_size value: '1000'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.tmp_table_size = ON;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size = OFF;
@ -96,7 +77,6 @@ Warning 1292 Truncated incorrect tmp_table_size value: '0'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
SET @@global.tmp_table_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size ="Test";
@ -120,18 +100,18 @@ SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = "Test";
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@session.tmp_table_size = 12345678901;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
4294967295
SELECT @@session.tmp_table_size IN (12345678901,4294967295);
@@session.tmp_table_size IN (12345678901,4294967295)
1
'#------------------FN_DYNVARS_005_06-----------------------#'
SELECT @@global.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
SELECT @@global.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
@@global.tmp_table_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_005_07-----------------------#'
SELECT @@session.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
SELECT @@session.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
@@session.tmp_table_size = VARIABLE_VALUE
1
@ -163,10 +143,4 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT tmp_table_size = @@session.tmp_table_size;
ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
SET @@global.tmp_table_size = @start_global_value;
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
16777216
SET @@session.tmp_table_size = @start_session_value;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
16777216

View File

@ -1,172 +0,0 @@
SET @start_global_value = @@global.tmp_table_size;
SELECT @start_global_value;
@start_global_value
16777216
SET @start_session_value = @@session.tmp_table_size;
SELECT @start_session_value;
@start_session_value
16777216
'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.tmp_table_size = 100;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '100'
SET @@global.tmp_table_size = DEFAULT;
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
16777216
'Bug# 34876: This variable has invalid default value as compared to documentation';
SET @@session.tmp_table_size = 200;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '200'
SET @@session.tmp_table_size = DEFAULT;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
16777216
'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_02-------------------------#'
SET @@global.tmp_table_size = DEFAULT;
SELECT @@global.tmp_table_size = 33554432;
@@global.tmp_table_size = 33554432
0
SET @@session.tmp_table_size = DEFAULT;
SELECT @@session.tmp_table_size = 33554432;
@@session.tmp_table_size = 33554432
0
'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_03-------------------------#'
SET @@global.tmp_table_size = 1024;
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
SET @@global.tmp_table_size = 60020;
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
60020
SET @@global.tmp_table_size = 4294967295;
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
4294967295
'#--------------------FN_DYNVARS_005_04-------------------------#'
SET @@session.tmp_table_size = 1024;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
1024
SET @@session.tmp_table_size =4294967295;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
4294967295
SET @@session.tmp_table_size = 65535;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
65535
'#------------------FN_DYNVARS_005_05-----------------------#'
SET @@global.tmp_table_size = 0;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '0'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
SET @@global.tmp_table_size = -1024;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '0'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
SET @@global.tmp_table_size = 1000;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '1000'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.tmp_table_size = ON;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size = OFF;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size = True;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '1'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
SET @@global.tmp_table_size = False;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '0'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
SET @@global.tmp_table_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size ="Test";
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@session.tmp_table_size = ON;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@session.tmp_table_size = OFF;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@session.tmp_table_size = True;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '1'
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
1024
SET @@session.tmp_table_size = False;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '0'
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
1024
SET @@session.tmp_table_size = "Test";
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@session.tmp_table_size = 12345678901;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
12345678901
'#------------------FN_DYNVARS_005_06-----------------------#'
SELECT @@global.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
@@global.tmp_table_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_005_07-----------------------#'
SELECT @@session.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
@@session.tmp_table_size = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.tmp_table_size = 1024;
SET @@tmp_table_size = 4294967295;
SELECT @@tmp_table_size = @@global.tmp_table_size;
@@tmp_table_size = @@global.tmp_table_size
0
'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@tmp_table_size = 100;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '100'
SELECT @@tmp_table_size = @@local.tmp_table_size;
@@tmp_table_size = @@local.tmp_table_size
1
SELECT @@local.tmp_table_size = @@session.tmp_table_size;
@@local.tmp_table_size = @@session.tmp_table_size
1
'#---------------------FN_DYNVARS_001_11----------------------#'
SET tmp_table_size = 1027;
SELECT @@tmp_table_size;
@@tmp_table_size
1027
SELECT local.tmp_table_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT global.tmp_table_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT tmp_table_size = @@session.tmp_table_size;
ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
SET @@global.tmp_table_size = @start_global_value;
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
16777216
SET @@session.tmp_table_size = @start_session_value;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
16777216

View File

@ -1,27 +1,29 @@
############## mysql-test\t\tmp_table_size_basic.test #########################
# #
# Variable Name: tmp_table_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 33554432 #
# Range: 1024-4294967295 #
# #
# #
# Creation Date: 2008-02-13 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable tmp_table_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_tmp_table_size #
# #
###############################################################################
########################### tmp_table_size_basic.test ##########################
# #
# Variable Name: tmp_table_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: system dependend #
# Range: 1024-system dependend #
# #
# #
# Creation Date: 2008-02-13 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable tmp_table_size #
# that checks the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# Modified: 2008-12-04 HHunger #
# removed the differences between 64 and 32 bit platforms #
# #
# Reference: #
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
################################################################################
--source include/load_sysvars.inc
@ -29,17 +31,12 @@
# START OF tmp_table_size TESTS #
##############################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.tmp_table_size;
SELECT @start_global_value;
SET @start_session_value = @@session.tmp_table_size;
SELECT @start_session_value;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
##############################################################
@ -48,27 +45,19 @@ SELECT @start_session_value;
SET @@global.tmp_table_size = 100;
SET @@global.tmp_table_size = DEFAULT;
SELECT @@global.tmp_table_size;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
SET @@session.tmp_table_size = 200;
SET @@session.tmp_table_size = DEFAULT;
SELECT @@session.tmp_table_size;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
# Check the DEFAULT value of tmp_table_size #
# Check the DEFAULT value of tmp_table_size #
########################################################################
# The DEFAULT value is system dependend.
# Therefore we have only a plausibility check here
SELECT @@global.tmp_table_size >= 16777216;
SET @@global.tmp_table_size = DEFAULT;
SELECT @@global.tmp_table_size = 33554432;
SET @@session.tmp_table_size = DEFAULT;
SELECT @@session.tmp_table_size = 33554432;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
SELECT @@session.tmp_table_size >= 16777216;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
########################################################################
@ -87,11 +76,11 @@ SELECT @@global.tmp_table_size;
#########################################################################
# Change the value of tmp_table_size to a valid value for SESSION Scope #
#########################################################################
SET @@session.tmp_table_size = 1024;
SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size =4294967295;
SET @@session.tmp_table_size = 4294967295;
SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = 65535;
SELECT @@session.tmp_table_size;
@ -111,37 +100,28 @@ SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = 1000;
SELECT @@global.tmp_table_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-- Error ER_WRONG_TYPE_FOR_VAR
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = ON;
-- Error ER_WRONG_TYPE_FOR_VAR
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = OFF;
SET @@global.tmp_table_size = True;
SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = False;
SELECT @@global.tmp_table_size;
--echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-- Error ER_WRONG_TYPE_FOR_VAR
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = 65530.34;
-- Error ER_WRONG_TYPE_FOR_VAR
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size ="Test";
-- Error ER_WRONG_TYPE_FOR_VAR
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = ON;
-- Error ER_WRONG_TYPE_FOR_VAR
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = OFF;
SET @@session.tmp_table_size = True;
@ -150,21 +130,21 @@ SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = False;
SELECT @@session.tmp_table_size;
-- Error ER_WRONG_TYPE_FOR_VAR
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = "Test";
SET @@session.tmp_table_size = 12345678901;
SELECT @@session.tmp_table_size;
# With a 64 bit mysqld:12345678901,with a 32 bit mysqld: 4294967295
SELECT @@session.tmp_table_size IN (12345678901,4294967295);
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
SELECT @@global.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
@ -172,13 +152,10 @@ WHERE VARIABLE_NAME='tmp_table_size';
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
SELECT @@session.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
########################################################################
# Check if global and session variables are independent of each other #
@ -216,16 +193,12 @@ SELECT global.tmp_table_size;
--Error ER_BAD_FIELD_ERROR
SELECT tmp_table_size = @@session.tmp_table_size;
####################################
# Restore initial value #
####################################
SET @@global.tmp_table_size = @start_global_value;
SELECT @@global.tmp_table_size;
SET @@session.tmp_table_size = @start_session_value;
SELECT @@session.tmp_table_size;
###################################################
# END OF tmp_table_size TESTS #

View File

@ -1,9 +0,0 @@
################################################################################
# Created by Horst Hunger 2008-05-07 #
# #
# Wrapper for 32 bit machines #
################################################################################
--source include/have_32bit.inc
--source suite/sys_vars/inc/tmp_table_size_basic.inc

View File

@ -1,9 +0,0 @@
################################################################################
# Created by Horst Hunger 2008-05-07 #
# #
# Wrapper for 64 bit machines #
################################################################################
--source include/have_64bit.inc
--source suite/sys_vars/inc/tmp_table_size_basic.inc

View File

@ -751,6 +751,19 @@ ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4);
SELECT * FROM t1;
DROP TABLE t1;
#
# Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types
#
create table t1 (a tinytext character set latin1);
alter table t1 convert to character set utf8;
show create table t1;
drop table t1;
create table t1 (a mediumtext character set latin1);
alter table t1 convert to character set utf8;
show create table t1;
drop table t1;
--echo End of 5.0 tests
#

View File

@ -1532,5 +1532,11 @@ DROP TABLE t1;
###########################################################################
#
# Bug#40104 regression with table names?
#
create table `me:i`(id int);
drop table `me:i`;
--echo
--echo End of 5.1 tests

View File

@ -1804,4 +1804,17 @@ unlock tables;
drop table t1;
--disconnect con1
#
# Bug#41441 repair csv table crashes debug server
#
# Note: The test should be removed after Bug#33717 is fixed
create table t1(a enum ('a') not null) engine=csv;
insert into t1 values (2);
--error ER_CRASHED_ON_USAGE
select * from t1 limit 1;
repair table t1;
select * from t1 limit 1;
drop table t1;
--echo End of 5.1 tests

View File

@ -697,4 +697,29 @@ set names latin1;
#
select hex(char(0x41 using ucs2));
#
# Bug#37575: UCASE fails on monthname
#
SET character_set_connection=ucs2;
SELECT CHARSET(DAYNAME(19700101));
SELECT CHARSET(MONTHNAME(19700101));
SELECT LOWER(DAYNAME(19700101));
SELECT LOWER(MONTHNAME(19700101));
SELECT UPPER(DAYNAME(19700101));
SELECT UPPER(MONTHNAME(19700101));
SELECT HEX(MONTHNAME(19700101));
SELECT HEX(DAYNAME(19700101));
SET LC_TIME_NAMES=ru_RU;
SET NAMES utf8;
SET character_set_connection=ucs2;
SELECT CHARSET(DAYNAME(19700101));
SELECT CHARSET(MONTHNAME(19700101));
SELECT LOWER(DAYNAME(19700101));
SELECT LOWER(MONTHNAME(19700101));
SELECT UPPER(DAYNAME(19700101));
SELECT UPPER(MONTHNAME(19700101));
SELECT HEX(MONTHNAME(19700101));
SELECT HEX(DAYNAME(19700101));
SET character_set_connection=latin1;
--echo End of 5.0 tests

View File

@ -10,5 +10,7 @@
#
##############################################################################
federated_transactions : Bug#29523 Transactions do not work
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
slow_query_log_func : Bug #37962: *_func tests containing sleeps/race conditions
wait_timeout_func : Bug #41225 joro wait_timeout_func fails
kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
query_cache_28249 : Bug#41098 Query Cache returns wrong result with concurrent insert

View File

@ -58,8 +58,6 @@ 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
@ -85,25 +83,13 @@ let $wait_condition=select count(*) = 0 from information_schema.events
where event_name='event_4' and status='enabled';
--source include/wait_condition.inc
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;
# 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) >= 4, 'OK', 'ERROR') FROM table_2;
let $wait_condition=SELECT SUM(a) >= 1 FROM table_3;
source include/wait_condition.inc;
SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
let $wait_condition=SELECT SUM(a) >= 1 FROM table_4;
source include/wait_condition.inc;
SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4;
#
# On a busy system the scheduler may skip execution of events,
# we can't reliably expect that the data in a table to be modified
# by an event will be exact. Thus we do not SELECT from the tables
# in this test. See also
# Bug#39854 events_scheduling fails sporadically on pushbuild
#
SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS

View File

@ -445,3 +445,12 @@ EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
DROP TABLE t1;
#
# BUG#37245 - Full text search problem
#
CREATE TABLE t1(a CHAR(10));
INSERT INTO t1 VALUES('aaa15');
SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
DROP TABLE t1;

View File

@ -0,0 +1 @@
$SIMPLE_PARSER_OPT

View File

@ -0,0 +1,10 @@
--source include/have_simple_parser.inc
#
# BUG#39746 - Debug flag breaks struct definition (server crash)
#
INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
DROP TABLE t1;
UNINSTALL PLUGIN simple_parser;

View File

@ -150,4 +150,18 @@ FROM t1;
DROP TABLE t1;
#
# Bug #40761: Assert on sum func on IF(..., CAST(longtext AS UNSIGNED), signed)
# (was: LEFT JOIN on inline view crashes server)
#
CREATE TABLE t1 (c LONGTEXT);
INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890');
SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
DROP TABLE t1;
--echo End of 5.0 tests

View File

@ -1263,4 +1263,14 @@ CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
SELECT HEX(c1) from v1;
DROP VIEW v1;
#
# Bug #35558 Wrong server metadata blows up the client
#
create table t1(a float);
insert into t1 values (1.33);
--enable_metadata
select format(a, 2) from t1;
--disable_metadata
drop table t1;
--echo End of 5.0 tests

Some files were not shown because too many files have changed in this diff Show More