diff options
| author | Sergei Golubchik <serg@mariadb.org> | 2019-05-11 16:56:41 +0200 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2019-05-18 20:34:03 +0200 |
| commit | 8feb78ef53d254539caa0ede374acf2d4db13d2b (patch) | |
| tree | 9009f201959c35f60e420b44eb6a408227b68502 | |
| parent | d199591cf2aad9b056a13fe03d63031971155adb (diff) | |
| download | mariadb-git-8feb78ef53d254539caa0ede374acf2d4db13d2b.tar.gz | |
cleanup: replace a magic constant with a define
| -rw-r--r-- | sql/sql_truncate.cc | 2 | ||||
| -rw-r--r-- | sql/table.h | 2 | ||||
| -rw-r--r-- | sql/table_cache.cc | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index c0dee66c317..c89ca92bcb1 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -319,7 +319,7 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref, TABLE_SHARE *share= tdc_acquire_share(thd, table_ref, GTS_TABLE | GTS_VIEW); if (share == NULL) DBUG_RETURN(TRUE); - DBUG_ASSERT(share != (TABLE_SHARE*)1); + DBUG_ASSERT(share != UNUSABLE_TABLE_SHARE); versioned= share->versioned; sequence= share->table_type == TABLE_TYPE_SEQUENCE; diff --git a/sql/table.h b/sql/table.h index 865824bf36f..3b965f525d3 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1025,6 +1025,8 @@ struct TABLE_SHARE void set_overlapped_keys(); }; +/* not NULL, but cannot be dereferenced */ +#define UNUSABLE_TABLE_SHARE ((TABLE_SHARE*)1) /** Class is used as a BLOB field value storage for diff --git a/sql/table_cache.cc b/sql/table_cache.cc index 7a555d53558..5631232e066 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -945,7 +945,7 @@ end: table existed? Let's return an invalid pointer here to catch dereferencing attempts. */ - share= (TABLE_SHARE*) 1; + share= UNUSABLE_TABLE_SHARE; } DBUG_RETURN(share); |
