mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
branches/zip: Always check for "row too large" when executing SQL to create
an index or table. We have to skip this check when loading table definitions from the data dictionary, because we could otherwise refuse to load old tables (even uncompressed ones). This addresses Issue #119. The first "row too large" check was implemented in MySQL 5.0.3 to address MySQL Bug #5682. In the InnoDB Plugin 1.0.2, a more accurate check was implemented in innodb_strict_mode. We now make the check unconditional. dict_create_index_step(): Pass strict=TRUE to dict_index_add_to_cache(). trx_is_strict(), thd_is_strict(): Remove. innodb-zip.test: Test in innodb_strict_mode=OFF. innodb_bug36169.test: Ensure that none of the tables can be created. rb://56 approved by Sunny Bains.
This commit is contained in:
@ -122,7 +122,7 @@ table_schema table_name row_format
|
||||
test t1 Compressed
|
||||
test t2 Compact
|
||||
drop table t1,t2;
|
||||
SET SESSION innodb_strict_mode = on;
|
||||
SET SESSION innodb_strict_mode = off;
|
||||
CREATE TABLE t1(
|
||||
c TEXT NOT NULL, d TEXT NOT NULL,
|
||||
PRIMARY KEY (c(767),d(767)))
|
||||
|
@ -84,7 +84,8 @@ SELECT table_schema, table_name, row_format
|
||||
FROM information_schema.tables WHERE engine='innodb';
|
||||
drop table t1,t2;
|
||||
|
||||
SET SESSION innodb_strict_mode = on;
|
||||
# The following should fail even in non-strict mode.
|
||||
SET SESSION innodb_strict_mode = off;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1(
|
||||
c TEXT NOT NULL, d TEXT NOT NULL,
|
||||
|
@ -22,6 +22,7 @@ SET GLOBAL innodb_file_per_table=ON;
|
||||
# Generating 10 tables
|
||||
# Creating a table with 94 columns and 24 indexes
|
||||
DROP TABLE IF EXISTS `table0`;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE IF NOT EXISTS `table0`
|
||||
(`col0` BOOL,
|
||||
`col1` BOOL,
|
||||
@ -145,6 +146,7 @@ KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`)
|
||||
|
||||
# Creating a table with 10 columns and 32 indexes
|
||||
DROP TABLE IF EXISTS `table1`;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE IF NOT EXISTS `table1`
|
||||
(`col0` CHAR (113),
|
||||
`col1` FLOAT,
|
||||
@ -192,6 +194,7 @@ KEY `idx31` (`col4`(1),`col0`)
|
||||
|
||||
# Creating a table with 141 columns and 18 indexes
|
||||
DROP TABLE IF EXISTS `table2`;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE IF NOT EXISTS `table2`
|
||||
(`col0` BOOL,
|
||||
`col1` MEDIUMINT,
|
||||
@ -356,6 +359,7 @@ KEY `idx17` (`col24`(250),`col7`,`col92`,`col45`)
|
||||
|
||||
# Creating a table with 199 columns and 1 indexes
|
||||
DROP TABLE IF EXISTS `table3`;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE IF NOT EXISTS `table3`
|
||||
(`col0` SMALLINT,
|
||||
`col1` SET ('test1','test2','test3'),
|
||||
@ -561,6 +565,7 @@ KEY `idx0` (`col39`,`col23`)
|
||||
|
||||
# Creating a table with 133 columns and 16 indexes
|
||||
DROP TABLE IF EXISTS `table4`;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE IF NOT EXISTS `table4`
|
||||
(`col0` VARCHAR (60),
|
||||
`col1` NUMERIC,
|
||||
@ -715,6 +720,7 @@ KEY `idx15` (`col4`(246),`col130`,`col115`,`col3`(141))
|
||||
|
||||
# Creating a table with 176 columns and 13 indexes
|
||||
DROP TABLE IF EXISTS `table5`;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE IF NOT EXISTS `table5`
|
||||
(`col0` MEDIUMTEXT,
|
||||
`col1` VARCHAR (90),
|
||||
@ -910,6 +916,7 @@ KEY `idx12` (`col24`)
|
||||
# Creating a table with 179 columns and 46 indexes
|
||||
DROP TABLE IF EXISTS `table6`;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE IF NOT EXISTS `table6`
|
||||
(`col0` ENUM ('test1','test2','test3'),
|
||||
`col1` MEDIUMBLOB,
|
||||
|
Reference in New Issue
Block a user