Commit ca0e296b authored by Michael Widenius's avatar Michael Widenius

Merge with 5.1-merge (new XTRADB code updated up to MySQL 5.1.47)

Fixed tests cases.
parents 7b4bd6df 09241387
......@@ -108,7 +108,8 @@ static struct my_option my_long_options[]=
NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"charset", 'C', "Charset dir", &charsets_dir, &charsets_dir,
{"charset", 'C', "Charset dir",
(char**) &charsets_dir, (char**) &charsets_dir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"in_file", 'F', "Input file", &TXTFILE, &TXTFILE,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
......
......@@ -49,7 +49,7 @@ static struct my_option my_long_options[] =
{"config-file", 'c', "Deprecated, please use --defaults-file instead. "
"Name of config file to read; if no extension is given, default "
"extension (e.g., .ini or .cnf) will be added",
&config_file, &config_file, 0, GET_STR, REQUIRED_ARG,
(char**) &config_file, (char**) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
......@@ -61,7 +61,7 @@ static struct my_option my_long_options[] =
{"defaults-file", 'c', "Like --config-file, except: if first option, "
"then read this file only, do not read global or per-user config "
"files; should be the first option",
&config_file, &config_file, 0, GET_STR, REQUIRED_ARG,
(char**) &config_file, (char*) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"defaults-extra-file", 'e',
"Read this file after the global config file and before the config "
......@@ -70,7 +70,7 @@ static struct my_option my_long_options[] =
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"defaults-group-suffix", 'g',
"In addition to the given groups, read also groups with this suffix",
&my_defaults_group_suffix, &my_defaults_group_suffix,
(char**) &my_defaults_group_suffix, (char**) &my_defaults_group_suffix,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extra-file", 'e',
"Deprecated. Synonym for --defaults-extra-file.",
......
......@@ -53,6 +53,8 @@ extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1,
extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1,
const MY_BITMAP *map2);
extern uint bitmap_set_next(MY_BITMAP *map);
extern uint bitmap_get_first(const MY_BITMAP *map);
extern uint bitmap_get_first_set(const MY_BITMAP *map);
......
......@@ -104,6 +104,7 @@ TEST_DIRS = t r include std_data std_data/parts collections \
suite/pbxt/t suite/pbxt/r \
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
suite/innodb_plugin suite/innodb_plugin/t suite/innodb_plugin/r suite/innodb_plugin/include \
suite/percona \
suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \
suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \
suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \
......
--source include/percona_query_cache_with_comments_clear.inc
let $query=/* with comment first */select * from t1;
eval $query;
--source include/percona_query_cache_with_comments_eval.inc
let $query=# with comment first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=-- with comment first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=/* with comment first and "quote" */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=# with comment first and "quote"
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=-- with comment first and "quote"
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
/* with comment and whitespaces first */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
# with comment and whitespaces first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
-- with comment and whitespaces first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $internal=* internal comment *;
let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $internal=* internal comment with "quote" *;
let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* comment in the end */;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* *\/ */;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* comment in the end */
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select ' \' ' from t1;
--source include/percona_query_cache_with_comments_eval.inc
-- source include/have_query_cache.inc
set GLOBAL query_cache_size=1355776;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
--source include/percona_query_cache_with_comments_clear.inc
# Reset query cache variables.
flush query cache; # This crashed in some versions
flush query cache; # This crashed in some versions
reset query cache;
flush status;
DROP TABLE t1;
SET GLOBAL query_cache_size=default;
set global query_cache_strip_comments=OFF;
echo -----------------------------------------------------;
echo $query;
echo -----------------------------------------------------;
--source include/percona_query_cache_with_comments_show.inc
eval $query;
eval $query;
--source include/percona_query_cache_with_comments_show.inc
let $show=show status like "Qcache_queries_in_cache";
eval $show;
let $show=show status like "Qcache_inserts";
eval $show;
let $show=show status like "Qcache_hits";
eval $show;
......@@ -130,7 +130,7 @@ my $path_config_file; # The generated config file, var/my.cnf
# executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts,innodb,innodb_plugin";
my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts,innodb,innodb_plugin,percona";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
......
......@@ -98,7 +98,7 @@ XTRADB_ENHANCEMENTS name
INNODB_BUFFER_POOL_PAGES_INDEX schema_name
XTRADB_ADMIN_COMMAND result_message
INNODB_TRX trx_id
INNODB_SYS_TABLES NAME
INNODB_SYS_TABLES SCHEMA
INNODB_LOCK_WAITS requesting_trx_id
INNODB_CMPMEM_RESET page_size
INNODB_LOCKS lock_id
......@@ -159,7 +159,7 @@ XTRADB_ENHANCEMENTS name
INNODB_BUFFER_POOL_PAGES_INDEX schema_name
XTRADB_ADMIN_COMMAND result_message
INNODB_TRX trx_id
INNODB_SYS_TABLES NAME
INNODB_SYS_TABLES SCHEMA
INNODB_LOCK_WAITS requesting_trx_id
INNODB_CMPMEM_RESET page_size
INNODB_LOCKS lock_id
......
This diff is collapsed.
......@@ -691,14 +691,16 @@ count(*)
select count(*) from t1 where sca_pic is null;
count(*)
2
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
alter table t1 drop index sca_pic;
alter table t1 add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
select count(*) from t1 where cat_code='E';
count(*)
0
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
......@@ -1508,7 +1510,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop index id2 on t2;
drop index id on t2;
Got one of the listed errors
ERROR HY000: Cannot drop index 'id': needed in a foreign key constraint
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
......
SET @old_innodb_file_format=@@innodb_file_format;
SET @old_innodb_file_per_table=@@innodb_file_per_table;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON;
DROP TABLE IF EXISTS `test1`;
CREATE TABLE IF NOT EXISTS `test1` (
`a` int primary key auto_increment,
`b` int default 0,
`c` char(100) default 'testtest'
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
set autocommit=0;
CREATE PROCEDURE insert_many(p1 int)
BEGIN
SET @x = 0;
SET @y = 0;
REPEAT
insert into test1 set b=1;
SET @x = @x + 1;
SET @y = @y + 1;
IF @y >= 1000 THEN
commit;
SET @y = 0;
END IF;
UNTIL @x >= p1 END REPEAT;
END|
DROP PROCEDURE insert_many;
ALTER TABLE test1 ENGINE=MyISAM;
DROP TABLE test1;
SET GLOBAL innodb_file_format=@old_innodb_file_format;
SET GLOBAL innodb_file_per_table=@old_innodb_file_per_table;
set global innodb_file_format_check=Antelope;
......@@ -202,7 +202,7 @@ eval kill query $ID;
rollback;
connection con2;
--error 0,ER_QUERY_INTERRUPTED
--error 0,ER_QUERY_INTERRUPTED,ER_LOCK_WAIT_TIMEOUT
reap;
# todo 1,2 above
rollback;
......
......@@ -198,14 +198,15 @@ NULL information_schema INNODB_SYS_INDEXES PAGE_NO 7 0 NO bigint NULL NULL 19 0
NULL information_schema INNODB_SYS_INDEXES SPACE 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_INDEXES TABLE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_INDEXES TYPE 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES CLUSTER_NAME 7 NO varchar 192 576 NULL NULL utf8 utf8_general_ci varchar(192) select
NULL information_schema INNODB_SYS_TABLES ID 2 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES MIX_ID 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES MIX_LEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES NAME 1 NO varchar 192 576 NULL NULL utf8 utf8_general_ci varchar(192) select
NULL information_schema INNODB_SYS_TABLES N_COLS 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES SPACE 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES TYPE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES CLUSTER_NAME 8 NO varchar 192 576 NULL NULL utf8 utf8_general_ci varchar(192) select
NULL information_schema INNODB_SYS_TABLES ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES MIX_ID 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES MIX_LEN 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES NAME 2 NO varchar 192 576 NULL NULL utf8 utf8_general_ci varchar(192) select
NULL information_schema INNODB_SYS_TABLES N_COLS 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES SCHEMA 1 NO varchar 192 576 NULL NULL utf8 utf8_general_ci varchar(192) select
NULL information_schema INNODB_SYS_TABLES SPACE 9 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_SYS_TABLES TYPE 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_TABLE_STATS clust_size 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_TABLE_STATS modified 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema INNODB_TABLE_STATS other_size 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
......@@ -670,6 +671,7 @@ NULL information_schema INNODB_SYS_INDEXES N_FIELDS bigint NULL NULL NULL NULL b
NULL information_schema INNODB_SYS_INDEXES TYPE bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema INNODB_SYS_INDEXES SPACE bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema INNODB_SYS_INDEXES PAGE_NO bigint NULL NULL NULL NULL bigint(21) unsigned
3.0000 information_schema INNODB_SYS_TABLES SCHEMA varchar 192 576 utf8 utf8_general_ci varchar(192)
3.0000 information_schema INNODB_SYS_TABLES NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
NULL information_schema INNODB_SYS_TABLES ID bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema INNODB_SYS_TABLES N_COLS bigint NULL NULL NULL NULL bigint(21) unsigned
......
......@@ -18,6 +18,7 @@
--source include/not_embedded.inc
# This test depends on having the PBXT information_schema stuff.
--source include/have_pbxt.inc
--source include/have_xtradb.inc
let $my_where = WHERE table_schema = 'information_schema'
AND table_name <> 'profiling';
......
......@@ -13,18 +13,18 @@ d1
1
2
INSERT INTO t1 VALUES(null);
Got one of the listed errors
ALTER TABLE t1 AUTO_INCREMENT = 3;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`d1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`d1`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
d1
1
2
3
4
DROP TABLE t1;
......@@ -691,14 +691,16 @@ count(*)
select count(*) from t1 where sca_pic is null;
count(*)
2
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
alter table t1 drop index sca_pic;
alter table t1 add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
select count(*) from t1 where cat_code='E';
count(*)
0
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
......@@ -1357,7 +1359,7 @@ insert t2 select * from t1;
insert t3 select * from t1;
checksum table t1, t2, t3, t4 quick;
Table Checksum
test.t1 2948697075
test.t1 3442722830
test.t2 NULL
test.t3 NULL
test.t4 NULL
......@@ -1365,17 +1367,17 @@ Warnings:
Error 1146 Table 'test.t4' doesn't exist
checksum table t1, t2, t3, t4;
Table Checksum
test.t1 2948697075
test.t2 2948697075
test.t3 2948697075
test.t1 3442722830
test.t2 3442722830
test.t3 3442722830
test.t4 NULL
Warnings:
Error 1146 Table 'test.t4' doesn't exist
checksum table t1, t2, t3, t4 extended;
Table Checksum
test.t1 2948697075
test.t2 2948697075
test.t3 2948697075
test.t1 3442722830
test.t2 3442722830
test.t3 3442722830
test.t4 NULL
Warnings:
Error 1146 Table 'test.t4' doesn't exist
......@@ -1432,7 +1434,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop index id2 on t2;
drop index id on t2;
Got one of the listed errors
ERROR HY000: Cannot drop index 'id': needed in a foreign key constraint
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
......@@ -1662,7 +1664,7 @@ count(*)
drop table t1;
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value
512
8191
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
16384
......@@ -1690,9 +1692,10 @@ variable_value - @innodb_row_lock_time_max_orig
SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
variable_value - @innodb_row_lock_time_avg_orig
0
SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
innodb_sync_spin_loops 30
set global innodb_sync_spin_loops=1000;
show variables like "innodb_sync_spin_loops";
Variable_name Value
......@@ -1705,10 +1708,11 @@ set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 8
innodb_thread_concurrency 0
set global innodb_thread_concurrency=1001;
Warnings:
Warning 1292 Truncated incorrect thread_concurrency value: '1001'
......@@ -2301,6 +2305,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1 (v varchar(10), c char(10)) row_format=fixed;
Warnings:
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
......
......@@ -25,8 +25,8 @@ ALTER TABLE t1 CHANGE a c INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t1 CHANGE b c INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
affected rows: 3
info: Records: 3 Duplicates: 0 Warnings: 0
# Test renaming the column in the referencing table
......@@ -34,8 +34,8 @@ ALTER TABLE t2 CHANGE a c INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t2 CHANGE b c INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
affected rows: 3
info: Records: 3 Duplicates: 0 Warnings: 0
# Test with self-referential constraints
......@@ -45,8 +45,8 @@ ALTER TABLE t3 CHANGE b d INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t3 CHANGE c d INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
affected rows: 3
info: Records: 3 Duplicates: 0 Warnings: 0
# Cleanup.
......
......@@ -763,6 +763,7 @@ t1 CREATE TABLE `t1` (
CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
SET SESSION innodb_strict_mode = on;
CREATE TABLE t1 (
c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
......
......@@ -10,9 +10,5 @@
#
##############################################################################
innodb : Bug#53306 2010-04-30 VasilDimov valgrind warnings
innodb_bug52663 : Waiting for merge with XtraDB
innodb_bug51920 : Waiting for merge with XtraDB
innodb_bug48024 : Waiting for merge with XtraDB
innodb_bug49164 : Waiting for merge with XtraDB
innodb_bug54044 : Waiting for merge with XtraDB
#innodb : Bug#53306 2010-04-30 VasilDimov valgrind warnings
innodb_bug48024 : Waiting for merge with Percona Server; bug fixed in innodb_plugin in MySQL 5.1.48
......@@ -27,7 +27,7 @@ SELECT * FROM t1;
# longer results in the two data dictionaries being out of sync. If they
# revert their changes then this check for ER_AUTOINC_READ_FAILED will need
# to be enabled. Also, see http://bugs.mysql.com/bug.php?id=47621.
-- error ER_AUTOINC_READ_FAILED,1467
# -- error ER_AUTOINC_READ_FAILED,1467
INSERT INTO t1 VALUES(null);
ALTER TABLE t1 AUTO_INCREMENT = 3;
SHOW CREATE TABLE t1;
......
......@@ -427,11 +427,13 @@ INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca
select count(*) from t1 where sca_code = 'PD';
select count(*) from t1 where sca_code <= 'PD';
select count(*) from t1 where sca_pic is null;
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
alter table t1 drop index sca_pic;
alter table t1 add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where cat_code='E';
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where sca_pic >= 'n';
select sca_pic from t1 where sca_pic is null;
......@@ -1124,7 +1126,7 @@ show create table t2;
create index id2 on t2 (id);
show create table t2;
drop index id2 on t2;
--error 1025,1025
--error ER_DROP_INDEX_FK
drop index id on t2;
show create table t2;
drop table t2;
......@@ -1292,6 +1294,7 @@ drop table t1;
# Test for testable InnoDB status variables. This test
# uses previous ones(pages_created, rows_deleted, ...).
--replace_result 8192 8191
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
......@@ -1306,6 +1309,7 @@ SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.g
SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
# Test for innodb_sync_spin_loops variable
SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
show variables like "innodb_sync_spin_loops";
set global innodb_sync_spin_loops=1000;
show variables like "innodb_sync_spin_loops";
......@@ -1313,6 +1317,7 @@ set global innodb_sync_spin_loops=0;
show variables like "innodb_sync_spin_loops";
set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops";
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
# Test for innodb_thread_concurrency variable
SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
......
......@@ -1021,6 +1021,8 @@ DROP TABLE t1,t2;
#
# Bug #21101 (Prints wrong error message if max row size is too large)
#
#from innodb-1.0.8, any size is passed without innodb_strict_mode.
SET SESSION innodb_strict_mode = on;
--error 1118
CREATE TABLE t1 (
c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
......
drop table if exists t1;
drop database if exists mysqltest;
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
alter table t1 add unique index (b), add unique index (c), add unique index (d);
ERROR 23000: Duplicate entry '4' for key 'b'
alter table t1 add unique index (c), add unique index (b), add index (d);
ERROR 23000: Duplicate entry 'ac' for key 'c'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
`c` char(10) DEFAULT NULL,
`d` varchar(20) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
drop table if exists t1;
drop database if exists mysqltest;
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
alter table t1 add unique index (b), add unique index (c), add unique index (d);
ERROR 23000: Duplicate entry 'ac' for key 'c'
alter table t1 add unique index (c), add unique index (b), add index (d);
ERROR 23000: Duplicate entry 'ac' for key 'c'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
`c` char(10) DEFAULT NULL,
`d` varchar(20) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
......@@ -440,6 +440,8 @@ t3 CREATE TABLE `t3` (
PRIMARY KEY (`a`),
KEY `c` (`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table t2 drop index b, add index (b);
ERROR 42000: Incorrect index name 'b'
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
......@@ -623,6 +625,22 @@ t1 CREATE TABLE `t1` (
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
alter table t1 add unique index (b), add unique index (c), add unique index (d);
ERROR 23000: Duplicate entry '4' for key 'b'
alter table t1 add unique index (c), add unique index (b), add index (d);
ERROR 23000: Duplicate entry 'ac' for key 'c'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
`c` char(10) DEFAULT NULL,
`d` varchar(20) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1(a int not null, b int not null, c int, primary key (a), key(c)) engine=innodb;
insert into t1 values (5,1,5),(4,2,4),(3,3,3),(2,4,2),(1,5,1);
alter table t1 add unique index (b);
......
drop table if exists t1;
drop database if exists mysqltest;
CREATE TABLE t1 (
sca_code char(6) NOT NULL,
cat_code char(6) NOT NULL,
sca_desc varchar(50),
lan_code char(2) NOT NULL,
sca_pic varchar(100),
sca_sdesc varchar(50),
sca_sch_desc varchar(16),
PRIMARY KEY (sca_code, cat_code, lan_code),
INDEX sca_pic (sca_pic)
) engine = innodb ;
INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
ERROR 42000: Incorrect index name 'sca_pic'
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
select count(*) from t1 where sca_pic >= 'n';
count(*)
1
select sca_pic from t1 where sca_pic is null;
sca_pic
NULL
NULL
update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
drop table t1;
drop table if exists t1;
drop database if exists mysqltest;
CREATE TABLE t1 (
sca_code char(6) NOT NULL,
cat_code char(6) NOT NULL,
sca_desc varchar(50),
lan_code char(2) NOT NULL,
sca_pic varchar(100),
sca_sdesc varchar(50),
sca_sch_desc varchar(16),
PRIMARY KEY (sca_code, cat_code, lan_code),
INDEX sca_pic (sca_pic)
) engine = innodb ;
INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
select count(*) from t1 where sca_pic >= 'n';
count(*)
1
select sca_pic from t1 where sca_pic is null;
sca_pic
NULL
NULL
update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
drop table t1;
......@@ -700,6 +700,22 @@ count(*)
select count(*) from t1 where cat_code='E';
count(*)
0
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
ERROR 42000: Incorrect index name 'sca_pic'
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
select count(*) from t1 where sca_pic >= 'n';
count(*)
1
select sca_pic from t1 where sca_pic is null;
sca_pic
NULL
NULL
update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
drop table t1;
set @a:=now();
CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb;
......@@ -1657,13 +1673,13 @@ variable_value
16384
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
variable_value - @innodb_rows_deleted_orig
70
71
SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
variable_value - @innodb_rows_inserted_orig
1063
1066
SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
variable_value - @innodb_rows_updated_orig
863
865
SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
variable_value - @innodb_row_lock_waits_orig
0
......
#
# Bug#21704: Renaming column does not update FK definition.
#
# Test that it's not possible to rename columns participating in a
# foreign key (either in the referencing or referenced table).
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ROW_FORMAT=COMPACT ENGINE=INNODB;
CREATE TABLE t2 (a INT PRIMARY KEY, b INT,
CONSTRAINT fk1 FOREIGN KEY (a) REFERENCES t1(a))
ROW_FORMAT=COMPACT ENGINE=INNODB;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT, KEY(b), C INT,
CONSTRAINT fk2 FOREIGN KEY (b) REFERENCES t3 (a))
ROW_FORMAT=COMPACT ENGINE=INNODB;
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
INSERT INTO t2 VALUES (1,1),(2,2),(3,3);
INSERT INTO t3 VALUES (1,1,1),(2,2,2),(3,3,3);
# Test renaming the column in the referenced table.
ALTER TABLE t1 CHANGE a c INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t1 CHANGE b c INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
# Test renaming the column in the referencing table
ALTER TABLE t2 CHANGE a c INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t2 CHANGE b c INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
# Test with self-referential constraints
ALTER TABLE t3 CHANGE a d INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150)
ALTER TABLE t3 CHANGE b d INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t3 CHANGE c d INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
# Cleanup.
DROP TABLE t3;
DROP TABLE t2;
DROP TABLE t1;
......@@ -36,7 +36,7 @@ a b c
commit;
select * from bug49164;
a b c
1 1 1
1 1 6
2 2 2
3 3 3
drop table bug49164;
......@@ -10,13 +10,10 @@
#
##############################################################################
innodb_bug48024 : Waiting for merge/fix from XtraDB
innodb_bug53590 : Waiting for merge/fix from XtraDB
innodb_bug53591 : Waiting for merge/fix from XtraDB
innodb_bug53592 : Waiting for merge/fix from XtraDB
innodb-use-sys-malloc : Waiting for bugfix from Percona for LP#612600
innodb_plugin.innodb-autoinc-44030 : Waiting for merge with XtraDB
innodb_bug48024 : Waiting for merge with XtraDB
innodb_bug49164 : Waiting for merge with XtraDB
innodb_bug51378 : Waiting for merge with XtraDB
innodb_bug51920 : Waiting for merge with XtraDB
innodb_bug52663 : Waiting for merge with XtraDB
innodb_bug54044 : Waiting for merge with XtraDB
innodb_bug52745 : Waiting for merge with XtraDB
innodb_bug54679 : Waiting for merge with XtraDB
innodb_bug53290 : Waiting for merge/fix from XtraDB
innodb_bug54679 : Waiting for merge/fix from XtraDB
#
# Tests from innodb.test that has different results for innodb_plugin & xtradb.
-- source include/have_real_innodb_plugin.inc
--disable_warnings
drop table if exists t1;
drop database if exists mysqltest;
--enable_warnings
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
--error ER_DUP_ENTRY
alter table t1 add unique index (b), add unique index (c), add unique index (d);
--error ER_DUP_ENTRY
alter table t1 add unique index (c), add unique index (b), add index (d);
show create table t1;
drop table t1;
#
# Tests from innodb.test that has different results for innodb_plugin & xtradb.
-- source include/have_xtradb.inc
--disable_warnings
drop table if exists t1;
drop database if exists mysqltest;
--enable_warnings
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
--error ER_DUP_ENTRY
alter table t1 add unique index (b), add unique index (c), add unique index (d);
--error ER_DUP_ENTRY
alter table t1 add unique index (c), add unique index (b), add index (d);
show create table t1;
drop table t1;
......@@ -141,6 +141,9 @@ show create table t4;
--error ER_CANT_CREATE_TABLE
alter table t3 add constraint dc foreign key (a) references t1(a);
show create table t3;
# this should be fixed by MySQL (see Bug #51451)
--error ER_WRONG_NAME_FOR_INDEX
alter table t2 drop index b, add index (b);
show create table t2;
--error ER_ROW_IS_REFERENCED_2
delete from t1;
......@@ -183,6 +186,15 @@ alter table t1 add index (b);
show create table t1;
drop table t1;
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
--error ER_DUP_ENTRY
alter table t1 add unique index (b), add unique index (c), add unique index (d);
--error ER_DUP_ENTRY
alter table t1 add unique index (c), add unique index (b), add index (d);
show create table t1;
drop table t1;
create table t1(a int not null, b int not null, c int, primary key (a), key(c)) engine=innodb;
insert into t1 values (5,1,5),(4,2,4),(3,3,3),(2,4,2),(1,5,1);
alter table t1 add unique index (b);
......
#
# Tests from innodb.test that has different results for innodb_plugin.
-- source include/have_real_innodb_plugin.inc
--disable_warnings
drop table if exists t1;
drop database if exists mysqltest;
--enable_warnings
CREATE TABLE t1 (
sca_code char(6) NOT NULL,
cat_code char(6) NOT NULL,
sca_desc varchar(50),
lan_code char(2) NOT NULL,
sca_pic varchar(100),
sca_sdesc varchar(50),
sca_sch_desc varchar(16),
PRIMARY KEY (sca_code, cat_code, lan_code),
INDEX sca_pic (sca_pic)
) engine = innodb ;
INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
# this should be fixed by MySQL (see Bug #51451)
--error ER_WRONG_NAME_FOR_INDEX
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where sca_pic >= 'n';
select sca_pic from t1 where sca_pic is null;
update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
drop table t1;
#
# Tests from innodb.test that has different results for innodb_plugin.
-- source include/have_xtradb.inc
--disable_warnings
drop table if exists t1;
drop database if exists mysqltest;
--enable_warnings
CREATE TABLE t1 (
sca_code char(6) NOT NULL,
cat_code char(6) NOT NULL,
sca_desc varchar(50),
lan_code char(2) NOT NULL,
sca_pic varchar(100),
sca_sdesc varchar(50),
sca_sch_desc varchar(16),
PRIMARY KEY (sca_code, cat_code, lan_code),
INDEX sca_pic (sca_pic)
) engine = innodb ;
INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
# this should be fixed by MySQL (see Bug #51451)
#--error ER_WRONG_NAME_FOR_INDEX
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where sca_pic >= 'n';
select sca_pic from t1 where sca_pic is null;
update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
drop table t1;
......@@ -439,6 +439,16 @@ alter table t1 add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where cat_code='E';
# this should be fixed by MySQL (see Bug #51451)
--error ER_WRONG_NAME_FOR_INDEX
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
alter table t1 drop index sca_pic;
alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where sca_pic >= 'n';
select sca_pic from t1 where sca_pic is null;
update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
drop table t1;
#
......
-- source include/have_xtradb.inc
--echo #
--echo # Bug#21704: Renaming column does not update FK definition.
--echo #
--echo
--echo # Test that it's not possible to rename columns participating in a
--echo # foreign key (either in the referencing or referenced table).
--echo
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
--enable_warnings
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ROW_FORMAT=COMPACT ENGINE=INNODB;
CREATE TABLE t2 (a INT PRIMARY KEY, b INT,
CONSTRAINT fk1 FOREIGN KEY (a) REFERENCES t1(a))
ROW_FORMAT=COMPACT ENGINE=INNODB;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT, KEY(b), C INT,
CONSTRAINT fk2 FOREIGN KEY (b) REFERENCES t3 (a))
ROW_FORMAT=COMPACT ENGINE=INNODB;
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
INSERT INTO t2 VALUES (1,1),(2,2),(3,3);
INSERT INTO t3 VALUES (1,1,1),(2,2,2),(3,3,3);
--echo
--echo # Test renaming the column in the referenced table.
--echo
# mysqltest first does replace_regex, then replace_result
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error ER_ERROR_ON_RENAME
ALTER TABLE t1 CHANGE a c INT;
--echo # Ensure that online column rename works.
--enable_info
ALTER TABLE t1 CHANGE b c INT;
--disable_info
--echo
--echo # Test renaming the column in the referencing table
--echo
# mysqltest first does replace_regex, then replace_result
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error ER_ERROR_ON_RENAME
ALTER TABLE t2 CHANGE a c INT;
--echo # Ensure that online column rename works.
--enable_info
ALTER TABLE t2 CHANGE b c INT;
--disable_info
--echo
--echo # Test with self-referential constraints
--echo
# mysqltest first does replace_regex, then replace_result
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error ER_ERROR_ON_RENAME
ALTER TABLE t3 CHANGE a d INT;
# mysqltest first does replace_regex, then replace_result
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--error ER_ERROR_ON_RENAME
ALTER TABLE t3 CHANGE b d INT;
--echo # Ensure that online column rename works.
--enable_info
ALTER TABLE t3 CHANGE c d INT;
--disable_info
--echo
--echo # Cleanup.
--echo
DROP TABLE t3;
DROP TABLE t2;
DROP TABLE t1;
-- source include/have_real_innodb_plugin.inc
-- source include/have_innodb_plugin.inc
--echo #
--echo # Bug#21704: Renaming column does not update FK definition.
......
#
# XtraDB doesn't have this problem
#
-- source include/have_real_innodb_plugin.inc
-- source include/have_innodb_plugin.inc
let $file_format=`select @@innodb_file_format`;
let $file_format_check=`select @@innodb_file_format_check`;
......
percona_suppress_log_warning_1592: Feature not merged into MariaDB
percona_log_slow_slave_statements: Feature not merged into MariaDB
percona_log_slow_slave_statements-and-use_global_long_query_time: Feature not merged into MariaDB
percona_slow_query_log-control_global_slow: Feature not merged into MariaDB
percona_slow_query_log-microseconds_in_slow_query_log: Feature not merged into MariaDB
percona_query_cache_with_comments: Feature not merged into MariaDB
percona_query_cache_with_comments_prepared_statements: Feature not merged into MariaDB
percona_show_temp_tables: Feature not merged into MariaDB
percona_slow_query_log-use_global_long_query_time: Feature not merged into MariaDB
percona_query_cache_with_comments_disable: Feature not merged into MariaDB
percona_slow_query_log-log_slow_verbosity: InnoDB filtering information not fully merged into MariaDB
# Establish connection con1 (user=root)
# Establish connection con2 (user=root)
# Establish connection con3 (user=root)
# Drop test table
drop table if exists t;
# Create test table
create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
# Insert two rows to test table
insert into t values(2,1);
insert into t values(1,2);
# Switch to connection con1
BEGIN;
SELECT b FROM t WHERE a=1 FOR UPDATE;
b
2
# Switch to connection con2
BEGIN;
SELECT b FROM t WHERE a=2 FOR UPDATE;
b
1
# Switch to connection con1
SELECT b FROM t WHERE a=2 FOR UPDATE;
# Switch to connection con2
SELECT b FROM t WHERE a=1 FOR UPDATE;
# Switch to connection con3
1
# Drop test table
drop table t;
--source include/have_innodb.inc
--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
--echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--echo # Establish connection con3 (user=root)
connect (con3,localhost,root,,);
--echo # Drop test table
--disable_warnings
drop table if exists t;
--enable_warnings
disable_abort_on_error;
--echo # Create test table
create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
--echo # Insert two rows to test table
insert into t values(2,1);
insert into t values(1,2);
#--echo # Save current deadlock count
let $current = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
--echo # Switch to connection con1
connection con1;
BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE;
#show engine innodb status;
--echo # Switch to connection con2
connection con2;
BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE;
--echo # Switch to connection con1
connection con1;
SEND SELECT b FROM t WHERE a=2 FOR UPDATE;
--echo # Switch to connection con2
connection con2;
SEND SELECT b FROM t WHERE a=1 FOR UPDATE;
SLEEP 0.2;
--echo # Switch to connection con3
connection con3;
let $result = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
let $diff = `SELECT $result - $current`;
echo $diff;
--echo # Drop test table
drop table t;
show variables like 'innodb_doublewrite%';
Variable_name Value
innodb_doublewrite ON
innodb_doublewrite_file ib_doublewrite
--source include/have_innodb.inc
show variables like 'innodb_doublewrite%';
--slow-query-log-file=percona_log_slow_slave_statements-master.log --long-query-time=1
\ No newline at end of file
--slow-query-log-file=percona_log_slow_slave_statements-slave.log --long-query-time=1
\ No newline at end of file
# Activate master-slave replication
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;
# Make table t for test
DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT);
# Start slave replication
START SLAVE;
INSERT INTO t VALUES (1);
# Read information about master binlog
# Sync(1) slave thread
# Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements OFF
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements ON
INSERT INTO t VALUES (2);
# Read information about master binlog
# Sync slave(2) thread
# Restart slave
STOP SLAVE;
START SLAVE;
INSERT INTO t VALUES (3);
# Read information about master binlog
# Sync(3) slave thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time OFF
set global long_query_time=0;
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time OFF
INSERT INTO t VALUES (4);
# Read information about master binlog
# Sync slave(4) thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time OFF
set global use_global_long_query_time=1;
show variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time ON
INSERT INTO t VALUES (5);
# Read information about master binlog
# Sync slave(5) thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time ON
set global long_query_time=1;
set global use_global_long_query_time=0;
# Analyse master slow_query_log
0
0
0
0
0
# Analyse slave slow_query_log
0
0
0
0
1
set global log_slow_slave_statements=OFF;
DROP TABLE t;
# Read information about master binlog
# Sync slave(6) thread
-- echo # Activate master-slave replication
-- source include/master-slave.inc
connection master;
-- echo # Make table t for test
-- disable_warnings
DROP TABLE IF EXISTS t;
-- enable_warnings
CREATE TABLE t(id INT);
-- echo # Start slave replication
-- disable_warnings
connection slave;
START SLAVE;
-- source include/wait_for_slave_to_start.inc
-- enable_warnings
#-- echo # Make insert(1) on master
connection master;
INSERT INTO t VALUES (1);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync(1) slave thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
#-- echo # Make insert(2) on master
connection master;
INSERT INTO t VALUES (2);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(2) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Restart slave
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
START SLAVE;
-- source include/wait_for_slave_to_start.inc
#-- echo # Make insert(3) on master
connection master;
INSERT INTO t VALUES (3);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync(3) slave thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
set global long_query_time=0;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
#-- echo # Make insert(4) on master
connection master;
INSERT INTO t VALUES (4);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(4) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
set global use_global_long_query_time=1;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
#-- echo # Make insert(5) on master
connection master;
let $MASTER_DATADIR= `select @@datadir`;
INSERT INTO t VALUES (5);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(5) thread
connection slave;
let $SLAVE_DATADIR= `select @@datadir`;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
set global long_query_time=1;
set global use_global_long_query_time=0;
-- echo # Analyse master slow_query_log
let $i=5;
let $k=1;
let $cmd=cat ./$MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
exec $current_cmd;
dec $i;
inc $k;
}
-- echo # Analyse slave slow_query_log
let $i=5;
let $k=1;
let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
exec $current_cmd;
dec $i;
inc $k;
}
set global log_slow_slave_statements=OFF;
connection master;
DROP TABLE t;
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(6) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
--slow-query-log-file=percona_log_slow_slave_statements-master.log --long-query-time=0
\ No newline at end of file
--slow-query-log-file=percona_log_slow_slave_statements-slave.log --long-query-time=0
\ No newline at end of file
# Activate master-slave replication
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;
# Make table t for test
DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT);
# Start slave replication
START SLAVE;
INSERT INTO t VALUES (1);
# Read information about master binlog
# Sync(1) slave thread
# Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements OFF
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements ON
INSERT INTO t VALUES (2);
# Read information about master binlog
# Sync slave(2) thread
# Restart slave
STOP SLAVE;
START SLAVE;
INSERT INTO t VALUES (3);
# Read information about master binlog
# Sync(3) slave thread
# Read and change log_slow_slave_statements to OFF on slave
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements ON
set global log_slow_slave_statements=OFF;
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements OFF
INSERT INTO t VALUES (4);
# Read information about master binlog
# Sync slave(4) thread
# Restart slave
STOP SLAVE;
START SLAVE;
INSERT INTO t VALUES (5);
# Read information about master binlog
# Sync slave(5) thread
# Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements OFF
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements ON
INSERT INTO t VALUES (6);
# Read information about master binlog
# Sync slave(6) thread
# Restart slave
STOP SLAVE;
START SLAVE;
INSERT INTO t VALUES (7);
# Read information about master binlog
# Sync slave(7) thread
# Analyse master slow_query_log
1
1
1
1
1
1
1
# Analyse slave slow_query_log
0
0
1
0
0
0
1
set global log_slow_slave_statements=OFF;
DROP TABLE t;
# Read information about master binlog
# Sync slave(8) thread
-- echo # Activate master-slave replication
-- source include/master-slave.inc
connection master;
-- echo # Make table t for test
-- disable_warnings
DROP TABLE IF EXISTS t;
-- enable_warnings
CREATE TABLE t(id INT);
-- echo # Start slave replication
-- disable_warnings
connection slave;
START SLAVE;
-- source include/wait_for_slave_to_start.inc
-- enable_warnings
#-- echo # Make insert(1) on master
connection master;
INSERT INTO t VALUES (1);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync(1) slave thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
#-- echo # Make insert(2) on master
connection master;
INSERT INTO t VALUES (2);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(2) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Restart slave
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
START SLAVE;
-- source include/wait_for_slave_to_start.inc
#-- echo # Make insert(3) on master
connection master;
INSERT INTO t VALUES (3);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync(3) slave thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Read and change log_slow_slave_statements to OFF on slave
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=OFF;
show variables like 'log_slow_slave_statements';
#-- echo # Make insert(4) on master
connection master;
INSERT INTO t VALUES (4);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(4) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Restart slave
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
START SLAVE;
-- source include/wait_for_slave_to_start.inc
#-- echo # Make insert(5) on master
connection master;
INSERT INTO t VALUES (5);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(5) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
#-- echo # Make insert(6) on master
connection master;
INSERT INTO t VALUES (6);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(6) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Restart slave
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
START SLAVE;
-- source include/wait_for_slave_to_start.inc
#-- echo # Make insert(7) on master
connection master;
let $MASTER_DATADIR= `select @@datadir`;
INSERT INTO t VALUES (7);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(7) thread
connection slave;
let $SLAVE_DATADIR= `select @@datadir`;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Analyse master slow_query_log
let $i=7;
let $k=1;
let $cmd=cat $MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep -c;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
exec $current_cmd;
dec $i;
inc $k;
}
-- echo # Analyse slave slow_query_log
let $i=7;
let $k=1;
let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep -c;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
exec $current_cmd;
dec $i;
inc $k;
}
set global log_slow_slave_statements=OFF;
connection master;
DROP TABLE t;
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(8) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
--source include/percona_query_cache_with_comments_clear.inc
let $query=/* with comment first */select * from t1;
eval $query;
--source include/percona_query_cache_with_comments_eval.inc
let $query=# with comment first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=-- with comment first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=/* with comment first and "quote" */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=# with comment first and "quote"
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=-- with comment first and "quote"
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
/* with comment and whitespaces first */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
# with comment and whitespaces first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
-- with comment and whitespaces first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $internal=* internal comment *;
let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $internal=* internal comment with "quote" *;
let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* comment in the end */;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* comment in the end */
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end
;
--source include/percona_query_cache_with_comments_eval.inc
set global query_cache_strip_comments=ON;
-- source include/percona_query_cache_with_comments_begin.inc
-- source include/percona_query_cache_with_comments.inc
-- source include/percona_query_cache_with_comments_end.inc
set GLOBAL query_cache_size=1355776;
drop table if exists t1;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
flush query cache;
flush query cache;
reset query cache;
flush status;
( select * from t1 );
a
1
2
3
/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := REPLACE(REPLACE(@@SQL_MODE, 'ANSI_QUOTES', ''), ',,', ','), @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
/* only comment */;
# only comment
;
-- only comment
;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
-- source include/have_query_cache.inc
set GLOBAL query_cache_size=1355776;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
flush query cache; # This crashed in some versions
flush query cache; # This crashed in some versions
reset query cache;
flush status;
( select * from t1 );
/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := REPLACE(REPLACE(@@SQL_MODE, 'ANSI_QUOTES', ''), ',,', ','), @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
/* only comment */;
let query=# only comment
;
eval $query;
let query=-- only comment
;
eval $query;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
-- source include/percona_query_cache_with_comments_begin.inc
-- source include/percona_query_cache_with_comments.inc
-- source include/percona_query_cache_with_comments_end.inc
-- source include/have_query_cache.inc
set GLOBAL query_cache_size=1355776;
# Reset query cache variables.
flush query cache; # This crashed in some versions
flush query cache; # This crashed in some versions
reset query cache;
flush status;
--disable_warnings
drop table if exists t1;
--enable_warnings
#
# First simple test
#
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
set global query_cache_strip_comments=ON;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '/* with comment */ select * from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
execute stmt;
execute stmt;
execute stmt;
execute stmt;
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * /*internal comment*/from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * /*internal comment*/ from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 /* at the end */';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 /* with "quote" */';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 /* with \'quote\' */';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 # 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 # 123 with "quote"
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 # 123 with \'quote\'
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1
# 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '#456
select * from t1
# 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 -- 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1
-- 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '-- comment in first
select * from t1
# 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '(#456(
select * from t1
# 123(
)';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '/*test*/(-- comment in first(
select * from t1
-- 123 asdasd
/* test */)';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select "test",a from t1';
execute stmt;
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select "test /* internal \'comment\' */",a from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select "test #internal comment" ,a from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select "test #internal comment" #external comment
,a from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
set global query_cache_strip_comments=OFF;
drop table if exists t1,t2,t3;
drop database if exists showtemp;
create database if not exists showtemp;
use test;
create temporary table t1(id int);
create temporary table t2(id int);
create temporary table showtemp.t3(id int);
insert into t1 values(10),(20),(30),(40);
insert into showtemp.t3 values(999);
show temporary tables;
Temp_tables_in_test
t2
t1
show temporary tables from test;
Temp_tables_in_test
t2
t1
show temporary tables in showtemp;
Temp_tables_in_showtemp
t3
select table_schema, table_name, engine, table_rows from Information_schema.temporary_tables;
table_schema table_name engine table_rows
showtemp t3 MyISAM 1
test t2 MyISAM 0
test t1 MyISAM 4
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
table_schema table_name engine table_rows
showtemp t3 MyISAM 1
test t2 MyISAM 0
test t1 MyISAM 4
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='showtemp';
table_schema table_name engine table_rows
showtemp t3 MyISAM 1
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='temp';
table_schema table_name engine table_rows
drop table if exists showtemp.t2;
create temporary table t1(id int);
create temporary table showtemp.t2(id int);
show temporary tables;
Temp_tables_in_test
t1
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
table_schema table_name engine table_rows
showtemp t2 MyISAM 0
test t1 MyISAM 0
showtemp t3 MyISAM 1
test t2 MyISAM 0
test t1 MyISAM 4
drop table showtemp.t2;
drop table t1;
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
table_schema table_name engine table_rows
showtemp t3 MyISAM 1
test t2 MyISAM 0
test t1 MyISAM 4
drop table t1, t2;
drop table showtemp.t3;
drop database showtemp;
# Uses GRANT commands that usually disabled in embedded server
-- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
#
# Test of SHOW [GLOBAL] TEMPORARY TABLES [FROM/IN] DB and
# Information_schema.temporary_tables and global_temporary_tables
#
connect(stcon1,localhost,root,,test);
connect(stcon2,localhost,root,,test);
connection stcon1;
--disable_warnings
drop table if exists t1,t2,t3;
drop database if exists showtemp;
create database if not exists showtemp;
--enable_warnings
use test;
create temporary table t1(id int);
create temporary table t2(id int);
create temporary table showtemp.t3(id int);
insert into t1 values(10),(20),(30),(40);
insert into showtemp.t3 values(999);
show temporary tables;
# "Session" is not same value always. mysql-test cannot test it always.
#show global temporary tables;
show temporary tables from test;
show temporary tables in showtemp;
select table_schema, table_name, engine, table_rows from Information_schema.temporary_tables;
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='showtemp';
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='temp';
connection stcon2;
--disable_warnings
drop table if exists showtemp.t2;
--enable_warnings
create temporary table t1(id int);
create temporary table showtemp.t2(id int);
show temporary tables;
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
drop table showtemp.t2;
drop table t1;
disconnect stcon2;
connection stcon1;
select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
drop table t1, t2;
drop table showtemp.t3;
drop database showtemp;
connection default;
disconnect stcon1;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
--slow-query-log-file=percona_slow_query_log-control_global_slow.log --long-query-time=1
\ No newline at end of file
--slow-query-log-file=percona_slow_query_log-log_slow_filter.log --long-query-time=1
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment