diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-05-24 00:41:18 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-05-24 00:41:18 +0400 |
commit | 598cf5aec7c7cf4dbb158c87d80916b6e58e7ae6 (patch) | |
tree | f4f37b22f4271c44aa03c55abe609a058828bedc /sql/sql_table.cc | |
parent | dabd4a1c55cabbe73350c7c9b4c2bd6ab2db2b5c (diff) | |
parent | d72a4710aaad2f1e76ac20d50793f13f941ef899 (diff) | |
download | mariadb-git-598cf5aec7c7cf4dbb158c87d80916b6e58e7ae6.tar.gz |
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:
conflict Makefile.am
conflict mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
conflict mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
conflict sql/opt_sum.cc
conflict sql/set_var.cc
conflict sql/sql_base.cc
conflict sql/sql_priv.h
conflict sql/sql_show.cc
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8058ee20868..9177573971e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -426,6 +426,25 @@ uint filename_to_tablename(const char *from, char *to, uint to_length) /** + Check if given string begins with "#mysql50#" prefix + + @param name string to check cut + + @retval + FALSE no prefix found + @retval + TRUE prefix found +*/ + +bool check_mysql50_prefix(const char *name) +{ + return (name[0] == '#' && + !strncmp(name, MYSQL50_TABLE_NAME_PREFIX, + MYSQL50_TABLE_NAME_PREFIX_LENGTH)); +} + + +/** Check if given string begins with "#mysql50#" prefix, cut it if so. @param from string to check and cut @@ -440,9 +459,7 @@ uint filename_to_tablename(const char *from, char *to, uint to_length) uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length) { - if (from[0] == '#' && - !strncmp(from, MYSQL50_TABLE_NAME_PREFIX, - MYSQL50_TABLE_NAME_PREFIX_LENGTH)) + if (check_mysql50_prefix(from)) return (uint) (strmake(to, from + MYSQL50_TABLE_NAME_PREFIX_LENGTH, to_length - 1) - to); return 0; |