Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
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:
MariaDB [test2]> select * from information_schema.innodb_sys_tables where name like '%ti%';
|
+----------+----------------------------+------+--------+-------+------------+---------------+------------+
|
| TABLE_ID | NAME | FLAG | N_COLS | SPACE | ROW_FORMAT | ZIP_PAGE_SIZE | SPACE_TYPE |
|
+----------+----------------------------+------+--------+-------+------------+---------------+------------+
|
| 19 | mysql/gtid_slave_pos | 33 | 7 | 4 | Dynamic | 0 | Single |
|
| 18 | mysql/transaction_registry | 33 | 8 | 3 | Dynamic | 0 | Single |
|
| 21 | test/ti1 | 0 | 5 | 6 | Redundant | 0 | Single |
|
| 22 | test/ti2 | 1 | 5 | 7 | Compact | 0 | Single |
|
| 23 | test/ti3 | 33 | 5 | 8 | Dynamic | 0 | Single |
|
| 24 | test/ti4 | 41 | 5 | 9 | Compressed | 8192 | Single |
|
| 25 | test/ti5 | 33 | 5 | 10 | Dynamic | 0 | Single |
|
| 28 | test2/ti0 | 1 | 5 | 11 | Compact | 0 | Single |
|
+----------+----------------------------+------+--------+-------+------------+---------------+------------+
|
8 rows in set (0.000 sec)
|
Upstream manual is a bit more correct in explanation of flags, but also lacks specific values explained.
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.