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 /mysql-test/r/ddl_i18n_koi8r.result | |
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 'mysql-test/r/ddl_i18n_koi8r.result')
-rw-r--r-- | mysql-test/r/ddl_i18n_koi8r.result | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result index dfdc8fd463e..34cea2a5a7d 100644 --- a/mysql-test/r/ddl_i18n_koi8r.result +++ b/mysql-test/r/ddl_i18n_koi8r.result @@ -16,6 +16,8 @@ FROM t1| CREATE VIEW v2 AS SELECT _utf8'тест' as c1| +CREATE VIEW v3 AS SELECT _utf8'тест'| + SHOW CREATE VIEW v1| @@ -26,15 +28,22 @@ SHOW CREATE VIEW v2| View Create View character_set_client collation_connection v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _utf8'тест' AS `c1` koi8r koi8r_general_ci +SHOW CREATE VIEW v3| +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select _utf8'тест' AS `` koi8r koi8r_general_ci + SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'| TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION -NULL mysqltest1 v1 SELECT '' AS c1, AS c2 -FROM t1 NONE YES root@localhost DEFINER koi8r koi8r_general_ci +NULL mysqltest1 v1 select '' AS `c1`,`mysqltest1`.`t1`.`` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'| TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION -NULL mysqltest1 v2 SELECT '' as c1 NONE NO root@localhost DEFINER koi8r koi8r_general_ci +NULL mysqltest1 v2 select '' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci + +SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'| +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION +NULL mysqltest1 v3 select '' AS `` NONE NO root@localhost DEFINER koi8r koi8r_general_ci SELECT COLLATION(c1), COLLATION(c2) FROM v1| @@ -45,6 +54,10 @@ SELECT COLLATION(c1) FROM v2| COLLATION(c1) utf8_general_ci +SELECT * FROM v3| + + + ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| @@ -54,6 +67,7 @@ SET @@character_set_results= cp1251| SET @@collation_connection= cp1251_general_ci| SELECT * FROM mysqltest1.v1| SELECT * FROM mysqltest1.v2| +SELECT * FROM mysqltest1.v3| use mysqltest1| set names koi8r| @@ -66,15 +80,22 @@ SHOW CREATE VIEW v2| View Create View character_set_client collation_connection v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _utf8'тест' AS `c1` koi8r koi8r_general_ci +SHOW CREATE VIEW v3| +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select _utf8'тест' AS `` koi8r koi8r_general_ci + SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'| TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION -NULL mysqltest1 v1 SELECT '' AS c1, AS c2 -FROM t1 NONE YES root@localhost DEFINER koi8r koi8r_general_ci +NULL mysqltest1 v1 select '' AS `c1`,`mysqltest1`.`t1`.`` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'| TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION -NULL mysqltest1 v2 SELECT '' as c1 NONE NO root@localhost DEFINER koi8r koi8r_general_ci +NULL mysqltest1 v2 select '' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci + +SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'| +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION +NULL mysqltest1 v3 select '' AS `` NONE NO root@localhost DEFINER koi8r koi8r_general_ci SELECT COLLATION(c1), COLLATION(c2) FROM v1| @@ -85,6 +106,10 @@ SELECT COLLATION(c1) FROM v2| COLLATION(c1) utf8_general_ci +SELECT * FROM v3| + + + ---> Dumping mysqltest1 to ddl_i18n_koi8r.views.mysqltest1.sql @@ -99,6 +124,7 @@ SET @@character_set_results= cp1251| SET @@collation_connection= cp1251_general_ci| SELECT * FROM mysqltest1.v1| SELECT * FROM mysqltest1.v2| +SELECT * FROM mysqltest1.v3| use mysqltest1| set names koi8r| @@ -111,15 +137,23 @@ SHOW CREATE VIEW v2| View Create View character_set_client collation_connection v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _utf8'тест' AS `c1` koi8r koi8r_general_ci +SHOW CREATE VIEW v3| +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select _utf8'тест' AS `` koi8r koi8r_general_ci + SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'| TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION -NULL mysqltest1 v1 select '' AS `c1`,`t1`.`` AS `c2` from `t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci +NULL mysqltest1 v1 select '' AS `c1`,`mysqltest1`.`t1`.`` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'| TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION NULL mysqltest1 v2 select '' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci +SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'| +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION +NULL mysqltest1 v3 select '' AS `` NONE NO root@localhost DEFINER koi8r koi8r_general_ci + SELECT COLLATION(c1), COLLATION(c2) FROM v1| COLLATION(c1) COLLATION(c2) @@ -129,6 +163,10 @@ SELECT COLLATION(c1) FROM v2| COLLATION(c1) utf8_general_ci +SELECT * FROM v3| + + + ---> connection: default use test| DROP DATABASE mysqltest1| |