1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

mark subquery in the FROM clause like derived and quoate all identifiers (BUG#4609)

mysql-test/r/bench_count_distinct.result:
  Quoting of fields and tables names
mysql-test/r/case.result:
  Quoting of fields and tables names
mysql-test/r/fulltext.result:
  Quoting of fields and tables names
mysql-test/r/func_default.result:
  Quoting of fields and tables names
mysql-test/r/func_gconcat.result:
  Quoting of fields and tables names
mysql-test/r/func_group.result:
  Quoting of fields and tables names
mysql-test/r/func_if.result:
  Quoting of fields and tables names
mysql-test/r/func_in.result:
  Quoting of fields and tables names
mysql-test/r/func_regexp.result:
  Quoting of fields and tables names
mysql-test/r/func_test.result:
  Quoting of fields and tables names
mysql-test/r/gis.result:
  Quoting of fields and tables names
mysql-test/r/group_by.result:
  Quoting of fields and tables names
mysql-test/r/having.result:
  Quoting of fields and tables names
mysql-test/r/insert_update.result:
  Quoting of fields and tables names
mysql-test/r/join_nested.result:
  Quoting of fields and tables names
mysql-test/r/olap.result:
  Quoting of fields and tables names
mysql-test/r/query_cache.result:
  Quoting of fields and tables names
mysql-test/r/select.result:
  Quoting of fields and tables names
mysql-test/r/subselect.result:
  Quoting of fields and tables names
mysql-test/r/union.result:
  Quoting of fields and tables names
mysql-test/r/varbinary.result:
  Quoting of fields and tables names
mysql-test/r/view.result:
  Quoting of fields and tables names
  test of view with quated fields
mysql-test/t/view.test:
  test of view with quated fields
sql/item.cc:
  Quoting of fields and tables names
sql/item.h:
  Quoting of fields and tables names
sql/sql_select.cc:
  Quoting of fields and tables names
sql/sql_view.cc:
  mark subquery in the FROM clause like derived
This commit is contained in:
unknown
2004-07-20 08:48:28 +03:00
parent f0957bcc61
commit ec33aa2bee
27 changed files with 180 additions and 122 deletions

View File

@ -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);