diff options
author | unknown <serg@serg.mylan> | 2004-01-14 14:08:56 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-01-14 14:08:56 +0100 |
commit | 2f69de8e0ee819eb1858ee907e4119def5e0d7b1 (patch) | |
tree | 543ec2cd5f96d9fe3c3e3af56b4919e77e81ec4e /sql | |
parent | 13cf5e6b0ae32d25d4f6d13928ce5766ba0e2f50 (diff) | |
parent | df9dd1d80f605ea34e7aa485b04a4859132c8d62 (diff) | |
download | mariadb-git-2f69de8e0ee819eb1858ee907e4119def5e0d7b1.tar.gz |
Merge bk-internal:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
sql/sql_show.cc:
Auto merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_show.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 984d57fc354..4ae59093a0e 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -997,6 +997,19 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd) DBUG_RETURN(0); } +/* possible TODO: call find_keyword() from sql_lex.cc here */ +static bool require_quotes(const char *name, uint length) +{ + uint i, d, c; + for (i=0; i<length; i+=d) + { + c=((uchar *)name)[i]; + d=my_mbcharlen(system_charset_info, c); + if (d==1 && !system_charset_info->ident_map[c]) + return 1; + } + return 0; +} void append_identifier(THD *thd, String *packet, const char *name, uint length) @@ -1007,7 +1020,8 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) else qtype= '`'; - if (thd->options & OPTION_QUOTE_SHOW_CREATE) + if ((thd->options & OPTION_QUOTE_SHOW_CREATE) || + require_quotes(name, length)) { packet->append(&qtype, 1); packet->append(name, length, system_charset_info); |