diff options
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r-- | sql/table_cache.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc index 6d190400217..b3cf6cd2892 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -1134,6 +1134,9 @@ void tdc_assign_new_table_id(TABLE_SHARE *share) DBUG_ASSERT(share); DBUG_ASSERT(tdc_inited); + 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. @@ -1141,7 +1144,7 @@ void tdc_assign_new_table_id(TABLE_SHARE *share) do { tid= my_atomic_add64_explicit(&last_table_id, 1, MY_MEMORY_ORDER_RELAXED); - } while (unlikely(tid == ~0UL)); + } while (unlikely(tid == ~0UL || tid == 0)); share->table_map_id= tid; DBUG_PRINT("info", ("table_id= %lu", share->table_map_id)); |