summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 01f96b5f93b..375f7a3f65f 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -343,6 +343,9 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data,
&share->LOCK_ha_data, MY_MUTEX_INIT_FAST);
+ DBUG_EXECUTE_IF("simulate_big_table_id",
+ if (last_table_id < UINT_MAX32)
+ last_table_id= UINT_MAX32 - 1;);
/*
There is one reserved number that cannot be used. Remember to
change this when 6-byte global table id's are introduced.
@@ -351,7 +354,8 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
{
share->table_map_id=
last_table_id.fetch_add(1, std::memory_order_relaxed);
- } while (unlikely(share->table_map_id == ~0UL));
+ } while (unlikely(share->table_map_id == ~0UL ||
+ share->table_map_id == 0));
}
DBUG_RETURN(share);
}