1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

fixed quoting of identifiers in VIEWs (BUG#4613)

mysql-test/r/view.result:
  fixed quoting of identifiers in VIEWs
mysql-test/t/view.test:
  fixed quoting of identifiers in VIEWs
sql/item.cc:
  fixed quoting of identifiers in VIEWs
sql/sql_select.cc:
  fixed quoting of identifiers in VIEWs
sql/sql_view.cc:
  fixed quoting of identifiers in VIEWs
This commit is contained in:
unknown
2004-07-20 18:51:02 +03:00
parent 9050c44cff
commit b0b75bbfbb
5 changed files with 56 additions and 38 deletions

View File

@ -11250,37 +11250,32 @@ 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("`.`", 3);
str->append(view_name.str, view_name.length);
append_identifier(thd, str, view_db.str, view_db.length);
str->append('.');
append_identifier(thd, str, view_name.str, view_name.length);
if (my_strcasecmp(table_alias_charset, view_name.str, alias))
{
str->append("` `", 3);
str->append(alias);
str->append(' ');
append_identifier(thd, str, alias, strlen(alias));
}
str->append('`');
}
else if (derived)
{
str->append('(');
derived->print(str);
str->append(") `", 3);
str->append(alias);
str->append('`');
str->append(") ", 2);
append_identifier(thd, str, alias, strlen(alias));
}
else
{
str->append('`');
str->append(db);
str->append("`.`", 3);
str->append(real_name);
append_identifier(thd, str, db, db_length);
str->append('.');
append_identifier(thd, str, real_name, real_name_length);
if (my_strcasecmp(table_alias_charset, real_name, alias))
{
str->append("` `", 3);
str->append(alias);
str->append(' ');
append_identifier(thd, str, alias, strlen(alias));
}
str->append('`');
}
}