Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b67e1d3c
Commit
b67e1d3c
authored
Sep 10, 2014
by
Jan Lindström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusted defrag test that fails randomly (timing problem) and fix
result of innodb_sys_index test.
parent
6748976d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
+16
-13
mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result
...est/suite/innodb/r/innodb_defrag_stats_many_tables.result
+8
-6
mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test
...-test/suite/innodb/t/innodb_defrag_stats_many_tables.test
+8
-4
mysql-test/suite/percona/innodb_sys_index.result
mysql-test/suite/percona/innodb_sys_index.result
+0
-3
No files found.
mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result
View file @
b67e1d3c
DROP TABLE if exists t1;
DROP TABLE if exists t1;
SET @start_table_definition_cache = @@global.table_definition_cache;
SET @start_table_definition_cache = @@global.table_definition_cache;
SET @@global.table_definition_cache = 400;
SET @@global.table_definition_cache = 400;
SET @start_flush_log_at_trx_commit = @@global.innodb_flush_log_at_trx_commit;
SET @@global.innodb_flush_log_at_trx_commit=2;
SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
SET @@global.innodb_defragment_stats_accuracy =
1
0;
SET @@global.innodb_defragment_stats_accuracy =
8
0;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
INSERT INTO t1 VALUES(1, REPEAT('A', 256));
INSERT INTO t1 VALUES(1, REPEAT('A', 256));
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
...
@@ -18,16 +20,16 @@ INSERT INTO t1 (b) SELECT b from t1;
...
@@ -18,16 +20,16 @@ INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
stat_value > 0
stat_value > 0
Create
4
05 table to overflow the table cache.
Create
5
05 table to overflow the table cache.
Sleep for a while to make sure t1 is evicted.
Sleep for a while to make sure t1 is evicted.
select sleep(1
0
);
select sleep(1
5
);
sleep(1
0
)
sleep(1
5
)
0
0
Reload t1 to get defrag stats from persistent storage
Reload t1 to get defrag stats from persistent storage
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
make sure the stats thread will wake up and do the write even if there's a race condition between set and reset.
make sure the stats thread will wake up and do the write even if there's a race condition between set and reset.
select sleep(1
2
);
select sleep(1
5
);
sleep(1
2
)
sleep(1
5
)
0
0
select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
stat_value > 0
stat_value > 0
...
...
mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test
View file @
b67e1d3c
...
@@ -7,14 +7,17 @@
...
@@ -7,14 +7,17 @@
DROP
TABLE
if
exists
t1
;
DROP
TABLE
if
exists
t1
;
--
enable_warnings
--
enable_warnings
let
$num_tables
=
4
05
;
let
$num_tables
=
5
05
;
SET
@
start_table_definition_cache
=
@@
global
.
table_definition_cache
;
SET
@
start_table_definition_cache
=
@@
global
.
table_definition_cache
;
SET
@@
global
.
table_definition_cache
=
400
;
SET
@@
global
.
table_definition_cache
=
400
;
SET
@
start_flush_log_at_trx_commit
=
@@
global
.
innodb_flush_log_at_trx_commit
;
SET
@@
global
.
innodb_flush_log_at_trx_commit
=
2
;
# set stats accuracy to be pretty high so stats sync is easily triggered.
# set stats accuracy to be pretty high so stats sync is easily triggered.
SET
@
start_innodb_defragment_stats_accuracy
=
@@
global
.
innodb_defragment_stats_accuracy
;
SET
@
start_innodb_defragment_stats_accuracy
=
@@
global
.
innodb_defragment_stats_accuracy
;
SET
@@
global
.
innodb_defragment_stats_accuracy
=
1
0
;
SET
@@
global
.
innodb_defragment_stats_accuracy
=
8
0
;
# Create table.
# Create table.
CREATE
TABLE
t1
(
a
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
,
b
VARCHAR
(
256
),
KEY
SECOND
(
a
,
b
))
ENGINE
=
INNODB
;
CREATE
TABLE
t1
(
a
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
,
b
VARCHAR
(
256
),
KEY
SECOND
(
a
,
b
))
ENGINE
=
INNODB
;
...
@@ -48,13 +51,13 @@ while ($count)
...
@@ -48,13 +51,13 @@ while ($count)
}
}
--
enable_query_log
--
enable_query_log
--
echo
Sleep
for
a
while
to
make
sure
t1
is
evicted
.
--
echo
Sleep
for
a
while
to
make
sure
t1
is
evicted
.
select
sleep
(
1
0
);
select
sleep
(
1
5
);
--
echo
Reload
t1
to
get
defrag
stats
from
persistent
storage
--
echo
Reload
t1
to
get
defrag
stats
from
persistent
storage
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
--
echo
make
sure
the
stats
thread
will
wake
up
and
do
the
write
even
if
there
's a race condition between set and reset.
--
echo
make
sure
the
stats
thread
will
wake
up
and
do
the
write
even
if
there
's a race condition between set and reset.
select sleep(1
2
);
select sleep(1
5
);
select stat_value > 0 from mysql.innodb_index_stats where table_name like '
%
t1
%
' and stat_name = '
n_page_split
'
;
select stat_value > 0 from mysql.innodb_index_stats where table_name like '
%
t1
%
' and stat_name = '
n_page_split
'
;
...
@@ -69,5 +72,6 @@ while ($count)
...
@@ -69,5 +72,6 @@ while ($count)
EVAL
DROP
TABLE
t_
$count
;
EVAL
DROP
TABLE
t_
$count
;
dec
$count
;
dec
$count
;
}
}
set
@@
global
.
innodb_flush_log_at_trx_commit
=
@
start_flush_log_at_trx_commit
;
--
enable_query_log
--
enable_query_log
DROP
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/suite/percona/innodb_sys_index.result
View file @
b67e1d3c
drop table if exists t1;
drop table if exists t1;
Warnings:
Warnings:
Note 1051 Unknown table 'test.t1'
Note 1051 Unknown table 'test.t1'
select @@version_comment limit 1 ;
@@version_comment
Source distribution, wsrep_25.10.r3991
SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ;
CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ;
SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ;
SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment