[MDEV-11585] Hard-code the shared InnoDB temporary tablespace ID Created: 2016-12-16  Updated: 2018-06-21  Resolved: 2016-12-19

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 10.2.3

Type: Task Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Attachments: File mysql-5.7.17-MDEV-11585-hard-code-SRV_TMP_SPACE_ID.patch    
Issue Links:
Duplicate
duplicates MDEV-13056 The server keeps crashing Closed
Problem/Incident
causes MDEV-11927 InnoDB change buffer is not being mer... Closed
causes MDEV-15591 Create index fails on innoDB temporar... Closed
Relates
relates to MDEV-11816 Disallow CREATE TEMPORARY TABLE…ROW_F... Closed
relates to MDEV-13013 InnoDB unnecessarily extends data files Closed
relates to MDEV-11202 InnoDB 10.1 -> 10.2 migration does no... Closed

 Description   

MySQL 5.7 supports only one shared temporary tablespace.
MariaDB 10.2 does not support any other shared InnoDB tablespaces than the two predefined tablespaces: the persistent InnoDB system tablespace (default file name ibdata1) and the temporary tablespace (default file name ibtmp1).

InnoDB is unnecessarily allocating a tablespace ID for the predefined temporary tablespace on every startup, and it is in several places testing whether a tablespace ID matches this dynamically generated ID.

We should use a compile-time constant to reduce code size and to avoid unnecessary updates to the DICT_HDR page at every startup.

Using a hard-coded tablespace ID will also make it easier to remove the TEMPORARY flag from FSP_SPACE_FLAGS in MDEV-11202.



 Comments   
Comment by Marko Mäkelä [ 2016-12-16 ]

bb-10.2-mdev-11585

Comment by Jan Lindström (Inactive) [ 2016-12-19 ]

ok to push.

Comment by Marko Mäkelä [ 2016-12-20 ]

It seems that the value 0xFFFFFFFFU might clash with ULINT_UNDEFINED on 32-bit systems, potentially causing tables in the temporary tablespace to be mistaken for tables with a missing tablespace or vice versa. I changed the constant to 0xFFFFFFFEU (-2) to see if this fixes some test failures. (I was unable to build with -m32 on my x86-64 Debian GNU/Linux system.)

Generated at Thu Feb 08 07:51:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.