forked from percona/percona-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PS-7657 crash seen with update query on a partition table having comp…
…ressed column https://jira.percona.com/browse/PS-7657 Analysis : Update statements execution flow on tables with partitions by key and having compressed column: 1.First it searches for the row and positions the cursor (the blob is decompressed and stored in blob_heap and record is returned to server) 2. Builds new row and then calls update(old_row, new_row). Since the blob field doesn't change, the blob from old row is stored in the new row (mysql record) 3. Parition hanlder detects that the updated row should be in different partition 4. Insert the new row in new parition. During insertion, we empty the blob heap. This releases the blocks used by blob and corrupts the blob data in new row 5. So we end up inserting garbage to the new partition after the update Fix : Avoided prebuilt->compress_heap from being empty till it's required
- Loading branch information
Nitendra Bhosle
committed
May 11, 2021
1 parent
1c6e68c
commit 59cb3d5
Showing
6 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
mysql-test/suite/rpl/r/rpl_update_partitioned_table_with_compressed_column.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
include/master-slave.inc | ||
Warnings: | ||
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. | ||
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. | ||
[connection master] | ||
CREATE TABLE t1 (f1 INT, f2 BLOB COLUMN_FORMAT COMPRESSED) ENGINE=INNODB PARTITION BY HASH (f1) PARTITIONS 2; | ||
REPLACE INTO t1 (f1,f2)VALUES(0,'123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456'); | ||
UPDATE t1 SET f1=1 WHERE f1 = 0; | ||
include/sync_slave_sql_with_master.inc | ||
include/diff_tables.inc [master:t1,slave:t1] | ||
[connection master] | ||
DROP TABLE t1; | ||
include/rpl_end.inc |
22 changes: 22 additions & 0 deletions
22
mysql-test/suite/rpl/t/rpl_update_partitioned_table_with_compressed_column.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# PS-7599 : Node inconsistency seen in PS during update on compressed column table | ||
# | ||
--source include/have_binlog_format_row.inc | ||
--source include/master-slave.inc | ||
|
||
CREATE TABLE t1 (f1 INT, f2 BLOB COLUMN_FORMAT COMPRESSED) ENGINE=INNODB PARTITION BY HASH (f1) PARTITIONS 2; | ||
|
||
REPLACE INTO t1 (f1,f2)VALUES(0,'123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456'); | ||
|
||
UPDATE t1 SET f1=1 WHERE f1 = 0; | ||
|
||
--source include/sync_slave_sql_with_master.inc | ||
|
||
--let $diff_tables= master:t1,slave:t1 | ||
--source include/diff_tables.inc | ||
|
||
--source include/rpl_connection_master.inc | ||
|
||
DROP TABLE t1; | ||
|
||
--source include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters