[MDEV-19523] Document values of FLAG column in I_S.innodb_sys_tables and I_S.innodb_sys_tablespaces properly Created: 2019-05-19 Updated: 2019-05-26 Resolved: 2019-05-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation, Information Schema, Storage Engine - InnoDB |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Valerii Kravchuk | Assignee: | Ian Gilfillan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Our KB article, https://mariadb.com/kb/en/library/information-schema-innodb_sys_tables-table/, says the following about the FLAG column: "0 (InnoDB system table) or 1 (user table)." This is not true, as I can easily see values 0, 33 and 41 also for user tables:
Upstream manual is a bit more correct in explanation of flags, but also lacks specific values explained. |
| Comments |
| Comment by Marko Mäkelä [ 2019-05-20 ] | |||||||||||||||||||||
|
First of all, the table flags are not the same as tablespace flags (FSP_SPACE_FLAGS). There are some MariaDB specific changes to both. Also, the dict_table_t::flags do not fully correspond to SYS_TABLES.TYPE, and INNODB_SYS_TABLES.FLAG is actually not reporting SYS_TABLES.TYPE, but dict_table_t::flags that corresponds to the data dictionary record. Bit 0 (the least significant) bit is set if ROW_FORMAT is not REDUNDANT. Bits 1‥4 are 0, except for ROW_FORMAT=COMPRESSED, where they will determine the KEY_BLOCK_SIZE (the compressed page size). Bit 5 is set for ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED. Bit 6 is set if the DATA DIRECTORY attribute was present when the table was originally created. Bit 7 is set if the page_compressed attribute is present. Bits 8‥11 determine the page_compression_level. Bits 12‥13 are normally 00, but 11 for "no-rollback tables" (MariaDB 10.3 CREATE SEQUENCE). In MariaDB 10.1, these bits could be 01 or 10 for ATOMIC_WRITES=ON or ATOMIC_WRITES=OFF. Please check the validity of these claims with some examples. | |||||||||||||||||||||
| Comment by Valerii Kravchuk [ 2019-05-26 ] | |||||||||||||||||||||
|
May I ask where Bit 0 (the least significant) comes from, exactly, on disk? It does not seem to be set in the .ibd file for the table with row_format=Compact (see also INNODB_SYS_TABLESPACES), so where exactly something is stored (on disk)? Also, what about this KB page, https://mariadb.com/kb/en/library/information-schema-innodb_sys_tablespaces-table/, that still says wrong thing: "FLAG 1 if a DATA DIRECTORY option has been specified in CREATE TABLE, otherwise 0." The above is surely incorrect:
|