diff options
author | unknown <anozdrin/alik@quad.> | 2008-02-12 22:09:16 +0300 |
---|---|---|
committer | unknown <anozdrin/alik@quad.> | 2008-02-12 22:09:16 +0300 |
commit | c1d0dd94bb4734f0a441c589b6fc9fa25d2fa768 (patch) | |
tree | d07b7e82d1b8efe31aa691c59c358479c0f246fb /mysql-test/r/view.result | |
parent | 84f227dffe386ba886040e440cb998508fc9d84d (diff) | |
download | mariadb-git-c1d0dd94bb4734f0a441c589b6fc9fa25d2fa768.tar.gz |
Fix for Bug#32538: View definition picks up character set,
but not collation.
The problem here was that text literals in a view were always
dumped with character set introducer. That lead to loosing
collation information.
The fix is to dump character set introducer only if it was
in the original query. That is now possible because there
is no problem any more of loss of character set of string
literals in views -- after WL#4052 the view is dumped
in the original character set.
mysql-test/r/case.result:
Update result file.
mysql-test/r/compress.result:
Update result file.
mysql-test/r/ctype_collate.result:
Update result file.
mysql-test/r/date_formats.result:
Update result file.
mysql-test/r/ddl_i18n_koi8r.result:
Update result file.
mysql-test/r/ddl_i18n_utf8.result:
Update result file.
mysql-test/r/fulltext.result:
Update result file.
mysql-test/r/func_crypt.result:
Update result file.
mysql-test/r/func_encrypt.result:
Update result file.
mysql-test/r/func_if.result:
Update result file.
mysql-test/r/func_in.result:
Update result file.
mysql-test/r/func_like.result:
Update result file.
mysql-test/r/func_regexp.result:
Update result file.
mysql-test/r/func_set.result:
Update result file.
mysql-test/r/func_str.result:
Update result file.
mysql-test/r/func_time.result:
Update result file.
mysql-test/r/gis.result:
Update result file.
mysql-test/r/group_min_max.result:
Update result file.
mysql-test/r/mysqldump.result:
Update result file.
mysql-test/r/negation_elimination.result:
Update result file.
mysql-test/r/null.result:
Update result file.
mysql-test/r/select.result:
Update result file.
mysql-test/r/show_check.result:
Update result file.
mysql-test/r/sp-code.result:
Update result file.
mysql-test/r/ssl.result:
Update result file.
mysql-test/r/ssl_compress.result:
Update result file.
mysql-test/r/subselect.result:
Update result file.
mysql-test/r/temp_table.result:
Update result file.
mysql-test/r/type_blob.result:
Update result file.
mysql-test/r/view.result:
Update result file.
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Update result file.
mysql-test/suite/rpl/r/rpl_get_lock.result:
Update result file.
mysql-test/suite/rpl/r/rpl_master_pos_wait.result:
Update result file.
mysql-test/t/view.test:
Add a test case for Bug#32538.
sql/item.cc:
Do not dump character set introducer if it was not specified
explicitly in the original query.
sql/item.h:
Add 'cs_specified' property to Item_string.
sql/sql_yacc.yy:
Set Item_string::cs_specified property to TRUE
when character set introducer is explicitly specified.
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r-- | mysql-test/r/view.result | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 09b997797b4..3f8ed1b4e56 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3061,7 +3061,7 @@ TheEnd TheEnd SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'The\ZEnd' AS `TheEnd` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 'The\ZEnd' AS `TheEnd` latin1 latin1_swedish_ci DROP VIEW v1; CREATE TABLE t1 (mydate DATETIME); INSERT INTO t1 VALUES @@ -3613,7 +3613,9 @@ ERROR HY000: Field of view 'test.v1' underlying table doesn't have a default val set @@sql_mode=@old_mode; drop view v1; drop table t1; -End of 5.0 tests. +# ----------------------------------------------------------------- +# -- End of 5.0 tests. +# ----------------------------------------------------------------- DROP DATABASE IF EXISTS `d-1`; CREATE DATABASE `d-1`; USE `d-1`; @@ -3676,4 +3678,48 @@ DROP TABLE t1; # End of test case for Bug#26676. -End of 5.1 tests. +# ----------------------------------------------------------------- +# -- Bug#32538: View definition picks up character set, but not collation +# ----------------------------------------------------------------- + +DROP VIEW IF EXISTS v1; + +SET collation_connection = latin1_general_ci; +CREATE VIEW v1 AS SELECT _latin1 'text1' AS c1, 'text2' AS c2; + +SELECT COLLATION(c1), COLLATION(c2) FROM v1; +COLLATION(c1) COLLATION(c2) +latin1_swedish_ci latin1_general_ci + +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'text1' AS `c1`,'text2' AS `c2` latin1 latin1_general_ci + +SELECT * FROM v1 WHERE c1 = 'text1'; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin1_general_ci,COERCIBLE) for operation '=' + +SELECT * FROM v1 WHERE c2 = 'text2'; +c1 c2 +text1 text2 + +use test; +SET names latin1; + +SELECT COLLATION(c1), COLLATION(c2) FROM v1; +COLLATION(c1) COLLATION(c2) +latin1_swedish_ci latin1_general_ci + +SELECT * FROM v1 WHERE c1 = 'text1'; +c1 c2 +text1 text2 + +SELECT * FROM v1 WHERE c2 = 'text2'; +ERROR HY000: Illegal mix of collations (latin1_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' + +DROP VIEW v1; + +# -- End of test case for Bug#32538. + +# ----------------------------------------------------------------- +# -- End of 5.1 tests. +# ----------------------------------------------------------------- |