diff options
author | kostja@bodhi.(none) <> | 2007-07-16 17:22:33 +0400 |
---|---|---|
committer | kostja@bodhi.(none) <> | 2007-07-16 17:22:33 +0400 |
commit | be4f73c44fdf563e1f5b1393316fd23b7f286c3f (patch) | |
tree | 2871e2ea453c7f2ac10d1123bf0bf7bc9ab5663c /mysql-test/t/show_check.test | |
parent | 28a620213f462e70e47cb6329140063a300b74b5 (diff) | |
parent | eec9f7c59d3a60101d37275eacb4dce4d963ecf9 (diff) | |
download | mariadb-git-be4f73c44fdf563e1f5b1393316fd23b7f286c3f.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.(none):/opt/local/work/mysql-5.1-runtime
Diffstat (limited to 'mysql-test/t/show_check.test')
-rw-r--r-- | mysql-test/t/show_check.test | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 6e848695b80..09c0b08a3cd 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -913,4 +913,68 @@ DROP TABLE t1; DROP PROCEDURE p1; DEALLOCATE PREPARE stmt1; +# +# BUG#10491: Server returns data as charset binary SHOW CREATE TABLE or SELECT +# FROM INFORMATION_SCHEMA. +# +# Before the change performed to fix the bug, the metadata of the output of +# SHOW CREATE statements would always describe the result as 'binary'. That +# would ensure that the result is never converted to character_set_client +# (which was essential to mysqldump). Now we return to the client the actual +# character set of the object -- which is character_set_client of the +# connection that issues the CREATE statement, and this triggers an automatic +# conversion to character_set_results of the connection that issues SHOW CREATE +# statement. +# +# This test demonstrates that this conversion indeed is taking place. +# + +# Prepare: create objects in a one character set. + +set names koi8r; + +--disable_warnings +DROP VIEW IF EXISTS v1; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TABLE IF EXISTS t1; +DROP EVENT IF EXISTS ev1; +--enable_warnings + +CREATE VIEW v1 AS SELECT 'ΤΕΣΤ' AS test; + +CREATE PROCEDURE p1() SELECT 'ΤΕΣΤ' AS test; + +CREATE FUNCTION f1() RETURNS CHAR(10) RETURN 'ΤΕΣΤ'; + +CREATE TABLE t1(c1 CHAR(10)); +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 + FOR EACH ROW + SET NEW.c1 = 'ΤΕΣΤ'; + +CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ΤΕΣΤ' AS test; + +# Test: switch the character set and show that SHOW CREATE output is +# automatically converted to the new character_set_client. + +set names utf8; + +SHOW CREATE VIEW v1; + +SHOW CREATE PROCEDURE p1; + +SHOW CREATE FUNCTION f1; + +SHOW CREATE TRIGGER t1_bi; + +SHOW CREATE EVENT ev1; + +# Cleanup. + +DROP VIEW v1; +DROP PROCEDURE p1; +DROP FUNCTION f1; +DROP TABLE t1; +DROP EVENT ev1; + --echo End of 5.1 tests |