mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
mark subquery in the FROM clause like derived and quoate all identifiers (BUG#4609)
This commit is contained in:
@ -11250,42 +11250,48 @@ void st_table_list::print(THD *thd, String *str)
|
||||
}
|
||||
else if (view_name.str)
|
||||
{
|
||||
str->append('`');
|
||||
str->append(view_db.str, view_db.length);
|
||||
str->append('.');
|
||||
str->append("`.`", 3);
|
||||
str->append(view_name.str, view_name.length);
|
||||
if (my_strcasecmp(table_alias_charset, view_name.str, alias))
|
||||
{
|
||||
str->append(' ');
|
||||
str->append("` `", 3);
|
||||
str->append(alias);
|
||||
}
|
||||
str->append('`');
|
||||
}
|
||||
else if (derived)
|
||||
{
|
||||
str->append('(');
|
||||
derived->print(str);
|
||||
str->append(") ", 2);
|
||||
str->append(") `", 3);
|
||||
str->append(alias);
|
||||
str->append('`');
|
||||
}
|
||||
else
|
||||
{
|
||||
str->append('`');
|
||||
str->append(db);
|
||||
str->append('.');
|
||||
str->append("`.`", 3);
|
||||
str->append(real_name);
|
||||
if (my_strcasecmp(table_alias_charset, real_name, alias))
|
||||
{
|
||||
str->append(' ');
|
||||
str->append("` `", 3);
|
||||
str->append(alias);
|
||||
}
|
||||
str->append('`');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void st_select_lex::print(THD *thd, String *str)
|
||||
{
|
||||
if (!thd)
|
||||
thd= current_thd;
|
||||
|
||||
str->append("select ", 7);
|
||||
|
||||
|
||||
//options
|
||||
if (options & SELECT_STRAIGHT_JOIN)
|
||||
str->append("straight_join ", 14);
|
||||
|
Reference in New Issue
Block a user