Commit bc6b7859 authored by unknown's avatar unknown
Browse files

Fix for multiple test failures on some platforms.


sql/sql_lex.cc:
  Added a debug assertion that the passed string is not empty.
sql/sql_show.cc:
  Do not quote empty string.
parent bfa21dd1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ static int find_keyword(LEX *lex, uint len, bool function)

  SYNOPSIS
    is_keyword()
    name      checked name
    name      checked name (must not be empty)
    len       length of checked name

  RETURN VALUES
@@ -233,6 +233,7 @@ static int find_keyword(LEX *lex, uint len, bool function)

bool is_keyword(const char *name, uint len)
{
  DBUG_ASSERT(len != 0);
  return get_hash_symbol(name,len,0)!=0;
}

+2 −1
Original line number Diff line number Diff line
@@ -713,7 +713,8 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)

int get_quote_char_for_identifier(THD *thd, const char *name, uint length)
{
  if (!is_keyword(name,length) &&
  if (!length ||
      !is_keyword(name,length) &&
      !require_quotes(name, length) &&
      !(thd->options & OPTION_QUOTE_SHOW_CREATE))
    return EOF;