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
13eae188
Commit
13eae188
authored
Sep 23, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
a69cf6f0
ce23802c
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
2594 additions
and
99 deletions
+2594
-99
Docs/README-wsrep
Docs/README-wsrep
+3
-3
Docs/myisam.txt
Docs/myisam.txt
+1
-1
mysql-test/suite/innodb/r/innodb-table-online.result
mysql-test/suite/innodb/r/innodb-table-online.result
+17
-35
mysql-test/suite/innodb/t/innodb-table-online.test
mysql-test/suite/innodb/t/innodb-table-online.test
+24
-35
mysql-test/suite/rpl/r/rpl_row_img_sequence_full.result
mysql-test/suite/rpl/r/rpl_row_img_sequence_full.result
+767
-0
mysql-test/suite/rpl/r/rpl_row_img_sequence_min.result
mysql-test/suite/rpl/r/rpl_row_img_sequence_min.result
+797
-0
mysql-test/suite/rpl/r/rpl_row_img_sequence_noblob.result
mysql-test/suite/rpl/r/rpl_row_img_sequence_noblob.result
+796
-0
mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf
mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf
+0
-0
mysql-test/suite/rpl/t/rpl_row_img_sequence_full.test
mysql-test/suite/rpl/t/rpl_row_img_sequence_full.test
+48
-0
mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf
mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf
+21
-0
mysql-test/suite/rpl/t/rpl_row_img_sequence_min.test
mysql-test/suite/rpl/t/rpl_row_img_sequence_min.test
+8
-21
mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf
mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf
+21
-0
mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.test
mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.test
+51
-0
sql/sql_udf.cc
sql/sql_udf.cc
+3
-2
storage/innobase/row/row0log.cc
storage/innobase/row/row0log.cc
+4
-2
storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc
...pider/mysql-test/spider/bugfix/include/restart_spider.inc
+8
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
+12
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
+11
-0
storage/spider/spd_group_by_handler.cc
storage/spider/spd_group_by_handler.cc
+2
-0
No files found.
Docs/README-wsrep
View file @
13eae188
...
...
@@ -365,7 +365,7 @@ wsrep_forced_binlog_format=none
special value NONE, meaning that there is no forced binlog format in effect.
This variable was introduced to support STATEMENT format replication during
rolling schema upgrade processing. However, in most cases ROW replication
is valid for asymmetric
t
schema replication.
is valid for asymmetric schema replication.
State snapshot transfer options.
...
...
@@ -416,7 +416,7 @@ wsrep_sst_donor=
6. ONLINE SCHEMA UPGRADE
Schema upgrades mean any data definition statements (DDL statem
n
ents) run
Schema upgrades mean any data definition statements (DDL statements) run
for the database. They change the database structure and are non-
transactional.
...
...
@@ -429,7 +429,7 @@ wsrep_sst_donor=
With earlier releases, DDL processing happened always by Total Order
Isolation (TOI) method. With TOI, the DDL was scheduled to be processed in
same transaction seq
eu
ncing 'slot' in each cluster node.
same transaction seq
ue
ncing 'slot' in each cluster node.
The processing is secured by locking the affected table from any other use.
With TOI method, the whole cluster has part of the database locked for the
duration of the DDL processing.
...
...
Docs/myisam.txt
View file @
13eae188
...
...
@@ -177,7 +177,7 @@ HA_EXTRA_NO_KEYREAD=8 Normal read of records (def)
HA_EXTRA_NO_USER_CHANGE=9 No user is allowed to write
HA_EXTRA_KEY_CACHE=10
HA_EXTRA_NO_KEY_CACHE=11
HA_EXTRA_WAIT_LOCK=12 Wait until file is ava
lably
(def)
HA_EXTRA_WAIT_LOCK=12 Wait until file is ava
ilable
(def)
HA_EXTRA_NO_WAIT_LOCK=13 If file is locked, return quickly
HA_EXTRA_WRITE_CACHE=14 Use write cache in ha_write()
HA_EXTRA_FLUSH_CACHE=15 flush write_record_cache
...
...
mysql-test/suite/innodb/r/innodb-table-online.result
View file @
13eae188
...
...
@@ -18,15 +18,12 @@ ddl_log_file_alter_table 0
SET DEBUG_SYNC = 'RESET';
SET DEBUG_SYNC = 'write_row_noreplace SIGNAL have_handle WAIT_FOR go_ahead';
INSERT INTO t1 VALUES(1,2,3);
# Establish session con1 (user=root)
connect con1,localhost,root,,;
connection con1;
SET DEBUG_SYNC = 'now WAIT_FOR have_handle';
SET lock_wait_timeout = 1;
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
# session default
connection default;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
...
...
@@ -37,7 +34,6 @@ ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
# session con1
connection con1;
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG = '+d,innodb_OOM_prepare_inplace_alter';
...
...
@@ -55,7 +51,6 @@ SET SESSION DEBUG = @saved_debug_dbug;
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
# session default
connection default;
SHOW CREATE TABLE t1;
Table Create Table
...
...
@@ -67,22 +62,17 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=REDUNDANT
BEGIN;
INSERT INTO t1 VALUES(7,4,2);
# session con1
connection con1;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR insert_done';
ALTER TABLE t1 DROP PRIMARY KEY, ADD UNIQUE INDEX(c2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# session default
connection default;
COMMIT;
# session con1
connection con1;
ALTER TABLE t1 DROP PRIMARY KEY, ADD UNIQUE INDEX(c2);
ERROR 23000: Duplicate entry '4' for key 'c2'
# session default
connection default;
DELETE FROM t1 WHERE c1 = 7;
# session con1
connection con1;
ALTER TABLE t1 DROP PRIMARY KEY, ADD UNIQUE INDEX(c2), ROW_FORMAT=COMPACT,
LOCK = SHARED, ALGORITHM = INPLACE;
...
...
@@ -100,7 +90,6 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `c2_2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT
ALTER TABLE t1 DROP INDEX c2, ADD PRIMARY KEY(c1);
# session default
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR scanned';
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
...
...
@@ -114,13 +103,10 @@ ddl_log_file_alter_table 0
BEGIN;
INSERT INTO t1 VALUES(4,7,2);
SET DEBUG_SYNC = 'now SIGNAL insert_done';
# session con1
connection con1;
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
# session default
connection default;
ROLLBACK;
# session con1
connection con1;
SHOW CREATE TABLE t1;
Table Create Table
...
...
@@ -142,7 +128,6 @@ ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
# session default
connection default;
INSERT INTO t1 VALUES(6,3,1);
ERROR 23000: Duplicate entry '3' for key 'c2_2'
...
...
@@ -152,14 +137,12 @@ DROP INDEX c2_2 ON t1;
BEGIN;
INSERT INTO t1 VALUES(7,4,2);
ROLLBACK;
# session con1
connection con1;
KILL QUERY @id;
ERROR 70100: Query execution was interrupted
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR dml_done';
SET DEBUG_SYNC = 'row_log_table_apply2_before SIGNAL applied WAIT_FOR kill_done';
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
# session default
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR rebuilt';
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
...
...
@@ -176,7 +159,6 @@ ROLLBACK;
SET DEBUG_SYNC = 'now SIGNAL dml_done WAIT_FOR applied';
KILL QUERY @id;
SET DEBUG_SYNC = 'now SIGNAL kill_done';
# session con1
connection con1;
ERROR 70100: Query execution was interrupted
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
...
...
@@ -187,7 +169,6 @@ ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
# session default
connection default;
CHECK TABLE t1;
Table Op Msg_type Msg_text
...
...
@@ -212,7 +193,6 @@ WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
# session con1
connection con1;
SHOW CREATE TABLE t1;
Table Create Table
...
...
@@ -227,7 +207,6 @@ SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt2 WAIT_FOR dml2_done
SET lock_wait_timeout = 10;
ALTER TABLE t1 ROW_FORMAT=COMPACT
PAGE_COMPRESSED = YES PAGE_COMPRESSION_LEVEL = 1, ALGORITHM = INPLACE;
# session default
connection default;
INSERT INTO t1 SELECT 80 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 160 + c1, c2, c3 FROM t1;
...
...
@@ -290,7 +269,6 @@ SELECT
sort_balance @merge_encrypt_1>@merge_encrypt_0 @merge_decrypt_1>@merge_decrypt_0 @rowlog_encrypt_1>@rowlog_encrypt_0
0 0 0 0
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
# session con1
connection con1;
ERROR HY000: Creating index 'PRIMARY' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
...
...
@@ -321,7 +299,6 @@ ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c22f,c1,c4(5)),
CHANGE c2 c22f INT, CHANGE c3 c3 CHAR(255) NULL, CHANGE c1 c1 INT AFTER c22f,
ADD COLUMN c4 VARCHAR(6) DEFAULT 'Online', LOCK=NONE;
# session default
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR rebuilt3';
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
...
...
@@ -349,7 +326,6 @@ ddl_pending_alter_table 1
ddl_sort_file_alter_table 2
ddl_log_file_alter_table 2
SET DEBUG_SYNC = 'now SIGNAL dml3_done';
# session con1
connection con1;
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
name count
...
...
@@ -405,20 +381,16 @@ SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f,
DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c4(5)),
ADD COLUMN c5 CHAR(5) DEFAULT 'tired' FIRST;
# session default
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR c3p5_created0';
BEGIN;
INSERT INTO t1 VALUES(347,33101,'Pikku kakkosen posti','YLETV2');
INSERT INTO t1 VALUES(33101,347,NULL,'');
SET DEBUG_SYNC = 'now SIGNAL ins_done0';
# session con1
connection con1;
ERROR 01000: Data truncated for column 'c3' at row 323
# session default
connection default;
ROLLBACK;
# session con1
connection con1;
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created WAIT_FOR ins_done';
...
...
@@ -426,14 +398,12 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP COLUMN c22f,
ADD COLUMN c6 VARCHAR(1000) DEFAULT
'I love tracking down hard-to-reproduce bugs.',
ADD PRIMARY KEY c3p5(c3(5), c6(2));
# session default
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR c3p5_created';
SET DEBUG_SYNC = 'ib_after_row_insert SIGNAL ins_done WAIT_FOR ddl_timed_out';
INSERT INTO t1 VALUES(347,33101,NULL,'');
ERROR 23000: Column 'c3' cannot be null
INSERT INTO t1 VALUES(347,33101,'Pikku kakkosen posti','');
# session con1
connection con1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC = 'now SIGNAL ddl_timed_out';
...
...
@@ -445,7 +415,6 @@ ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 6
ddl_log_file_alter_table 2
# session default
connection default;
SELECT COUNT(*) FROM t1;
COUNT(*)
...
...
@@ -463,12 +432,8 @@ c22f c1 c3 c4
5 36 36foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo Online
5 41 41foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo Online
5 46 46foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo Online
# session con1
connection con1;
ALTER TABLE t1 DISCARD TABLESPACE;
# Disconnect session con1
disconnect con1;
# session default
connection default;
SHOW CREATE TABLE t1;
Table Create Table
...
...
@@ -482,6 +447,23 @@ t1 CREATE TABLE `t1` (
SET DEBUG_SYNC = 'RESET';
SET GLOBAL innodb_monitor_disable = module_ddl;
DROP TABLE t1;
#
# MDEV-29600 Memory leak in row_log_table_apply_update()
#
CREATE TABLE t1 (pk INT PRIMARY KEY, f TEXT) ENGINE=InnoDB;
INSERT INTO t1 SET pk=1;
connection con1;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL created WAIT_FOR updated';
ALTER TABLE t1 FORCE;
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR created';
UPDATE t1 SET f = REPEAT('a', 20000);
SET DEBUG_SYNC = 'now SIGNAL updated';
connection con1;
disconnect con1;
connection default;
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
mysql-test/suite/innodb/t/innodb-table-online.test
View file @
13eae188
...
...
@@ -30,9 +30,7 @@ SET DEBUG_SYNC = 'write_row_noreplace SIGNAL have_handle WAIT_FOR go_ahead';
--
send
INSERT
INTO
t1
VALUES
(
1
,
2
,
3
);
--
echo
# Establish session con1 (user=root)
connect
(
con1
,
localhost
,
root
,,);
connection
con1
;
# This should block at the end because of the INSERT in connection default
# is holding a metadata lock.
...
...
@@ -42,13 +40,11 @@ SET lock_wait_timeout = 1;
ALTER
TABLE
t1
ROW_FORMAT
=
REDUNDANT
;
SET
DEBUG_SYNC
=
'now SIGNAL go_ahead'
;
--
echo
# session default
connection
default
;
--
error
ER_DUP_ENTRY
reap
;
eval
$innodb_metrics_select
;
--
echo
# session con1
connection
con1
;
SET
@
saved_debug_dbug
=
@@
SESSION
.
debug_dbug
;
SET
DEBUG_DBUG
=
'+d,innodb_OOM_prepare_inplace_alter'
;
...
...
@@ -61,14 +57,12 @@ ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
SET
SESSION
DEBUG
=
@
saved_debug_dbug
;
ALTER
TABLE
t1
ROW_FORMAT
=
REDUNDANT
,
ALGORITHM
=
INPLACE
,
LOCK
=
NONE
;
--
echo
# session default
connection
default
;
SHOW
CREATE
TABLE
t1
;
# Insert a duplicate entry (4) for the upcoming UNIQUE INDEX(c2).
BEGIN
;
INSERT
INTO
t1
VALUES
(
7
,
4
,
2
);
--
echo
# session con1
connection
con1
;
# This DEBUG_SYNC should not kick in yet, because the duplicate key will be
# detected before we get a chance to apply the online log.
...
...
@@ -78,20 +72,16 @@ SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR insert_don
--
error
ER_LOCK_WAIT_TIMEOUT
ALTER
TABLE
t1
DROP
PRIMARY
KEY
,
ADD
UNIQUE
INDEX
(
c2
);
--
echo
# session default
connection
default
;
COMMIT
;
--
echo
# session con1
connection
con1
;
--
error
ER_DUP_ENTRY
ALTER
TABLE
t1
DROP
PRIMARY
KEY
,
ADD
UNIQUE
INDEX
(
c2
);
--
echo
# session default
connection
default
;
DELETE
FROM
t1
WHERE
c1
=
7
;
--
echo
# session con1
connection
con1
;
ALTER
TABLE
t1
DROP
PRIMARY
KEY
,
ADD
UNIQUE
INDEX
(
c2
),
ROW_FORMAT
=
COMPACT
,
LOCK
=
SHARED
,
ALGORITHM
=
INPLACE
;
...
...
@@ -106,7 +96,6 @@ SHOW CREATE TABLE t1;
--
send
ALTER
TABLE
t1
DROP
INDEX
c2
,
ADD
PRIMARY
KEY
(
c1
);
--
echo
# session default
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR scanned'
;
eval
$innodb_metrics_select
;
...
...
@@ -116,7 +105,6 @@ BEGIN;
INSERT
INTO
t1
VALUES
(
4
,
7
,
2
);
SET
DEBUG_SYNC
=
'now SIGNAL insert_done'
;
--
echo
# session con1
connection
con1
;
# Because the modification log will be applied in order and we did
# not roll back before the log apply, there will be a duplicate key
...
...
@@ -124,11 +112,9 @@ connection con1;
--
error
ER_DUP_ENTRY
reap
;
--
echo
# session default
connection
default
;
ROLLBACK
;
--
echo
# session con1
connection
con1
;
SHOW
CREATE
TABLE
t1
;
# Now, rebuild the table without any concurrent DML, while no duplicate exists.
...
...
@@ -137,7 +123,6 @@ ALTER TABLE t1 DROP PRIMARY KEY, ADD UNIQUE INDEX(c2), ALGORITHM = INPLACE;
ALTER
TABLE
t1
DROP
INDEX
c2
,
ADD
PRIMARY
KEY
(
c1
),
ALGORITHM
=
INPLACE
;
eval
$innodb_metrics_select
;
--
echo
# session default
connection
default
;
--
error
ER_DUP_ENTRY
INSERT
INTO
t1
VALUES
(
6
,
3
,
1
);
...
...
@@ -148,7 +133,6 @@ BEGIN;
INSERT
INTO
t1
VALUES
(
7
,
4
,
2
);
ROLLBACK
;
--
echo
# session con1
connection
con1
;
let
$ID
=
`SELECT @id := CONNECTION_ID()`
;
--
error
ER_QUERY_INTERRUPTED
...
...
@@ -159,7 +143,6 @@ SET DEBUG_SYNC = 'row_log_table_apply2_before SIGNAL applied WAIT_FOR kill_done'
--
send
ALTER
TABLE
t1
ROW_FORMAT
=
REDUNDANT
;
--
echo
# session default
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR rebuilt'
;
eval
$innodb_metrics_select
;
...
...
@@ -171,13 +154,11 @@ let $ignore= `SELECT @id := $ID`;
KILL
QUERY
@
id
;
SET
DEBUG_SYNC
=
'now SIGNAL kill_done'
;
--
echo
# session con1
connection
con1
;
--
error
ER_QUERY_INTERRUPTED
reap
;
eval
$innodb_metrics_select
;
--
echo
# session default
connection
default
;
CHECK
TABLE
t1
;
INSERT
INTO
t1
SELECT
5
+
c1
,
c2
,
c3
FROM
t1
;
...
...
@@ -199,7 +180,6 @@ SET @rowlog_encrypt_0=
(
SELECT
variable_value
FROM
information_schema
.
global_status
WHERE
variable_name
=
'innodb_encryption_n_rowlog_blocks_encrypted'
);
--
echo
# session con1
connection
con1
;
SHOW
CREATE
TABLE
t1
;
ALTER
TABLE
t1
ROW_FORMAT
=
REDUNDANT
;
...
...
@@ -217,7 +197,6 @@ PAGE_COMPRESSED = YES PAGE_COMPRESSION_LEVEL = 1, ALGORITHM = INPLACE;
# Generate some log (delete-mark, delete-unmark, insert etc.)
# while the index creation is blocked. Some of this may run
# in parallel with the clustered index scan.
--
echo
# session default
connection
default
;
INSERT
INTO
t1
SELECT
80
+
c1
,
c2
,
c3
FROM
t1
;
INSERT
INTO
t1
SELECT
160
+
c1
,
c2
,
c3
FROM
t1
;
...
...
@@ -261,7 +240,6 @@ SELECT
# Release con1.
SET
DEBUG_SYNC
=
'now SIGNAL dml2_done'
;
--
echo
# session con1
connection
con1
;
# If the following fails with the wrong error, it probably means that
# you should rerun with a larger mtr --debug-sync-timeout.
...
...
@@ -295,7 +273,6 @@ ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c22f,c1,c4(5)),
CHANGE
c2
c22f
INT
,
CHANGE
c3
c3
CHAR
(
255
)
NULL
,
CHANGE
c1
c1
INT
AFTER
c22f
,
ADD
COLUMN
c4
VARCHAR
(
6
)
DEFAULT
'Online'
,
LOCK
=
NONE
;
--
echo
# session default
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR rebuilt3'
;
# Generate some log (delete-mark, delete-unmark, insert etc.)
...
...
@@ -312,7 +289,6 @@ eval $innodb_metrics_select;
# Release con1.
SET
DEBUG_SYNC
=
'now SIGNAL dml3_done'
;
--
echo
# session con1
connection
con1
;
reap
;
eval
$innodb_metrics_select
;
...
...
@@ -365,7 +341,6 @@ ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f,
DROP
PRIMARY
KEY
,
ADD
PRIMARY
KEY
(
c1
,
c4
(
5
)),
ADD
COLUMN
c5
CHAR
(
5
)
DEFAULT
'tired'
FIRST
;
--
echo
# session default
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR c3p5_created0'
;
...
...
@@ -374,16 +349,13 @@ INSERT INTO t1 VALUES(347,33101,'Pikku kakkosen posti','YLETV2');
INSERT
INTO
t1
VALUES
(
33101
,
347
,
NULL
,
''
);
SET
DEBUG_SYNC
=
'now SIGNAL ins_done0'
;
--
echo
# session con1
connection
con1
;
--
error
WARN_DATA_TRUNCATED
reap
;
--
echo
# session default
connection
default
;
ROLLBACK
;
--
echo
# session con1
connection
con1
;
ALTER
TABLE
t1
MODIFY
c3
CHAR
(
255
)
NOT
NULL
;
...
...
@@ -394,7 +366,6 @@ ADD COLUMN c6 VARCHAR(1000) DEFAULT
'I love tracking down hard-to-reproduce bugs.'
,
ADD
PRIMARY
KEY
c3p5
(
c3
(
5
),
c6
(
2
));
--
echo
# session default
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR c3p5_created'
;
SET
DEBUG_SYNC
=
'ib_after_row_insert SIGNAL ins_done WAIT_FOR ddl_timed_out'
;
...
...
@@ -403,33 +374,51 @@ INSERT INTO t1 VALUES(347,33101,NULL,'');
--
send
INSERT
INTO
t1
VALUES
(
347
,
33101
,
'Pikku kakkosen posti'
,
''
);
--
echo
# session con1
connection
con1
;
--
error
ER_LOCK_WAIT_TIMEOUT
reap
;
SET
DEBUG_SYNC
=
'now SIGNAL ddl_timed_out'
;
eval
$innodb_metrics_select
;
--
echo
# session default
connection
default
;
reap
;
SELECT
COUNT
(
*
)
FROM
t1
;
ALTER
TABLE
t1
ROW_FORMAT
=
REDUNDANT
;
SELECT
*
FROM
t1
LIMIT
10
;
--
echo
# session con1
connection
con1
;
ALTER
TABLE
t1
DISCARD
TABLESPACE
;
--
echo
# Disconnect session con1
disconnect
con1
;
--
echo
# session default
connection
default
;
SHOW
CREATE
TABLE
t1
;
SET
DEBUG_SYNC
=
'RESET'
;
SET
GLOBAL
innodb_monitor_disable
=
module_ddl
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-29600 Memory leak in row_log_table_apply_update()
--
echo
#
CREATE
TABLE
t1
(
pk
INT
PRIMARY
KEY
,
f
TEXT
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
SET
pk
=
1
;
connection
con1
;
SET
DEBUG_SYNC
=
'row_log_table_apply1_before SIGNAL created WAIT_FOR updated'
;
send
ALTER
TABLE
t1
FORCE
;
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR created'
;
UPDATE
t1
SET
f
=
REPEAT
(
'a'
,
20000
);
SET
DEBUG_SYNC
=
'now SIGNAL updated'
;
connection
con1
;
reap
;
disconnect
con1
;
connection
default
;
DROP
TABLE
t1
;
SET
DEBUG_SYNC
=
'RESET'
;
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--
source
include
/
wait_until_count_sessions
.
inc
...
...
mysql-test/suite/rpl/r/rpl_row_img_sequence_full.result
0 → 100644
View file @
13eae188
This diff is collapsed.
Click to expand it.
mysql-test/suite/rpl/r/rpl_row_img_sequence_min.result
0 → 100644
View file @
13eae188
This diff is collapsed.
Click to expand it.
mysql-test/suite/rpl/r/rpl_row_img_sequence.result
→
mysql-test/suite/rpl/r/rpl_row_img_sequence
_noblob
.result
View file @
13eae188
This diff is collapsed.
Click to expand it.
mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf
→
mysql-test/suite/rpl/t/rpl_row_img_sequence
_full
.cnf
View file @
13eae188
File moved
mysql-test/suite/rpl/t/rpl_row_img_sequence_full.test
0 → 100644
View file @
13eae188
#
# Purpose:
# The rpl_row_img_sequence group of tests verify that sequence MDL updates,
# i.e. NEXTVAL and SETVAL, respect the binlog_row_image variable value when
# written into the binary log. In particular, it ensures that only changed
# columns are written with MINIMAL image mode, and all columns are written
# otherwise. This test focuses on validating the behavior of
# binlog_row_img=FULL.
#
# Methodology
# After issuing a sequence update, ensure that both 1) it was replicated
# correctly, and 2) it was binlogged respective to the binlog_row_image value.
# The sequence table does not use caching to ensure each update is immediately
# binlogged. Each command is binlogged into its own unique log file, and the
# entirety of the file is analyzed for correctness of its sequence event.
# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns
# which belong to the event, and the columns are analyzed to ensure the correct
# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple
# chained replicas, varying engines between InnoDB and MyISAM.
#
# References:
# MDEV-28487: sequences not respect value of binlog_row_image with select
# nextval(seq_gen)
#
--
let
$rpl_topology
=
1
->
2
->
3
--
source
include
/
rpl_init
.
inc
--
source
include
/
have_binlog_format_row
.
inc
--
connection
server_1
--
source
include
/
have_innodb
.
inc
--
connection
server_2
--
source
include
/
have_innodb
.
inc
--
connection
server_3
--
source
include
/
have_innodb
.
inc
--
connection
server_1
--
echo
#
--
echo
# binlog_row_image=FULL should write all columns to the binary log
--
echo
#
--
let
$row_img_set
=
server_1
:
FULL
:
N
,
server_2
:
FULL
:
Y
,
server_3
:
FULL
:
Y
--
source
include
/
rpl_row_img_set
.
inc
--
let
$expected_columns
=
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
)
--
let
row_img_test_script
=
include
/
rpl_row_img_sequence
.
inc
--
source
include
/
rpl_row_img_general_loop
.
inc
--
source
include
/
rpl_end
.
inc
--
echo
# End of tests
mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf
0 → 100644
View file @
13eae188
!include include/default_mysqld.cnf
[mysqld.1]
log-slave-updates
innodb
gtid_domain_id=0
[mysqld.2]
log-slave-updates
innodb
gtid_domain_id=1
[mysqld.3]
log-slave-updates
innodb
gtid_domain_id=2
[ENV]
SERVER_MYPORT_1= @mysqld.1.port
SERVER_MYPORT_2= @mysqld.2.port
SERVER_MYPORT_3= @mysqld.3.port
mysql-test/suite/rpl/t/rpl_row_img_sequence.test
→
mysql-test/suite/rpl/t/rpl_row_img_sequence
_min
.test
View file @
13eae188
#
# Purpose:
# This test verifies that sequence DML updates, i.e. NEXTVAL and SETVAL,
# respect the binlog_row_image variable value when written into the binary log.
# In particular, it ensures that only changed columns are written with MINIMAL
# image mode, and all columns are written otherwise.
# The rpl_row_img_sequence group of tests verify that sequence MDL updates,
# i.e. NEXTVAL and SETVAL, respect the binlog_row_image variable value when
# written into the binary log. In particular, it ensures that only changed
# columns are written with MINIMAL image mode, and all columns are written
# otherwise. This test focuses on validating the behavior of
# binlog_row_img=MINIMAL.
#
# Methodology
# After issuing a sequence update, ensure that both 1) it was replicated
...
...
@@ -34,8 +36,8 @@
--
connection
server_1
--
echo
#
--
echo
#
Test Case 1) binlog_row_image=MINIMAL should write only columns
--
echo
#
1 and 8 to the
binary log
--
echo
#
binlog_row_image=MINIMAL should write only columns 1 and 8 to the
--
echo
# binary log
--
echo
#
--
let
$row_img_set
=
server_1
:
MINIMAL
:
N
,
server_2
:
MINIMAL
:
Y
,
server_3
:
MINIMAL
:
Y
--
source
include
/
rpl_row_img_set
.
inc
...
...
@@ -43,23 +45,8 @@
--
let
row_img_test_script
=
include
/
rpl_row_img_sequence
.
inc
--
source
include
/
rpl_row_img_general_loop
.
inc
--
echo
#
--
echo
# Test Case 2) binlog_row_image=NOBLOB should write all columns to the
--
echo
# binary log
--
echo
#
--
let
$row_img_set
=
server_1
:
NOBLOB
:
N
,
server_2
:
NOBLOB
:
Y
,
server_3
:
NOBLOB
:
Y
--
source
include
/
rpl_row_img_set
.
inc
--
let
$expected_columns
=
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
)
--
source
include
/
rpl_row_img_general_loop
.
inc
--
echo
#
--
echo
# Test Case 3) binlog_row_image=NOBLOB should write all columns to the
--
echo
# binary log
--
echo
#
--
let
$row_img_set
=
server_1
:
FULL
:
N
,
server_2
:
FULL
:
Y
,
server_3
:
FULL
:
Y
--
source
include
/
rpl_row_img_set
.
inc
--
let
$expected_columns
=
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
)
--
source
include
/
rpl_row_img_general_loop
.
inc
--
source
include
/
rpl_end
.
inc
--
echo
# End of tests
mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf
0 → 100644
View file @
13eae188
!include include/default_mysqld.cnf
[mysqld.1]
log-slave-updates
innodb
gtid_domain_id=0
[mysqld.2]
log-slave-updates
innodb
gtid_domain_id=1
[mysqld.3]
log-slave-updates
innodb
gtid_domain_id=2
[ENV]
SERVER_MYPORT_1= @mysqld.1.port
SERVER_MYPORT_2= @mysqld.2.port
SERVER_MYPORT_3= @mysqld.3.port
mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.test
0 → 100644
View file @
13eae188
#
# Purpose:
# The rpl_row_img_sequence group of tests verify that sequence MDL updates,
# i.e. NEXTVAL and SETVAL, respect the binlog_row_image variable value when
# written into the binary log. In particular, it ensures that only changed
# columns are written with MINIMAL image mode, and all columns are written
# otherwise. This test focuses on validating the behavior of
# binlog_row_img=NOBLOB.
#
# Methodology
# After issuing a sequence update, ensure that both 1) it was replicated
# correctly, and 2) it was binlogged respective to the binlog_row_image value.
# The sequence table does not use caching to ensure each update is immediately
# binlogged. Each command is binlogged into its own unique log file, and the
# entirety of the file is analyzed for correctness of its sequence event.
# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns
# which belong to the event, and the columns are analyzed to ensure the correct
# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple
# chained replicas, varying engines between InnoDB and MyISAM.
#
# References:
# MDEV-28487: sequences not respect value of binlog_row_image with select
# nextval(seq_gen)
#
--
let
$rpl_topology
=
1
->
2
->
3
--
source
include
/
rpl_init
.
inc
--
source
include
/
have_binlog_format_row
.
inc
--
connection
server_1
--
source
include
/
have_innodb
.
inc
--
connection
server_2
--
source
include
/
have_innodb
.
inc
--
connection
server_3
--
source
include
/
have_innodb
.
inc
--
connection
server_1
--
echo
#
--
echo
# binlog_row_image=NOBLOB should write all columns to the binary logs
--
echo
#
--
let
$row_img_set
=
server_1
:
NOBLOB
:
N
,
server_2
:
NOBLOB
:
Y
,
server_3
:
NOBLOB
:
Y
--
source
include
/
rpl_row_img_set
.
inc
--
let
$expected_columns
=
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
)
--
let
row_img_test_script
=
include
/
rpl_row_img_sequence
.
inc
--
source
include
/
rpl_row_img_general_loop
.
inc
--
let
$row_img_set
=
server_1
:
FULL
:
N
,
server_2
:
FULL
:
Y
,
server_3
:
FULL
:
Y
--
source
include
/
rpl_row_img_set
.
inc
--
source
include
/
rpl_end
.
inc
--
echo
# End of tests
sql/sql_udf.cc
View file @
13eae188
...
...
@@ -609,7 +609,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
/* Allow creation of functions even if we can't open func table */
if
(
unlikely
(
!
table
))
goto
err
;
goto
err
_open_func_table
;
table
->
use_all_columns
();
restore_record
(
table
,
s
->
default_values
);
// Default values for fields
table
->
field
[
0
]
->
store
(
u_d
->
name
.
str
,
u_d
->
name
.
length
,
system_charset_info
);
...
...
@@ -623,7 +623,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
{
my_error
(
ER_ERROR_ON_WRITE
,
MYF
(
0
),
"mysql.func"
,
error
);
del_udf
(
u_d
);
goto
err
;
goto
err
_open_func_table
;
}
done:
...
...
@@ -638,6 +638,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
err:
if
(
new_dl
)
dlclose
(
dl
);
err_open_func_table:
mysql_rwlock_unlock
(
&
THR_LOCK_udf
);
DBUG_RETURN
(
1
);
}
...
...
storage/innobase/row/row0log.cc
View file @
13eae188
/*****************************************************************************
Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 202
1
, MariaDB Corporation.
Copyright (c) 2017, 202
2
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -2175,6 +2175,7 @@ row_log_table_apply_update(
}
func_exit_committed:
ut_ad
(
mtr
.
has_committed
());
ut_free
(
pcur
.
old_rec_buf
);
if
(
error
!=
DB_SUCCESS
)
{
/* Report the erroneous row using the new
...
...
@@ -2362,7 +2363,8 @@ row_log_table_apply_update(
entry
=
row_build_index_entry
(
old_row
,
old_ext
,
index
,
heap
);
if
(
!
entry
)
{
ut_ad
(
0
);
return
(
DB_CORRUPTION
);
error
=
DB_CORRUPTION
;
goto
func_exit_committed
;
}
mtr_start
(
&
mtr
);
...
...
storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc
0 → 100644
View file @
13eae188
--
let
$_expect_file_name
=
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.1
.
expect
--
exec
echo
"wait"
>
$_expect_file_name
--
shutdown_server
--
source
include
/
wait_until_disconnected
.
inc
--
exec
echo
"restart"
>
$_expect_file_name
--
enable_reconnect
--
source
include
/
wait_until_connected_again
.
inc
storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
0 → 100644
View file @
13eae188
CREATE TABLE t (c INT);
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
FLUSH TABLES WITH READ LOCK;
CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
ERROR HY000: Can't execute the query because you have a conflicting read lock
SELECT * FROM t;
c
DROP TABLE t;
storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
0 → 100644
View file @
13eae188
CREATE
TABLE
t
(
c
INT
);
SHOW
CREATE
TABLE
t
;
FLUSH
TABLES
WITH
READ
LOCK
;
--
error
ER_CANT_UPDATE_WITH_READLOCK
CREATE
FUNCTION
spider_bg_direct_sql
RETURNS
INT
SONAME
'ha_spider.so'
;
SELECT
*
FROM
t
;
--
source
include
/
restart_spider
.
inc
DROP
TABLE
t
;
storage/spider/spd_group_by_handler.cc
View file @
13eae188
...
...
@@ -1857,6 +1857,8 @@ group_by_handler *spider_create_group_by_handler(
{
for
(
order
=
query
->
order_by
;
order
;
order
=
order
->
next
)
{
if
((
*
order
->
item
)
->
type
()
==
Item
::
SUM_FUNC_ITEM
)
continue
;
if
(
spider_db_print_item_type
((
*
order
->
item
),
NULL
,
spider
,
NULL
,
NULL
,
0
,
roop_count
,
TRUE
,
fields_arg
))
{
...
...
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