diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-05-01 14:06:48 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-05-01 14:06:48 +0200 |
commit | d81b662b8c75018f4facd2323558805ee2bc7eb8 (patch) | |
tree | 0dda05c5b8a3bd53672a8949e621e48e46e701c3 /sql/table.cc | |
parent | 5b6c75ca4d05f6bb6c56179de725831ff009d650 (diff) | |
download | mariadb-git-d81b662b8c75018f4facd2323558805ee2bc7eb8.tar.gz |
Asserting correct database name lettercase in
various places in the code.
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc index 210a9246a16..5da15dab9e7 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3436,6 +3436,24 @@ uint calculate_key_len(TABLE *table, uint key, const uchar *buf, return length; } +#ifndef DBUG_OFF +/** + Verifies that database/table name is in lowercase, when it should be + + This is supposed to be used only inside DBUG_ASSERT() +*/ +bool ok_for_lower_case_names(const char *name) +{ + if (!lower_case_table_names || !name) + return true; + + char buf[SAFE_NAME_LEN]; + strmake_buf(buf, name); + my_casedn_str(files_charset_info, buf); + return strcmp(name, buf) == 0; +} +#endif + /* Check if database name is valid |