-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PS-9222 Include reordered fields when calculating mlog buffer size #5321
Merged
VarunNagaraju
merged 2 commits into
percona:release-8.0.37-29
from
VarunNagaraju:PS-9222-8.0
Jun 28, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
mysql-test/suite/innodb/r/instant_alter_index_prefix.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,38 @@ | ||
without prefix field in the index | ||
CREATE TABLE t1 (c1 TINYTEXT COLLATE ascii_bin NOT NULL, c2 DATETIME(3) NOT NULL, c3 TEXT, UNIQUE KEY (c1(30))); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k1','2021-12-21','something'); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k3','2021-12-21','something else'); | ||
ALTER TABLE t1 ADD COLUMN c4 VARCHAR(18) NOT NULL, ALGORITHM=INSTANT; | ||
SET GLOBAL innodb_log_checkpoint_now = ON; | ||
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; | ||
SET GLOBAL innodb_dict_stats_disabled_debug = 1; | ||
SET GLOBAL innodb_master_thread_disabled_debug = 1; | ||
SET GLOBAL innodb_checkpoint_disabled = ON; | ||
UPDATE t1 SET c4 = 'value' WHERE c1 = 'k1'; | ||
# Restart the server and reload the table to see if tables are corrupted. | ||
# Kill and restart | ||
# Run a select to confirm that the database started up successfully | ||
SELECT * FROM t1; | ||
c1 c2 c3 c4 | ||
k1 2021-12-21 00:00:00.000 something value | ||
k3 2021-12-21 00:00:00.000 something else | ||
DROP TABLE t1; | ||
with prefix field in the index | ||
CREATE TABLE t1 (c1 TINYTEXT COLLATE ascii_bin NOT NULL, c2 DATETIME(3) NOT NULL, c3 TEXT, PRIMARY KEY (c1(30))); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k1','2021-12-21','something'); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k3','2021-12-21','something else'); | ||
ALTER TABLE t1 ADD COLUMN c4 VARCHAR(18) NOT NULL, ALGORITHM=INSTANT; | ||
SET GLOBAL innodb_log_checkpoint_now = ON; | ||
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; | ||
SET GLOBAL innodb_dict_stats_disabled_debug = 1; | ||
SET GLOBAL innodb_master_thread_disabled_debug = 1; | ||
SET GLOBAL innodb_checkpoint_disabled = ON; | ||
UPDATE t1 SET c4 = 'value' WHERE c1 = 'k1'; | ||
# Restart the server and reload the table to see if tables are corrupted. | ||
# Kill and restart | ||
# Run a select to confirm that the database started up successfully | ||
SELECT * FROM t1; | ||
c1 c2 c3 c4 | ||
k1 2021-12-21 00:00:00.000 something value | ||
k3 2021-12-21 00:00:00.000 something else | ||
DROP TABLE t1; |
44 changes: 44 additions & 0 deletions
44
mysql-test/suite/innodb/r/instant_alter_stored_column_order.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,44 @@ | ||
without prefix field in the index | ||
CREATE TABLE t1 (c1 TINYTEXT COLLATE ascii_bin NOT NULL, c2 DATETIME(3) NOT NULL, c3 TEXT, UNIQUE KEY (c1(30))); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k1','2021-12-21','something'); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k3','2021-12-21','something else'); | ||
ALTER TABLE t1 | ||
CHANGE c2 c2 DATETIME(3) NOT NULL AFTER c3, | ||
ADD COLUMN c4 VARCHAR(18) NOT NULL, | ||
ALGORITHM=INSTANT; | ||
SET GLOBAL innodb_log_checkpoint_now = ON; | ||
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; | ||
SET GLOBAL innodb_dict_stats_disabled_debug = 1; | ||
SET GLOBAL innodb_master_thread_disabled_debug = 1; | ||
SET GLOBAL innodb_checkpoint_disabled = ON; | ||
UPDATE t1 SET c4 = 'value' WHERE c1 = 'k1'; | ||
# Restart the server and reload the table to see if tables are corrupted. | ||
# Kill and restart | ||
# Run a select to confirm that the database started up successfully | ||
SELECT * FROM t1; | ||
c1 c3 c2 c4 | ||
k1 something 2021-12-21 00:00:00.000 value | ||
k3 something else 2021-12-21 00:00:00.000 | ||
DROP TABLE t1; | ||
with prefix field in the index | ||
CREATE TABLE t1 (c1 TINYTEXT COLLATE ascii_bin NOT NULL, c2 DATETIME(3) NOT NULL, c3 TEXT, PRIMARY KEY (c1(30))); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k1','2021-12-21','something'); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k3','2021-12-21','something else'); | ||
ALTER TABLE t1 | ||
CHANGE c2 c2 DATETIME(3) NOT NULL AFTER c3, | ||
ADD COLUMN c4 VARCHAR(18) NOT NULL, | ||
ALGORITHM=INSTANT; | ||
SET GLOBAL innodb_log_checkpoint_now = ON; | ||
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; | ||
SET GLOBAL innodb_dict_stats_disabled_debug = 1; | ||
SET GLOBAL innodb_master_thread_disabled_debug = 1; | ||
SET GLOBAL innodb_checkpoint_disabled = ON; | ||
UPDATE t1 SET c4 = 'value' WHERE c1 = 'k1'; | ||
# Restart the server and reload the table to see if tables are corrupted. | ||
# Kill and restart | ||
# Run a select to confirm that the database started up successfully | ||
SELECT * FROM t1; | ||
c1 c3 c2 c4 | ||
k1 something 2021-12-21 00:00:00.000 value | ||
k3 something else 2021-12-21 00:00:00.000 | ||
DROP TABLE t1; |
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,50 @@ | ||
# PS-9222 Testing if ALGORITHM=INSTANT crashes server | ||
source include/have_debug.inc; | ||
|
||
--echo without prefix field in the index | ||
CREATE TABLE t1 (c1 TINYTEXT COLLATE ascii_bin NOT NULL, c2 DATETIME(3) NOT NULL, c3 TEXT, UNIQUE KEY (c1(30))); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k1','2021-12-21','something'); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k3','2021-12-21','something else'); | ||
|
||
ALTER TABLE t1 ADD COLUMN c4 VARCHAR(18) NOT NULL, ALGORITHM=INSTANT; | ||
|
||
SET GLOBAL innodb_log_checkpoint_now = ON; | ||
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; | ||
SET GLOBAL innodb_dict_stats_disabled_debug = 1; | ||
SET GLOBAL innodb_master_thread_disabled_debug = 1; | ||
SET GLOBAL innodb_checkpoint_disabled = ON; | ||
|
||
UPDATE t1 SET c4 = 'value' WHERE c1 = 'k1'; | ||
|
||
--echo # Restart the server and reload the table to see if tables are corrupted. | ||
--source include/kill_and_restart_mysqld.inc | ||
|
||
-- echo # Run a select to confirm that the database started up successfully | ||
SELECT * FROM t1; | ||
|
||
# cleanup | ||
DROP TABLE t1; | ||
|
||
--echo with prefix field in the index | ||
CREATE TABLE t1 (c1 TINYTEXT COLLATE ascii_bin NOT NULL, c2 DATETIME(3) NOT NULL, c3 TEXT, PRIMARY KEY (c1(30))); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k1','2021-12-21','something'); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k3','2021-12-21','something else'); | ||
|
||
ALTER TABLE t1 ADD COLUMN c4 VARCHAR(18) NOT NULL, ALGORITHM=INSTANT; | ||
|
||
SET GLOBAL innodb_log_checkpoint_now = ON; | ||
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; | ||
SET GLOBAL innodb_dict_stats_disabled_debug = 1; | ||
SET GLOBAL innodb_master_thread_disabled_debug = 1; | ||
SET GLOBAL innodb_checkpoint_disabled = ON; | ||
|
||
UPDATE t1 SET c4 = 'value' WHERE c1 = 'k1'; | ||
|
||
--echo # Restart the server and reload the table to see if tables are corrupted. | ||
--source include/kill_and_restart_mysqld.inc | ||
|
||
-- echo # Run a select to confirm that the database started up successfully | ||
SELECT * FROM t1; | ||
|
||
# cleanup | ||
DROP TABLE t1; |
56 changes: 56 additions & 0 deletions
56
mysql-test/suite/innodb/t/instant_alter_stored_column_order.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,56 @@ | ||
# PS-9222 Testing if ALGORITHM=INSTANT crashes server | ||
source include/have_debug.inc; | ||
|
||
--echo without prefix field in the index | ||
CREATE TABLE t1 (c1 TINYTEXT COLLATE ascii_bin NOT NULL, c2 DATETIME(3) NOT NULL, c3 TEXT, UNIQUE KEY (c1(30))); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k1','2021-12-21','something'); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k3','2021-12-21','something else'); | ||
|
||
ALTER TABLE t1 | ||
CHANGE c2 c2 DATETIME(3) NOT NULL AFTER c3, | ||
ADD COLUMN c4 VARCHAR(18) NOT NULL, | ||
ALGORITHM=INSTANT; | ||
|
||
SET GLOBAL innodb_log_checkpoint_now = ON; | ||
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; | ||
SET GLOBAL innodb_dict_stats_disabled_debug = 1; | ||
SET GLOBAL innodb_master_thread_disabled_debug = 1; | ||
SET GLOBAL innodb_checkpoint_disabled = ON; | ||
|
||
UPDATE t1 SET c4 = 'value' WHERE c1 = 'k1'; | ||
|
||
--echo # Restart the server and reload the table to see if tables are corrupted. | ||
--source include/kill_and_restart_mysqld.inc | ||
|
||
-- echo # Run a select to confirm that the database started up successfully | ||
SELECT * FROM t1; | ||
|
||
# cleanup | ||
DROP TABLE t1; | ||
|
||
--echo with prefix field in the index | ||
CREATE TABLE t1 (c1 TINYTEXT COLLATE ascii_bin NOT NULL, c2 DATETIME(3) NOT NULL, c3 TEXT, PRIMARY KEY (c1(30))); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k1','2021-12-21','something'); | ||
INSERT INTO t1 (c1, c2, c3) VALUE ('k3','2021-12-21','something else'); | ||
|
||
ALTER TABLE t1 | ||
CHANGE c2 c2 DATETIME(3) NOT NULL AFTER c3, | ||
ADD COLUMN c4 VARCHAR(18) NOT NULL, | ||
ALGORITHM=INSTANT; | ||
|
||
SET GLOBAL innodb_log_checkpoint_now = ON; | ||
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; | ||
SET GLOBAL innodb_dict_stats_disabled_debug = 1; | ||
SET GLOBAL innodb_master_thread_disabled_debug = 1; | ||
SET GLOBAL innodb_checkpoint_disabled = ON; | ||
|
||
UPDATE t1 SET c4 = 'value' WHERE c1 = 'k1'; | ||
|
||
--echo # Restart the server and reload the table to see if tables are corrupted. | ||
--source include/kill_and_restart_mysqld.inc | ||
|
||
-- echo # Run a select to confirm that the database started up successfully | ||
SELECT * FROM t1; | ||
|
||
# cleanup | ||
DROP TABLE t1; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameter
changed_order
is unused