mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.2 into bb-10.2-ext
This commit is contained in:
@@ -4044,7 +4044,7 @@ xb_space_create_file(
|
|||||||
const page_size_t page_size(flags);
|
const page_size_t page_size(flags);
|
||||||
|
|
||||||
if (!page_size.is_compressed()) {
|
if (!page_size.is_compressed()) {
|
||||||
buf_flush_init_for_writing(NULL, page, NULL, 0, false);
|
buf_flush_init_for_writing(NULL, page, NULL, 0);
|
||||||
|
|
||||||
ret = os_file_write(IORequestWrite, path, *file, page, 0,
|
ret = os_file_write(IORequestWrite, path, *file, page, 0,
|
||||||
UNIV_PAGE_SIZE);
|
UNIV_PAGE_SIZE);
|
||||||
@@ -4061,7 +4061,7 @@ xb_space_create_file(
|
|||||||
page_zip.m_end = page_zip.m_nonempty =
|
page_zip.m_end = page_zip.m_nonempty =
|
||||||
page_zip.n_blobs = 0;
|
page_zip.n_blobs = 0;
|
||||||
|
|
||||||
buf_flush_init_for_writing(NULL, page, &page_zip, 0, false);
|
buf_flush_init_for_writing(NULL, page, &page_zip, 0);
|
||||||
|
|
||||||
ret = os_file_write(IORequestWrite, path, *file,
|
ret = os_file_write(IORequestWrite, path, *file,
|
||||||
page_zip.data, 0, zip_size);
|
page_zip.data, 0, zip_size);
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
package My::Tee;
|
package My::Tee;
|
||||||
|
use IO::Handle;
|
||||||
|
|
||||||
# see PerlIO::via
|
# see PerlIO::via
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ sub WRITE
|
|||||||
{
|
{
|
||||||
my ($obj, $buf, $fh) = @_;
|
my ($obj, $buf, $fh) = @_;
|
||||||
print $fh $buf;
|
print $fh $buf;
|
||||||
|
$fh->flush;
|
||||||
print $copyfh $buf;
|
print $copyfh $buf;
|
||||||
return length($buf);
|
return length($buf);
|
||||||
}
|
}
|
||||||
|
@@ -1020,6 +1020,22 @@ cast('-0.0' as decimal(5,1)) < 0
|
|||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
# Start of 10.2 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-15420 Wrong result for CAST from TIME or DATETIME with zero integer part and non-zero microseconds to DECIMAL(X,Y)
|
||||||
|
#
|
||||||
|
SET sql_mode='';
|
||||||
|
SELECT
|
||||||
|
CAST(TIMESTAMP'0000-00-00 00:00:00.123456' AS DECIMAL(10,6)) AS c1,
|
||||||
|
CAST(TIME'00:00:00.123456' AS DECIMAL(10,6)) AS c2;
|
||||||
|
c1 c2
|
||||||
|
0.123456 0.123456
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
#
|
||||||
|
# End of 10.2 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
# Start of 10.3 tests
|
# Start of 10.3 tests
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@@ -323,3 +323,25 @@ XA ROLLBACK 'xid1';
|
|||||||
connection default;
|
connection default;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
disconnect con2;
|
disconnect con2;
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
|
||||||
|
CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t2 VALUES (1),(2);
|
||||||
|
CREATE TABLE t3 (i INT) ENGINE=InnoDB;
|
||||||
|
XA BEGIN 'xid1';
|
||||||
|
REPLACE INTO t1 SELECT * FROM t2;
|
||||||
|
connect con1,localhost,root,,test;
|
||||||
|
XA BEGIN 'xid2';
|
||||||
|
INSERT INTO t1 SELECT * FROM t2;
|
||||||
|
connection default;
|
||||||
|
REPLACE INTO t2 SELECT * FROM t2;
|
||||||
|
connection con1;
|
||||||
|
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||||
|
disconnect con1;
|
||||||
|
connect con2,localhost,root,,test;
|
||||||
|
INSERT INTO t3 VALUES (1);
|
||||||
|
XA BEGIN 'xid3';
|
||||||
|
disconnect con2;
|
||||||
|
connection default;
|
||||||
|
XA END 'xid1';
|
||||||
|
XA ROLLBACK 'xid1';
|
||||||
|
DROP TABLE t1, t2, t3;
|
||||||
|
@@ -13,4 +13,4 @@
|
|||||||
innodb_scrub : MDEV-8139 scrubbing does not work reliably
|
innodb_scrub : MDEV-8139 scrubbing does not work reliably
|
||||||
innodb_scrub_background : MDEV-8139 scrubbing does not work reliably
|
innodb_scrub_background : MDEV-8139 scrubbing does not work reliably
|
||||||
innodb-redo-badkey : MDEV-13893 / MDEV-12699 Improve crash recovery of corrupted data pages
|
innodb-redo-badkey : MDEV-13893 / MDEV-12699 Improve crash recovery of corrupted data pages
|
||||||
innodb_encryption-page-compression : MDEV-14814 wait condition timeout
|
|
||||||
|
@@ -129,6 +129,6 @@ NOT FOUND /barfoo/ in t2.ibd
|
|||||||
# t3 yes on expecting NOT FOUND
|
# t3 yes on expecting NOT FOUND
|
||||||
NOT FOUND /tmpres/ in t3.ibd
|
NOT FOUND /tmpres/ in t3.ibd
|
||||||
# t4 yes on expecting NOT FOUND
|
# t4 yes on expecting NOT FOUND
|
||||||
NOT FOUND /mysql/ in t4.ibd
|
# MDEV-15527 FIXME: Enable this test!
|
||||||
DROP PROCEDURE innodb_insert_proc;
|
DROP PROCEDURE innodb_insert_proc;
|
||||||
DROP TABLE t1,t2,t3,t4;
|
DROP TABLE t1,t2,t3,t4;
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
SET GLOBAL innodb_encryption_threads = 4;
|
SET GLOBAL innodb_encryption_threads = 4;
|
||||||
SET GLOBAL innodb_encrypt_tables = on;
|
|
||||||
set global innodb_compression_algorithm = 1;
|
set global innodb_compression_algorithm = 1;
|
||||||
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
create table innodb_normal (c1 int, b char(20)) engine=innodb;
|
||||||
show warnings;
|
show warnings;
|
||||||
@@ -165,7 +164,6 @@ innodb_page_compressed7, innodb_page_compressed8,
|
|||||||
innodb_page_compressed9 for export;
|
innodb_page_compressed9 for export;
|
||||||
unlock tables;
|
unlock tables;
|
||||||
# Wait until dirty pages are compressed and encrypted 2
|
# Wait until dirty pages are compressed and encrypted 2
|
||||||
unlock tables;
|
|
||||||
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
|
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
|
||||||
variable_value > 0
|
variable_value > 0
|
||||||
1
|
1
|
||||||
|
@@ -111,7 +111,8 @@ SELECT COUNT(*) FROM t4;
|
|||||||
--let SEARCH_PATTERN=mysql
|
--let SEARCH_PATTERN=mysql
|
||||||
--echo # t4 yes on expecting NOT FOUND
|
--echo # t4 yes on expecting NOT FOUND
|
||||||
-- let SEARCH_FILE=$t4_IBD
|
-- let SEARCH_FILE=$t4_IBD
|
||||||
-- source include/search_pattern_in_file.inc
|
--echo # MDEV-15527 FIXME: Enable this test!
|
||||||
|
#-- source include/search_pattern_in_file.inc
|
||||||
|
|
||||||
DROP PROCEDURE innodb_insert_proc;
|
DROP PROCEDURE innodb_insert_proc;
|
||||||
DROP TABLE t1,t2,t3,t4;
|
DROP TABLE t1,t2,t3,t4;
|
||||||
|
@@ -2,8 +2,14 @@
|
|||||||
-- source include/have_example_key_management_plugin.inc
|
-- source include/have_example_key_management_plugin.inc
|
||||||
-- source include/not_embedded.inc
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
let $innodb_encrypt_tables_orig = `SELECT @@innodb_encrypt_tables`;
|
||||||
|
let $innodb_encryption_threads_orig = `SELECT @@innodb_encryption_threads`;
|
||||||
|
--enable_query_log
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
SET GLOBAL innodb_encryption_threads = 4;
|
SET GLOBAL innodb_encryption_threads = 4;
|
||||||
SET GLOBAL innodb_encrypt_tables = on;
|
--enable_warnings
|
||||||
|
|
||||||
# zlib
|
# zlib
|
||||||
set global innodb_compression_algorithm = 1;
|
set global innodb_compression_algorithm = 1;
|
||||||
@@ -110,12 +116,12 @@ innodb_page_compressed3, innodb_page_compressed4,
|
|||||||
innodb_page_compressed5, innodb_page_compressed6,
|
innodb_page_compressed5, innodb_page_compressed6,
|
||||||
innodb_page_compressed7, innodb_page_compressed8,
|
innodb_page_compressed7, innodb_page_compressed8,
|
||||||
innodb_page_compressed9 for export;
|
innodb_page_compressed9 for export;
|
||||||
|
|
||||||
unlock tables;
|
unlock tables;
|
||||||
|
|
||||||
--echo # Wait until dirty pages are compressed and encrypted 2
|
--echo # Wait until dirty pages are compressed and encrypted 2
|
||||||
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
|
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
unlock tables;
|
|
||||||
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_DECRYPTED';
|
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_DECRYPTED';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
@@ -134,3 +140,9 @@ drop table innodb_page_compressed6;
|
|||||||
drop table innodb_page_compressed7;
|
drop table innodb_page_compressed7;
|
||||||
drop table innodb_page_compressed8;
|
drop table innodb_page_compressed8;
|
||||||
drop table innodb_page_compressed9;
|
drop table innodb_page_compressed9;
|
||||||
|
|
||||||
|
# reset system
|
||||||
|
--disable_query_log
|
||||||
|
EVAL SET GLOBAL innodb_encrypt_tables = $innodb_encrypt_tables_orig;
|
||||||
|
EVAL SET GLOBAL innodb_encryption_threads = $innodb_encryption_threads_orig;
|
||||||
|
--enable_query_log
|
||||||
|
85
mysql-test/suite/innodb/r/default_row_format_alter.result
Normal file
85
mysql-test/suite/innodb/r/default_row_format_alter.result
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
SET @row_format = @@GLOBAL.innodb_default_row_format;
|
||||||
|
####################################
|
||||||
|
# Check if table rebuilding alter isn't affect if table is created
|
||||||
|
# with explicit row_format
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, 'abc');
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT 0 N
|
||||||
|
SET GLOBAL innodb_default_row_format=DYNAMIC;
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
|
||||||
|
# Here we expect COMPACT because it was explicitly specified at CREATE
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
####################################
|
||||||
|
# Check if table rebuilding alter is affected when there is no
|
||||||
|
# row_format specified at CREATE TABLE.
|
||||||
|
SET GLOBAL innodb_default_row_format = COMPACT;
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, 'abc');
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
|
||||||
|
SET GLOBAL innodb_default_row_format = DYNAMIC;
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
|
||||||
|
# Here we expect DYNAMIC because there is no explicit ROW_FORMAT and the
|
||||||
|
# default_row_format is changed to DYNAMIC just before ALTER
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Dynamic # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
####################################
|
||||||
|
# Check the row_format effect on ALTER, ALGORITHM=COPY
|
||||||
|
SET GLOBAL innodb_default_row_format = REDUNDANT;
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
|
||||||
|
SET GLOBAL innoDB_default_row_format = COMPACT;
|
||||||
|
ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
|
||||||
|
# Because of ALGORITHM=COPY, there is TABLE REBUILD and the table isn't
|
||||||
|
# created with explicit row_format, so we expect ROW_FORMAT=COMPACT
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Check the row_format effect on ALTER, ALGORITH=COPY on
|
||||||
|
# create table with explicit row_format
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT 0 N
|
||||||
|
SET GLOBAL innoDB_default_row_format = COMPACT;
|
||||||
|
ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
|
||||||
|
# Because of ALGORITHM=COPY, there is TABLE REBUILD and the table is
|
||||||
|
# created with explicit row_format, so we expect original
|
||||||
|
# ROW_FORMAT=REDUNDANT
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
##################################
|
||||||
|
# Check row_format on ALTER ALGORITHM=INPLACE
|
||||||
|
SET GLOBAL innodb_default_row_format=COMPACT;
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT, KEY k1(b(10))) ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
|
||||||
|
SET GLOBAL innodb_default_row_format=DYNAMIC;
|
||||||
|
ALTER TABLE t1 DROP INDEX k1;
|
||||||
|
# Because it is in-place operation, there is no rebuild, so the
|
||||||
|
# original format has to be retained.
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET GLOBAL innodb_default_row_format = @row_format;
|
@@ -0,0 +1,108 @@
|
|||||||
|
SET @row_format = @@GLOBAL.innodb_default_row_format;
|
||||||
|
SET @large_prefix = @@GLOBAL.innodb_large_prefix;
|
||||||
|
SET @file_format = @@GLOBAL.innodb_file_format;
|
||||||
|
SET GLOBAL innodb_file_format = barracuda;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
# ###########################################################
|
||||||
|
# Check with Import/Export tablespace with Default_row_format
|
||||||
|
SET GLOBAL innodb_default_row_format=Compact;
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
@@innodb_default_row_format
|
||||||
|
compact
|
||||||
|
SELECT @@innodb_file_per_table;
|
||||||
|
@@innodb_file_per_table
|
||||||
|
1
|
||||||
|
CREATE TABLE tab(a INT) ENGINE=InnoDB;
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
|
||||||
|
INSERT INTO tab VALUES(1);
|
||||||
|
INSERT INTO tab VALUES(2);
|
||||||
|
SELECT * FROM tab;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
2
|
||||||
|
FLUSH TABLE tab FOR EXPORT;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
DROP TABLE tab;
|
||||||
|
SET GLOBAL innodb_default_row_format=Dynamic;
|
||||||
|
CREATE TABLE tab(a INT) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE tab DISCARD TABLESPACE;
|
||||||
|
ALTER TABLE tab IMPORT TABLESPACE;
|
||||||
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1)
|
||||||
|
DROP TABLE tab;
|
||||||
|
SET GLOBAL innodb_default_row_format=Compact;
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
@@innodb_default_row_format
|
||||||
|
compact
|
||||||
|
CREATE TABLE tab(a INT) ENGINE=InnoDB;
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
|
||||||
|
ALTER TABLE tab DISCARD TABLESPACE;
|
||||||
|
ALTER TABLE tab IMPORT TABLESPACE;
|
||||||
|
SELECT * FROM tab;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
2
|
||||||
|
DROP TABLE tab;
|
||||||
|
# ###########################################################
|
||||||
|
SET GLOBAL innodb_default_row_format=Dynamic;
|
||||||
|
SET GLOBAL innodb_large_prefix=ON;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
@@innodb_default_row_format
|
||||||
|
dynamic
|
||||||
|
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(3070))) ENGINE= InnoDB;
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
|
||||||
|
INSERT INTO tab(a,b) VALUES(1,'Check with max column size');
|
||||||
|
SELECT * FROM tab;
|
||||||
|
a b
|
||||||
|
1 Check with max column size
|
||||||
|
SET GLOBAL innodb_default_row_format=COMPACT;
|
||||||
|
ALTER TABLE tab ROW_FORMAT=COMPACT;
|
||||||
|
ERROR HY000: Index column size too large. The maximum column size is 767 bytes
|
||||||
|
DROP TABLE tab;
|
||||||
|
SET GLOBAL innodb_default_row_format=Default;
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
@@innodb_default_row_format
|
||||||
|
dynamic
|
||||||
|
SET GLOBAL innodb_default_row_format=Dynamic;
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
@@innodb_default_row_format
|
||||||
|
dynamic
|
||||||
|
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(767))) ENGINE= InnoDB;
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
|
||||||
|
INSERT INTO tab(a,b) VALUES(1,'Check with max column size');
|
||||||
|
SELECT * FROM tab;
|
||||||
|
a b
|
||||||
|
1 Check with max column size
|
||||||
|
ALTER TABLE tab ROW_FORMAT=COMPACT;
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT 0 N
|
||||||
|
SELECT * FROM tab;
|
||||||
|
a b
|
||||||
|
1 Check with max column size
|
||||||
|
ALTER TABLE tab ROW_FORMAT=COMPRESSED;
|
||||||
|
SELECT * FROM tab;
|
||||||
|
a b
|
||||||
|
1 Check with max column size
|
||||||
|
ALTER TABLE tab ROW_FORMAT=Dynamic;
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC 0 N
|
||||||
|
DROP TABLE tab;
|
||||||
|
SET GLOBAL innodb_default_row_format = @row_format;
|
||||||
|
SET GLOBAL innodb_large_prefix = @large_prefix;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
SET GLOBAL innodb_file_format = @file_format;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
@@ -0,0 +1,11 @@
|
|||||||
|
--- default_row_format_create.result
|
||||||
|
+++ default_row_format_create,dynamic.result
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
|
-t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
|
||||||
|
+t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
@@ -0,0 +1,11 @@
|
|||||||
|
--- default_row_format_create.result
|
||||||
|
+++ default_row_format_create,redundant.result
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
|
-t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
|
||||||
|
+t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
26
mysql-test/suite/innodb/r/default_row_format_create.result
Normal file
26
mysql-test/suite/innodb/r/default_row_format_create.result
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=REDUNDANT 0 N
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB
|
||||||
|
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||||
|
t1 InnoDB # Compressed # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPRESSED key_block_size=1 0 N
|
||||||
|
DROP TABLE t1;
|
74
mysql-test/suite/innodb/r/file_format_defaults.result
Normal file
74
mysql-test/suite/innodb/r/file_format_defaults.result
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
call mtr.add_suppression("InnoDB: Cannot add field `c1` in table `test`\\.`tab0`");
|
||||||
|
SELECT @@innodb_strict_mode;
|
||||||
|
@@innodb_strict_mode
|
||||||
|
1
|
||||||
|
SELECT @@innodb_file_per_table;
|
||||||
|
@@innodb_file_per_table
|
||||||
|
1
|
||||||
|
SET @file_format = @@GLOBAL.innodb_file_format;
|
||||||
|
SET GLOBAL innodb_large_prefix=ON;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
SET SQL_MODE=strict_all_tables;
|
||||||
|
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
Warnings:
|
||||||
|
Warning 1071 Specified key was too long; max key length is 3072 bytes
|
||||||
|
SHOW CREATE TABLE tab0;
|
||||||
|
Table Create Table
|
||||||
|
tab0 CREATE TABLE `tab0` (
|
||||||
|
`c1` varchar(65530) DEFAULT NULL,
|
||||||
|
KEY `c1` (`c1`(3072))
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||||
|
DROP TABLE tab0;
|
||||||
|
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB KEY_BLOCK_SIZE=2;
|
||||||
|
ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
|
||||||
|
SET GLOBAL innodb_file_format=Antelope;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
|
||||||
|
ERROR HY000: Can't create table `test`.`tab0` (errno: 140 "Wrong create options")
|
||||||
|
SET GLOBAL innodb_file_format=Default;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
|
||||||
|
DROP TABLE tab0;
|
||||||
|
SELECT @@innodb_file_format;
|
||||||
|
@@innodb_file_format
|
||||||
|
Barracuda
|
||||||
|
SET GLOBAL innodb_strict_mode=OFF;
|
||||||
|
SET GLOBAL innodb_strict_mode=Default;
|
||||||
|
SELECT @@innodb_strict_mode;
|
||||||
|
@@innodb_strict_mode
|
||||||
|
1
|
||||||
|
SET GLOBAL innodb_large_prefix=OFF;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
SELECT @@innodb_large_prefix;
|
||||||
|
@@innodb_large_prefix
|
||||||
|
0
|
||||||
|
SET GLOBAL innodb_large_prefix=Default;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
SELECT @@innodb_large_prefix;
|
||||||
|
@@innodb_large_prefix
|
||||||
|
1
|
||||||
|
SET GLOBAL innodb_file_format_max=Default;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
SELECT @@innodb_file_format_max;
|
||||||
|
@@innodb_file_format_max
|
||||||
|
Antelope
|
||||||
|
CREATE TABLE tab1(c1 int ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
SELECT @@innodb_file_format_max;
|
||||||
|
@@innodb_file_format_max
|
||||||
|
Barracuda
|
||||||
|
SET GLOBAL innodb_file_format_max=Default;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
SET GLOBAL innodb_large_prefix=off;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
SET GLOBAL innodb_file_format = @file_format;
|
||||||
|
Warnings:
|
||||||
|
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
|
||||||
|
DROP TABLE tab1;
|
98
mysql-test/suite/innodb/t/default_row_format_alter.test
Normal file
98
mysql-test/suite/innodb/t/default_row_format_alter.test
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
|
||||||
|
SET @row_format = @@GLOBAL.innodb_default_row_format;
|
||||||
|
|
||||||
|
--echo ####################################
|
||||||
|
--echo # Check if table rebuilding alter isn't affect if table is created
|
||||||
|
--echo # with explicit row_format
|
||||||
|
eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, 'abc');
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
|
||||||
|
SET GLOBAL innodb_default_row_format=DYNAMIC;
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
|
||||||
|
|
||||||
|
--echo # Here we expect COMPACT because it was explicitly specified at CREATE
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo ####################################
|
||||||
|
--echo # Check if table rebuilding alter is affected when there is no
|
||||||
|
--echo # row_format specified at CREATE TABLE.
|
||||||
|
SET GLOBAL innodb_default_row_format = COMPACT;
|
||||||
|
eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, 'abc');
|
||||||
|
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
|
||||||
|
SET GLOBAL innodb_default_row_format = DYNAMIC;
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
|
||||||
|
|
||||||
|
--echo # Here we expect DYNAMIC because there is no explicit ROW_FORMAT and the
|
||||||
|
--echo # default_row_format is changed to DYNAMIC just before ALTER
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo ####################################
|
||||||
|
--echo # Check the row_format effect on ALTER, ALGORITHM=COPY
|
||||||
|
SET GLOBAL innodb_default_row_format = REDUNDANT;
|
||||||
|
eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
|
||||||
|
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
|
||||||
|
SET GLOBAL innoDB_default_row_format = COMPACT;
|
||||||
|
ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
|
||||||
|
|
||||||
|
--echo # Because of ALGORITHM=COPY, there is TABLE REBUILD and the table isn't
|
||||||
|
--echo # created with explicit row_format, so we expect ROW_FORMAT=COMPACT
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo
|
||||||
|
--echo ###################################
|
||||||
|
--echo # Check the row_format effect on ALTER, ALGORITH=COPY on
|
||||||
|
--echo # create table with explicit row_format
|
||||||
|
eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
|
||||||
|
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
|
||||||
|
SET GLOBAL innoDB_default_row_format = COMPACT;
|
||||||
|
ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
|
||||||
|
|
||||||
|
--echo # Because of ALGORITHM=COPY, there is TABLE REBUILD and the table is
|
||||||
|
--echo # created with explicit row_format, so we expect original
|
||||||
|
--echo # ROW_FORMAT=REDUNDANT
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo
|
||||||
|
--echo ##################################
|
||||||
|
--echo # Check row_format on ALTER ALGORITHM=INPLACE
|
||||||
|
SET GLOBAL innodb_default_row_format=COMPACT;
|
||||||
|
|
||||||
|
eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT, KEY k1(b(10))) ENGINE=INNODB;
|
||||||
|
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
|
||||||
|
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
|
||||||
|
SET GLOBAL innodb_default_row_format=DYNAMIC;
|
||||||
|
ALTER TABLE t1 DROP INDEX k1;
|
||||||
|
|
||||||
|
--echo # Because it is in-place operation, there is no rebuild, so the
|
||||||
|
--echo # original format has to be retained.
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_default_row_format = @row_format;
|
167
mysql-test/suite/innodb/t/default_row_format_compatibility.test
Normal file
167
mysql-test/suite/innodb/t/default_row_format_compatibility.test
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
|
||||||
|
SET @row_format = @@GLOBAL.innodb_default_row_format;
|
||||||
|
SET @large_prefix = @@GLOBAL.innodb_large_prefix;
|
||||||
|
SET @file_format = @@GLOBAL.innodb_file_format;
|
||||||
|
SET GLOBAL innodb_file_format = barracuda;
|
||||||
|
|
||||||
|
# set the variables
|
||||||
|
let $MYSQLD_DATADIR = `SELECT @@datadir`;
|
||||||
|
|
||||||
|
--echo # ###########################################################
|
||||||
|
--echo # Check with Import/Export tablespace with Default_row_format
|
||||||
|
|
||||||
|
# Set row_format=Compact
|
||||||
|
SET GLOBAL innodb_default_row_format=Compact;
|
||||||
|
|
||||||
|
# Check row_format=Compact
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
|
||||||
|
# Check file_per_table=1
|
||||||
|
SELECT @@innodb_file_per_table;
|
||||||
|
|
||||||
|
CREATE TABLE tab(a INT) ENGINE=InnoDB;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
|
||||||
|
INSERT INTO tab VALUES(1);
|
||||||
|
INSERT INTO tab VALUES(2);
|
||||||
|
|
||||||
|
# Check the rows
|
||||||
|
SELECT * FROM tab;
|
||||||
|
|
||||||
|
FLUSH TABLE tab FOR EXPORT;
|
||||||
|
|
||||||
|
# Take the backup of the ibd and cfg files
|
||||||
|
--copy_file $MYSQLD_DATADIR/test/tab.cfg $MYSQLD_DATADIR/tab.cfg
|
||||||
|
--copy_file $MYSQLD_DATADIR/test/tab.ibd $MYSQLD_DATADIR/tab.ibd
|
||||||
|
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
DROP TABLE tab;
|
||||||
|
|
||||||
|
# Set the default_row_format=Dynamic
|
||||||
|
SET GLOBAL innodb_default_row_format=Dynamic;
|
||||||
|
|
||||||
|
CREATE TABLE tab(a INT) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
# Remove the *.ibd file
|
||||||
|
ALTER TABLE tab DISCARD TABLESPACE;
|
||||||
|
|
||||||
|
# Move the *.ibd,*.cfg file into orginal location
|
||||||
|
--move_file $MYSQLD_DATADIR/tab.cfg $MYSQLD_DATADIR/test/tab.cfg
|
||||||
|
--move_file $MYSQLD_DATADIR/tab.ibd $MYSQLD_DATADIR/test/tab.ibd
|
||||||
|
|
||||||
|
--error ER_TABLE_SCHEMA_MISMATCH
|
||||||
|
ALTER TABLE tab IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
# Take the backup of the ibd and cfg files
|
||||||
|
--copy_file $MYSQLD_DATADIR/test/tab.cfg $MYSQLD_DATADIR/tab.cfg
|
||||||
|
--copy_file $MYSQLD_DATADIR/test/tab.ibd $MYSQLD_DATADIR/tab.ibd
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
DROP TABLE tab;
|
||||||
|
|
||||||
|
# Remove orphan files
|
||||||
|
--remove_file $MYSQLD_DATADIR/test/tab.cfg
|
||||||
|
--remove_file $MYSQLD_DATADIR/test/tab.ibd
|
||||||
|
|
||||||
|
# Set the default_row_format=Compact
|
||||||
|
SET GLOBAL innodb_default_row_format=Compact;
|
||||||
|
|
||||||
|
# Check row_format=Compact
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
|
||||||
|
CREATE TABLE tab(a INT) ENGINE=InnoDB;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
|
||||||
|
# Remove the *.ibd file
|
||||||
|
ALTER TABLE tab DISCARD TABLESPACE;
|
||||||
|
|
||||||
|
# Move the *ibd,*.cfg file into orginal location
|
||||||
|
--move_file $MYSQLD_DATADIR/tab.cfg $MYSQLD_DATADIR/test/tab.cfg
|
||||||
|
--move_file $MYSQLD_DATADIR/tab.ibd $MYSQLD_DATADIR/test/tab.ibd
|
||||||
|
|
||||||
|
# Check import is successful (because same row_format)
|
||||||
|
ALTER TABLE tab IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
# Check the rows
|
||||||
|
SELECT * FROM tab;
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
DROP TABLE tab;
|
||||||
|
|
||||||
|
--echo # ###########################################################
|
||||||
|
# Check when Index Column size (3070 bytes) is too long, Change row_format
|
||||||
|
# Check when Index Column size (767 bytes), Change row_format
|
||||||
|
# Dynamic to Compact to Dynamic
|
||||||
|
|
||||||
|
# Set the default_row_format=Dynamic
|
||||||
|
SET GLOBAL innodb_default_row_format=Dynamic;
|
||||||
|
SET GLOBAL innodb_large_prefix=ON;
|
||||||
|
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
|
||||||
|
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(3070))) ENGINE= InnoDB;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
|
||||||
|
INSERT INTO tab(a,b) VALUES(1,'Check with max column size');
|
||||||
|
|
||||||
|
# Check by SELECT, no errors
|
||||||
|
SELECT * FROM tab;
|
||||||
|
|
||||||
|
# Change row_format to Compact
|
||||||
|
SET GLOBAL innodb_default_row_format=COMPACT;
|
||||||
|
|
||||||
|
# Check error ERROR 1709 (HY000): Index column size too large
|
||||||
|
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||||
|
ALTER TABLE tab ROW_FORMAT=COMPACT;
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
DROP TABLE tab;
|
||||||
|
|
||||||
|
# Change the default_row_format to default
|
||||||
|
SET GLOBAL innodb_default_row_format=Default;
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
SET GLOBAL innodb_default_row_format=Dynamic;
|
||||||
|
|
||||||
|
# Change row_format to Dynamic
|
||||||
|
SELECT @@innodb_default_row_format;
|
||||||
|
|
||||||
|
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(767))) ENGINE= InnoDB;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
|
||||||
|
INSERT INTO tab(a,b) VALUES(1,'Check with max column size');
|
||||||
|
|
||||||
|
# Check by SELECT, no errors
|
||||||
|
SELECT * FROM tab;
|
||||||
|
|
||||||
|
# Check no errors because Compact allows 767 bytes
|
||||||
|
ALTER TABLE tab ROW_FORMAT=COMPACT;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
|
||||||
|
# Check by SELECT, no errors
|
||||||
|
SELECT * FROM tab;
|
||||||
|
|
||||||
|
# Check no errors
|
||||||
|
ALTER TABLE tab ROW_FORMAT=COMPRESSED;
|
||||||
|
|
||||||
|
# Check by SELECT, no errors
|
||||||
|
SELECT * FROM tab;
|
||||||
|
|
||||||
|
# Check no errors
|
||||||
|
ALTER TABLE tab ROW_FORMAT=Dynamic;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 'tab';
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
DROP TABLE tab;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_default_row_format = @row_format;
|
||||||
|
SET GLOBAL innodb_large_prefix = @large_prefix;
|
||||||
|
SET GLOBAL innodb_file_format = @file_format;
|
28
mysql-test/suite/innodb/t/default_row_format_create.test
Normal file
28
mysql-test/suite/innodb/t/default_row_format_create.test
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
--source include/innodb_row_format.inc
|
||||||
|
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB
|
||||||
|
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
|
||||||
|
SHOW TABLE STATUS LIKE 't1';
|
||||||
|
DROP TABLE t1;
|
@@ -0,0 +1 @@
|
|||||||
|
--innodb_large_prefix=OFF --innodb_file_format=barracuda --innodb-file-format-check=off --innodb-file-format-max=antelope
|
76
mysql-test/suite/innodb/t/file_format_defaults.test
Normal file
76
mysql-test/suite/innodb/t/file_format_defaults.test
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
#***********************************************************
|
||||||
|
# WL#7703:
|
||||||
|
# Check the max key length 3072 when innodb_large_prefix=ON
|
||||||
|
# Check boundary value of max key length 3073
|
||||||
|
# When innodb_file_format=Antelope, compress DDLs fails
|
||||||
|
# Check file_format_max becomes Barracuda on DDL operation
|
||||||
|
# on compression table.
|
||||||
|
#***********************************************************
|
||||||
|
-- source include/have_innodb.inc
|
||||||
|
-- source include/have_innodb_16k.inc
|
||||||
|
|
||||||
|
call mtr.add_suppression("InnoDB: Cannot add field `c1` in table `test`\\.`tab0`");
|
||||||
|
|
||||||
|
# Check some default settings
|
||||||
|
SELECT @@innodb_strict_mode;
|
||||||
|
|
||||||
|
SELECT @@innodb_file_per_table;
|
||||||
|
|
||||||
|
SET @file_format = @@GLOBAL.innodb_file_format;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_large_prefix=ON;
|
||||||
|
SET SQL_MODE=strict_all_tables;
|
||||||
|
|
||||||
|
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
SHOW CREATE TABLE tab0;
|
||||||
|
DROP TABLE tab0;
|
||||||
|
|
||||||
|
--error ER_TOO_BIG_ROWSIZE
|
||||||
|
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB KEY_BLOCK_SIZE=2;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_file_format=Antelope;
|
||||||
|
|
||||||
|
--error ER_CANT_CREATE_TABLE
|
||||||
|
CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_file_format=Default;
|
||||||
|
|
||||||
|
CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
|
||||||
|
DROP TABLE tab0;
|
||||||
|
|
||||||
|
SELECT @@innodb_file_format;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_strict_mode=OFF;
|
||||||
|
|
||||||
|
# Check with default value
|
||||||
|
SET GLOBAL innodb_strict_mode=Default;
|
||||||
|
|
||||||
|
SELECT @@innodb_strict_mode;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_large_prefix=OFF;
|
||||||
|
|
||||||
|
SELECT @@innodb_large_prefix;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_large_prefix=Default;
|
||||||
|
|
||||||
|
# Check with default value
|
||||||
|
SELECT @@innodb_large_prefix;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_file_format_max=Default;
|
||||||
|
|
||||||
|
# Check with default value
|
||||||
|
SELECT @@innodb_file_format_max;
|
||||||
|
|
||||||
|
CREATE TABLE tab1(c1 int ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
|
||||||
|
# Check file format changed to Barracuda, on DDL operation
|
||||||
|
SELECT @@innodb_file_format_max;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_file_format_max=Default;
|
||||||
|
|
||||||
|
# Restore to the value that we explicitly used at startup.
|
||||||
|
SET GLOBAL innodb_large_prefix=off;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_file_format = @file_format;
|
||||||
|
|
||||||
|
DROP TABLE tab1;
|
@@ -613,6 +613,24 @@ select cast('-0.0' as decimal(5,1)) < 0;
|
|||||||
--echo # End of 5.5 tests
|
--echo # End of 5.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Start of 10.2 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-15420 Wrong result for CAST from TIME or DATETIME with zero integer part and non-zero microseconds to DECIMAL(X,Y)
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SET sql_mode=''; # Allow zero date
|
||||||
|
SELECT
|
||||||
|
CAST(TIMESTAMP'0000-00-00 00:00:00.123456' AS DECIMAL(10,6)) AS c1,
|
||||||
|
CAST(TIME'00:00:00.123456' AS DECIMAL(10,6)) AS c2;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.2 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Start of 10.3 tests
|
--echo # Start of 10.3 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@@ -441,6 +441,42 @@ connection default;
|
|||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
disconnect con2;
|
disconnect con2;
|
||||||
|
|
||||||
# Wait till all disconnects are completed
|
|
||||||
|
#
|
||||||
|
# MDEV 15217 Assertion `thd->transaction.xid_state.xid.is_null()' failed in trans_xa_start.
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
|
||||||
|
CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t2 VALUES (1),(2);
|
||||||
|
CREATE TABLE t3 (i INT) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
XA BEGIN 'xid1';
|
||||||
|
REPLACE INTO t1 SELECT * FROM t2;
|
||||||
|
|
||||||
|
--connect (con1,localhost,root,,test)
|
||||||
|
XA BEGIN 'xid2';
|
||||||
|
--send
|
||||||
|
INSERT INTO t1 SELECT * FROM t2;
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
REPLACE INTO t2 SELECT * FROM t2;
|
||||||
|
|
||||||
|
--connection con1
|
||||||
|
--error ER_LOCK_DEADLOCK
|
||||||
|
--reap
|
||||||
|
--disconnect con1
|
||||||
|
|
||||||
|
--connect (con2,localhost,root,,test)
|
||||||
|
INSERT INTO t3 VALUES (1);
|
||||||
|
XA BEGIN 'xid3';
|
||||||
|
|
||||||
|
|
||||||
|
#Cleanup
|
||||||
|
--disconnect con2
|
||||||
|
--connection default
|
||||||
|
XA END 'xid1';
|
||||||
|
XA ROLLBACK 'xid1';
|
||||||
|
DROP TABLE t1, t2, t3;
|
||||||
|
|
||||||
--source include/wait_until_count_sessions.inc
|
--source include/wait_until_count_sessions.inc
|
||||||
|
|
||||||
|
@@ -6,9 +6,9 @@ machine="Linux-x64"
|
|||||||
|
|
||||||
# InnoDB tests
|
# InnoDB tests
|
||||||
|
|
||||||
./run-all-tests --suffix=-innodb --comments="Engine=InnoDB --innodb_buffer_pool_size=256M --innodb_additional_mem_pool_size=20M --innodb_log_file_size=1000M --innodb_log_buffer_size=16M --innodb_lock_wait_timeout=50 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT --innodb_log_files_in_group=2 --skip-innodb-doublewrite" --create-options="ENGINE=InnoDB" --hw="$hw" --optimization="$optimization" --machine="$machine" --log
|
./run-all-tests --suffix=-innodb --comments="Engine=InnoDB --innodb_buffer_pool_size=256M --innodb_log_file_size=1000M --innodb_log_buffer_size=16M --innodb_lock_wait_timeout=50 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT --innodb_log_files_in_group=2 --skip-innodb-doublewrite" --create-options="ENGINE=InnoDB" --hw="$hw" --optimization="$optimization" --machine="$machine" --log
|
||||||
|
|
||||||
./run-all-tests --suffix=_fast-innodb --comments="Engine=InnoDB --innodb_buffer_pool_size=256M --innodb_additional_mem_pool_size=20M --innodb_log_file_size=1000M --innodb_log_buffer_size=16M --innodb_lock_wait_timeout=50 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT --innodb_log_files_in_group=2 --skip-innodb-doublewrite" --create-options="ENGINE=InnoDB" --hw="$hw" --optimization="$optimization" --machine="$machine" --fast --log
|
./run-all-tests --suffix=_fast-innodb --comments="Engine=InnoDB --innodb_buffer_pool_size=256M --innodb_log_file_size=1000M --innodb_log_buffer_size=16M --innodb_lock_wait_timeout=50 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT --innodb_log_files_in_group=2 --skip-innodb-doublewrite" --create-options="ENGINE=InnoDB" --hw="$hw" --optimization="$optimization" --machine="$machine" --fast --log
|
||||||
|
|
||||||
# MyISAM tests
|
# MyISAM tests
|
||||||
|
|
||||||
|
@@ -1507,6 +1507,7 @@ void THD::cleanup(void)
|
|||||||
close_temporary_tables();
|
close_temporary_tables();
|
||||||
|
|
||||||
transaction.xid_state.xa_state= XA_NOTR;
|
transaction.xid_state.xa_state= XA_NOTR;
|
||||||
|
transaction.xid_state.rm_error= 0;
|
||||||
trans_rollback(this);
|
trans_rollback(this);
|
||||||
xid_cache_delete(this, &transaction.xid_state);
|
xid_cache_delete(this, &transaction.xid_state);
|
||||||
|
|
||||||
|
@@ -19091,7 +19091,7 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
|
|||||||
skip_over= FALSE;
|
skip_over= FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (join_tab->keep_current_rowid)
|
if (join_tab->keep_current_rowid && !error)
|
||||||
join_tab->table->file->position(join_tab->table->record[0]);
|
join_tab->table->file->position(join_tab->table->record[0]);
|
||||||
|
|
||||||
rc= evaluate_join_record(join, join_tab, error);
|
rc= evaluate_join_record(join, join_tab, error);
|
||||||
|
@@ -5887,9 +5887,9 @@ buf_page_check_corrupt(buf_page_t* bpage, fil_space_t* space)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Complete a read or write request of a file page to or from the buffer pool.
|
/** Complete a read or write request of a file page to or from the buffer pool.
|
||||||
@param[in,out] bpage Page to complete
|
@param[in,out] bpage page to complete
|
||||||
@param[in] evict whether or not to evict the page
|
@param[in] dblwr whether the doublewrite buffer was used (on write)
|
||||||
from LRU list.
|
@param[in] evict whether or not to evict the page from LRU list
|
||||||
@return whether the operation succeeded
|
@return whether the operation succeeded
|
||||||
@retval DB_SUCCESS always when writing, or if a read page was OK
|
@retval DB_SUCCESS always when writing, or if a read page was OK
|
||||||
@retval DB_TABLESPACE_DELETED if the tablespace does not exist
|
@retval DB_TABLESPACE_DELETED if the tablespace does not exist
|
||||||
@@ -5899,7 +5899,7 @@ buf_page_check_corrupt(buf_page_t* bpage, fil_space_t* space)
|
|||||||
not match */
|
not match */
|
||||||
UNIV_INTERN
|
UNIV_INTERN
|
||||||
dberr_t
|
dberr_t
|
||||||
buf_page_io_complete(buf_page_t* bpage, bool evict)
|
buf_page_io_complete(buf_page_t* bpage, bool dblwr, bool evict)
|
||||||
{
|
{
|
||||||
enum buf_io_fix io_type;
|
enum buf_io_fix io_type;
|
||||||
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
|
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
|
||||||
@@ -6093,8 +6093,9 @@ database_corrupted:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BPageMutex* block_mutex = buf_page_get_mutex(bpage);
|
||||||
buf_pool_mutex_enter(buf_pool);
|
buf_pool_mutex_enter(buf_pool);
|
||||||
mutex_enter(buf_page_get_mutex(bpage));
|
mutex_enter(block_mutex);
|
||||||
|
|
||||||
#ifdef UNIV_IBUF_COUNT_DEBUG
|
#ifdef UNIV_IBUF_COUNT_DEBUG
|
||||||
if (io_type == BUF_IO_WRITE || uncompressed) {
|
if (io_type == BUF_IO_WRITE || uncompressed) {
|
||||||
@@ -6112,8 +6113,7 @@ database_corrupted:
|
|||||||
buf_page_set_io_fix(bpage, BUF_IO_NONE);
|
buf_page_set_io_fix(bpage, BUF_IO_NONE);
|
||||||
buf_page_monitor(bpage, io_type);
|
buf_page_monitor(bpage, io_type);
|
||||||
|
|
||||||
switch (io_type) {
|
if (io_type == BUF_IO_READ) {
|
||||||
case BUF_IO_READ:
|
|
||||||
/* NOTE that the call to ibuf may have moved the ownership of
|
/* NOTE that the call to ibuf may have moved the ownership of
|
||||||
the x-latch to this OS thread: do not let this confuse you in
|
the x-latch to this OS thread: do not let this confuse you in
|
||||||
debugging! */
|
debugging! */
|
||||||
@@ -6127,15 +6127,12 @@ database_corrupted:
|
|||||||
BUF_IO_READ);
|
BUF_IO_READ);
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_exit(buf_page_get_mutex(bpage));
|
mutex_exit(block_mutex);
|
||||||
|
} else {
|
||||||
break;
|
|
||||||
|
|
||||||
case BUF_IO_WRITE:
|
|
||||||
/* Write means a flush operation: call the completion
|
/* Write means a flush operation: call the completion
|
||||||
routine in the flush system */
|
routine in the flush system */
|
||||||
|
|
||||||
buf_flush_write_complete(bpage);
|
buf_flush_write_complete(bpage, dblwr);
|
||||||
|
|
||||||
if (uncompressed) {
|
if (uncompressed) {
|
||||||
rw_lock_sx_unlock_gen(&((buf_block_t*) bpage)->lock,
|
rw_lock_sx_unlock_gen(&((buf_block_t*) bpage)->lock,
|
||||||
@@ -6154,18 +6151,11 @@ database_corrupted:
|
|||||||
evict = true;
|
evict = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_exit(block_mutex);
|
||||||
|
|
||||||
if (evict) {
|
if (evict) {
|
||||||
mutex_exit(buf_page_get_mutex(bpage));
|
|
||||||
buf_LRU_free_page(bpage, true);
|
buf_LRU_free_page(bpage, true);
|
||||||
} else {
|
|
||||||
mutex_exit(buf_page_get_mutex(bpage));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
ut_error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_PRINT("ib_buf", ("%s page %u:%u",
|
DBUG_PRINT("ib_buf", ("%s page %u:%u",
|
||||||
|
@@ -107,9 +107,6 @@ buf_dblwr_sync_datafiles()
|
|||||||
/* Wait that all async writes to tablespaces have been posted to
|
/* Wait that all async writes to tablespaces have been posted to
|
||||||
the OS */
|
the OS */
|
||||||
os_aio_wait_until_no_pending_writes();
|
os_aio_wait_until_no_pending_writes();
|
||||||
|
|
||||||
/* Now we flush the data to disk (for example, with fsync) */
|
|
||||||
fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************//**
|
/****************************************************************//**
|
||||||
@@ -724,12 +721,9 @@ buf_dblwr_update(
|
|||||||
const buf_page_t* bpage, /*!< in: buffer block descriptor */
|
const buf_page_t* bpage, /*!< in: buffer block descriptor */
|
||||||
buf_flush_t flush_type)/*!< in: flush type */
|
buf_flush_t flush_type)/*!< in: flush type */
|
||||||
{
|
{
|
||||||
if (!srv_use_doublewrite_buf
|
ut_ad(srv_use_doublewrite_buf);
|
||||||
|| buf_dblwr == NULL
|
ut_ad(buf_dblwr);
|
||||||
|| fsp_is_system_temporary(bpage->id.space())) {
|
ut_ad(!fsp_is_system_temporary(bpage->id.space()));
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ut_ad(!srv_read_only_mode);
|
ut_ad(!srv_read_only_mode);
|
||||||
|
|
||||||
switch (flush_type) {
|
switch (flush_type) {
|
||||||
@@ -957,6 +951,8 @@ buf_dblwr_flush_buffered_writes()
|
|||||||
if (!srv_use_doublewrite_buf || buf_dblwr == NULL) {
|
if (!srv_use_doublewrite_buf || buf_dblwr == NULL) {
|
||||||
/* Sync the writes to the disk. */
|
/* Sync the writes to the disk. */
|
||||||
buf_dblwr_sync_datafiles();
|
buf_dblwr_sync_datafiles();
|
||||||
|
/* Now we flush the data to disk (for example, with fsync) */
|
||||||
|
fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -992,7 +988,6 @@ try_again:
|
|||||||
goto try_again;
|
goto try_again;
|
||||||
}
|
}
|
||||||
|
|
||||||
ut_a(!buf_dblwr->batch_running);
|
|
||||||
ut_ad(buf_dblwr->first_free == buf_dblwr->b_reserved);
|
ut_ad(buf_dblwr->first_free == buf_dblwr->b_reserved);
|
||||||
|
|
||||||
/* Disallow anyone else to post to doublewrite buffer or to
|
/* Disallow anyone else to post to doublewrite buffer or to
|
||||||
|
@@ -776,12 +776,10 @@ buf_flush_relocate_on_flush_list(
|
|||||||
buf_flush_list_mutex_exit(buf_pool);
|
buf_flush_list_mutex_exit(buf_pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************//**
|
/** Update the flush system data structures when a write is completed.
|
||||||
Updates the flush system data structures when a write is completed. */
|
@param[in,out] bpage flushed page
|
||||||
void
|
@param[in] dblwr whether the doublewrite buffer was used */
|
||||||
buf_flush_write_complete(
|
void buf_flush_write_complete(buf_page_t* bpage, bool dblwr)
|
||||||
/*=====================*/
|
|
||||||
buf_page_t* bpage) /*!< in: pointer to the block in question */
|
|
||||||
{
|
{
|
||||||
buf_flush_t flush_type;
|
buf_flush_t flush_type;
|
||||||
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
|
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
|
||||||
@@ -804,8 +802,10 @@ buf_flush_write_complete(
|
|||||||
os_event_set(buf_pool->no_flush[flush_type]);
|
os_event_set(buf_pool->no_flush[flush_type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dblwr) {
|
||||||
buf_dblwr_update(bpage, flush_type);
|
buf_dblwr_update(bpage, flush_type);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Calculate the checksum of a page from compressed table and update
|
/** Calculate the checksum of a page from compressed table and update
|
||||||
the page.
|
the page.
|
||||||
@@ -832,18 +832,14 @@ buf_flush_update_zip_checksum(
|
|||||||
@param[in] block buffer block; NULL if bypassing the buffer pool
|
@param[in] block buffer block; NULL if bypassing the buffer pool
|
||||||
@param[in,out] page page frame
|
@param[in,out] page page frame
|
||||||
@param[in,out] page_zip_ compressed page, or NULL if uncompressed
|
@param[in,out] page_zip_ compressed page, or NULL if uncompressed
|
||||||
@param[in] newest_lsn newest modification LSN to the page
|
@param[in] newest_lsn newest modification LSN to the page */
|
||||||
@param[in] skip_checksum whether to disable the page checksum */
|
|
||||||
void
|
void
|
||||||
buf_flush_init_for_writing(
|
buf_flush_init_for_writing(
|
||||||
const buf_block_t* block,
|
const buf_block_t* block,
|
||||||
byte* page,
|
byte* page,
|
||||||
void* page_zip_,
|
void* page_zip_,
|
||||||
lsn_t newest_lsn,
|
lsn_t newest_lsn)
|
||||||
bool skip_checksum)
|
|
||||||
{
|
{
|
||||||
ib_uint32_t checksum = BUF_NO_CHECKSUM_MAGIC;
|
|
||||||
|
|
||||||
ut_ad(block == NULL || block->frame == page);
|
ut_ad(block == NULL || block->frame == page);
|
||||||
ut_ad(block == NULL || page_zip_ == NULL
|
ut_ad(block == NULL || page_zip_ == NULL
|
||||||
|| &block->page.zip == page_zip_);
|
|| &block->page.zip == page_zip_);
|
||||||
@@ -895,13 +891,7 @@ buf_flush_init_for_writing(
|
|||||||
mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
|
mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
|
||||||
newest_lsn);
|
newest_lsn);
|
||||||
|
|
||||||
if (skip_checksum) {
|
if (block && srv_page_size == 16384) {
|
||||||
ut_ad(block == NULL
|
|
||||||
|| block->page.id.space() == SRV_TMP_SPACE_ID);
|
|
||||||
ut_ad(page_get_space_id(page) == SRV_TMP_SPACE_ID);
|
|
||||||
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum);
|
|
||||||
} else {
|
|
||||||
if (block != NULL && UNIV_PAGE_SIZE == 16384) {
|
|
||||||
/* The page type could be garbage in old files
|
/* The page type could be garbage in old files
|
||||||
created before MySQL 5.5. Such files always
|
created before MySQL 5.5. Such files always
|
||||||
had a page size of 16 kilobytes. */
|
had a page size of 16 kilobytes. */
|
||||||
@@ -962,44 +952,36 @@ buf_flush_init_for_writing(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ((srv_checksum_algorithm_t) srv_checksum_algorithm) {
|
uint32_t checksum;
|
||||||
|
|
||||||
|
switch (srv_checksum_algorithm_t(srv_checksum_algorithm)) {
|
||||||
|
case SRV_CHECKSUM_ALGORITHM_INNODB:
|
||||||
|
case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
|
||||||
|
checksum = buf_calc_page_new_checksum(page);
|
||||||
|
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
|
||||||
|
checksum);
|
||||||
|
/* With the InnoDB checksum, we overwrite the first 4 bytes of
|
||||||
|
the end lsn field to store the old formula checksum. Since it
|
||||||
|
depends also on the field FIL_PAGE_SPACE_OR_CHKSUM, it has to
|
||||||
|
be calculated after storing the new formula checksum. */
|
||||||
|
checksum = buf_calc_page_old_checksum(page);
|
||||||
|
break;
|
||||||
case SRV_CHECKSUM_ALGORITHM_CRC32:
|
case SRV_CHECKSUM_ALGORITHM_CRC32:
|
||||||
case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
|
case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
|
||||||
|
/* In other cases we write the same checksum to both fields. */
|
||||||
checksum = buf_calc_page_crc32(page);
|
checksum = buf_calc_page_crc32(page);
|
||||||
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
|
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
|
||||||
checksum);
|
checksum);
|
||||||
break;
|
break;
|
||||||
case SRV_CHECKSUM_ALGORITHM_INNODB:
|
|
||||||
case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
|
|
||||||
checksum = (ib_uint32_t) buf_calc_page_new_checksum(
|
|
||||||
page);
|
|
||||||
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
|
|
||||||
checksum);
|
|
||||||
checksum = (ib_uint32_t) buf_calc_page_old_checksum(
|
|
||||||
page);
|
|
||||||
break;
|
|
||||||
case SRV_CHECKSUM_ALGORITHM_NONE:
|
case SRV_CHECKSUM_ALGORITHM_NONE:
|
||||||
case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
|
case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
|
||||||
|
checksum = BUF_NO_CHECKSUM_MAGIC;
|
||||||
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
|
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
|
||||||
checksum);
|
checksum);
|
||||||
break;
|
break;
|
||||||
/* no default so the compiler will emit a warning if
|
/* no default so the compiler will emit a warning if
|
||||||
new enum is added and not handled here */
|
new enum is added and not handled here */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* With the InnoDB checksum, we overwrite the first 4 bytes of
|
|
||||||
the end lsn field to store the old formula checksum. Since it
|
|
||||||
depends also on the field FIL_PAGE_SPACE_OR_CHKSUM, it has to
|
|
||||||
be calculated after storing the new formula checksum.
|
|
||||||
|
|
||||||
In other cases we write the same value to both fields.
|
|
||||||
If CRC32 is used then it is faster to use that checksum
|
|
||||||
(calculated above) instead of calculating another one.
|
|
||||||
We can afford to store something other than
|
|
||||||
buf_calc_page_old_checksum() or BUF_NO_CHECKSUM_MAGIC in
|
|
||||||
this field because the file will not be readable by old
|
|
||||||
versions of MySQL/InnoDB anyway (older than MySQL 5.6.3) */
|
|
||||||
|
|
||||||
mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
|
mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
|
||||||
checksum);
|
checksum);
|
||||||
@@ -1025,8 +1007,8 @@ buf_flush_write_block_low(
|
|||||||
ut_ad(space->purpose == FIL_TYPE_TEMPORARY
|
ut_ad(space->purpose == FIL_TYPE_TEMPORARY
|
||||||
|| space->purpose == FIL_TYPE_IMPORT
|
|| space->purpose == FIL_TYPE_IMPORT
|
||||||
|| space->purpose == FIL_TYPE_TABLESPACE);
|
|| space->purpose == FIL_TYPE_TABLESPACE);
|
||||||
const bool is_temp = space->purpose == FIL_TYPE_TEMPORARY;
|
ut_ad((space->purpose == FIL_TYPE_TEMPORARY)
|
||||||
ut_ad(is_temp == fsp_is_system_temporary(space->id));
|
== fsp_is_system_temporary(space->id));
|
||||||
page_t* frame = NULL;
|
page_t* frame = NULL;
|
||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
|
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
|
||||||
@@ -1088,20 +1070,15 @@ buf_flush_write_block_low(
|
|||||||
reinterpret_cast<const buf_block_t*>(bpage),
|
reinterpret_cast<const buf_block_t*>(bpage),
|
||||||
reinterpret_cast<const buf_block_t*>(bpage)->frame,
|
reinterpret_cast<const buf_block_t*>(bpage)->frame,
|
||||||
bpage->zip.data ? &bpage->zip : NULL,
|
bpage->zip.data ? &bpage->zip : NULL,
|
||||||
bpage->newest_modification, is_temp);
|
bpage->newest_modification);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
frame = buf_page_encrypt_before_write(space, bpage, frame);
|
frame = buf_page_encrypt_before_write(space, bpage, frame);
|
||||||
|
|
||||||
/* Disable use of double-write buffer for temporary tablespace.
|
ut_ad(space->purpose == FIL_TYPE_TABLESPACE
|
||||||
Given the nature and load of temporary tablespace doublewrite buffer
|
|| space->atomic_write_supported);
|
||||||
adds an overhead during flushing. */
|
if (!space->use_doublewrite()) {
|
||||||
|
|
||||||
if (is_temp || space->atomic_write_supported
|
|
||||||
|| !srv_use_doublewrite_buf
|
|
||||||
|| buf_dblwr == NULL) {
|
|
||||||
|
|
||||||
ulint type = IORequest::WRITE | IORequest::DO_NOT_WAKE;
|
ulint type = IORequest::WRITE | IORequest::DO_NOT_WAKE;
|
||||||
|
|
||||||
IORequest request(type, bpage);
|
IORequest request(type, bpage);
|
||||||
@@ -1126,7 +1103,7 @@ buf_flush_write_block_low(
|
|||||||
are working on. */
|
are working on. */
|
||||||
if (sync) {
|
if (sync) {
|
||||||
ut_ad(flush_type == BUF_FLUSH_SINGLE_PAGE);
|
ut_ad(flush_type == BUF_FLUSH_SINGLE_PAGE);
|
||||||
if (!is_temp) {
|
if (space->purpose != FIL_TYPE_TEMPORARY) {
|
||||||
fil_flush(space);
|
fil_flush(space);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1141,7 +1118,7 @@ buf_flush_write_block_low(
|
|||||||
#endif
|
#endif
|
||||||
/* true means we want to evict this page from the
|
/* true means we want to evict this page from the
|
||||||
LRU list as well. */
|
LRU list as well. */
|
||||||
buf_page_io_complete(bpage, true);
|
buf_page_io_complete(bpage, space->use_doublewrite(), true);
|
||||||
|
|
||||||
ut_ad(err == DB_SUCCESS);
|
ut_ad(err == DB_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@@ -433,10 +433,15 @@ fil_space_set_imported(
|
|||||||
mutex_enter(&fil_system->mutex);
|
mutex_enter(&fil_system->mutex);
|
||||||
|
|
||||||
fil_space_t* space = fil_space_get_by_id(id);
|
fil_space_t* space = fil_space_get_by_id(id);
|
||||||
|
const fil_node_t* node = UT_LIST_GET_FIRST(space->chain);
|
||||||
|
|
||||||
ut_ad(space->purpose == FIL_TYPE_IMPORT);
|
ut_ad(space->purpose == FIL_TYPE_IMPORT);
|
||||||
space->purpose = FIL_TYPE_TABLESPACE;
|
space->purpose = FIL_TYPE_TABLESPACE;
|
||||||
|
space->atomic_write_supported = node->atomic_write
|
||||||
|
&& srv_use_atomic_writes
|
||||||
|
&& my_test_if_atomic_write(node->handle,
|
||||||
|
int(page_size_t(space->flags)
|
||||||
|
.physical()));
|
||||||
mutex_exit(&fil_system->mutex);
|
mutex_exit(&fil_system->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -574,7 +579,7 @@ fil_node_open_file(
|
|||||||
ut_a(node->n_pending == 0);
|
ut_a(node->n_pending == 0);
|
||||||
ut_a(!node->is_open());
|
ut_a(!node->is_open());
|
||||||
|
|
||||||
read_only_mode = !fsp_is_system_temporary(space->id)
|
read_only_mode = space->purpose != FIL_TYPE_TEMPORARY
|
||||||
&& srv_read_only_mode;
|
&& srv_read_only_mode;
|
||||||
|
|
||||||
const bool first_time_open = node->size == 0;
|
const bool first_time_open = node->size == 0;
|
||||||
@@ -582,8 +587,8 @@ fil_node_open_file(
|
|||||||
if (first_time_open
|
if (first_time_open
|
||||||
|| (space->purpose == FIL_TYPE_TABLESPACE
|
|| (space->purpose == FIL_TYPE_TABLESPACE
|
||||||
&& node == UT_LIST_GET_FIRST(space->chain)
|
&& node == UT_LIST_GET_FIRST(space->chain)
|
||||||
&& !undo::Truncate::was_tablespace_truncated(space->id)
|
&& srv_startup_is_before_trx_rollback_phase
|
||||||
&& srv_startup_is_before_trx_rollback_phase)) {
|
&& !undo::Truncate::was_tablespace_truncated(space->id))) {
|
||||||
/* We do not know the size of the file yet. First we
|
/* We do not know the size of the file yet. First we
|
||||||
open the file in the normal mode, no async I/O here,
|
open the file in the normal mode, no async I/O here,
|
||||||
for simplicity. Then do some checks, and close the
|
for simplicity. Then do some checks, and close the
|
||||||
@@ -732,6 +737,11 @@ retry:
|
|||||||
|
|
||||||
if (first_time_open) {
|
if (first_time_open) {
|
||||||
/*
|
/*
|
||||||
|
For the temporary tablespace and during the
|
||||||
|
non-redo-logged adjustments in
|
||||||
|
IMPORT TABLESPACE, we do not care about
|
||||||
|
the atomicity of writes.
|
||||||
|
|
||||||
Atomic writes is supported if the file can be used
|
Atomic writes is supported if the file can be used
|
||||||
with atomic_writes (not log file), O_DIRECT is
|
with atomic_writes (not log file), O_DIRECT is
|
||||||
used (tested in ha_innodb.cc) and the file is
|
used (tested in ha_innodb.cc) and the file is
|
||||||
@@ -739,12 +749,14 @@ retry:
|
|||||||
for the given block size
|
for the given block size
|
||||||
*/
|
*/
|
||||||
space->atomic_write_supported
|
space->atomic_write_supported
|
||||||
= srv_use_atomic_writes
|
= space->purpose == FIL_TYPE_TEMPORARY
|
||||||
&& node->atomic_write
|
|| space->purpose == FIL_TYPE_IMPORT
|
||||||
|
|| (node->atomic_write
|
||||||
|
&& srv_use_atomic_writes
|
||||||
&& my_test_if_atomic_write(
|
&& my_test_if_atomic_write(
|
||||||
node->handle,
|
node->handle,
|
||||||
int(page_size_t(space->flags)
|
int(page_size_t(space->flags)
|
||||||
.physical()));
|
.physical())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1552,6 +1564,13 @@ fil_space_create(
|
|||||||
|
|
||||||
if (space->purpose == FIL_TYPE_TEMPORARY) {
|
if (space->purpose == FIL_TYPE_TEMPORARY) {
|
||||||
ut_d(space->latch.set_temp_fsp());
|
ut_d(space->latch.set_temp_fsp());
|
||||||
|
/* SysTablespace::open_or_create() would pass
|
||||||
|
size!=0 to fil_node_create(), so first_time_open
|
||||||
|
would not hold in fil_node_open_file(), and we
|
||||||
|
must assign this manually. We do not care about
|
||||||
|
the durability or atomicity of writes to the
|
||||||
|
temporary tablespace files. */
|
||||||
|
space->atomic_write_supported = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
HASH_INSERT(fil_space_t, hash, fil_system->spaces, id, space);
|
HASH_INSERT(fil_space_t, hash, fil_system->spaces, id, space);
|
||||||
@@ -5317,6 +5336,7 @@ fil_aio_wait(
|
|||||||
fil_node_complete_io(node, type);
|
fil_node_complete_io(node, type);
|
||||||
const fil_type_t purpose = node->space->purpose;
|
const fil_type_t purpose = node->space->purpose;
|
||||||
const ulint space_id= node->space->id;
|
const ulint space_id= node->space->id;
|
||||||
|
const bool dblwr = node->space->use_doublewrite();
|
||||||
|
|
||||||
mutex_exit(&fil_system->mutex);
|
mutex_exit(&fil_system->mutex);
|
||||||
|
|
||||||
@@ -5346,7 +5366,7 @@ fil_aio_wait(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ulint offset = bpage->id.page_no();
|
ulint offset = bpage->id.page_no();
|
||||||
dberr_t err = buf_page_io_complete(bpage);
|
dberr_t err = buf_page_io_complete(bpage, dblwr);
|
||||||
if (err == DB_SUCCESS) {
|
if (err == DB_SUCCESS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -600,17 +600,14 @@ fsp_init_file_page_low(
|
|||||||
buf_block_t* block) /*!< in: pointer to a page */
|
buf_block_t* block) /*!< in: pointer to a page */
|
||||||
{
|
{
|
||||||
page_t* page = buf_block_get_frame(block);
|
page_t* page = buf_block_get_frame(block);
|
||||||
page_zip_des_t* page_zip= buf_block_get_page_zip(block);
|
|
||||||
|
|
||||||
if (!fsp_is_system_temporary(block->page.id.space())) {
|
|
||||||
memset(page, 0, UNIV_PAGE_SIZE);
|
memset(page, 0, UNIV_PAGE_SIZE);
|
||||||
}
|
|
||||||
|
|
||||||
mach_write_to_4(page + FIL_PAGE_OFFSET, block->page.id.page_no());
|
mach_write_to_4(page + FIL_PAGE_OFFSET, block->page.id.page_no());
|
||||||
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID,
|
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID,
|
||||||
block->page.id.space());
|
block->page.id.space());
|
||||||
|
|
||||||
if (page_zip) {
|
if (page_zip_des_t* page_zip= buf_block_get_page_zip(block)) {
|
||||||
memset(page_zip->data, 0, page_zip_get_size(page_zip));
|
memset(page_zip->data, 0, page_zip_get_size(page_zip));
|
||||||
memcpy(page_zip->data + FIL_PAGE_OFFSET,
|
memcpy(page_zip->data + FIL_PAGE_OFFSET,
|
||||||
page + FIL_PAGE_OFFSET, 4);
|
page + FIL_PAGE_OFFSET, 4);
|
||||||
|
@@ -4447,6 +4447,7 @@ begin_sync:
|
|||||||
ib_vector_get(cache->indexes, i));
|
ib_vector_get(cache->indexes, i));
|
||||||
|
|
||||||
if (index_cache->index->to_be_dropped
|
if (index_cache->index->to_be_dropped
|
||||||
|
|| index_cache->index->table->to_be_dropped
|
||||||
|| fts_sync_index_check(index_cache)) {
|
|| fts_sync_index_check(index_cache)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -4465,10 +4466,9 @@ end_sync:
|
|||||||
/* Clear fts syncing flags of any indexes incase sync is
|
/* Clear fts syncing flags of any indexes incase sync is
|
||||||
interrupeted */
|
interrupeted */
|
||||||
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
|
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
|
||||||
fts_index_cache_t* index_cache;
|
static_cast<fts_index_cache_t*>(
|
||||||
index_cache = static_cast<fts_index_cache_t*>(
|
ib_vector_get(cache->indexes, i))
|
||||||
ib_vector_get(cache->indexes, i));
|
->index->index_fts_syncing = false;
|
||||||
index_cache->index->index_fts_syncing = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sync->interrupted = false;
|
sync->interrupted = false;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2013, 2017, MariaDB Corporation.
|
Copyright (c) 2013, 2018, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
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
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -1271,9 +1271,9 @@ buf_page_init_for_read(
|
|||||||
bool unzip);
|
bool unzip);
|
||||||
|
|
||||||
/** Complete a read or write request of a file page to or from the buffer pool.
|
/** Complete a read or write request of a file page to or from the buffer pool.
|
||||||
@param[in,out] bpage Page to complete
|
@param[in,out] bpage page to complete
|
||||||
@param[in] evict whether or not to evict the page
|
@param[in] dblwr whether the doublewrite buffer was used (on write)
|
||||||
from LRU list.
|
@param[in] evict whether or not to evict the page from LRU list
|
||||||
@return whether the operation succeeded
|
@return whether the operation succeeded
|
||||||
@retval DB_SUCCESS always when writing, or if a read page was OK
|
@retval DB_SUCCESS always when writing, or if a read page was OK
|
||||||
@retval DB_PAGE_CORRUPTED if the checksum fails on a page read
|
@retval DB_PAGE_CORRUPTED if the checksum fails on a page read
|
||||||
@@ -1282,7 +1282,7 @@ buf_page_init_for_read(
|
|||||||
not match */
|
not match */
|
||||||
UNIV_INTERN
|
UNIV_INTERN
|
||||||
dberr_t
|
dberr_t
|
||||||
buf_page_io_complete(buf_page_t* bpage, bool evict = false)
|
buf_page_io_complete(buf_page_t* bpage, bool dblwr = false, bool evict = false)
|
||||||
MY_ATTRIBUTE((nonnull));
|
MY_ATTRIBUTE((nonnull));
|
||||||
|
|
||||||
/********************************************************************//**
|
/********************************************************************//**
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2014, 2017, MariaDB Corporation.
|
Copyright (c) 2014, 2018, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
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
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -70,25 +70,21 @@ buf_flush_relocate_on_flush_list(
|
|||||||
/*=============================*/
|
/*=============================*/
|
||||||
buf_page_t* bpage, /*!< in/out: control block being moved */
|
buf_page_t* bpage, /*!< in/out: control block being moved */
|
||||||
buf_page_t* dpage); /*!< in/out: destination block */
|
buf_page_t* dpage); /*!< in/out: destination block */
|
||||||
/********************************************************************//**
|
/** Update the flush system data structures when a write is completed.
|
||||||
Updates the flush system data structures when a write is completed. */
|
@param[in,out] bpage flushed page
|
||||||
void
|
@param[in] dblwr whether the doublewrite buffer was used */
|
||||||
buf_flush_write_complete(
|
void buf_flush_write_complete(buf_page_t* bpage, bool dblwr);
|
||||||
/*=====================*/
|
|
||||||
buf_page_t* bpage); /*!< in: pointer to the block in question */
|
|
||||||
/** Initialize a page for writing to the tablespace.
|
/** Initialize a page for writing to the tablespace.
|
||||||
@param[in] block buffer block; NULL if bypassing the buffer pool
|
@param[in] block buffer block; NULL if bypassing the buffer pool
|
||||||
@param[in,out] page page frame
|
@param[in,out] page page frame
|
||||||
@param[in,out] page_zip_ compressed page, or NULL if uncompressed
|
@param[in,out] page_zip_ compressed page, or NULL if uncompressed
|
||||||
@param[in] newest_lsn newest modification LSN to the page
|
@param[in] newest_lsn newest modification LSN to the page */
|
||||||
@param[in] skip_checksum whether to disable the page checksum */
|
|
||||||
void
|
void
|
||||||
buf_flush_init_for_writing(
|
buf_flush_init_for_writing(
|
||||||
const buf_block_t* block,
|
const buf_block_t* block,
|
||||||
byte* page,
|
byte* page,
|
||||||
void* page_zip_,
|
void* page_zip_,
|
||||||
lsn_t newest_lsn,
|
lsn_t newest_lsn);
|
||||||
bool skip_checksum = false);
|
|
||||||
|
|
||||||
# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
|
# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
|
||||||
/********************************************************************//**
|
/********************************************************************//**
|
||||||
|
@@ -36,6 +36,8 @@ Created 10/25/1995 Heikki Tuuri
|
|||||||
#include "ibuf0types.h"
|
#include "ibuf0types.h"
|
||||||
|
|
||||||
// Forward declaration
|
// Forward declaration
|
||||||
|
extern ibool srv_use_doublewrite_buf;
|
||||||
|
extern struct buf_dblwr_t* buf_dblwr;
|
||||||
struct trx_t;
|
struct trx_t;
|
||||||
class page_id_t;
|
class page_id_t;
|
||||||
class truncate_t;
|
class truncate_t;
|
||||||
@@ -195,6 +197,13 @@ struct fil_space_t {
|
|||||||
{
|
{
|
||||||
return stop_new_ops || is_being_truncated;
|
return stop_new_ops || is_being_truncated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return whether doublewrite buffering is needed */
|
||||||
|
bool use_doublewrite() const
|
||||||
|
{
|
||||||
|
return !atomic_write_supported
|
||||||
|
&& srv_use_doublewrite_buf && buf_dblwr;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Value of fil_space_t::magic_n */
|
/** Value of fil_space_t::magic_n */
|
||||||
|
@@ -1489,8 +1489,12 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Avoid excessive mutex acquire/release */
|
/* Avoid excessive mutex acquire/release */
|
||||||
if (trx->in_depth++) {
|
++trx->in_depth;
|
||||||
/* The transaction is already inside InnoDB. */
|
|
||||||
|
/* If trx->in_depth is greater than 1 then
|
||||||
|
transaction is already in InnoDB. */
|
||||||
|
if (trx->in_depth > 1) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1518,7 +1522,10 @@ private:
|
|||||||
|
|
||||||
ut_ad(trx->in_depth > 0);
|
ut_ad(trx->in_depth > 0);
|
||||||
|
|
||||||
if (--trx->in_depth) {
|
--trx->in_depth;
|
||||||
|
|
||||||
|
if (trx->in_depth > 0) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -135,3 +135,17 @@ SELECT 1;
|
|||||||
1
|
1
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-15245: Assertion `false' failed in myrocks::ha_rocksdb::position
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=RocksDB;
|
||||||
|
INSERT INTO t1 VALUES (1),(2);
|
||||||
|
CREATE TABLE t2 (b INT) ENGINE=RocksDB
|
||||||
|
PARTITION BY RANGE(b)
|
||||||
|
(PARTITION p0 VALUES LESS THAN (1),
|
||||||
|
PARTITION p1 VALUES LESS THAN MAXVALUE);
|
||||||
|
INSERT INTO t2 VALUES (NULL),(0);
|
||||||
|
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.* FROM t1, t2;
|
||||||
|
UPDATE v1 SET b = 5;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2;
|
||||||
|
@@ -139,3 +139,22 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
|
|||||||
SELECT 1;
|
SELECT 1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-15245: Assertion `false' failed in myrocks::ha_rocksdb::position
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=RocksDB;
|
||||||
|
INSERT INTO t1 VALUES (1),(2);
|
||||||
|
# partitioning
|
||||||
|
CREATE TABLE t2 (b INT) ENGINE=RocksDB
|
||||||
|
PARTITION BY RANGE(b)
|
||||||
|
(PARTITION p0 VALUES LESS THAN (1),
|
||||||
|
PARTITION p1 VALUES LESS THAN MAXVALUE);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO t2 VALUES (NULL),(0);
|
||||||
|
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.* FROM t1, t2;
|
||||||
|
UPDATE v1 SET b = 5;
|
||||||
|
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2;
|
||||||
|
|
||||||
|
@@ -4,8 +4,9 @@ IF(CMAKE_VERSION VERSION_LESS "2.8.9")
|
|||||||
MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")
|
MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")
|
||||||
ELSEIF(NOT HAVE_DLOPEN)
|
ELSEIF(NOT HAVE_DLOPEN)
|
||||||
MESSAGE(STATUS "dlopen is required by TokuDB")
|
MESSAGE(STATUS "dlopen is required by TokuDB")
|
||||||
ELSEIF(NOT TARGET perfschema)
|
ELSEIF(PLUGIN_PERFSCHEMA MATCHES "^NO$")
|
||||||
MESSAGE(STATUS "Performance Schema is required by TokuDB")
|
MESSAGE(STATUS "Performance Schema is required by TokuDB")
|
||||||
|
RETURN()
|
||||||
ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
|
||||||
CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
|
CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
|
||||||
# tokudb requires F_NOCACHE or O_DIRECT, and designated initializers
|
# tokudb requires F_NOCACHE or O_DIRECT, and designated initializers
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2017, MariaDB Corporation.
|
Copyright (c) 2017, 2018, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
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
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -327,10 +327,8 @@ dict_build_table_def_step(
|
|||||||
|
|
||||||
mtr_commit(&mtr);
|
mtr_commit(&mtr);
|
||||||
} else {
|
} else {
|
||||||
/* Create in the system tablespace: disallow Barracuda
|
/* Create in the system tablespace */
|
||||||
features by keeping only the first bit which says whether
|
ut_ad(table->space == TRX_SYS_SPACE);
|
||||||
the row format is redundant or compact */
|
|
||||||
table->flags &= DICT_TF_COMPACT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
row = dict_create_sys_tables_tuple(table, node->heap);
|
row = dict_create_sys_tables_tuple(table, node->heap);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2016, 2017, MariaDB Corporation.
|
Copyright (c) 2016, 2018, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
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
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -4627,6 +4627,7 @@ begin_sync:
|
|||||||
ib_vector_get(cache->indexes, i));
|
ib_vector_get(cache->indexes, i));
|
||||||
|
|
||||||
if (index_cache->index->to_be_dropped
|
if (index_cache->index->to_be_dropped
|
||||||
|
|| index_cache->index->table->to_be_dropped
|
||||||
|| fts_sync_index_check(index_cache)) {
|
|| fts_sync_index_check(index_cache)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -4637,17 +4638,6 @@ begin_sync:
|
|||||||
end_sync:
|
end_sync:
|
||||||
if (error == DB_SUCCESS && !sync->interrupted) {
|
if (error == DB_SUCCESS && !sync->interrupted) {
|
||||||
error = fts_sync_commit(sync);
|
error = fts_sync_commit(sync);
|
||||||
if (error == DB_SUCCESS) {
|
|
||||||
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
|
|
||||||
fts_index_cache_t* index_cache;
|
|
||||||
index_cache = static_cast<fts_index_cache_t*>(
|
|
||||||
ib_vector_get(cache->indexes, i));
|
|
||||||
if (index_cache->index->index_fts_syncing) {
|
|
||||||
index_cache->index->index_fts_syncing
|
|
||||||
= false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
fts_sync_rollback(sync);
|
fts_sync_rollback(sync);
|
||||||
}
|
}
|
||||||
@@ -4656,12 +4646,9 @@ end_sync:
|
|||||||
/* Clear fts syncing flags of any indexes incase sync is
|
/* Clear fts syncing flags of any indexes incase sync is
|
||||||
interrupeted */
|
interrupeted */
|
||||||
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
|
for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
|
||||||
fts_index_cache_t* index_cache;
|
static_cast<fts_index_cache_t*>(
|
||||||
index_cache = static_cast<fts_index_cache_t*>(
|
ib_vector_get(cache->indexes, i))
|
||||||
ib_vector_get(cache->indexes, i));
|
->index->index_fts_syncing = false;
|
||||||
if (index_cache->index->index_fts_syncing == true) {
|
|
||||||
index_cache->index->index_fts_syncing = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sync->interrupted = false;
|
sync->interrupted = false;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2013, 2017, MariaDB Corporation.
|
Copyright (c) 2013, 2018, MariaDB Corporation.
|
||||||
Copyright (c) 2008, 2009 Google Inc.
|
Copyright (c) 2008, 2009 Google Inc.
|
||||||
Copyright (c) 2009, Percona Inc.
|
Copyright (c) 2009, Percona Inc.
|
||||||
Copyright (c) 2012, Facebook Inc.
|
Copyright (c) 2012, Facebook Inc.
|
||||||
@@ -372,6 +372,23 @@ static TYPELIB innodb_lock_schedule_algorithm_typelib = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** Possible values for system variable "innodb_default_row_format". */
|
||||||
|
static const char* innodb_default_row_format_names[] = {
|
||||||
|
"redundant",
|
||||||
|
"compact",
|
||||||
|
"dynamic",
|
||||||
|
NullS
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Used to define an enumerate type of the system variable
|
||||||
|
innodb_default_row_format. */
|
||||||
|
static TYPELIB innodb_default_row_format_typelib = {
|
||||||
|
array_elements(innodb_default_row_format_names) - 1,
|
||||||
|
"innodb_default_row_format_typelib",
|
||||||
|
innodb_default_row_format_names,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
/* The following counter is used to convey information to InnoDB
|
/* The following counter is used to convey information to InnoDB
|
||||||
about server activity: in case of normal DML ops it is not
|
about server activity: in case of normal DML ops it is not
|
||||||
sensible to call srv_active_wake_master_thread after each
|
sensible to call srv_active_wake_master_thread after each
|
||||||
@@ -392,6 +409,35 @@ static const char* innobase_change_buffering_values[IBUF_USE_COUNT] = {
|
|||||||
"all" /* IBUF_USE_ALL */
|
"all" /* IBUF_USE_ALL */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** Note we cannot use rec_format_enum because we do not allow
|
||||||
|
COMPRESSED row format for innodb_default_row_format option. */
|
||||||
|
enum default_row_format_enum {
|
||||||
|
DEFAULT_ROW_FORMAT_REDUNDANT = 0,
|
||||||
|
DEFAULT_ROW_FORMAT_COMPACT = 1,
|
||||||
|
DEFAULT_ROW_FORMAT_DYNAMIC = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Convert an InnoDB ROW_FORMAT value.
|
||||||
|
@param[in] row_format row_format from "innodb_default_row_format"
|
||||||
|
@return converted ROW_FORMAT */
|
||||||
|
static rec_format_t get_row_format(ulong row_format)
|
||||||
|
{
|
||||||
|
switch (row_format) {
|
||||||
|
case DEFAULT_ROW_FORMAT_REDUNDANT:
|
||||||
|
return REC_FORMAT_REDUNDANT;
|
||||||
|
case DEFAULT_ROW_FORMAT_COMPACT:
|
||||||
|
return REC_FORMAT_COMPACT;
|
||||||
|
case DEFAULT_ROW_FORMAT_DYNAMIC:
|
||||||
|
return REC_FORMAT_DYNAMIC;
|
||||||
|
default:
|
||||||
|
ut_ad(0);
|
||||||
|
return REC_FORMAT_COMPACT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static ulong innodb_default_row_format;
|
||||||
|
|
||||||
/* Call back function array defined by MySQL and used to
|
/* Call back function array defined by MySQL and used to
|
||||||
retrieve FTS results. */
|
retrieve FTS results. */
|
||||||
const struct _ft_vft ft_vft_result = {NULL,
|
const struct _ft_vft ft_vft_result = {NULL,
|
||||||
@@ -11859,8 +11905,6 @@ create_options_are_invalid(
|
|||||||
CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
|
CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
|
||||||
break;
|
break;
|
||||||
case ROW_TYPE_DYNAMIC:
|
case ROW_TYPE_DYNAMIC:
|
||||||
CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE(use_tablespace);
|
|
||||||
CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
|
|
||||||
/* ROW_FORMAT=DYNAMIC also shuns KEY_BLOCK_SIZE */
|
/* ROW_FORMAT=DYNAMIC also shuns KEY_BLOCK_SIZE */
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case ROW_TYPE_COMPACT:
|
case ROW_TYPE_COMPACT:
|
||||||
@@ -12095,7 +12139,8 @@ innobase_table_flags(
|
|||||||
bool zip_allowed = true;
|
bool zip_allowed = true;
|
||||||
ulint zip_ssize = 0;
|
ulint zip_ssize = 0;
|
||||||
enum row_type row_format;
|
enum row_type row_format;
|
||||||
rec_format_t innodb_row_format = REC_FORMAT_COMPACT;
|
rec_format_t innodb_row_format =
|
||||||
|
get_row_format(innodb_default_row_format);
|
||||||
bool use_data_dir;
|
bool use_data_dir;
|
||||||
ha_table_option_struct *options= form->s->option_struct;
|
ha_table_option_struct *options= form->s->option_struct;
|
||||||
|
|
||||||
@@ -12237,38 +12282,29 @@ index_bad:
|
|||||||
|
|
||||||
/* Validate the row format. Correct it if necessary */
|
/* Validate the row format. Correct it if necessary */
|
||||||
switch (row_format) {
|
switch (row_format) {
|
||||||
|
case ROW_TYPE_DEFAULT:
|
||||||
|
break;
|
||||||
case ROW_TYPE_REDUNDANT:
|
case ROW_TYPE_REDUNDANT:
|
||||||
innodb_row_format = REC_FORMAT_REDUNDANT;
|
innodb_row_format = REC_FORMAT_REDUNDANT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROW_TYPE_COMPRESSED:
|
|
||||||
case ROW_TYPE_DYNAMIC:
|
|
||||||
if (!use_tablespace) {
|
|
||||||
push_warning_printf(
|
|
||||||
thd, Sql_condition::WARN_LEVEL_WARN,
|
|
||||||
ER_ILLEGAL_HA_CREATE_OPTION,
|
|
||||||
"InnoDB: ROW_FORMAT=%s requires"
|
|
||||||
" innodb_file_per_table.",
|
|
||||||
get_row_format_name(row_format));
|
|
||||||
} else if (file_format_allowed == UNIV_FORMAT_A) {
|
|
||||||
push_warning_printf(
|
|
||||||
thd, Sql_condition::WARN_LEVEL_WARN,
|
|
||||||
ER_ILLEGAL_HA_CREATE_OPTION,
|
|
||||||
"InnoDB: ROW_FORMAT=%s requires"
|
|
||||||
" innodb_file_format > Antelope.",
|
|
||||||
get_row_format_name(row_format));
|
|
||||||
} else {
|
|
||||||
switch(row_format) {
|
|
||||||
case ROW_TYPE_COMPRESSED:
|
|
||||||
innodb_row_format = REC_FORMAT_COMPRESSED;
|
|
||||||
break;
|
|
||||||
case ROW_TYPE_DYNAMIC:
|
case ROW_TYPE_DYNAMIC:
|
||||||
innodb_row_format = REC_FORMAT_DYNAMIC;
|
innodb_row_format = REC_FORMAT_DYNAMIC;
|
||||||
break;
|
break;
|
||||||
default:
|
case ROW_TYPE_COMPRESSED:
|
||||||
/* Not possible, avoid compiler warning */
|
if (!use_tablespace) {
|
||||||
break;
|
push_warning_printf(
|
||||||
}
|
thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
|
ER_ILLEGAL_HA_CREATE_OPTION,
|
||||||
|
"InnoDB: ROW_FORMAT=COMPRESSED requires"
|
||||||
|
" innodb_file_per_table.");
|
||||||
|
} else if (file_format_allowed == UNIV_FORMAT_A) {
|
||||||
|
push_warning_printf(
|
||||||
|
thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
|
ER_ILLEGAL_HA_CREATE_OPTION,
|
||||||
|
"InnoDB: ROW_FORMAT=COMPRESSED requires"
|
||||||
|
" innodb_file_format > Antelope.");
|
||||||
|
} else {
|
||||||
|
innodb_row_format = REC_FORMAT_COMPRESSED;
|
||||||
break; /* Correct row_format */
|
break; /* Correct row_format */
|
||||||
}
|
}
|
||||||
zip_allowed = FALSE;
|
zip_allowed = FALSE;
|
||||||
@@ -12283,11 +12319,8 @@ index_bad:
|
|||||||
ER_ILLEGAL_HA_CREATE_OPTION,
|
ER_ILLEGAL_HA_CREATE_OPTION,
|
||||||
"InnoDB: assuming ROW_FORMAT=COMPACT.");
|
"InnoDB: assuming ROW_FORMAT=COMPACT.");
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case ROW_TYPE_DEFAULT:
|
|
||||||
/* If we fell through, set row format to Compact. */
|
|
||||||
row_format = ROW_TYPE_COMPACT;
|
|
||||||
/* fall through */
|
|
||||||
case ROW_TYPE_COMPACT:
|
case ROW_TYPE_COMPACT:
|
||||||
|
innodb_row_format = REC_FORMAT_COMPACT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21078,6 +21111,14 @@ static MYSQL_SYSVAR_BOOL(cmp_per_index_enabled, srv_cmp_per_index_enabled,
|
|||||||
"may have negative impact on performance (off by default)",
|
"may have negative impact on performance (off by default)",
|
||||||
NULL, innodb_cmp_per_index_update, FALSE);
|
NULL, innodb_cmp_per_index_update, FALSE);
|
||||||
|
|
||||||
|
static MYSQL_SYSVAR_ENUM(default_row_format, innodb_default_row_format,
|
||||||
|
PLUGIN_VAR_RQCMDARG,
|
||||||
|
"The default ROW FORMAT for all innodb tables created without explicit"
|
||||||
|
" ROW_FORMAT. Possible values are REDUNDANT, COMPACT, and DYNAMIC."
|
||||||
|
" The ROW_FORMAT value COMPRESSED is not allowed",
|
||||||
|
NULL, NULL, DEFAULT_ROW_FORMAT_COMPACT,
|
||||||
|
&innodb_default_row_format_typelib);
|
||||||
|
|
||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
static MYSQL_SYSVAR_UINT(trx_rseg_n_slots_debug, trx_rseg_n_slots_debug,
|
static MYSQL_SYSVAR_UINT(trx_rseg_n_slots_debug, trx_rseg_n_slots_debug,
|
||||||
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_NOCMDOPT,
|
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_NOCMDOPT,
|
||||||
@@ -21521,6 +21562,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
|
|||||||
MYSQL_SYSVAR(sync_array_size),
|
MYSQL_SYSVAR(sync_array_size),
|
||||||
MYSQL_SYSVAR(compression_failure_threshold_pct),
|
MYSQL_SYSVAR(compression_failure_threshold_pct),
|
||||||
MYSQL_SYSVAR(compression_pad_pct_max),
|
MYSQL_SYSVAR(compression_pad_pct_max),
|
||||||
|
MYSQL_SYSVAR(default_row_format),
|
||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
MYSQL_SYSVAR(trx_rseg_n_slots_debug),
|
MYSQL_SYSVAR(trx_rseg_n_slots_debug),
|
||||||
MYSQL_SYSVAR(limit_optimistic_insert_debug),
|
MYSQL_SYSVAR(limit_optimistic_insert_debug),
|
||||||
|
@@ -1000,6 +1000,12 @@ static int ull2dec(ulonglong from, decimal_t *to)
|
|||||||
|
|
||||||
sanity(to);
|
sanity(to);
|
||||||
|
|
||||||
|
if (!from)
|
||||||
|
{
|
||||||
|
decimal_make_zero(to);
|
||||||
|
return E_DEC_OK;
|
||||||
|
}
|
||||||
|
|
||||||
for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) {}
|
for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) {}
|
||||||
if (unlikely(intg1 > to->len))
|
if (unlikely(intg1 > to->len))
|
||||||
{
|
{
|
||||||
|
@@ -125,7 +125,6 @@ server-id = 1
|
|||||||
# You can set .._buffer_pool_size up to 50 - 80 %
|
# You can set .._buffer_pool_size up to 50 - 80 %
|
||||||
# of RAM but beware of setting memory usage too high
|
# of RAM but beware of setting memory usage too high
|
||||||
#innodb_buffer_pool_size = 384M
|
#innodb_buffer_pool_size = 384M
|
||||||
#innodb_additional_mem_pool_size = 20M
|
|
||||||
# Set .._log_file_size to 25 % of buffer pool size
|
# Set .._log_file_size to 25 % of buffer pool size
|
||||||
#innodb_log_file_size = 100M
|
#innodb_log_file_size = 100M
|
||||||
#innodb_log_buffer_size = 8M
|
#innodb_log_buffer_size = 8M
|
||||||
|
@@ -356,13 +356,6 @@ myisam_recover
|
|||||||
# and speed up some things.
|
# and speed up some things.
|
||||||
#skip-innodb
|
#skip-innodb
|
||||||
|
|
||||||
# Additional memory pool that is used by InnoDB to store metadata
|
|
||||||
# information. If InnoDB requires more memory for this purpose it will
|
|
||||||
# start to allocate it from the OS. As this is fast enough on most
|
|
||||||
# recent operating systems, you normally do not need to change this
|
|
||||||
# value. SHOW INNODB STATUS will display the current amount used.
|
|
||||||
innodb_additional_mem_pool_size = 16M
|
|
||||||
|
|
||||||
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
|
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
|
||||||
# row data. The bigger you set this the less disk I/O is needed to
|
# row data. The bigger you set this the less disk I/O is needed to
|
||||||
# access data in tables. On a dedicated database server you may set this
|
# access data in tables. On a dedicated database server you may set this
|
||||||
|
@@ -125,7 +125,6 @@ server-id = 1
|
|||||||
# You can set .._buffer_pool_size up to 50 - 80 %
|
# You can set .._buffer_pool_size up to 50 - 80 %
|
||||||
# of RAM but beware of setting memory usage too high
|
# of RAM but beware of setting memory usage too high
|
||||||
#innodb_buffer_pool_size = 256M
|
#innodb_buffer_pool_size = 256M
|
||||||
#innodb_additional_mem_pool_size = 20M
|
|
||||||
# Set .._log_file_size to 25 % of buffer pool size
|
# Set .._log_file_size to 25 % of buffer pool size
|
||||||
#innodb_log_file_size = 64M
|
#innodb_log_file_size = 64M
|
||||||
#innodb_log_buffer_size = 8M
|
#innodb_log_buffer_size = 8M
|
||||||
|
@@ -123,7 +123,6 @@ server-id = 1
|
|||||||
# You can set .._buffer_pool_size up to 50 - 80 %
|
# You can set .._buffer_pool_size up to 50 - 80 %
|
||||||
# of RAM but beware of setting memory usage too high
|
# of RAM but beware of setting memory usage too high
|
||||||
#innodb_buffer_pool_size = 16M
|
#innodb_buffer_pool_size = 16M
|
||||||
#innodb_additional_mem_pool_size = 2M
|
|
||||||
# Set .._log_file_size to 25 % of buffer pool size
|
# Set .._log_file_size to 25 % of buffer pool size
|
||||||
#innodb_log_file_size = 5M
|
#innodb_log_file_size = 5M
|
||||||
#innodb_log_buffer_size = 8M
|
#innodb_log_buffer_size = 8M
|
||||||
|
@@ -65,7 +65,6 @@ server-id = 1
|
|||||||
# You can set .._buffer_pool_size up to 50 - 80 %
|
# You can set .._buffer_pool_size up to 50 - 80 %
|
||||||
# of RAM but beware of setting memory usage too high
|
# of RAM but beware of setting memory usage too high
|
||||||
#innodb_buffer_pool_size = 16M
|
#innodb_buffer_pool_size = 16M
|
||||||
#innodb_additional_mem_pool_size = 2M
|
|
||||||
# Set .._log_file_size to 25 % of buffer pool size
|
# Set .._log_file_size to 25 % of buffer pool size
|
||||||
#innodb_log_file_size = 5M
|
#innodb_log_file_size = 5M
|
||||||
#innodb_log_buffer_size = 8M
|
#innodb_log_buffer_size = 8M
|
||||||
|
@@ -39,8 +39,8 @@
|
|||||||
# you can put MariaDB-only options here
|
# you can put MariaDB-only options here
|
||||||
[mariadb]
|
[mariadb]
|
||||||
|
|
||||||
# This group is only read by MariaDB-10.1 servers.
|
# This group is only read by MariaDB-10.2 servers.
|
||||||
# If you use the same .cnf file for MariaDB of different versions,
|
# If you use the same .cnf file for MariaDB of different versions,
|
||||||
# use this group for options that older servers don't understand
|
# use this group for options that older servers don't understand
|
||||||
[mariadb-10.1]
|
[mariadb-10.2]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user