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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
26fc07b1
Commit
26fc07b1
authored
Jul 03, 2023
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.6 into 10.9
parents
d04de1aa
f7b8a2c9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
63 additions
and
367 deletions
+63
-367
mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result
...-test/suite/innodb/r/innodb_defragment_fill_factor.result
+0
-118
mysql-test/suite/innodb/r/innodb_information_schema_buffer.result
...st/suite/innodb/r/innodb_information_schema_buffer.result
+0
-1
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.opt
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.opt
+0
-4
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
+0
-203
mysql-test/suite/sql_sequence/alter.result
mysql-test/suite/sql_sequence/alter.result
+14
-0
mysql-test/suite/sql_sequence/alter.test
mysql-test/suite/sql_sequence/alter.test
+12
-0
storage/innobase/btr/btr0sea.cc
storage/innobase/btr/btr0sea.cc
+27
-32
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+7
-7
storage/innobase/handler/i_s.cc
storage/innobase/handler/i_s.cc
+1
-1
storage/innobase/include/btr0sea.h
storage/innobase/include/btr0sea.h
+2
-1
No files found.
mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result
deleted
100644 → 0
View file @
d04de1aa
Testing tables with large records
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c VARCHAR(256), KEY SECOND(a, b,c)) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('A', 256), REPEAT('B', 256));
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
SET GLOBAL innodb_fast_shutdown = 0;
# restart
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
select count(*) from t1;
count(*)
927
select count(*) from t1 force index (second);
count(*)
927
# A few more insertions on the page should not cause a page split.
insert into t1 values (81, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (83, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (87, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (82, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (86, REPEAT('A', 256), REPEAT('B', 256));
# Insert more rows to cause a page split
insert into t1 values (180, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (181, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (182, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (183, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (184, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (185, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (186, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (187, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (188, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (189, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (190, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (191, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (192, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (193, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (194, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (195, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (196, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (197, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (198, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (199, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (200, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (201, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (202, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (203, REPEAT('A', 256), REPEAT('B', 256));
insert into t1 values (204, REPEAT('A', 256), REPEAT('B', 256));
DROP TABLE t1;
Testing table with small records
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(16), c VARCHAR(32), KEY SECOND(a,b,c)) ENGINE=INNODB;
SET GLOBAL innodb_fast_shutdown = 0;
# restart
optimize table t2;
Table Op Msg_type Msg_text
test.t2 optimize status OK
select count(*) from t2;
count(*)
3701
select count(*) from t2 force index(second);
count(*)
3701
The page should have room for about 20 insertions
insert into t2 values(1181, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1191, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1182, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1192, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1183, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1193, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1184, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1194, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1185, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1195, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1186, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1196, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1187, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1197, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1188, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1198, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1189, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1199, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1190, REPEAT('A', 16), REPEAT('B',32));
insert into t2 values(1180, REPEAT('A', 16), REPEAT('B',32));
# Insert more rows to cause a page split
insert into t2 values (180, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (181, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (182, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (183, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (184, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (185, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (186, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (187, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (188, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (189, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (190, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (191, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (192, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (193, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (194, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (195, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (196, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (197, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (198, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (199, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (200, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (201, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (202, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (203, REPEAT('A', 16), REPEAT('B', 32));
insert into t2 values (204, REPEAT('A', 16), REPEAT('B', 32));
DROP TABLE t2;
mysql-test/suite/innodb/r/innodb_information_schema_buffer.result
View file @
26fc07b1
...
...
@@ -14,7 +14,6 @@ WHERE TABLE_NAME LIKE '%infoschema_buffer_test%' AND PAGE_TYPE='index';
POOL_ID BLOCK_ID SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE PAGE_STATE IO_FIX IS_OLD FREE_PAGE_CLOCK
0 # # 3 INDEX 0 FIX AHI LSN LSN TIME `test`.`infoschema_buffer_test` GEN_CLUST_INDEX 2 58 0 FILE_PAGE IO_FIX OLD #
0 # # 4 INDEX 0 FIX AHI LSN LSN TIME `test`.`infoschema_buffer_test` idx 2 32 0 FILE_PAGE IO_FIX OLD #
0 # # 5 INDEX 0 FIX AHI LSN LSN TIME `test`.`infoschema_buffer_test` idx 2 32 0 FILE_PAGE IO_FIX OLD #
DROP TABLE infoschema_buffer_test;
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME LIKE '%infoschema_buffer_test%';
...
...
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.opt
deleted
100644 → 0
View file @
d04de1aa
--loose-innodb-buffer-pool-stats
--loose-innodb-buffer-page
--loose-innodb-buffer-page-lru
--innodb-defragment=1
\ No newline at end of file
mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
deleted
100644 → 0
View file @
d04de1aa
--
source
include
/
have_innodb
.
inc
--
source
include
/
big_test
.
inc
--
source
include
/
not_valgrind
.
inc
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_innodb_16k
.
inc
--
echo
Testing
tables
with
large
records
# Create table.
CREATE
TABLE
t1
(
a
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
,
b
VARCHAR
(
256
),
c
VARCHAR
(
256
),
KEY
SECOND
(
a
,
b
,
c
))
ENGINE
=
INNODB
;
# Populate table.
INSERT
INTO
t1
VALUES
(
1
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
INSERT
INTO
t1
(
b
)
SELECT
b
from
t1
;
--
disable_query_log
let
$size
=
10
;
while
(
$size
)
{
let
$j
=
100
*
$size
;
eval
delete
from
t1
where
a
between
$j
-
20
and
$j
+
5
;
dec
$size
;
}
--
enable_query_log
SET
GLOBAL
innodb_fast_shutdown
=
0
;
--
source
include
/
restart_mysqld
.
inc
optimize
table
t1
;
select
count
(
*
)
from
t1
;
--
let
$primary_before
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'PRIMARY'
,
Value
,
1
)
select
count
(
*
)
from
t1
force
index
(
second
);
--
let
$second_before
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'second'
,
Value
,
1
)
--
echo
# A few more insertions on the page should not cause a page split.
insert
into
t1
values
(
81
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
83
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
87
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
82
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
86
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
--
let
$primary_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'PRIMARY'
,
Value
,
1
)
--
let
$second_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'second'
,
Value
,
1
)
if
(
$primary_before
!=
$primary_after
)
{
--
echo
Insertion
caused
page
split
on
primary
,
which
should
be
avoided
by
innodb_defragment_fill_factor
.
}
if
(
$second_before
!=
$second_after
)
{
--
echo
Insertion
caused
page
split
on
second
,
which
should
be
avoided
by
innodb_defragment_fill_factor
.
}
--
echo
# Insert more rows to cause a page split
insert
into
t1
values
(
180
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
181
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
182
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
183
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
184
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
185
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
186
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
187
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
188
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
189
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
190
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
191
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
192
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
193
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
194
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
195
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
196
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
197
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
198
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
199
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
200
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
201
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
202
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
203
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
insert
into
t1
values
(
204
,
REPEAT
(
'A'
,
256
),
REPEAT
(
'B'
,
256
));
--
let
$primary_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'PRIMARY'
,
Value
,
1
)
--
let
$second_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t1%'
and
index_name
=
'second'
,
Value
,
1
)
if
(
$primary_before
==
$primary_after
)
{
--
echo
Too
little
space
is
reserved
on
primary
index
.
}
if
(
$second_before
==
$second_after
)
{
--
echo
Too
little
space
is
reserved
on
second
index
.
}
DROP
TABLE
t1
;
--
echo
Testing
table
with
small
records
CREATE
TABLE
t2
(
a
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
,
b
VARCHAR
(
16
),
c
VARCHAR
(
32
),
KEY
SECOND
(
a
,
b
,
c
))
ENGINE
=
INNODB
;
# Populate table.
--
disable_query_log
INSERT
INTO
t2
VALUES
(
1
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
INSERT
INTO
t2
(
b
)
SELECT
b
from
t2
;
--
enable_query_log
--
disable_query_log
let
$size
=
40
;
while
(
$size
)
{
let
$j
=
100
*
$size
;
eval
delete
from
t2
where
a
between
$j
-
20
and
$j
;
dec
$size
;
}
--
enable_query_log
SET
GLOBAL
innodb_fast_shutdown
=
0
;
--
source
include
/
restart_mysqld
.
inc
optimize
table
t2
;
select
count
(
*
)
from
t2
;
select
count
(
*
)
from
t2
force
index
(
second
);
--
let
$second_before
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t2%'
and
index_name
=
'second'
,
Value
,
1
)
--
echo
The
page
should
have
room
for
about
20
insertions
insert
into
t2
values
(
1181
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1191
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1182
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1192
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1183
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1193
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1184
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1194
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1185
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1195
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1186
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1196
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1187
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1197
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1188
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1198
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1189
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1199
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1190
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
1180
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
--
let
$second_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t2%'
and
index_name
=
'second'
,
Value
,
1
)
if
(
$second_before
!=
$second_after
)
{
--
echo
Insertion
caused
page
split
on
second
,
which
should
be
avoided
by
innodb_defragment_fill_factor
.
}
--
echo
# Insert more rows to cause a page split
insert
into
t2
values
(
180
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
181
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
182
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
183
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
184
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
185
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
186
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
187
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
188
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
189
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
190
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
191
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
192
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
193
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
194
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
195
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
196
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
197
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
198
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
199
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
200
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
201
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
202
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
203
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
insert
into
t2
values
(
204
,
REPEAT
(
'A'
,
16
),
REPEAT
(
'B'
,
32
));
--
let
$second_after
=
query_get_value
(
select
count
(
*
)
as
Value
from
information_schema
.
innodb_buffer_page
where
table_name
like
'%t2%'
and
index_name
=
'second'
,
Value
,
1
)
if
(
$second_before
==
$second_after
)
{
--
echo
Too
little
space
is
reserved
on
second
index
.
}
DROP
TABLE
t2
;
mysql-test/suite/sql_sequence/alter.result
View file @
26fc07b1
...
...
@@ -248,3 +248,17 @@ SELECT NEXTVAL(s);
NEXTVAL(s)
1
DROP SEQUENCE s;
#
# MDEV-31607 ER_DUP_KEY in mysql.table_stats upon REANME on sequence
#
CREATE SEQUENCE s1 ENGINE=InnoDB;
CREATE SEQUENCE s2 ENGINE=InnoDB;
SHOW CREATE SEQUENCE s1;
Table Create Table
s1 CREATE SEQUENCE `s1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB
SHOW CREATE SEQUENCE s2;
Table Create Table
s2 CREATE SEQUENCE `s2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB
DROP SEQUENCE s2;
RENAME TABLE s1 TO s2;
DROP SEQUENCE s2;
mysql-test/suite/sql_sequence/alter.test
View file @
26fc07b1
...
...
@@ -161,3 +161,15 @@ CREATE SEQUENCE s;
ALTER
TABLE
s
ORDER
BY
cache_size
;
SELECT
NEXTVAL
(
s
);
DROP
SEQUENCE
s
;
--
echo
#
--
echo
# MDEV-31607 ER_DUP_KEY in mysql.table_stats upon REANME on sequence
--
echo
#
CREATE
SEQUENCE
s1
ENGINE
=
InnoDB
;
CREATE
SEQUENCE
s2
ENGINE
=
InnoDB
;
SHOW
CREATE
SEQUENCE
s1
;
SHOW
CREATE
SEQUENCE
s2
;
DROP
SEQUENCE
s2
;
RENAME
TABLE
s1
TO
s2
;
DROP
SEQUENCE
s2
;
storage/innobase/btr/btr0sea.cc
View file @
26fc07b1
...
...
@@ -2118,14 +2118,13 @@ static bool ha_validate(const hash_table_t *table,
}
/** Validates the search system for given hash table.
@param[in] hash_table_id hash table to validate
@return TRUE if ok */
static
ibool
btr_search_hash_table_validate
(
ulint
hash_table_id
)
@param thd connection, for checking if CHECK TABLE has been killed
@param hash_table_id hash table to validate
@return true if ok */
static
bool
btr_search_hash_table_validate
(
THD
*
thd
,
ulint
hash_table_id
)
{
ha_node_t
*
node
;
ibool
ok
=
TRUE
;
bool
ok
=
true
;
ulint
i
;
ulint
cell_count
;
mem_heap_t
*
heap
=
NULL
;
...
...
@@ -2133,9 +2132,15 @@ btr_search_hash_table_validate(ulint hash_table_id)
rec_offs
*
offsets
=
offsets_
;
btr_search_x_lock_all
();
if
(
!
btr_search_enabled
)
{
if
(
!
btr_search_enabled
||
(
thd
&&
thd_kill_level
(
thd
)))
{
func_exit:
btr_search_x_unlock_all
();
return
(
TRUE
);
if
(
UNIV_LIKELY_NULL
(
heap
))
{
mem_heap_free
(
heap
);
}
return
ok
;
}
/* How many cells to check before temporarily releasing
...
...
@@ -2162,8 +2167,8 @@ btr_search_hash_table_validate(ulint hash_table_id)
btr_search_x_lock_all
();
if
(
!
btr_search_enabled
)
{
ok
=
true
;
if
(
!
btr_search_enabled
||
(
thd
&&
thd_kill_level
(
thd
)))
{
goto
func_exit
;
}
...
...
@@ -2270,8 +2275,8 @@ btr_search_hash_table_validate(ulint hash_table_id)
btr_search_x_lock_all
();
if
(
!
btr_search_enabled
)
{
ok
=
true
;
if
(
!
btr_search_enabled
||
(
thd
&&
thd_kill_level
(
thd
)))
{
goto
func_exit
;
}
...
...
@@ -2292,33 +2297,23 @@ btr_search_hash_table_validate(ulint hash_table_id)
ulint
end_index
=
ut_min
(
i
+
chunk_size
-
1
,
cell_count
-
1
);
if
(
!
ha_validate
(
&
part
.
table
,
i
,
end_index
))
{
ok
=
FALSE
;
ok
=
false
;
}
}
mysql_mutex_unlock
(
&
buf_pool
.
mutex
);
func_exit:
btr_search_x_unlock_all
();
if
(
UNIV_LIKELY_NULL
(
heap
))
{
mem_heap_free
(
heap
);
}
return
(
ok
);
goto
func_exit
;
}
/** Validate the search system.
@
return true if ok. */
bool
b
tr_search_validate
(
)
/** Validate
s
the search system.
@
param thd connection, for checking if CHECK TABLE has been killed
@return true if ok */
b
ool
btr_search_validate
(
THD
*
thd
)
{
for
(
ulint
i
=
0
;
i
<
btr_ahi_parts
;
++
i
)
{
if
(
!
btr_search_hash_table_validate
(
i
))
{
return
(
false
);
}
}
return
(
true
);
for
(
ulint
i
=
0
;
i
<
btr_ahi_parts
;
++
i
)
if
(
!
btr_search_hash_table_validate
(
thd
,
i
))
return
(
false
);
return
true
;
}
#ifdef UNIV_DEBUG
...
...
storage/innobase/handler/ha_innodb.cc
View file @
26fc07b1
...
...
@@ -13706,13 +13706,12 @@ int ha_innobase::delete_table(const char *name)
}
if
(
!
table
->
no_rollback
())
{
err
=
trx
->
drop_table_foreign
(
table
->
name
);
if
(
err
==
DB_SUCCESS
&&
table_stats
&&
index_stats
)
err
=
trx
->
drop_table_statistics
(
table
->
name
);
if
(
err
!=
DB_SUCCESS
)
goto
err_exit
;
}
if
(
err
==
DB_SUCCESS
&&
table_stats
&&
index_stats
)
err
=
trx
->
drop_table_statistics
(
table
->
name
);
if
(
err
!=
DB_SUCCESS
)
goto
err_exit
;
err
=
trx
->
drop_table
(
*
table
);
if
(
err
!=
DB_SUCCESS
)
...
...
@@ -15374,7 +15373,8 @@ ha_innobase::check(
/* We validate the whole adaptive hash index for all tables
at every CHECK TABLE only when QUICK flag is not present. */
if
(
!
(
check_opt
->
flags
&
T_QUICK
)
&&
!
btr_search_validate
())
{
if
(
!
(
check_opt
->
flags
&
T_QUICK
)
&&
!
btr_search_validate
(
m_prebuilt
->
trx
->
mysql_thd
))
{
push_warning
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
ER_NOT_KEYFILE
,
"InnoDB: The adaptive hash index is corrupted."
);
...
...
storage/innobase/handler/i_s.cc
View file @
26fc07b1
...
...
@@ -4066,7 +4066,7 @@ i_s_innodb_buffer_page_get_info(
page_info
->
state
=
bpage
->
state
();
if
(
page_info
->
state
<
buf_page_t
::
FRE
ED
)
{
if
(
page_info
->
state
<
buf_page_t
::
UNFIX
ED
)
{
page_info
->
page_type
=
I_S_PAGE_TYPE_UNKNOWN
;
page_info
->
compressed_only
=
false
;
}
else
{
...
...
storage/innobase/include/btr0sea.h
View file @
26fc07b1
...
...
@@ -127,8 +127,9 @@ void btr_search_update_hash_on_insert(btr_cur_t *cursor,
void
btr_search_update_hash_on_delete
(
btr_cur_t
*
cursor
);
/** Validates the search system.
@param thd connection, for checking if CHECK TABLE has been killed
@return true if ok */
bool
btr_search_validate
();
bool
btr_search_validate
(
THD
*
thd
);
/** Lock all search latches in exclusive mode. */
static
inline
void
btr_search_x_lock_all
();
...
...
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