diff options
author | unknown <anozdrin/alik@quad.> | 2008-02-22 13:30:33 +0300 |
---|---|---|
committer | unknown <anozdrin/alik@quad.> | 2008-02-22 13:30:33 +0300 |
commit | a3e83048a36b20481155315d1026c6d91da8ecef (patch) | |
tree | 3addb17d5ad1fc4ed36a5cfc04608c6864c99630 /sql/sql_lex.cc | |
parent | ffd88cb2bd1bb31a85036a422145b325a36d629e (diff) | |
download | mariadb-git-a3e83048a36b20481155315d1026c6d91da8ecef.tar.gz |
Fix for Bug#30217: Views: changes in metadata behaviour
between 5.0 and 5.1.
The problem was that in the patch for Bug#11986 it was decided
to store original query in UTF8 encoding for the INFORMATION_SCHEMA.
This approach however turned out to be quite difficult to implement
properly. The main problem is to preserve the same IS-output after
dump/restore.
So, the fix is to rollback to the previous functionality, but also
to fix it to support multi-character-set-queries properly. The idea
is to generate INFORMATION_SCHEMA-query from the item-tree after
parsing view declaration. The IS-query should:
- be completely in UTF8;
- not contain character set introducers.
For more information, see WL4052.
mysql-test/include/ddl_i18n.check_views.inc:
Add a test case for Bug#30217.
mysql-test/r/ddl_i18n_koi8r.result:
Update result file.
mysql-test/r/ddl_i18n_utf8.result:
Update result file.
mysql-test/r/information_schema.result:
Update result file.
mysql-test/r/information_schema_db.result:
Update result file.
mysql-test/r/mysqldump.result:
Update result file.
mysql-test/r/show_check.result:
Update result file.
mysql-test/t/ddl_i18n_koi8r.test:
Add a test case for Bug#30217.
mysql-test/t/ddl_i18n_utf8.test:
Add a test case for Bug#30217.
mysql-test/t/mysqldump.test:
Add a test case for Bug#30217.
sql/ha_ndbcluster.cc:
Add a parameter to print().
sql/item.cc:
1. Add a parameter to print().
2. Item_string::print():
- Do not append character set introducer to the text literal
if we're building a query for INFORMATION_SCHEMA;
- Convert text literal to UTF8 if we're building a query
for INFORMATION_SCHEMA.
sql/item.h:
Add a parameter to print().
sql/item_cmpfunc.cc:
Add a parameter to print().
sql/item_cmpfunc.h:
Add a parameter to print().
sql/item_func.cc:
Add a parameter to print().
sql/item_func.h:
Add a parameter to print().
sql/item_geofunc.h:
Add a parameter to print().
sql/item_row.cc:
Add a parameter to print().
sql/item_row.h:
Add a parameter to print().
sql/item_strfunc.cc:
Add a parameter to print().
sql/item_strfunc.h:
Add a parameter to print().
sql/item_subselect.cc:
Add a parameter to print().
sql/item_subselect.h:
Add a parameter to print().
sql/item_sum.cc:
Add a parameter to print().
sql/item_sum.h:
Add a parameter to print().
sql/item_timefunc.cc:
Add a parameter to print().
sql/item_timefunc.h:
Add a parameter to print().
sql/mysql_priv.h:
Add a parameter to print().
sql/sp_head.cc:
Add a parameter to print().
sql/sql_lex.cc:
Add a parameter to print().
sql/sql_lex.h:
Add a parameter to print().
sql/sql_parse.cc:
Add a parameter to print().
sql/sql_select.cc:
Add a parameter to print().
sql/sql_show.cc:
Add a parameter to print().
sql/sql_test.cc:
Add a parameter to print().
sql/sql_view.cc:
Build INFORMATION_SCHEMA query from Item-tree.
sql/sql_yacc.yy:
Build INFORMATION_SCHEMA query from Item-tree.
sql/table.h:
Add a parameter to print().
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5352f8efbbb..b07efc62a00 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1947,7 +1947,7 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num) } -void st_select_lex_unit::print(String *str) +void st_select_lex_unit::print(String *str, enum_query_type query_type) { bool union_all= !union_distinct; for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) @@ -1962,7 +1962,7 @@ void st_select_lex_unit::print(String *str) } if (sl->braces) str->append('('); - sl->print(thd, str); + sl->print(thd, str, query_type); if (sl->braces) str->append(')'); } @@ -1971,16 +1971,19 @@ void st_select_lex_unit::print(String *str) if (fake_select_lex->order_list.elements) { str->append(STRING_WITH_LEN(" order by ")); - fake_select_lex->print_order(str, - (ORDER *) fake_select_lex-> - order_list.first); + fake_select_lex->print_order( + str, + (ORDER *) fake_select_lex->order_list.first, + query_type); } - fake_select_lex->print_limit(thd, str); + fake_select_lex->print_limit(thd, str, query_type); } } -void st_select_lex::print_order(String *str, ORDER *order) +void st_select_lex::print_order(String *str, + ORDER *order, + enum_query_type query_type) { for (; order; order= order->next) { @@ -1991,7 +1994,7 @@ void st_select_lex::print_order(String *str, ORDER *order) str->append(buffer, length); } else - (*order->item)->print(str); + (*order->item)->print(str, query_type); if (!order->asc) str->append(STRING_WITH_LEN(" desc")); if (order->next) @@ -2000,7 +2003,9 @@ void st_select_lex::print_order(String *str, ORDER *order) } -void st_select_lex::print_limit(THD *thd, String *str) +void st_select_lex::print_limit(THD *thd, + String *str, + enum_query_type query_type) { SELECT_LEX_UNIT *unit= master_unit(); Item_subselect *item= unit->item; @@ -2019,10 +2024,10 @@ void st_select_lex::print_limit(THD *thd, String *str) str->append(STRING_WITH_LEN(" limit ")); if (offset_limit) { - offset_limit->print(str); + offset_limit->print(str, query_type); str->append(','); } - select_limit->print(str); + select_limit->print(str, query_type); } } |