branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
set global innodb_file_per_table=off;
2008-04-10 11:02:16 +00:00
set global innodb_file_format=`0`;
2008-03-14 11:07:39 +00:00
create table t0(a int primary key) engine=innodb row_format=compressed;
Warnings:
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
create table t00(a int primary key) engine=innodb
key_block_size=4 row_format=compressed;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
2008-04-10 11:02:16 +00:00
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
2008-03-14 11:07:39 +00:00
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
create table t1(a int primary key) engine=innodb row_format=dynamic;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
Warnings:
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
create table t2(a int primary key) engine=innodb row_format=redundant;
create table t3(a int primary key) engine=innodb row_format=compact;
create table t4(a int primary key) engine=innodb key_block_size=9;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
2008-04-10 11:02:16 +00:00
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
create table t5(a int primary key) engine=innodb
branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
key_block_size=1 row_format=redundant;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
2008-04-10 11:02:16 +00:00
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
set global innodb_file_per_table=on;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
create table t6(a int primary key) engine=innodb
branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
key_block_size=1 row_format=redundant;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
Warnings:
2008-04-10 11:02:16 +00:00
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
2008-04-10 11:02:16 +00:00
set global innodb_file_format=`1`;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
create table t7(a int primary key) engine=innodb
branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
key_block_size=1 row_format=redundant;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
create table t8(a int primary key) engine=innodb
key_block_size=1 row_format=fixed;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
create table t9(a int primary key) engine=innodb
branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
key_block_size=1 row_format=compact;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
create table t10(a int primary key) engine=innodb
key_block_size=1 row_format=dynamic;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
create table t11(a int primary key) engine=innodb
key_block_size=1 row_format=compressed;
create table t12(a int primary key) engine=innodb
branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
key_block_size=1;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
create table t13(a int primary key) engine=innodb
row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
2008-03-14 11:07:39 +00:00
test t0 Compact
test t00 Compact
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
test t1 Compact
test t10 Dynamic
test t11 Compressed
test t12 Compressed
test t13 Compressed
test t14 Compact
test t2 Redundant
test t3 Compact
test t4 Compact
test t5 Redundant
test t6 Redundant
test t7 Redundant
test t8 Compact
test t9 Compact
2008-03-14 11:07:39 +00:00
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
alter table t1 key_block_size=0;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
alter table t1 row_format=dynamic;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Dynamic
alter table t1 row_format=compact;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Compact
alter table t1 row_format=redundant;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Redundant
branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format. Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.
This change breaks introduces an incompatible change for for
compressed tables. We can do this, as we have not released yet.
innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.
DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.
DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.
dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP. For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.
DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.
dict_mem_table_create(): Assert that no extra bits are set in the flags.
dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.
dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.
dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.
dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len. Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.
dtuple_convert_back_big_rec(): Restore the columns.
srv_file_format: New variable: innodb_file_format.
fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.
fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags. Check the flags.
fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.
fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.
fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a
wrapper for fil_space_get_zip_size().
fsp_header_get_flags(): New function.
fsp_header_init_fields(): Replace zip_size with flags.
FSP_SPACE_FLAGS: New name for the tablespace flags. This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.
MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit
parameter for the tablespace flags.
ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.
PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
drop table t1;
2008-01-23 13:46:45 +00:00
create table t1(a int not null, b text, index(b(10))) engine=innodb
key_block_size=1;
2008-03-13 12:49:34 +00:00
create table t2(b text)engine=innodb;
insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
insert into t1 select 1, b from t2;
2008-01-23 13:46:45 +00:00
commit;
begin;
update t1 set b=repeat('B',100);
2008-03-13 12:49:34 +00:00
select a,left(b,40) from t1 natural join t2;
a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
2008-01-23 13:46:45 +00:00
rollback;
2008-03-13 12:49:34 +00:00
select a,left(b,40) from t1 natural join t2;
a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC.
Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE,
so that any table dump can be loaded.
As of this change, InnoDB supports the following table formats:
ROW_FORMAT=REDUNDANT
the only format before MySQL/InnoDB 5.0.3
ROW_FORMAT=COMPACT
the new default format of MySQL/InnoDB 5.0.3
ROW_FORMAT=DYNAMIC
uncompressed, no prefix in the clustered index record for BLOBs
ROW_FORMAT=COMPRESSED
like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs;
the compressed page size is specified by KEY_BLOCK_SIZE in
kilobytes (1, 2, 4, 8, or 16; default 8)
KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED;
ignored if ROW_FORMAT is not COMPRESSED
KEY_BLOCK_SIZE=anything else: ignored
The InnoDB row format is displayed in the 4th column (Row_format) of
the output of SHOW TABLE STATUS. The Create_options column may show
ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have
anything to do with InnoDB.
The table format can also be queried like this:
SELECT table_schema, table_name, row_format
FROM information_schema.tables
WHERE engine='innodb' and row_format in ('Compressed','Dynamic');
When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond
to the compressed page size. But the .frm file could be manipulated
to show any KEY_BLOCK_SIZE.
For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not
include KEY_BLOCK_SIZE. It does include row_format (spelled in
lowercase). This looks like a MySQL bug, because the table
INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS.
I reported this as Bug #35275 <http://bugs.mysql.com/35275>.
ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC.
ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and
ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or
KEY_BLOCK_SIZE, but issue warnings instead.
ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO
if KEY_BLOCK_SIZE has been specified.
innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED.
innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
2008-03-13 17:25:53 +00:00
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Compressed
test t2 Compact
drop table t1,t2;
2008-03-17 11:30:23 +00:00
CREATE TABLE t1(
c TEXT NOT NULL, d TEXT NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(
'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~)+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}(+.147:=@CFILORUX[^adgjmpsvy|(+.147:=@CFILORUX[^adgjmpsvy|(+.147:=@CFILORUX[^adgjmpsvy|(,048<@DHLPTX\`dhlptx|)-159=AEIMQUY]aeimquy}*.26:>BFJNRVZ^bfjnrvz~+/37;?CGKOSW[_cgkosw{(-27<AFKPUZ_dinsx}+05:?DINSX]bglqv{).38=BGLQV[`ejoty~,16;@EJOTY^chmrw|*/49>CHMRW\afkpuz(.4:@FLRX^djpv|+17=CIOU[agmsy(.4:@FLRX^djpv|+17=CIOU[agmsy(.4:@FLRX^djpv|+17=CIOU[agmsy(/6=DKRY`gnu|,3:AHOV]dkry)07>ELSZahov}-4;BIPW^elsz*18?FMT[bipw~.5<CJQX_fmt{+29@GNU\cjqx(08@HPX`hpx)19AIQYaiqy*2:BJRZbjrz+3;CKS[cks{,4<DLT\dlt|-5=EMU]emu}.6>FNV^fnv~/7?GOW_gow(1:CLU^gpy+4=FOXajs|.7@IR[dmv(1:CLU^gpy+4=FOXajs|.7@IR[dmv(1:CLU^gpy+4=',
'FOXajs|.7@IR[dmv(2<FPZdnx+5?IS]gq{.8BLV`jt~1;EOYcmw*4>HR\fpz-7AKU_is}0:DNXblv)3=GQ[eoy,6@JT^hr|/9CMWaku(3>IT_ju)4?JU`kv*5@KValw+6ALWbmx,7BMXcny-8CNYdoz.9DOZep{/:EP[fq|0;FQ\gr}1<GR]hs~2=HS^it(4@LXdp|1=IUamy.:FR^jv+7CO[gs(4@LXdp|1=IUamy.:FR^jv+7CO[gs(4@LXdp|1=IUamy.:FR^jv+7CO[gs(5BO\iv,9FS`mz0=JWdq~4AN[hu+8ER_ly/<IVcp}3@MZgt*7DQ^kx.;HUbo|2?LYfs)6CP]jw-:GTan{1>KXer(6DR`n|3AO]ky0>LZhv-;IWes*8FTbp~5CQ_m{2@N\jx/=KYgu,:HVdr)7ESao}4BP^lz1?M[iw.<JXft+9GUcq(7FUds+:IXgv.=L[jy1@O^m|4CRap(7FUds+:IXgv.=L[jy1@O^m|4CRap(7FUds+:IXgv.=L[jy1@O^m|4CRap(8HXhx1AQaq*:JZjz3CScs,<L\l|5EUeu.>N^n~7GWgw0@P`p)9IYiy2BRbr+;K[k{4DTdt-=M]m}6FVfv/?O_o(9J[l}7HYj{5FWhy3DUfw1BSdu/@Qbs->O`q+<M^o):K\m~8IZk|6GXiz4EVgx2CTev0ARct.?Par,=N_p*;L]n(:L^p+=Oas.@Rdv1CUgy4FXj|7I[m(:L^p+=Oas.@Rdv1CUgy4FXj|7');
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
drop table t1;
2008-04-10 11:02:16 +00:00
set global innodb_file_format=`0`;
select @@innodb_file_format;
@@innodb_file_format
Antelope
set global innodb_file_format=`1`;
select @@innodb_file_format;
@@innodb_file_format
Barracuda
set global innodb_file_format=`2`;
ERROR HY000: Incorrect arguments to SET
set global innodb_file_format=`-1`;
ERROR HY000: Incorrect arguments to SET
set global innodb_file_format=`Antelope`;
set global innodb_file_format=`Barracuda`;
set global innodb_file_format=`Cheetah`;
ERROR HY000: Incorrect arguments to SET
set global innodb_file_format=`abc`;
ERROR HY000: Incorrect arguments to SET
set global innodb_file_format=`1a`;
ERROR HY000: Incorrect arguments to SET
set global innodb_file_format=``;
ERROR HY000: Incorrect arguments to SET
2008-04-09 04:25:35 +00:00
set global innodb_file_per_table = on;
2008-04-10 11:02:16 +00:00
set global innodb_file_format = `1`;
2008-04-09 04:25:35 +00:00
set innodb_strict_mode = on;
create table t1 (id int primary key) engine = innodb key_block_size = 0;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb key_block_size = 9;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t3 (id int primary key) engine = innodb key_block_size = 1;
create table t4 (id int primary key) engine = innodb key_block_size = 2;
create table t5 (id int primary key) engine = innodb key_block_size = 4;
create table t6 (id int primary key) engine = innodb key_block_size = 8;
create table t7 (id int primary key) engine = innodb key_block_size = 16;
create table t8 (id int primary key) engine = innodb row_format = compressed;
create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t10 Compact
test t11 Redundant
test t3 Compressed
test t4 Compressed
test t5 Compressed
test t6 Compressed
test t7 Compressed
test t8 Compressed
test t9 Dynamic
drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
create table t1 (id int primary key) engine = innodb
key_block_size = 8 row_format = compressed;
create table t2 (id int primary key) engine = innodb
key_block_size = 8 row_format = redundant;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t3 (id int primary key) engine = innodb
key_block_size = 8 row_format = compact;
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t3' (errno: 1478)
create table t4 (id int primary key) engine = innodb
key_block_size = 8 row_format = dynamic;
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t5' (errno: 1478)
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Compressed
drop table t1;
create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = compact;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
set global innodb_file_per_table = off;
create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb key_block_size = 2;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t3 (id int primary key) engine = innodb key_block_size = 4;
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t3' (errno: 1478)
create table t4 (id int primary key) engine = innodb key_block_size = 8;
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb key_block_size = 16;
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t5' (errno: 1478)
create table t6 (id int primary key) engine = innodb row_format = compressed;
ERROR HY000: Can't create table 'test.t6' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Error 1005 Can't create table 'test.t6' (errno: 1478)
create table t7 (id int primary key) engine = innodb row_format = dynamic;
ERROR HY000: Can't create table 'test.t7' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t8 Compact
test t9 Redundant
drop table t8, t9;
set global innodb_file_per_table = on;
2008-04-10 11:02:16 +00:00
set global innodb_file_format = `0`;
2008-04-09 04:25:35 +00:00
create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show errors;
Level Code Message
2008-04-10 11:02:16 +00:00
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
2008-04-09 04:25:35 +00:00
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb key_block_size = 2;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
2008-04-10 11:02:16 +00:00
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
2008-04-09 04:25:35 +00:00
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t3 (id int primary key) engine = innodb key_block_size = 4;
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
show errors;
Level Code Message
2008-04-10 11:02:16 +00:00
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
2008-04-09 04:25:35 +00:00
Error 1005 Can't create table 'test.t3' (errno: 1478)
create table t4 (id int primary key) engine = innodb key_block_size = 8;
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
show errors;
Level Code Message
2008-04-10 11:02:16 +00:00
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
2008-04-09 04:25:35 +00:00
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb key_block_size = 16;
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
show errors;
Level Code Message
2008-04-10 11:02:16 +00:00
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
2008-04-09 04:25:35 +00:00
Error 1005 Can't create table 'test.t5' (errno: 1478)
create table t6 (id int primary key) engine = innodb row_format = compressed;
ERROR HY000: Can't create table 'test.t6' (errno: 1478)
show errors;
Level Code Message
2008-04-10 11:02:16 +00:00
Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
2008-04-09 04:25:35 +00:00
Error 1005 Can't create table 'test.t6' (errno: 1478)
create table t7 (id int primary key) engine = innodb row_format = dynamic;
ERROR HY000: Can't create table 'test.t7' (errno: 1478)
show errors;
Level Code Message
2008-04-10 11:02:16 +00:00
Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
2008-04-09 04:25:35 +00:00
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t8 Compact
test t9 Redundant
drop table t8, t9;
2008-03-07 14:10:08 +00:00
set global innodb_file_per_table=0;
2008-04-10 11:02:16 +00:00
set global innodb_file_format=Antelope;
2008-04-09 04:25:35 +00:00
set innodb_strict_mode=0;