diff options
author | Andrei Elkin <andrei.elkin@mariadb.com> | 2019-01-24 16:57:29 +0200 |
---|---|---|
committer | Andrei Elkin <andrei.elkin@mariadb.com> | 2019-01-25 13:42:27 +0200 |
commit | ef0b91ea941785be1f3913fc44ba735d5d03a6f6 (patch) | |
tree | 8374259326c133edfa4be708e2b333f710fa18b6 /sql | |
parent | 5d48ea7d07b481ae3930486b4b039e1454273190 (diff) | |
download | mariadb-git-ef0b91ea941785be1f3913fc44ba735d5d03a6f6.tar.gz |
MDEV-17803: ulonglongization of table_mapping entry::table_id to fix windows compilation in particular.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 4 | ||||
-rw-r--r-- | sql/rpl_tblmap.cc | 18 | ||||
-rw-r--r-- | sql/rpl_tblmap.h | 10 |
3 files changed, 16 insertions, 16 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 1369ba2d687..4879e9fcecf 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -11332,8 +11332,8 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi) table_list->updating= 1; table_list->required_type= FRMTYPE_TABLE; - DBUG_PRINT("debug", ("table: %s is mapped to %u", table_list->table_name, - table_list->table_id)); + DBUG_PRINT("debug", ("table: %s is mapped to %llu", table_list->table_name, + table_list->table_id)); table_list->master_had_triggers= ((m_flags & TM_BIT_HAS_TRIGGERS_F) ? 1 : 0); DBUG_PRINT("debug", ("table->master_had_triggers=%d", (int)table_list->master_had_triggers)); diff --git a/sql/rpl_tblmap.cc b/sql/rpl_tblmap.cc index 4c521cf0c16..80114f50d62 100644 --- a/sql/rpl_tblmap.cc +++ b/sql/rpl_tblmap.cc @@ -43,7 +43,7 @@ table_mapping::table_mapping() constructor is called at startup only. */ (void) my_hash_init(&m_table_ids,&my_charset_bin,TABLE_ID_HASH_SIZE, - offsetof(entry,table_id),sizeof(ulong), + offsetof(entry,table_id),sizeof(ulonglong), 0,0,0); /* We don't preallocate any block, this is consistent with m_free=0 above */ init_alloc_root(&m_mem_root, TABLE_ID_HASH_SIZE*sizeof(entry), 0, MYF(0)); @@ -59,20 +59,20 @@ table_mapping::~table_mapping() free_root(&m_mem_root, MYF(0)); } -TABLE* table_mapping::get_table(ulong table_id) +TABLE* table_mapping::get_table(ulonglong table_id) { DBUG_ENTER("table_mapping::get_table(ulong)"); - DBUG_PRINT("enter", ("table_id: %lu", table_id)); + DBUG_PRINT("enter", ("table_id: %llu", table_id)); entry *e= find_entry(table_id); if (e) { - DBUG_PRINT("info", ("tid %lu -> table 0x%lx (%s)", + DBUG_PRINT("info", ("tid %llu -> table 0x%lx (%s)", table_id, (long) e->table, MAYBE_TABLE_NAME(e->table))); DBUG_RETURN(e->table); } - DBUG_PRINT("info", ("tid %lu is not mapped!", table_id)); + DBUG_PRINT("info", ("tid %llu is not mapped!", table_id)); DBUG_RETURN(NULL); } @@ -102,10 +102,10 @@ int table_mapping::expand() return 0; } -int table_mapping::set_table(ulong table_id, TABLE* table) +int table_mapping::set_table(ulonglong table_id, TABLE* table) { DBUG_ENTER("table_mapping::set_table(ulong,TABLE*)"); - DBUG_PRINT("enter", ("table_id: %lu table: 0x%lx (%s)", + DBUG_PRINT("enter", ("table_id: %llu table: 0x%lx (%s)", table_id, (long) table, MAYBE_TABLE_NAME(table))); entry *e= find_entry(table_id); @@ -133,13 +133,13 @@ int table_mapping::set_table(ulong table_id, TABLE* table) DBUG_RETURN(ERR_MEMORY_ALLOCATION); } - DBUG_PRINT("info", ("tid %lu -> table 0x%lx (%s)", + DBUG_PRINT("info", ("tid %llu -> table 0x%lx (%s)", table_id, (long) e->table, MAYBE_TABLE_NAME(e->table))); DBUG_RETURN(0); // All OK } -int table_mapping::remove_table(ulong table_id) +int table_mapping::remove_table(ulonglong table_id) { entry *e= find_entry(table_id); if (e) diff --git a/sql/rpl_tblmap.h b/sql/rpl_tblmap.h index 9fb1c4afbd7..05b298e6053 100644 --- a/sql/rpl_tblmap.h +++ b/sql/rpl_tblmap.h @@ -70,10 +70,10 @@ public: table_mapping(); ~table_mapping(); - TABLE* get_table(ulong table_id); + TABLE* get_table(ulonglong table_id); - int set_table(ulong table_id, TABLE* table); - int remove_table(ulong table_id); + int set_table(ulonglong table_id, TABLE* table); + int remove_table(ulonglong table_id); void clear_tables(); ulong count() const { return m_table_ids.records; } @@ -83,14 +83,14 @@ private: it, which only works for PODs) */ struct entry { - ulong table_id; + ulonglong table_id; union { TABLE *table; entry *next; }; }; - entry *find_entry(ulong table_id) + entry *find_entry(ulonglong table_id) { return (entry *) my_hash_search(&m_table_ids, (uchar*)&table_id, |