mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
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().
This commit is contained in:
parent
ffd88cb2bd
commit
a3e83048a3
39 changed files with 710 additions and 381 deletions
|
|
@ -4230,6 +4230,40 @@ LOCK TABLES `test` WRITE;
|
|||
UNLOCK TABLES;
|
||||
drop database `test-database`;
|
||||
use test;
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# -- Bug#30217: Views: changes in metadata behaviour between 5.0 and 5.1.
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
DROP DATABASE IF EXISTS mysqldump_test_db;
|
||||
CREATE DATABASE mysqldump_test_db;
|
||||
use mysqldump_test_db;
|
||||
|
||||
CREATE VIEW v1(x, y) AS SELECT 'a', 'a';
|
||||
|
||||
SELECT view_definition
|
||||
FROM INFORMATION_SCHEMA.VIEWS
|
||||
WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1';
|
||||
view_definition
|
||||
select 'a' AS `x`,'a' AS `y`
|
||||
|
||||
---> Dumping mysqldump_test_db to bug30217.sql
|
||||
|
||||
DROP DATABASE mysqldump_test_db;
|
||||
use test;
|
||||
|
||||
---> Restoring mysqldump_test_db...
|
||||
|
||||
SELECT view_definition
|
||||
FROM INFORMATION_SCHEMA.VIEWS
|
||||
WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1';
|
||||
view_definition
|
||||
select 'a' AS `x`,'a' AS `y`
|
||||
|
||||
DROP DATABASE mysqldump_test_db;
|
||||
|
||||
# -- End of test case for Bug#32538.
|
||||
|
||||
#
|
||||
# End of 5.1 tests
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue