diff options
author | unknown <anozdrin/alik@ibm.> | 2007-06-28 21:34:54 +0400 |
---|---|---|
committer | unknown <anozdrin/alik@ibm.> | 2007-06-28 21:34:54 +0400 |
commit | 68860f28d721df6124227fe081bf80b759196b94 (patch) | |
tree | 7d6b94b3baf75de8b22461e2161e5461fc54cbd6 /mysql-test | |
parent | 4bc6552953fd2e55fc1a171a943ebe411c5620d3 (diff) | |
download | mariadb-git-68860f28d721df6124227fe081bf80b759196b94.tar.gz |
Patch for the following bugs:
- BUG#11986: Stored routines and triggers can fail if the code
has a non-ascii symbol
- BUG#16291: mysqldump corrupts string-constants with non-ascii-chars
- BUG#19443: INFORMATION_SCHEMA does not support charsets properly
- BUG#21249: Character set of SP-var can be ignored
- BUG#25212: Character set of string constant is ignored (stored routines)
- BUG#25221: Character set of string constant is ignored (triggers)
There were a few general problems that caused these bugs:
1. Character set information of the original (definition) query for views,
triggers, stored routines and events was lost.
2. mysqldump output query in client character set, which can be
inappropriate to encode definition-query.
3. INFORMATION_SCHEMA used strings with mixed encodings to display object
definition;
1. No query-definition-character set.
In order to compile query into execution code, some extra data (such as
environment variables or the database character set) is used. The problem
here was that this context was not preserved. So, on the next load it can
differ from the original one, thus the result will be different.
The context contains the following data:
- client character set;
- connection collation (character set and collation);
- collation of the owner database;
The fix is to store this context and use it each time we parse (compile)
and execute the object (stored routine, trigger, ...).
2. Wrong mysqldump-output.
The original query can contain several encodings (by means of character set
introducers). The problem here was that we tried to convert original query
to the mysqldump-client character set.
Moreover, we stored queries in different character sets for different
objects (views, for one, used UTF8, triggers used original character set).
The solution is
- to store definition queries in the original character set;
- to change SHOW CREATE statement to output definition query in the
binary character set (i.e. without any conversion);
- introduce SHOW CREATE TRIGGER statement;
- to dump special statements to switch the context to the original one
before dumping and restore it afterwards.
Note, in order to preserve the database collation at the creation time,
additional ALTER DATABASE might be used (to temporary switch the database
collation back to the original value). In this case, ALTER DATABASE
privilege will be required. This is a backward-incompatible change.
3. INFORMATION_SCHEMA showed non-UTF8 strings
The fix is to generate UTF8-query during the parsing, store it in the object
and show it in the INFORMATION_SCHEMA.
Basically, the idea is to create a copy of the original query convert it to
UTF8. Character set introducers are removed and all text literals are
converted to UTF8.
This UTF8 query is intended to provide user-readable output. It must not be
used to recreate the object. Specialized SHOW CREATE statements should be
used for this.
The reason for this limitation is the following: the original query can
contain symbols from several character sets (by means of character set
introducers).
Example:
- original query:
CREATE VIEW v1 AS SELECT _cp1251 'Hello' AS c1;
- UTF8 query (for INFORMATION_SCHEMA):
CREATE VIEW v1 AS SELECT 'Hello' AS c1;
client/mysqldump.c:
Set original character set and collation before dumping definition query.
include/my_sys.h:
Move out-parameter to the end of list.
mysql-test/lib/mtr_report.pl:
Ignore server-warnings during the test case.
mysql-test/r/create.result:
Update result file.
mysql-test/r/ctype_cp932_binlog_stm.result:
Update result file.
mysql-test/r/events.result:
Update result file.
mysql-test/r/events_bugs.result:
Update result file.
mysql-test/r/events_grant.result:
Update result file.
mysql-test/r/func_in.result:
Update result file.
mysql-test/r/gis.result:
Update result file.
mysql-test/r/grant.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/lowercase_view.result:
Update result file.
mysql-test/r/mysqldump.result:
Update result file.
mysql-test/r/ndb_sp.result:
Update result file.
mysql-test/r/ps.result:
Update result file.
mysql-test/r/rpl_replicate_do.result:
Update result file.
mysql-test/r/rpl_sp.result:
Update result file.
mysql-test/r/rpl_trigger.result:
Update result file.
mysql-test/r/rpl_view.result:
Update result file.
mysql-test/r/show_check.result:
Update result file.
mysql-test/r/skip_grants.result:
Update result file.
mysql-test/r/sp-destruct.result:
Update result file.
mysql-test/r/sp-error.result:
Update result file.
mysql-test/r/sp-security.result:
Update result file.
mysql-test/r/sp.result:
Update result file.
mysql-test/r/sql_mode.result:
Update result file.
mysql-test/r/system_mysql_db.result:
Update result file.
mysql-test/r/temp_table.result:
Update result file.
mysql-test/r/trigger-compat.result:
Update result file.
mysql-test/r/trigger-grant.result:
Update result file.
mysql-test/r/trigger.result:
Update result file.
mysql-test/r/view.result:
Update result file.
mysql-test/r/view_grant.result:
Update result file.
mysql-test/t/events.test:
Update test case (new columns added).
mysql-test/t/information_schema.test:
Update test case (new columns added).
mysql-test/t/show_check.test:
Test case for SHOW CREATE TRIGGER in prepared statements and
stored routines.
mysql-test/t/sp-destruct.test:
Update test case (new columns added).
mysql-test/t/sp.test:
Update test case (new columns added).
mysql-test/t/view.test:
Update test.
mysys/charset.c:
Move out-parameter to the end of list.
scripts/mysql_system_tables.sql:
Add new columns to mysql.proc and mysql.event.
scripts/mysql_system_tables_fix.sql:
Add new columns to mysql.proc and mysql.event.
sql/event_data_objects.cc:
Support new attributes for events.
sql/event_data_objects.h:
Support new attributes for events.
sql/event_db_repository.cc:
Support new attributes for events.
sql/event_db_repository.h:
Support new attributes for events.
sql/events.cc:
Add new columns to SHOW CREATE event resultset.
sql/mysql_priv.h:
1. Introduce Object_creation_ctx;
2. Introduce SHOW CREATE TRIGGER;
3. Introduce auxilary functions.
sql/sp.cc:
Add support for new store routines attributes.
sql/sp_head.cc:
Add support for new store routines attributes.
sql/sp_head.h:
Add support for new store routines attributes.
sql/sql_lex.cc:
Generate UTF8-body on parsing/lexing.
sql/sql_lex.h:
1. Generate UTF8-body on parsing/lexing.
2. Introduce SHOW CREATE TRIGGER.
sql/sql_parse.cc:
Introduce SHOW CREATE TRIGGER.
sql/sql_partition.cc:
Update parse_sql().
sql/sql_prepare.cc:
Update parse_sql().
sql/sql_show.cc:
Support new attributes for views
sql/sql_trigger.cc:
Support new attributes for views
sql/sql_trigger.h:
Support new attributes for views
sql/sql_view.cc:
Support new attributes for views
sql/sql_yacc.yy:
1. Add SHOW CREATE TRIGGER statement.
2. Generate UTF8-body for views, stored routines, triggers and events.
sql/table.cc:
Introduce Object_creation_ctx.
sql/table.h:
Introduce Object_creation_ctx.
sql/share/errmsg.txt:
Add new errors.
mysql-test/include/ddl_i18n.check_events.inc:
Aux file for test suite.
mysql-test/include/ddl_i18n.check_sp.inc:
Aux file for test suite.
mysql-test/include/ddl_i18n.check_triggers.inc:
Aux file for test suite.
mysql-test/include/ddl_i18n.check_views.inc:
Aux file for test suite.
mysql-test/include/have_cp1251.inc:
Aux file for test suite.
mysql-test/include/have_cp866.inc:
Aux file for test suite.
mysql-test/include/have_koi8r.inc:
Aux file for test suite.
mysql-test/include/have_utf8.inc:
Aux file for test suite.
mysql-test/r/ddl_i18n_koi8r.result:
Result file.
mysql-test/r/ddl_i18n_utf8.result:
Result file.
mysql-test/r/have_cp1251.require:
Aux file for test suite.
mysql-test/r/have_cp866.require:
Aux file for test suite.
mysql-test/r/have_koi8r.require:
Aux file for test suite.
mysql-test/r/have_utf8.require:
Aux file for test suite.
mysql-test/t/ddl_i18n_koi8r.test:
Complete koi8r test case for the CS patch.
mysql-test/t/ddl_i18n_utf8.test:
Complete utf8 test case for the CS patch.
Diffstat (limited to 'mysql-test')
55 files changed, 9234 insertions, 653 deletions
diff --git a/mysql-test/include/ddl_i18n.check_events.inc b/mysql-test/include/ddl_i18n.check_events.inc new file mode 100644 index 00000000000..8b0d70e3c0e --- /dev/null +++ b/mysql-test/include/ddl_i18n.check_events.inc @@ -0,0 +1,48 @@ +# - Check SHOW CREATE statement; + +--echo +--echo + +SHOW CREATE EVENT ev1| +--echo +SHOW CREATE EVENT ev2| +--echo +SHOW CREATE EVENT mysqltest2.ev3| +--echo +SHOW CREATE EVENT mysqltest2.ev3| + +# - Check SHOW statement; + +--echo +--echo + +SHOW EVENTS LIKE 'ev1'| + +--echo +SHOW EVENTS LIKE 'ev2'| + +--echo +SHOW EVENTS LIKE 'ev3'| + +--echo +SHOW EVENTS LIKE 'ev4'| + +# - Check INFORMATION_SCHEMA; + +--echo +--echo + +--replace_column 17 CREATED 18 LAST_ALTERED +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'| + +--echo +--replace_column 17 CREATED 18 LAST_ALTERED +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| + +--echo +--replace_column 17 CREATED 18 LAST_ALTERED +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| + +--echo +--replace_column 17 CREATED 18 LAST_ALTERED +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| diff --git a/mysql-test/include/ddl_i18n.check_sp.inc b/mysql-test/include/ddl_i18n.check_sp.inc new file mode 100644 index 00000000000..bb1657d7072 --- /dev/null +++ b/mysql-test/include/ddl_i18n.check_sp.inc @@ -0,0 +1,83 @@ +# - Check SHOW CREATE statement; + +--echo +--echo + +SHOW CREATE PROCEDURE p1| +--echo +SHOW CREATE PROCEDURE p2| +--echo +SHOW CREATE PROCEDURE mysqltest2.p3| +--echo +SHOW CREATE PROCEDURE mysqltest2.p4| + +# - Check SHOW statement; + +--echo +--echo + +--replace_column 5 MODIFIED 6 CREATED +SHOW PROCEDURE STATUS LIKE 'p1'| + +--echo +--replace_column 5 MODIFIED 6 CREATED +SHOW PROCEDURE STATUS LIKE 'p2'| + +--echo +--replace_column 5 MODIFIED 6 CREATED +SHOW PROCEDURE STATUS LIKE 'p3'| + +--echo +--replace_column 5 MODIFIED 6 CREATED +SHOW PROCEDURE STATUS LIKE 'p4'| + +# - Check INFORMATION_SCHEMA; + +--echo +--echo + +--replace_column 16 CREATED 17 ALTERED +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'| + +--echo +--replace_column 16 CREATED 17 ALTERED +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| + +--echo +--replace_column 16 CREATED 17 ALTERED +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| + +--echo +--replace_column 16 CREATED 17 ALTERED +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| + +# - Initialize the used variables (actual values don't matter); + +--echo +--echo + +SET @a = '1'| +SET @b = '2'| + +# - Execute the routines; + +--echo +--echo + +CALL p1(@a, @b)| +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| + +--echo + +CALL p2(@a, @b)| +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| + +--echo + +CALL mysqltest2.p3(@a, @b)| +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| + +--echo + +CALL mysqltest2.p4(@a, @b)| +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| diff --git a/mysql-test/include/ddl_i18n.check_triggers.inc b/mysql-test/include/ddl_i18n.check_triggers.inc new file mode 100644 index 00000000000..dbfbc3cda5e --- /dev/null +++ b/mysql-test/include/ddl_i18n.check_triggers.inc @@ -0,0 +1,106 @@ +# - Check SHOW CREATE statement; + +--echo +--echo + +SHOW CREATE TRIGGER trg1| +--echo +SHOW CREATE TRIGGER trg2| +--echo +SHOW CREATE TRIGGER mysqltest2.trg3| +--echo +SHOW CREATE TRIGGER mysqltest2.trg4| + +# - Check SHOW statement; + +--echo +--echo + +SHOW TRIGGERS| + +--echo + +use mysqltest2| + +--echo + +SHOW TRIGGERS| + +use mysqltest1| + +# - Check INFORMATION_SCHEMA; + +--echo +--echo + +--replace_column 17 CREATED +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'| + +--echo +--replace_column 17 CREATED +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| + +--echo +--replace_column 17 CREATED +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| + +--echo +--replace_column 17 CREATED +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| + +# - Initialize the used variables (actual values don't matter); + +--echo +--echo + +SET @a1 = '1'| +SET @a2 = '1'| +SET @a3 = '1'| + +SET @b1 = '2'| +SET @b2 = '2'| +SET @b3 = '2'| + +# - Execute the triggers; + +--echo +--echo + +INSERT INTO t1 VALUES(1)| + +--echo +--echo ---> Log: +SELECT msg FROM log| + +--echo +SELECT + COLLATION(@a1) AS ca1, + COLLATION(@a2) AS ca2, + COLLATION(@a3) AS ca3, + COLLATION(@b1) AS cb1, + COLLATION(@b2) AS cb2, + COLLATION(@b3) AS cb3| + +--echo +DELETE FROM log| + +--echo +--echo + +INSERT INTO mysqltest2.t1 VALUES(1)| + +--echo +--echo ---> Log: +SELECT msg FROM mysqltest2.log| + +--echo +SELECT + COLLATION(@a1) AS ca1, + COLLATION(@a2) AS ca2, + COLLATION(@a3) AS ca3, + COLLATION(@b1) AS cb1, + COLLATION(@b2) AS cb2, + COLLATION(@b3) AS cb3| + +--echo +DELETE FROM mysqltest2.log| diff --git a/mysql-test/include/ddl_i18n.check_views.inc b/mysql-test/include/ddl_i18n.check_views.inc new file mode 100644 index 00000000000..727f3506e4a --- /dev/null +++ b/mysql-test/include/ddl_i18n.check_views.inc @@ -0,0 +1,32 @@ +# - Check SHOW CREATE statement; + +--echo +--echo + +SHOW CREATE VIEW v1| + +--echo + +SHOW CREATE VIEW v2| + +# - Check INFORMATION_SCHEMA; + +--echo +--echo + +SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'| + +--echo + +SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'| + +# - Execute the views; + +--echo +--echo + +SELECT COLLATION(c1), COLLATION(c2) FROM v1| + +--echo + +SELECT COLLATION(c1) FROM v2| diff --git a/mysql-test/include/have_cp1251.inc b/mysql-test/include/have_cp1251.inc new file mode 100644 index 00000000000..2d5f1b3b529 --- /dev/null +++ b/mysql-test/include/have_cp1251.inc @@ -0,0 +1,7 @@ +--require r/have_cp1251.require + +--disable_query_log + +SHOW COLLATION LIKE 'cp1251_general_ci'; + +--enable_query_log diff --git a/mysql-test/include/have_cp866.inc b/mysql-test/include/have_cp866.inc new file mode 100644 index 00000000000..27390d87d51 --- /dev/null +++ b/mysql-test/include/have_cp866.inc @@ -0,0 +1,7 @@ +--require r/have_cp866.require + +--disable_query_log + +SHOW COLLATION LIKE 'cp866_general_ci'; + +--enable_query_log diff --git a/mysql-test/include/have_koi8r.inc b/mysql-test/include/have_koi8r.inc new file mode 100644 index 00000000000..1fe163565ba --- /dev/null +++ b/mysql-test/include/have_koi8r.inc @@ -0,0 +1,7 @@ +--require r/have_koi8r.require + +--disable_query_log + +SHOW COLLATION LIKE 'koi8r_general_ci'; + +--enable_query_log diff --git a/mysql-test/include/have_utf8.inc b/mysql-test/include/have_utf8.inc new file mode 100644 index 00000000000..58b74f4072f --- /dev/null +++ b/mysql-test/include/have_utf8.inc @@ -0,0 +1,7 @@ +--require r/have_utf8.require + +--disable_query_log + +SHOW COLLATION LIKE 'utf8_general_ci'; + +--enable_query_log diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index d82ed200a4b..a9d6d17d870 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -364,7 +364,12 @@ sub mtr_report_stats ($) { # Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes # server coredump /\QError in Log_event::read_log_event(): 'Sanity check failed', data_len: 258, event_type: 49\E/ or - /Statement is not safe to log in statement format/ + /Statement is not safe to log in statement format/ or + + # Test case for Bug#14233 produces the following warnings: + /Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc/ or + /Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc/ or + /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ ) { next; # Skip these lines diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index e73b74ccac3..f85478d7f9e 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -980,8 +980,8 @@ Table Create Table KEY `имя_индекса_в_кодировке_утф8_длиной_больше_чем_48` (`имя_поля_в_кодировке_утф8_длиной_больше_чем_45`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create view имя_вью_кодировке_утф8_длиной_больше_чем_42; -View Create View -имя_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `имя_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` AS `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` from `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` +View Create View character_set_client collation_connection +имя_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `имя_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` AS `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` from `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` utf8 utf8_general_ci create event имя_события_в_кодировке_утф8_длиной_больше_чем_48 on schedule every 2 year do select 1; select EVENT_NAME from information_schema.events where event_schema='test'; diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index b9a39b88ae5..c6ca7a3f008 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -40,9 +40,9 @@ IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 783 Query 1 1002 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) -master-bin.000001 1002 Query 1 1091 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1091 Query 1 1170 use `test`; DROP TABLE t4 +master-bin.000001 783 Query 1 999 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) +master-bin.000001 999 Query 1 1085 use `test`; DROP PROCEDURE bug18293 +master-bin.000001 1085 Query 1 1161 use `test`; DROP TABLE t4 End of 5.0 tests SHOW BINLOG EVENTS FROM 364; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result new file mode 100644 index 00000000000..9e5931330e2 --- /dev/null +++ b/mysql-test/r/ddl_i18n_koi8r.result @@ -0,0 +1,2783 @@ +set names koi8r; + +------------------------------------------------------------------- +Views +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| +CREATE TABLE t1( INT)| +INSERT INTO t1 VALUES(1)| + +CREATE VIEW v1 AS +SELECT '' AS c1, AS c2 +FROM t1| + +CREATE VIEW v2 AS SELECT _utf8'тест' as c1| + + + +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 _koi8r'' AS `c1`,`t1`.`` AS `c2` from `t1` koi8r koi8r_general_ci + +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 + + +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 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 COLLATION(c1), COLLATION(c2) FROM v1| +COLLATION(c1) COLLATION(c2) +koi8r_general_ci binary + +SELECT COLLATION(c1) FROM v2| +COLLATION(c1) +utf8_general_ci + + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| + +---> connection: con2 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +SELECT * FROM mysqltest1.v1| +SELECT * FROM mysqltest1.v2| +use mysqltest1| +set names koi8r| + + +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 _koi8r'' AS `c1`,`t1`.`` AS `c2` from `t1` koi8r koi8r_general_ci + +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 + + +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 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 COLLATION(c1), COLLATION(c2) FROM v1| +COLLATION(c1) COLLATION(c2) +koi8r_general_ci binary + +SELECT COLLATION(c1) FROM v2| +COLLATION(c1) +utf8_general_ci + +---> Dumping mysqltest1 to ddl_i18n_koi8r.views.mysqltest1.sql + + +DROP DATABASE mysqltest1| + + +---> Restoring mysqltest1... + +---> connection: con3 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +SELECT * FROM mysqltest1.v1| +SELECT * FROM mysqltest1.v2| +use mysqltest1| +set names koi8r| + + +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 _koi8r'' AS `c1`,`t1`.`` AS `c2` from `t1` koi8r koi8r_general_ci + +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 + + +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 + +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 COLLATION(c1), COLLATION(c2) FROM v1| +COLLATION(c1) COLLATION(c2) +koi8r_general_ci binary + +SELECT COLLATION(c1) FROM v2| +COLLATION(c1) +utf8_general_ci + +---> connection: default +use test| +DROP DATABASE mysqltest1| + +------------------------------------------------------------------- +Stored procedures/functions +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| + +CREATE PROCEDURE p1( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END| + +CREATE PROCEDURE p2( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END| + +CREATE PROCEDURE mysqltest2.p3( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END| + +CREATE PROCEDURE mysqltest2.p4( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END| + + +SHOW CREATE PROCEDURE p1| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE p2| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p3| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p4| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW PROCEDURE STATUS LIKE 'p1'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p2'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p3'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p4'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + + +SET @a = '1'| +SET @b = '2'| + + +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +---> connection: con2 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +set names koi8r| + + +SHOW CREATE PROCEDURE p1| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE p2| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p3| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p4| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW PROCEDURE STATUS LIKE 'p1'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p2'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p3'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p4'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + + +SET @a = '1'| +SET @b = '2'| + + +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +---> Dump of mysqltest1 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest1`; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = koi8r */ ; +/*!50003 SET character_set_results = koi8r */ ; +/*!50003 SET collation_connection = koi8r_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p1`( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = koi8r */ ; +/*!50003 SET character_set_results = koi8r */ ; +/*!50003 SET collation_connection = koi8r_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p2`( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; + +---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql + +---> Dump of mysqltest2 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest2`; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = koi8r */ ; +/*!50003 SET character_set_results = koi8r */ ; +/*!50003 SET collation_connection = koi8r_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p3`( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = koi8r */ ; +/*!50003 SET character_set_results = koi8r */ ; +/*!50003 SET collation_connection = koi8r_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p4`( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; + +---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql + + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + + +---> Restoring mysqltest1... +---> Restoring mysqltest2... + +---> connection: con3 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +set names koi8r| + + +SHOW CREATE PROCEDURE p1| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE p2| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p3| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +INOUT 1 CHAR(10), +OUT 2 CHAR(10)) +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p4| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +INOUT 1 CHAR(10) CHARACTER SET utf8, +OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION(_koi8r '') AS c5, +COLLATION(_utf8 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW PROCEDURE STATUS LIKE 'p1'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p2'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p3'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p4'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci + + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION(1) AS c2, +COLLATION(2) AS c3; +SELECT +COLLATION('') AS c4, +COLLATION( '') AS c5, +COLLATION( '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET 1 = 'a'; +SET 2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + + +SET @a = '1'| +SET @b = '2'| + + +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +---> connection: default +use test| +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +------------------------------------------------------------------- +Triggers +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| +CREATE TABLE t1(c INT)| +CREATE TABLE mysqltest2.t1(c INT)| +CREATE TABLE log(msg VARCHAR(255))| +CREATE TABLE mysqltest2.log(msg VARCHAR(255))| + +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END| + +CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END| + +CREATE TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END| + +CREATE TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END| + + + +SHOW CREATE TRIGGER trg1| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER trg2| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg3| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg4| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +trg2 INSERT t1 BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +use mysqltest2| + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg3 INSERT t1 BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +trg4 INSERT t1 BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +use mysqltest1| + + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + + +SET @a1 = '1'| +SET @a2 = '1'| +SET @a3 = '1'| +SET @b1 = '2'| +SET @b2 = '2'| +SET @b3 = '2'| + + +INSERT INTO t1 VALUES(1)| + +---> Log: +SELECT msg FROM log| +msg +utf8_unicode_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r +utf8_general_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM log| + + +INSERT INTO mysqltest2.t1 VALUES(1)| + +---> Log: +SELECT msg FROM mysqltest2.log| +msg +utf8_unicode_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r +utf8_general_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM mysqltest2.log| + + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| +ALTER TABLE t1 ADD COLUMN fake INT| +ALTER TABLE t1 DROP COLUMN fake| +ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest2.t1 DROP COLUMN fake| + +---> connection: con2 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +INSERT INTO mysqltest1.t1 VALUES(0)| +INSERT INTO mysqltest2.t1 VALUES(0)| +DELETE FROM mysqltest1.log| +DELETE FROM mysqltest2.log| +set names koi8r| +use mysqltest1| + + +SHOW CREATE TRIGGER trg1| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER trg2| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg3| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg4| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +trg2 INSERT t1 BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +use mysqltest2| + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg3 INSERT t1 BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +trg4 INSERT t1 BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +use mysqltest1| + + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + + +SET @a1 = '1'| +SET @a2 = '1'| +SET @a3 = '1'| +SET @b1 = '2'| +SET @b2 = '2'| +SET @b3 = '2'| + + +INSERT INTO t1 VALUES(1)| + +---> Log: +SELECT msg FROM log| +msg +utf8_unicode_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r +utf8_general_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM log| + + +INSERT INTO mysqltest2.t1 VALUES(1)| + +---> Log: +SELECT msg FROM mysqltest2.log| +msg +utf8_unicode_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r +utf8_general_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM mysqltest2.log| + +---> Dump of mysqltest1 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest1`; +CREATE TABLE `log` ( + `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO `t1` VALUES (1),(0),(1); +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = koi8r */ ; +/*!50003 SET character_set_results = koi8r */ ; +/*!50003 SET collation_connection = koi8r_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = koi8r */ ; +/*!50003 SET character_set_results = koi8r */ ; +/*!50003 SET collation_connection = koi8r_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; + +---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql + +---> Dump of mysqltest2 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest2`; +CREATE TABLE `log` ( + `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO `t1` VALUES (1),(0),(1); +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = koi8r */ ; +/*!50003 SET character_set_results = koi8r */ ; +/*!50003 SET collation_connection = koi8r_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = koi8r */ ; +/*!50003 SET character_set_results = koi8r */ ; +/*!50003 SET collation_connection = koi8r_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; + +---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql + + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + + +---> Restoring mysqltest1... +---> Restoring mysqltest2... +ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest1.t1 DROP COLUMN fake| +ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest2.t1 DROP COLUMN fake| + +---> connection: con3 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +INSERT INTO mysqltest1.t1 VALUES(0)| +INSERT INTO mysqltest2.t1 VALUES(0)| +DELETE FROM mysqltest1.log| +DELETE FROM mysqltest2.log| +set names koi8r| +use mysqltest1| + + +SHOW CREATE TRIGGER trg1| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER trg2| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg3| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = _koi8r ''; +SET @a2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg4| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = _koi8r ''; +SET @b2 = _utf8 'текст'; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +trg2 INSERT t1 BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +use mysqltest2| + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg3 INSERT t1 BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +trg4 INSERT t1 BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +use mysqltest1| + + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE 1 CHAR(10); +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = ''; +SET @a1 = ''; +SET @a2 = ''; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(1)); +INSERT INTO log VALUES(COLLATION('')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(COLLATION( '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = ''; +SET @b1 = ''; +SET @b2 = ''; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci + + +SET @a1 = '1'| +SET @a2 = '1'| +SET @a3 = '1'| +SET @b1 = '2'| +SET @b2 = '2'| +SET @b3 = '2'| + + +INSERT INTO t1 VALUES(1)| + +---> Log: +SELECT msg FROM log| +msg +utf8_unicode_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r +utf8_general_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM log| + + +INSERT INTO mysqltest2.t1 VALUES(1)| + +---> Log: +SELECT msg FROM mysqltest2.log| +msg +utf8_unicode_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r +utf8_general_ci +koi8r_general_ci +koi8r_general_ci +utf8_general_ci +koi8r_general_ci +koi8r + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM mysqltest2.log| + +---> connection: default +use test| +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +------------------------------------------------------------------- +Events +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| + +CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END| + +CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END| + +CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END| + +CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END| + + + +SHOW CREATE EVENT ev1| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT ev2| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW EVENTS LIKE 'ev1'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev2'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev3'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + +SHOW EVENTS LIKE 'ev4'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +---> connection: con2 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +SHOW CREATE EVENT ev1| +SHOW CREATE EVENT ev2| +SHOW CREATE EVENT mysqltest2.ev3| +SHOW CREATE EVENT mysqltest2.ev4| +set names koi8r| + + +SHOW CREATE EVENT ev1| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT ev2| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW EVENTS LIKE 'ev1'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev2'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev3'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + +SHOW EVENTS LIKE 'ev4'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +---> Dump of mysqltest1 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest1`; +/*!50106 SET @save_time_zone= @@TIME_ZONE */ ; +DELIMITER ;; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +/*!50003 SET @saved_cs_client = @@character_set_client */ ;; +/*!50003 SET @saved_cs_results = @@character_set_results */ ;; +/*!50003 SET @saved_col_connection = @@collation_connection */ ;; +/*!50003 SET character_set_client = koi8r */ ;; +/*!50003 SET character_set_results = koi8r */ ;; +/*!50003 SET collation_connection = koi8r_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!50003 SET sql_mode = @saved_sql_mode */ ;; +/*!50003 SET character_set_client = @saved_cs_client */ ;; +/*!50003 SET character_set_results = @saved_cs_results */ ;; +/*!50003 SET collation_connection = @saved_col_connection */ ;; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +DELIMITER ;; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +/*!50003 SET @saved_cs_client = @@character_set_client */ ;; +/*!50003 SET @saved_cs_results = @@character_set_results */ ;; +/*!50003 SET @saved_col_connection = @@collation_connection */ ;; +/*!50003 SET character_set_client = koi8r */ ;; +/*!50003 SET character_set_results = koi8r */ ;; +/*!50003 SET collation_connection = koi8r_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!50003 SET sql_mode = @saved_sql_mode */ ;; +/*!50003 SET character_set_client = @saved_cs_client */ ;; +/*!50003 SET character_set_results = @saved_cs_results */ ;; +/*!50003 SET collation_connection = @saved_col_connection */ ;; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +DELIMITER ; +/*!50106 SET TIME_ZONE= @save_time_zone */ ; + +---> Dumping mysqltest1 to ddl_i18n_koi8r.events.mysqltest1.sql + +---> Dump of mysqltest2 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest2`; +/*!50106 SET @save_time_zone= @@TIME_ZONE */ ; +DELIMITER ;; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +/*!50003 SET @saved_cs_client = @@character_set_client */ ;; +/*!50003 SET @saved_cs_results = @@character_set_results */ ;; +/*!50003 SET @saved_col_connection = @@collation_connection */ ;; +/*!50003 SET character_set_client = koi8r */ ;; +/*!50003 SET character_set_results = koi8r */ ;; +/*!50003 SET collation_connection = koi8r_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!50003 SET sql_mode = @saved_sql_mode */ ;; +/*!50003 SET character_set_client = @saved_cs_client */ ;; +/*!50003 SET character_set_results = @saved_cs_results */ ;; +/*!50003 SET collation_connection = @saved_col_connection */ ;; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +DELIMITER ;; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +/*!50003 SET @saved_cs_client = @@character_set_client */ ;; +/*!50003 SET @saved_cs_results = @@character_set_results */ ;; +/*!50003 SET @saved_col_connection = @@collation_connection */ ;; +/*!50003 SET character_set_client = koi8r */ ;; +/*!50003 SET character_set_results = koi8r */ ;; +/*!50003 SET collation_connection = koi8r_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!50003 SET sql_mode = @saved_sql_mode */ ;; +/*!50003 SET character_set_client = @saved_cs_client */ ;; +/*!50003 SET character_set_results = @saved_cs_results */ ;; +/*!50003 SET collation_connection = @saved_col_connection */ ;; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +DELIMITER ; +/*!50106 SET TIME_ZONE= @save_time_zone */ ; + +---> Dumping mysqltest2 to ddl_i18n_koi8r.events.mysqltest2.sql + + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + + +---> Restoring mysqltest1... +---> Restoring mysqltest2... + +---> connection: con3 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +SHOW CREATE EVENT ev1| +SHOW CREATE EVENT ev2| +SHOW CREATE EVENT mysqltest2.ev3| +SHOW CREATE EVENT mysqltest2.ev4| +set names koi8r| + + +SHOW CREATE EVENT ev1| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT ev2| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION(_koi8r '') AS c3, +COLLATION(_utf8 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END koi8r koi8r_general_ci utf8_unicode_ci + + +SHOW EVENTS LIKE 'ev1'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev2'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev3'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + +SHOW EVENTS LIKE 'ev4'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10); +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN +DECLARE 1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(1) AS c1, +COLLATION('') AS c2, +COLLATION( '') AS c3, +COLLATION( '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci + +------------------------------------------------------------------- +DDL statements within stored routine. +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| + +CREATE PROCEDURE p1() +BEGIN +CREATE TABLE t1(col1 VARCHAR(10)); +SHOW CREATE TABLE t1; +END| + +CREATE PROCEDURE mysqltest2.p2() +BEGIN +CREATE TABLE t2(col1 VARCHAR(10)); +SHOW CREATE TABLE t2; +END| + +CALL p1()| +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + +SHOW CREATE TABLE t1| +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + + +CALL mysqltest2.p2()| +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + +SHOW CREATE TABLE mysqltest2.t2| +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + +ALTER DATABASE mysqltest1 COLLATE cp1251_general_cs| +ALTER DATABASE mysqltest2 COLLATE cp1251_general_cs| +DROP TABLE t1| +DROP TABLE mysqltest2.t2| + +CALL p1()| +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs + +SHOW CREATE TABLE t1| +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs + + +CALL mysqltest2.p2()| +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs + +SHOW CREATE TABLE mysqltest2.t2| +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs + +---> connection: default +use test| +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result new file mode 100644 index 00000000000..d74d014d755 --- /dev/null +++ b/mysql-test/r/ddl_i18n_utf8.result @@ -0,0 +1,2783 @@ +set names utf8; + +------------------------------------------------------------------- +Views +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| +CREATE TABLE t1(кол INT)| +INSERT INTO t1 VALUES(1)| + +CREATE VIEW v1 AS +SELECT 'тест' AS c1, кол AS c2 +FROM t1| + +CREATE VIEW v2 AS SELECT _koi8r'' as c1| + + + +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 _utf8'тест' AS `c1`,`t1`.`кол` AS `c2` from `t1` utf8 utf8_general_ci + +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 _koi8r'' AS `c1` utf8 utf8_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 NONE YES root@localhost DEFINER utf8 utf8_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 utf8 utf8_general_ci + + +SELECT COLLATION(c1), COLLATION(c2) FROM v1| +COLLATION(c1) COLLATION(c2) +utf8_general_ci binary + +SELECT COLLATION(c1) FROM v2| +COLLATION(c1) +koi8r_general_ci + + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| + +---> connection: con2 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +SELECT * FROM mysqltest1.v1| +SELECT * FROM mysqltest1.v2| +use mysqltest1| +set names utf8| + + +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 _utf8'тест' AS `c1`,`t1`.`кол` AS `c2` from `t1` utf8 utf8_general_ci + +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 _koi8r'' AS `c1` utf8 utf8_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 NONE YES root@localhost DEFINER utf8 utf8_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 utf8 utf8_general_ci + + +SELECT COLLATION(c1), COLLATION(c2) FROM v1| +COLLATION(c1) COLLATION(c2) +utf8_general_ci binary + +SELECT COLLATION(c1) FROM v2| +COLLATION(c1) +koi8r_general_ci + +---> Dumping mysqltest1 to ddl_i18n_utf8views.mysqltest1.sql + + +DROP DATABASE mysqltest1| + + +---> Restoring mysqltest1... + +---> connection: con3 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +SELECT * FROM mysqltest1.v1| +SELECT * FROM mysqltest1.v2| +use mysqltest1| +set names utf8| + + +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 _utf8'тест' AS `c1`,`t1`.`кол` AS `c2` from `t1` utf8 utf8_general_ci + +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 _koi8r'' AS `c1` utf8 utf8_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 utf8 utf8_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 utf8 utf8_general_ci + + +SELECT COLLATION(c1), COLLATION(c2) FROM v1| +COLLATION(c1) COLLATION(c2) +utf8_general_ci binary + +SELECT COLLATION(c1) FROM v2| +COLLATION(c1) +koi8r_general_ci + +---> connection: default +use test| +DROP DATABASE mysqltest1| + +------------------------------------------------------------------- +Stored procedures/functions +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| + +CREATE PROCEDURE p1( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END| + +CREATE PROCEDURE p2( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END| + +CREATE PROCEDURE mysqltest2.p3( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END| + +CREATE PROCEDURE mysqltest2.p4( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END| + + +SHOW CREATE PROCEDURE p1| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE p2| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p3| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p4| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW PROCEDURE STATUS LIKE 'p1'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p2'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p3'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p4'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + + +SET @a = '1'| +SET @b = '2'| + + +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +---> connection: con2 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +set names utf8| + + +SHOW CREATE PROCEDURE p1| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE p2| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p3| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p4| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW PROCEDURE STATUS LIKE 'p1'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p2'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p3'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p4'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + + +SET @a = '1'| +SET @b = '2'| + + +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +---> Dump of mysqltest1 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest1`; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p1`( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p2`( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; + +---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql + +---> Dump of mysqltest2 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest2`; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p3`( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p4`( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; + +---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql + + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + + +---> Restoring mysqltest1... +---> Restoring mysqltest2... + +---> connection: con3 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +set names utf8| + + +SHOW CREATE PROCEDURE p1| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE p2| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p3| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +INOUT парам1 CHAR(10), +OUT парам2 CHAR(10)) +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE PROCEDURE mysqltest2.p4| +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +INOUT парам1 CHAR(10) CHARACTER SET utf8, +OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION(_utf8 'текст') AS c5, +COLLATION(_koi8r '') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW PROCEDURE STATUS LIKE 'p1'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p2'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p3'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + +SHOW PROCEDURE STATUS LIKE 'p4'| +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci + + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION(парам1) AS c2, +COLLATION(парам2) AS c3; +SELECT +COLLATION('текст') AS c4, +COLLATION( 'текст') AS c5, +COLLATION( 'текст') AS c6, +@@collation_connection AS c7, +@@character_set_client AS c8; +SET парам1 = 'a'; +SET парам2 = 'b'; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci + + +SET @a = '1'| +SET @b = '2'| + + +CALL p1(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL p2(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +CALL mysqltest2.p3(@a, @b)| +c1 c2 c3 +utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_unicode_ci utf8_unicode_ci + +CALL mysqltest2.p4(@a, @b)| +c1 c2 c3 +utf8_general_ci utf8_general_ci utf8_general_ci +c4 c5 c6 c7 c8 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8 +SELECT COLLATION(@a) AS ca, COLLATION(@b) cb| +ca cb +utf8_general_ci utf8_general_ci + +---> connection: default +use test| +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +------------------------------------------------------------------- +Triggers +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| +CREATE TABLE t1(c INT)| +CREATE TABLE mysqltest2.t1(c INT)| +CREATE TABLE log(msg VARCHAR(255))| +CREATE TABLE mysqltest2.log(msg VARCHAR(255))| + +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END| + +CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END| + +CREATE TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END| + +CREATE TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END| + + + +SHOW CREATE TRIGGER trg1| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER trg2| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg3| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg4| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +trg2 INSERT t1 BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci + +use mysqltest2| + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg3 INSERT t1 BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +trg4 INSERT t1 BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +use mysqltest1| + + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + + +SET @a1 = '1'| +SET @a2 = '1'| +SET @a3 = '1'| +SET @b1 = '2'| +SET @b2 = '2'| +SET @b3 = '2'| + + +INSERT INTO t1 VALUES(1)| + +---> Log: +SELECT msg FROM log| +msg +utf8_unicode_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 +utf8_general_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM log| + + +INSERT INTO mysqltest2.t1 VALUES(1)| + +---> Log: +SELECT msg FROM mysqltest2.log| +msg +utf8_unicode_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 +utf8_general_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM mysqltest2.log| + + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| +ALTER TABLE t1 ADD COLUMN fake INT| +ALTER TABLE t1 DROP COLUMN fake| +ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest2.t1 DROP COLUMN fake| + +---> connection: con2 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +INSERT INTO mysqltest1.t1 VALUES(0)| +INSERT INTO mysqltest2.t1 VALUES(0)| +DELETE FROM mysqltest1.log| +DELETE FROM mysqltest2.log| +set names utf8| +use mysqltest1| + + +SHOW CREATE TRIGGER trg1| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER trg2| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg3| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg4| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +trg2 INSERT t1 BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci + +use mysqltest2| + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg3 INSERT t1 BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +trg4 INSERT t1 BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +use mysqltest1| + + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + + +SET @a1 = '1'| +SET @a2 = '1'| +SET @a3 = '1'| +SET @b1 = '2'| +SET @b2 = '2'| +SET @b3 = '2'| + + +INSERT INTO t1 VALUES(1)| + +---> Log: +SELECT msg FROM log| +msg +utf8_unicode_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 +utf8_general_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM log| + + +INSERT INTO mysqltest2.t1 VALUES(1)| + +---> Log: +SELECT msg FROM mysqltest2.log| +msg +utf8_unicode_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 +utf8_general_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM mysqltest2.log| + +---> Dump of mysqltest1 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest1`; +CREATE TABLE `log` ( + `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO `t1` VALUES (1),(0),(1); +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; + +---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql + +---> Dump of mysqltest2 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest2`; +CREATE TABLE `log` ( + `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO `t1` VALUES (1),(0),(1); +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; + +---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql + + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + + +---> Restoring mysqltest1... +---> Restoring mysqltest2... +ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest1.t1 DROP COLUMN fake| +ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest2.t1 DROP COLUMN fake| + +---> connection: con3 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +INSERT INTO mysqltest1.t1 VALUES(0)| +INSERT INTO mysqltest2.t1 VALUES(0)| +DELETE FROM mysqltest1.log| +DELETE FROM mysqltest2.log| +set names utf8| +use mysqltest1| + + +SHOW CREATE TRIGGER trg1| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER trg2| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg3| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = _utf8 'текст'; +SET @a3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE TRIGGER mysqltest2.trg4| +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION(_utf8 'текст')); +INSERT INTO log VALUES(COLLATION(_koi8r '')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = _utf8 'текст'; +SET @b3 = _koi8r ''; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +trg2 INSERT t1 BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci + +use mysqltest2| + +SHOW TRIGGERS| +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg3 INSERT t1 BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +trg4 INSERT t1 BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +use mysqltest1| + + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10); +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @a1 = 'текст'; +SET @a2 = 'текст'; +SET @a3 = 'текст'; +END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +INSERT INTO log VALUES(COLLATION(перем1)); +INSERT INTO log VALUES(COLLATION('текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(COLLATION( 'текст')); +INSERT INTO log VALUES(@@collation_connection); +INSERT INTO log VALUES(@@character_set_client); +SET @b1 = 'текст'; +SET @b2 = 'текст'; +SET @b3 = 'текст'; +END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci + + +SET @a1 = '1'| +SET @a2 = '1'| +SET @a3 = '1'| +SET @b1 = '2'| +SET @b2 = '2'| +SET @b3 = '2'| + + +INSERT INTO t1 VALUES(1)| + +---> Log: +SELECT msg FROM log| +msg +utf8_unicode_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 +utf8_general_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM log| + + +INSERT INTO mysqltest2.t1 VALUES(1)| + +---> Log: +SELECT msg FROM mysqltest2.log| +msg +utf8_unicode_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 +utf8_general_ci +utf8_general_ci +utf8_general_ci +koi8r_general_ci +utf8_general_ci +utf8 + +SELECT +COLLATION(@a1) AS ca1, +COLLATION(@a2) AS ca2, +COLLATION(@a3) AS ca3, +COLLATION(@b1) AS cb1, +COLLATION(@b2) AS cb2, +COLLATION(@b3) AS cb3| +ca1 ca2 ca3 cb1 cb2 cb3 +utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci + +DELETE FROM mysqltest2.log| + +---> connection: default +use test| +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +------------------------------------------------------------------- +Events +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| + +CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END| + +CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END| + +CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END| + +CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END| + + + +SHOW CREATE EVENT ev1| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT ev2| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW EVENTS LIKE 'ev1'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev2'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev3'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + +SHOW EVENTS LIKE 'ev4'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +---> connection: con2 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +SHOW CREATE EVENT ev1| +SHOW CREATE EVENT ev2| +SHOW CREATE EVENT mysqltest2.ev3| +SHOW CREATE EVENT mysqltest2.ev4| +set names utf8| + + +SHOW CREATE EVENT ev1| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT ev2| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW EVENTS LIKE 'ev1'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev2'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev3'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + +SHOW EVENTS LIKE 'ev4'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +---> Dump of mysqltest1 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest1`; +/*!50106 SET @save_time_zone= @@TIME_ZONE */ ; +DELIMITER ;; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +/*!50003 SET @saved_cs_client = @@character_set_client */ ;; +/*!50003 SET @saved_cs_results = @@character_set_results */ ;; +/*!50003 SET @saved_col_connection = @@collation_connection */ ;; +/*!50003 SET character_set_client = utf8 */ ;; +/*!50003 SET character_set_results = utf8 */ ;; +/*!50003 SET collation_connection = utf8_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!50003 SET sql_mode = @saved_sql_mode */ ;; +/*!50003 SET character_set_client = @saved_cs_client */ ;; +/*!50003 SET character_set_results = @saved_cs_results */ ;; +/*!50003 SET collation_connection = @saved_col_connection */ ;; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +DELIMITER ;; +ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +/*!50003 SET @saved_cs_client = @@character_set_client */ ;; +/*!50003 SET @saved_cs_results = @@character_set_results */ ;; +/*!50003 SET @saved_col_connection = @@collation_connection */ ;; +/*!50003 SET character_set_client = utf8 */ ;; +/*!50003 SET character_set_results = utf8 */ ;; +/*!50003 SET collation_connection = utf8_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!50003 SET sql_mode = @saved_sql_mode */ ;; +/*!50003 SET character_set_client = @saved_cs_client */ ;; +/*!50003 SET character_set_results = @saved_cs_results */ ;; +/*!50003 SET collation_connection = @saved_col_connection */ ;; +ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +DELIMITER ; +/*!50106 SET TIME_ZONE= @save_time_zone */ ; + +---> Dumping mysqltest1 to ddl_i18n_utf8events.mysqltest1.sql + +---> Dump of mysqltest2 + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; + +USE `mysqltest2`; +/*!50106 SET @save_time_zone= @@TIME_ZONE */ ; +DELIMITER ;; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +/*!50003 SET @saved_cs_client = @@character_set_client */ ;; +/*!50003 SET @saved_cs_results = @@character_set_results */ ;; +/*!50003 SET @saved_col_connection = @@collation_connection */ ;; +/*!50003 SET character_set_client = utf8 */ ;; +/*!50003 SET character_set_results = utf8 */ ;; +/*!50003 SET collation_connection = utf8_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!50003 SET sql_mode = @saved_sql_mode */ ;; +/*!50003 SET character_set_client = @saved_cs_client */ ;; +/*!50003 SET character_set_results = @saved_cs_results */ ;; +/*!50003 SET collation_connection = @saved_col_connection */ ;; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +DELIMITER ;; +ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +/*!50003 SET @saved_cs_client = @@character_set_client */ ;; +/*!50003 SET @saved_cs_results = @@character_set_results */ ;; +/*!50003 SET @saved_col_connection = @@collation_connection */ ;; +/*!50003 SET character_set_client = utf8 */ ;; +/*!50003 SET character_set_results = utf8 */ ;; +/*!50003 SET collation_connection = utf8_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!50003 SET sql_mode = @saved_sql_mode */ ;; +/*!50003 SET character_set_client = @saved_cs_client */ ;; +/*!50003 SET character_set_results = @saved_cs_results */ ;; +/*!50003 SET collation_connection = @saved_col_connection */ ;; +ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +DELIMITER ; +/*!50106 SET TIME_ZONE= @save_time_zone */ ; + +---> Dumping mysqltest2 to ddl_i18n_utf8events.mysqltest2.sql + + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + + +---> Restoring mysqltest1... +---> Restoring mysqltest2... + +---> connection: con3 +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| +SHOW CREATE EVENT ev1| +SHOW CREATE EVENT ev2| +SHOW CREATE EVENT mysqltest2.ev3| +SHOW CREATE EVENT mysqltest2.ev4| +set names utf8| + + +SHOW CREATE EVENT ev1| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT ev2| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + +SHOW CREATE EVENT mysqltest2.ev3| +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION(_utf8 'текст') AS c3, +COLLATION(_koi8r '') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END utf8 utf8_general_ci utf8_unicode_ci + + +SHOW EVENTS LIKE 'ev1'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev2'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci + +SHOW EVENTS LIKE 'ev3'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + +SHOW EVENTS LIKE 'ev4'| +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation + + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10); +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN +DECLARE перем1 CHAR(10) CHARACTER SET utf8; +SELECT +COLLATION(перем1) AS c1, +COLLATION('текст') AS c2, +COLLATION( 'текст') AS c3, +COLLATION( 'текст') AS c4, +@@collation_connection AS c5, +@@character_set_client AS c6; +END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci + +------------------------------------------------------------------- +DDL statements within stored routine. +------------------------------------------------------------------- + +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +use mysqltest1| + +CREATE PROCEDURE p1() +BEGIN +CREATE TABLE t1(col1 VARCHAR(10)); +SHOW CREATE TABLE t1; +END| + +CREATE PROCEDURE mysqltest2.p2() +BEGIN +CREATE TABLE t2(col1 VARCHAR(10)); +SHOW CREATE TABLE t2; +END| + +CALL p1()| +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + +SHOW CREATE TABLE t1| +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + + +CALL mysqltest2.p2()| +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + +SHOW CREATE TABLE mysqltest2.t2| +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + +ALTER DATABASE mysqltest1 COLLATE cp1251_general_cs| +ALTER DATABASE mysqltest2 COLLATE cp1251_general_cs| +DROP TABLE t1| +DROP TABLE mysqltest2.t2| + +CALL p1()| +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs + +SHOW CREATE TABLE t1| +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs + + +CALL mysqltest2.p2()| +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs + +SHOW CREATE TABLE mysqltest2.t2| +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs + +---> connection: default +use test| +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index 0b1cd67f559..579f5907882 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -122,82 +122,105 @@ drop table t_event3; set names utf8; CREATE EVENT root6 ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1; SHOW CREATE EVENT root6; -Event sql_mode time_zone Create Event -root6 SYSTEM CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root6 SYSTEM CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root7 on schedule every 2 year do select 1; SHOW CREATE EVENT root7; -Event sql_mode time_zone Create Event -root7 SYSTEM CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root7 SYSTEM CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root8 on schedule every '2:5' year_month do select 1; SHOW CREATE EVENT root8; -Event sql_mode time_zone Create Event -root8 SYSTEM CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root8 SYSTEM CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root8_1 on schedule every '2:15' year_month do select 1; SHOW CREATE EVENT root8_1; -Event sql_mode time_zone Create Event -root8_1 SYSTEM CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root8_1 SYSTEM CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root9 on schedule every 2 week ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' do select 1; SHOW CREATE EVENT root9; -Event sql_mode time_zone Create Event -root9 SYSTEM CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root9 SYSTEM CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root10 on schedule every '20:5' day_hour do select 1; SHOW CREATE EVENT root10; -Event sql_mode time_zone Create Event -root10 SYSTEM CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root10 SYSTEM CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root11 on schedule every '20:25' day_hour do select 1; SHOW CREATE EVENT root11; -Event sql_mode time_zone Create Event -root11 SYSTEM CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root11 SYSTEM CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root12 on schedule every '20:25' hour_minute do select 1; SHOW CREATE EVENT root12; -Event sql_mode time_zone Create Event -root12 SYSTEM CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root12 SYSTEM CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root13 on schedule every '25:25' hour_minute do select 1; SHOW CREATE EVENT root13; -Event sql_mode time_zone Create Event -root13 SYSTEM CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root13 SYSTEM CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root13_1 on schedule every '11:65' hour_minute do select 1; SHOW CREATE EVENT root13_1; -Event sql_mode time_zone Create Event -root13_1 SYSTEM CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root13_1 SYSTEM CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root14 on schedule every '35:35' minute_second do select 1; SHOW CREATE EVENT root14; -Event sql_mode time_zone Create Event -root14 SYSTEM CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root14 SYSTEM CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root15 on schedule every '35:66' minute_second do select 1; SHOW CREATE EVENT root15; -Event sql_mode time_zone Create Event -root15 SYSTEM CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root15 SYSTEM CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root16 on schedule every '35:56' day_minute do select 1; SHOW CREATE EVENT root16; -Event sql_mode time_zone Create Event -root16 SYSTEM CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root16 SYSTEM CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root17 on schedule every '35:12:45' day_minute do select 1; SHOW CREATE EVENT root17; -Event sql_mode time_zone Create Event -root17 SYSTEM CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root17 SYSTEM CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root17_1 on schedule every '35:25:65' day_minute do select 1; SHOW CREATE EVENT root17_1; -Event sql_mode time_zone Create Event -root17_1 SYSTEM CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root17_1 SYSTEM CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root18 on schedule every '35:12:45' hour_second do select 1; SHOW CREATE EVENT root18; -Event sql_mode time_zone Create Event -root18 SYSTEM CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root18 SYSTEM CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root19 on schedule every '15:59:85' hour_second do select 1; SHOW CREATE EVENT root19; -Event sql_mode time_zone Create Event -root19 SYSTEM CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root19 SYSTEM CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci create event root20 on schedule every '50:20:12:45' day_second do select 1; SHOW CREATE EVENT root20; -Event sql_mode time_zone Create Event -root20 SYSTEM CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +root20 SYSTEM CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci set names cp1251; create event 21 on schedule every '50:23:59:95' day_second COMMENT ' 1251 ' do select 1; SHOW CREATE EVENT 21; -Event sql_mode time_zone Create Event -21 SYSTEM CREATE EVENT `21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT ' 1251 ' DO select 1 -insert into mysql.event (db, name, body, definer, interval_value, interval_field, originator) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND", 1); +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +21 SYSTEM CREATE EVENT `руут21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'това е 1251 коментар' DO select 1 cp1251 cp1251_general_ci latin1_swedish_ci +insert into mysql.event ( +db, +name, +body, +definer, +interval_value, +interval_field, +originator, +character_set_client, +collation_connection, +db_collation, +body_utf8) +values ( +database(), +"root22", +"select 1", +user(), +100, +"SECOND_MICROSECOND", +1, +'utf8', +'utf8_general_ci', +'utf8_general_ci', +'select 1'); show create event root22; ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' SHOW EVENTS; @@ -231,8 +254,8 @@ Create a test event. Only event metadata is relevant, the actual schedule and body are not. CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci Try to alter mysql.event: the server should fail to load event information after mysql.event was tampered with. @@ -241,14 +264,14 @@ works as before ALTER TABLE mysql.event ADD dummy INT; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci SELECT event_name FROM INFORMATION_SCHEMA.events; event_name intact_check SHOW CREATE EVENT intact_check; -Event sql_mode time_zone Create Event -intact_check SYSTEM CREATE EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +intact_check SYSTEM CREATE EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci DROP EVENT no_such_event; ERROR HY000: Unknown event 'no_such_event' CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; @@ -330,7 +353,7 @@ ERROR HY000: Cannot load from mysql.event. The table is probably corrupted DROP EVENT no_such_event; ERROR HY000: Unknown event 'no_such_event' CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; -ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 16. The table is probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 22, found 20. The table is probably corrupted ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; ERROR HY000: Unknown event 'intact_check_1' ALTER EVENT intact_check_1 RENAME TO intact_check_2; @@ -400,7 +423,7 @@ Restore the original table. CREATE TABLE mysql.event like event_like; DROP TABLE event_like; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion @@ -512,7 +535,7 @@ ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa SHOW EVENTS FROM ``; ERROR 42000: Incorrect database name '' SHOW EVENTS FROM `events\\test`; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation LOCK TABLES mode. @@ -520,8 +543,8 @@ create table t1 (a int); create event e1 on schedule every 10 hour do select 1; lock table t1 read; show create event e1; -Event sql_mode time_zone Create Event -e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci select event_name from information_schema.events; event_name e1 @@ -538,8 +561,8 @@ ERROR HY000: Table 'event' was not locked with LOCK TABLES unlock tables; lock table t1 write; show create event e1; -Event sql_mode time_zone Create Event -e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci select event_name from information_schema.events; event_name e1 @@ -556,8 +579,8 @@ ERROR HY000: Table 'event' was not locked with LOCK TABLES unlock tables; lock table t1 read, mysql.event read; show create event e1; -Event sql_mode time_zone Create Event -e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci select event_name from information_schema.events; event_name e1 @@ -574,8 +597,8 @@ ERROR HY000: Table 'event' was locked with a READ lock and can't be updated unlock tables; lock table t1 write, mysql.event read; show create event e1; -Event sql_mode time_zone Create Event -e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci select event_name from information_schema.events; event_name e1 @@ -596,8 +619,8 @@ lock table t1 write, mysql.event write; ERROR HY000: You can't combine write-locking of system tables with other tables or lock types lock table mysql.event write; show create event e1; -Event sql_mode time_zone Create Event -e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci select event_name from information_schema.events; event_name e1 diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index fae530f556b..fb66b96d816 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -33,7 +33,7 @@ create event e_55 on schedule at 20000101000000 do drop table t; Warnings: Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starts 10000101000000 do drop table t' at line 1 create event e_55 on schedule at 20200101000000 ends 10000101000000 do drop table t; @@ -389,30 +389,30 @@ SET TIME_ZONE= '+00:00'; SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci SET TIME_ZONE= '-01:00'; ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci SET TIME_ZONE= '+02:00'; ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci SET TIME_ZONE= '-03:00'; ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' ON COMPLETION PRESERVE DISABLE; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci SET TIME_ZONE= '+04:00'; ALTER EVENT e1 DO SELECT 2; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci DROP EVENT e1; SET TIME_ZONE='+05:00'; CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO @@ -426,24 +426,24 @@ SET TIME_ZONE='+00:00'; CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO SELECT 1; SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name; -EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR -NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 -NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 -NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci +NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci +NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 -events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 -events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE EVENT e1; -Event sql_mode time_zone Create Event -e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE EVENT e2; -Event sql_mode time_zone Create Event -e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE EVENT e3; -Event sql_mode time_zone Create Event -e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci The following should fail, and nothing should be altered. ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00'; @@ -474,10 +474,10 @@ SELECT 1; Warnings: Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 -events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 -events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci The following should succeed giving a warning. ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; @@ -510,15 +510,15 @@ CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' DO SELECT 1; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 -events_test e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 -events_test e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 -events_test e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 -events_test e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 -events_test e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 -events_test e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 -events_test e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci DROP EVENT e8; DROP EVENT e7; DROP EVENT e6; diff --git a/mysql-test/r/events_grant.result b/mysql-test/r/events_grant.result index 278cc5956f5..1aadf7e11f4 100644 --- a/mysql-test/r/events_grant.result +++ b/mysql-test/r/events_grant.result @@ -2,8 +2,8 @@ CREATE DATABASE IF NOT EXISTS events_test; use events_test; CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME; EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE @@ -29,8 +29,8 @@ ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_te USE events_test; "We should see one event"; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci SELECT CONCAT("Let's create some new events from the name of ", USER()); CONCAT("Let's create some new events from the name of ", USER()) Let's create some new events from the name of ev_test@localhost @@ -40,18 +40,18 @@ CREATE EVENT two_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION NOT PRESERVE CO CREATE EVENT three_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION PRESERVE COMMENT "three event" DO SELECT 123; "Now we should see 3 events:"; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 -events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 -events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci "This should show us only 2 events:"; SHOW EVENTS LIKE 't%event'; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 -events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci "This should show us no events:"; SHOW EVENTS FROM test LIKE '%'; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation GRANT EVENT ON events_test2.* TO ev_test@localhost; USE events_test2; CREATE EVENT four_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42; diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 54b29353fb8..4f64d39ccc0 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -225,8 +225,8 @@ a 46 CREATE VIEW v1 AS SELECT * FROM t1 WHERE a NOT IN (45); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` <> 45) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` <> 45) latin1 latin1_swedish_ci SELECT * FROM v1; a 44 diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 4896210c19d..1529fe77ac4 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -745,10 +745,10 @@ drop table t1; drop procedure if exists fn3; create function fn3 () returns point deterministic return GeomFromText("point(1 1)"); show create function fn3; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation fn3 CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS point DETERMINISTIC -return GeomFromText("point(1 1)") +return GeomFromText("point(1 1)") latin1 latin1_swedish_ci latin1_swedish_ci select astext(fn3()); astext(fn3()) POINT(1 1) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index a68cee5e52e..0d4dad39882 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -907,11 +907,11 @@ ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for tabl SHOW CREATE TABLE mysqltest2.v_yn; ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v_yn' SHOW CREATE TABLE mysqltest2.v_ny; -View Create View -v_ny CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_ny` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` +View Create View character_set_client collation_connection +v_ny CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_ny` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` latin1 latin1_swedish_ci SHOW CREATE VIEW mysqltest2.v_ny; -View Create View -v_ny CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_ny` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` +View Create View character_set_client collation_connection +v_ny CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_ny` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` latin1 latin1_swedish_ci SHOW CREATE TABLE mysqltest3.t_nn; ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't_nn' SHOW CREATE VIEW mysqltest3.t_nn; @@ -928,17 +928,17 @@ t_nn CREATE TABLE `t_nn` ( SHOW CREATE VIEW mysqltest2.t_nn; ERROR HY000: 'mysqltest2.t_nn' is not VIEW SHOW CREATE VIEW mysqltest2.v_yy; -View Create View -v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) +View Create View character_set_client collation_connection +v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) latin1 latin1_swedish_ci SHOW CREATE TABLE mysqltest2.v_yy; -View Create View -v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) +View Create View character_set_client collation_connection +v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) latin1 latin1_swedish_ci SHOW CREATE TABLE mysqltest2.v_nn; -View Create View -v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn` +View Create View character_set_client collation_connection +v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn` latin1 latin1_swedish_ci SHOW CREATE VIEW mysqltest2.v_nn; -View Create View -v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn` +View Create View character_set_client collation_connection +v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn` latin1 latin1_swedish_ci SHOW CREATE TABLE mysqltest2.t_nn; Table Create Table t_nn CREATE TABLE `t_nn` ( diff --git a/mysql-test/r/have_cp1251.require b/mysql-test/r/have_cp1251.require new file mode 100644 index 00000000000..465e8338084 --- /dev/null +++ b/mysql-test/r/have_cp1251.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +cp1251_general_ci cp1251 51 Yes 0 diff --git a/mysql-test/r/have_cp866.require b/mysql-test/r/have_cp866.require new file mode 100644 index 00000000000..da2a3e2f05e --- /dev/null +++ b/mysql-test/r/have_cp866.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +cp866_general_ci cp866 36 Yes 0 diff --git a/mysql-test/r/have_koi8r.require b/mysql-test/r/have_koi8r.require new file mode 100644 index 00000000000..b109b9ae520 --- /dev/null +++ b/mysql-test/r/have_koi8r.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +koi8r_general_ci koi8r 7 Yes 0 diff --git a/mysql-test/r/have_utf8.require b/mysql-test/r/have_utf8.require new file mode 100644 index 00000000000..71f8ccfff47 --- /dev/null +++ b/mysql-test/r/have_utf8.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +utf8_general_ci utf8 33 Yes Yes 1 diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index fc111430a4e..e290457d4ee 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -274,11 +274,11 @@ parameter_style sql_data_access dtd_identifier SQL CONTAINS SQL NULL SQL CONTAINS SQL int(11) show procedure status; -Db Name Type Definer Modified Created Security_type Comment -test sel2 PROCEDURE root@localhost # # DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test sel2 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci show function status; -Db Name Type Definer Modified Created Security_type Comment -test sub1 FUNCTION root@localhost # # DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test sub1 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci select a.ROUTINE_NAME from information_schema.ROUTINES a, information_schema.SCHEMATA b where a.ROUTINE_SCHEMA = b.SCHEMA_NAME; @@ -327,26 +327,26 @@ sel2 NULL sub1 NULL sub2 return i+1 show create procedure sel2; -Procedure sql_mode Create Procedure -sel2 NULL +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +sel2 NULL latin1 latin1_swedish_ci latin1_swedish_ci show create function sub1; -Function sql_mode Create Function -sub1 NULL +Function sql_mode Create Function character_set_client collation_connection Database Collation +sub1 NULL latin1 latin1_swedish_ci latin1_swedish_ci show create function sub2; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation sub2 CREATE DEFINER=`mysqltest_1`@`localhost` FUNCTION `sub2`(i int) RETURNS int(11) -return i+1 +return i+1 latin1 latin1_swedish_ci latin1_swedish_ci show function status like "sub2"; -Db Name Type Definer Modified Created Security_type Comment -test sub2 FUNCTION mysqltest_1@localhost # # DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test sub2 FUNCTION mysqltest_1@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci drop function sub2; show create procedure sel2; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation sel2 CREATE DEFINER=`root`@`localhost` PROCEDURE `sel2`() begin select * from t1; select * from t2; -end +end latin1 latin1_swedish_ci latin1_swedish_ci create view v0 (c) as select schema_name from information_schema.schemata; select * from v0; c @@ -386,12 +386,12 @@ latin1_spanish_ci show keys from v4; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment select * from information_schema.views where TABLE_NAME like "v%"; -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE -NULL test v0 /* ALGORITHM=UNDEFINED */ select `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER -NULL test v1 /* ALGORITHM=UNDEFINED */ select `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = _utf8'v1') NONE NO root@localhost DEFINER -NULL test v2 /* ALGORITHM=UNDEFINED */ select `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = _utf8'v2') NONE NO root@localhost DEFINER -NULL test v3 /* ALGORITHM=UNDEFINED */ select `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like _utf8'latin1%') NONE NO root@localhost DEFINER -NULL test v4 /* ALGORITHM=UNDEFINED */ select `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like _utf8'latin1%') NONE NO root@localhost DEFINER +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION +NULL test v0 select schema_name from information_schema.schemata NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v1 select table_name from information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v2 select column_name from information_schema.columns NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v3 select CHARACTER_SET_NAME from information_schema.character_sets NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v4 select COLLATION_NAME from information_schema.collations NONE NO root@localhost DEFINER latin1 latin1_swedish_ci drop view v0, v1, v2, v3, v4; create table t1 (a int); grant select,update,insert on t1 to mysqltest_1@localhost; @@ -483,10 +483,10 @@ create view v1 (c) as select a from t1 with check option; create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION; create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION; select * from information_schema.views; -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE -NULL test v1 /* ALGORITHM=UNDEFINED */ select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER -NULL test v2 /* ALGORITHM=UNDEFINED */ select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER -NULL test v3 /* ALGORITHM=UNDEFINED */ select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION +NULL test v1 select a from t1 with check option CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v2 select a from t1 WITH LOCAL CHECK OPTION LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v3 select a from t1 WITH CASCADED CHECK OPTION CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci grant select (a) on test.t1 to joe@localhost with grant option; select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE @@ -586,6 +586,10 @@ proc created timestamp proc modified timestamp proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') proc comment char(64) +proc character_set_client char(32) +proc collation_connection char(32) +proc db_collation char(32) +proc body_utf8 longblob drop table t115; create procedure p108 () begin declare c cursor for select data_type from information_schema.columns; open c; open c; end;// @@ -700,13 +704,13 @@ select constraint_name from information_schema.table_constraints where table_schema='test'; constraint_name show create view v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `test`.`t1`.`f1` AS `c` from `t1` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `test`.`t1`.`f1` AS `c` from `t1` latin1 latin1_swedish_ci Warnings: Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them show create table v3; -View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `sub1`(1) AS `c` +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `sub1`(1) AS `c` latin1 latin1_swedish_ci Warnings: Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them drop view v2; @@ -872,39 +876,39 @@ set @fired:= "Yes"; end if; end| show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation trg1 INSERT t1 begin if new.j > 10 then set new.j := 10; end if; -end BEFORE NULL root@localhost +end BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg2 UPDATE t1 begin if old.i % 2 = 0 then set new.j := -1; end if; -end BEFORE NULL root@localhost +end BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg3 UPDATE t1 begin if new.j = -1 then set @fired:= "Yes"; end if; -end AFTER NULL root@localhost +end AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci select * from information_schema.triggers; -TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION NULL test trg1 INSERT NULL test t1 0 NULL begin if new.j > 10 then set new.j := 10; end if; -end ROW BEFORE NULL NULL OLD NEW NULL root@localhost +end ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci NULL test trg2 UPDATE NULL test t1 0 NULL begin if old.i % 2 = 0 then set new.j := -1; end if; -end ROW BEFORE NULL NULL OLD NEW NULL root@localhost +end ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci NULL test trg3 UPDATE NULL test t1 0 NULL begin if new.j = -1 then set @fired:= "Yes"; end if; -end ROW AFTER NULL NULL OLD NEW NULL root@localhost +end ROW AFTER NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci drop trigger trg1; drop trigger trg2; drop trigger trg3; @@ -1156,7 +1160,7 @@ drop table t1; use mysql; INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL', 'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03', -'2006-03-02 18:40:03','',''); +'2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a'); select routine_name from information_schema.routines; routine_name @@ -1169,9 +1173,9 @@ create definer = mysqltest_1@localhost sql security definer view v2 as select 1; select * from information_schema.views where table_name='v1' or table_name='v2'; -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE -NULL test v1 NONE YES root@localhost DEFINER -NULL test v2 /* ALGORITHM=UNDEFINED */ select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION +NULL test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v2 select 1 NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci drop view v1, v2; drop table t1; drop user mysqltest_1@localhost; @@ -1196,23 +1200,23 @@ ROUTINE_NAME ROUTINE_DEFINITION f1 RETURN @a + 1 p1 SET @a= 1 SHOW CREATE PROCEDURE p1; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() -SET @a= 1 +SET @a= 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION f1; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) -RETURN @a + 1 +RETURN @a + 1 latin1 latin1_swedish_ci latin1_swedish_ci SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES; ROUTINE_NAME ROUTINE_DEFINITION f1 NULL p1 NULL SHOW CREATE PROCEDURE p1; -Procedure sql_mode Create Procedure -p1 NULL +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 NULL latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION f1; -Function sql_mode Create Function -f1 NULL +Function sql_mode Create Function character_set_client collation_connection Database Collation +f1 NULL latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); SELECT f1(); f1() diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result index 94ebc213122..a0fd33ac068 100644 --- a/mysql-test/r/information_schema_db.result +++ b/mysql-test/r/information_schema_db.result @@ -132,11 +132,11 @@ show fields from testdb_1.v6; Field Type Null Key Default Extra f1 char(4) YES NULL show create view testdb_1.v6; -View Create View -v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v6` AS select `t1`.`f1` AS `f1` from `t1` +View Create View character_set_client collation_connection +v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v6` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci show create view testdb_1.v7; -View Create View -v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` +View Create View character_set_client collation_connection +v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` latin1 latin1_swedish_ci Warnings: Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them show fields from testdb_1.v7; @@ -153,22 +153,22 @@ show fields from testdb_1.v5; Field Type Null Key Default Extra f1 char(4) YES NULL show create view testdb_1.v5; -View Create View -v5 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_1`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v5` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` +View Create View character_set_client collation_connection +v5 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_1`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v5` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci show fields from testdb_1.v6; Field Type Null Key Default Extra f1 char(4) YES NULL show create view testdb_1.v6; -View Create View -v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` +View Create View character_set_client collation_connection +v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci show fields from testdb_1.v7; Field Type Null Key Default Extra f1 null YES NULL Warnings: Note 1449 There is no 'no_such_user'@'no_such_host' registered show create view testdb_1.v7; -View Create View -v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` +View Create View character_set_client collation_connection +v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` latin1 latin1_swedish_ci Warnings: Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them revoke insert(f1) on v3 from testdb_2@localhost; @@ -200,8 +200,8 @@ show fields from testdb_1.v1; Field Type Null Key Default Extra f1 char(4) YES NULL show create view v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` latin1 latin1_swedish_ci show create view testdb_1.v1; ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1' select table_name from information_schema.columns a @@ -211,7 +211,7 @@ v2 select view_definition from information_schema.views a where a.table_name = 'v2'; view_definition -/* ALGORITHM=UNDEFINED */ select `v1`.`f1` AS `f1` from `testdb_1`.`v1` +select f1 from testdb_1.v1 select view_definition from information_schema.views a where a.table_name = 'testdb_1.v1'; view_definition diff --git a/mysql-test/r/lowercase_view.result b/mysql-test/r/lowercase_view.result index f09725dafcb..3653461c6b8 100644 --- a/mysql-test/r/lowercase_view.result +++ b/mysql-test/r/lowercase_view.result @@ -6,8 +6,8 @@ use MySQLTest; create table TaB (Field int); create view ViE as select * from TAb; show create table VIe; -View Create View -vie CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vie` AS select `tab`.`Field` AS `Field` from `tab` +View Create View character_set_client collation_connection +vie CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vie` AS select `tab`.`Field` AS `Field` from `tab` latin1 latin1_swedish_ci drop database MySQLTest; use test; create table t1Aa (col1 int); @@ -118,8 +118,8 @@ drop table t1Aa,t2Aa; create table t1Aa (col1 int); create view v1Aa as select col1 from t1Aa as AaA; show create view v1AA; -View Create View -v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA` +View Create View character_set_client collation_connection +v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci drop view v1AA; select Aaa.col1 from t1Aa as AaA; col1 @@ -127,7 +127,7 @@ create view v1Aa as select Aaa.col1 from t1Aa as AaA; drop view v1AA; create view v1Aa as select AaA.col1 from t1Aa as AaA; show create view v1AA; -View Create View -v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA` +View Create View character_set_client collation_connection +v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci drop view v1AA; drop table t1Aa; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index b6a0e506eda..007ed57f651 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1892,10 +1892,19 @@ DROP TABLE IF EXISTS `v2`; ) */; /*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */ /*!50002 WITH CASCADED CHECK OPTION */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1974,9 +1983,18 @@ DROP TABLE IF EXISTS `v1`; ) */; /*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `t1`.`a` AS `a` from `t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2033,10 +2051,19 @@ DROP TABLE IF EXISTS `v2`; ) */; /*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */ /*!50002 WITH CASCADED CHECK OPTION */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2143,19 +2170,46 @@ DROP TABLE IF EXISTS `v3`; ) */; /*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v2` AS select `v3`.`a` AS `a` from (`v3` join `v1`) where ((`v1`.`a` = `v3`.`a`) and (`v3`.`b` = 3)) limit 1 */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!50001 DROP TABLE IF EXISTS `v3`*/; /*!50001 DROP VIEW IF EXISTS `v3`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2198,21 +2252,21 @@ end if; end| set sql_mode=default| show triggers like "t1"; -Trigger Event Table Statement Timing Created sql_mode Definer +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation trg1 INSERT t1 begin if new.a > 10 then set new.a := 10; set new.a := 11; end if; -end BEFORE 0000-00-00 00:00:00 root@localhost +end BEFORE 0000-00-00 00:00:00 root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg2 UPDATE t1 begin if old.a % 2 = 0 then set new.b := 12; end if; -end BEFORE 0000-00-00 00:00:00 root@localhost +end BEFORE 0000-00-00 00:00:00 root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg3 UPDATE t1 begin if new.a = -1 then set @fired:= "Yes"; end if; -end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost +end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci INSERT INTO t1 (a) VALUES (1),(2),(3),(22); update t1 set a = 4 where a=3; @@ -2241,30 +2295,64 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; - +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 SET SESSION SQL_MODE="" */;; -/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW begin +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg1 before insert on t1 for each row +begin if new.a > 10 then set new.a := 10; set new.a := 11; end if; end */;; - -/*!50003 SET SESSION SQL_MODE="" */;; -/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg2` BEFORE UPDATE ON `t1` FOR EACH ROW begin +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg2 before update on t1 for each row begin if old.a % 2 = 0 then set new.b := 12; end if; end */;; - -/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;; -/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg3` AFTER UPDATE ON `t1` FOR EACH ROW begin +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg3 after update on t1 for each row +begin if new.a = -1 then set @fired:= "Yes"; end if; end */;; - DELIMITER ; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL @@ -2274,17 +2362,26 @@ LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; - +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ; DELIMITER ;; -/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;; -/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW begin +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg4 before insert on t2 for each row +begin if new.a > 10 then set @fired:= "No"; end if; end */;; - DELIMITER ; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2346,26 +2443,26 @@ Tables_in_test t1 t2 show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation trg1 INSERT t1 begin if new.a > 10 then set new.a := 10; set new.a := 11; end if; -end BEFORE # root@localhost +end BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg2 UPDATE t1 begin if old.a % 2 = 0 then set new.b := 12; end if; -end BEFORE # root@localhost +end BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg3 UPDATE t1 begin if new.a = -1 then set @fired:= "Yes"; end if; -end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost +end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg4 INSERT t2 begin if new.a > 10 then set @fired:= "No"; end if; -end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost +end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci DROP TABLE t1, t2; # # Bugs #9136, #12917: problems with --defaults-extra-file option @@ -2394,9 +2491,9 @@ SELECT * FROM `test2`; a2 1 SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation testref INSERT test1 BEGIN -INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL root@localhost +INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci SELECT * FROM `test1`; a1 1 @@ -2457,38 +2554,96 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2),(3),(4),(5); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */;; -/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b */;; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; -/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */;; -/*!50003 SET SESSION SQL_MODE=""*/;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; /*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1 begin set f1= concat( 'hello', f1 ); return f1; end */;; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; -/*!50003 DROP PROCEDURE IF EXISTS `a'b` */;; -/*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `a'b` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI' */ ; +DELIMITER ;; /*!50003 CREATE*/ /*!50020 DEFINER="root"@"localhost"*/ /*!50003 PROCEDURE "a'b"() select 1 */;; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; -/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */;; -/*!50003 SET SESSION SQL_MODE=""*/;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; /*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) BEGIN SELECT a+b INTO c; end */;; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; -/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */;; -/*!50003 SET SESSION SQL_MODE=""*/;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; /*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc2`(OUT a INT) BEGIN select sum(id) from t1 into a; END */;; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2631,14 +2786,22 @@ LOCK TABLES "t1 test" WRITE; INSERT INTO "t1 test" VALUES (1),(2),(3); /*!40000 ALTER TABLE "t1 test" ENABLE KEYS */; UNLOCK TABLES; - +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 SET SESSION SQL_MODE="" */;; -/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN INSERT INTO `t2 test` SET a2 = NEW.a1; END */;; - DELIMITER ; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; DROP TABLE IF EXISTS "t2 test"; CREATE TABLE "t2 test" ( "a2" int(11) DEFAULT NULL @@ -2727,19 +2890,46 @@ DROP TABLE IF EXISTS `v2`; USE `test`; /*!50001 DROP TABLE IF EXISTS `v0`*/; /*!50001 DROP VIEW IF EXISTS `v0`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v0` AS select `v1`.`a` AS `a`,`v1`.`b` AS `b`,`v1`.`c` AS `c` from `v1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v2` AS select `v0`.`a` AS `a`,`v0`.`b` AS `b`,`v0`.`c` AS `c` from `v0` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2791,15 +2981,25 @@ LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; - +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE' */ ; DELIMITER ;; -/*!50003 SET SESSION SQL_MODE="IGNORE_SPACE" */;; -/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `tr1` BEFORE INSERT ON `t1` FOR EACH ROW BEGIN +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER tr1 BEFORE INSERT ON t1 +FOR EACH ROW +BEGIN SET new.a = 0; END */;; - DELIMITER ; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2927,12 +3127,12 @@ drop trigger tr1; drop trigger tr2; drop table t1, t2; show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation tr1 INSERT t1 set -new.created=now() BEFORE # root@localhost +new.created=now() BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci tr2 INSERT t1 begin insert into t2 set b=new.a and created=new.created; -end AFTER # root@localhost +end AFTER # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci drop trigger tr1; drop trigger tr2; drop table t1, t2; @@ -2945,14 +3145,32 @@ insert into t values(5, 51); create view v1 as select qty, price, qty*price as value from t; create view v2 as select qty from v1; mysqldump { +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `t`.`qty` AS `qty`,`t`.`price` AS `price`,(`t`.`qty` * `t`.`price`) AS `value` from `t` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; } mysqldump { +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v2` AS select `v1`.`qty` AS `qty` from `v1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; } mysqldump drop view v1; @@ -2967,13 +3185,13 @@ return 42 */| /*!50003 CREATE PROCEDURE `p`() select 42 */| show create function f; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS bigint(20) -return 42 +return 42 latin1 latin1_swedish_ci latin1_swedish_ci show create procedure p; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p CREATE DEFINER=`root`@`localhost` PROCEDURE `p`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci drop function f; drop procedure p; # @@ -3035,9 +3253,18 @@ DROP TABLE IF EXISTS `v1`; USE `mysqldump_test_db`; /*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `t1`.`id` AS `id` from `t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3080,9 +3307,18 @@ USE `mysqldump_views`; USE `mysqldump_tables`; USE `mysqldump_views`; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; drop view nasishnasifu; drop database mysqldump_views; drop table mysqldump_tables.basetable; @@ -3269,11 +3505,11 @@ create function f2() returns int return f1(); create view v3 as select bug23491_original.f1(); use bug23491_restore; show create view bug23491_restore.v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `f1`() AS `f1()` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `f1`() AS `f1()` latin1 latin1_swedish_ci show create view bug23491_restore.v3; -View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `bug23491_original`.`f1`() AS `bug23491_original.f1()` +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `bug23491_original`.`f1`() AS `bug23491_original.f1()` latin1 latin1_swedish_ci drop database bug23491_original; drop database bug23491_restore; use test; @@ -3289,21 +3525,25 @@ grant all privileges on mysqldump_test_db.* to user1; grant all privileges on mysqldump_test_db.* to user2; create procedure mysqldump_test_db.sp1() select 'hello'; -/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; -DELIMITER ;; - -- insufficient privileges to SHOW CREATE PROCEDURE `sp1` -- does user2 have permissions on mysql.proc? -DELIMITER ; - -/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE*/ /*!50020 DEFINER=`user1`@`%`*/ /*!50003 PROCEDURE `sp1`() select 'hello' */;; -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; drop procedure sp1; drop user user1; drop user user2; @@ -3543,35 +3783,35 @@ use first; set time_zone = 'UTC'; create event ee1 on schedule at '2035-12-31 20:01:23' do set @a=5; show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci show create event ee1; -Event sql_mode time_zone Create Event -ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci drop database first; create database second; use second; show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci show create event ee1; -Event sql_mode time_zone Create Event -ee1 NO_AUTO_VALUE_ON_ZERO UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5; create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5; show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 -second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 -second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci drop database second; create database third; use third; show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 -third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 -third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci drop database third; set time_zone = 'SYSTEM'; use test; @@ -3624,9 +3864,18 @@ DROP TABLE IF EXISTS `v1`; USE `mysqldump_test_db`; /*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `t1`.`id` AS `id` from `t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff --git a/mysql-test/r/ndb_sp.result b/mysql-test/r/ndb_sp.result index 32e6d2eddd7..3a59d09bb4a 100644 --- a/mysql-test/r/ndb_sp.result +++ b/mysql-test/r/ndb_sp.result @@ -31,12 +31,12 @@ select @test_var; 10 alter procedure test_proc1 comment 'new comment'; show create procedure test_proc1; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure Client_cs Connection_cl Database_cl test_proc1 CREATE DEFINER=`root`@`localhost` PROCEDURE `test_proc1`(in var_in int) COMMENT 'new comment' begin select * from t1 where a = var_in; -end +end latin1 latin1_swedish_ci latin1_swedish_ci drop procedure test_proc1; drop procedure test_proc2; drop procedure test_proc3; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 84fcb8634d6..9214d470b37 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -2118,11 +2118,11 @@ prepare abc from "show master logs"; deallocate prepare abc; create procedure proc_1() show events; call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation drop procedure proc_1; create function func_1() returns int begin show events; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -2132,27 +2132,27 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show events"; execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation deallocate prepare abc; drop procedure if exists a; create procedure a() select 42; create procedure proc_1(a char(2)) show create procedure a; call proc_1("bb"); -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure proc_1; create function func_1() returns int begin show create procedure a; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -2162,34 +2162,34 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show create procedure a"; execute abc; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci deallocate prepare abc; drop procedure a; drop function if exists a; create function a() returns int return 42+13; create procedure proc_1(a char(2)) show create function a; call proc_1("bb"); -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure proc_1; create function func_1() returns int begin show create function a; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -2199,17 +2199,17 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show create function a"; execute abc; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci deallocate prepare abc; drop function a; drop table if exists tab1; @@ -2277,14 +2277,14 @@ union all (select b, count(*) from t1 group by b); create procedure proc_1() show create view v1; call proc_1(); -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci call proc_1(); -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci call proc_1(); -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci drop procedure proc_1; create function func_1() returns int begin show create view v1; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -2294,14 +2294,14 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show create view v1"; execute abc; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci execute abc; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci execute abc; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci deallocate prepare abc; drop view v1; drop table t1; diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result index 2a1dc4b44af..d854a2d0f8d 100644 --- a/mysql-test/r/rpl_replicate_do.result +++ b/mysql-test/r/rpl_replicate_do.result @@ -87,27 +87,27 @@ Tables_in_test t1 t2 show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer -trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost -trg2 INSERT t2 set new.b=2 BEFORE NULL root@localhost +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg2 INSERT t2 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci *** slave *** show tables; Tables_in_test t1 show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer -trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci *** master *** drop trigger trg1; drop trigger trg2; show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation *** slave *** show tables; Tables_in_test t1 show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation *** master *** drop table t1; drop table t2; diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 208c46c5fab..0b89b6d29c7 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -17,21 +17,31 @@ insert into t1 values (b); insert into t1 values (unix_timestamp()); end| select * from mysql.proc where name='foo' and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin declare b int; set b = 8; insert into t1 values (b); insert into t1 values (unix_timestamp()); -end root@localhost # # +end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end select * from mysql.proc where name='foo' and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin declare b int; set b = 8; insert into t1 values (b); insert into t1 values (unix_timestamp()); -end root@localhost # # +end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end set timestamp=1000000000; call foo(); select * from t1; @@ -115,15 +125,17 @@ select * from t2; a 20 select * from mysql.proc where name="foo4" and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin insert into t2 values(20),(20); -end root@localhost # # +end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +insert into t2 values(20),(20); +end drop procedure foo4; select * from mysql.proc where name="foo4" and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 select * from mysql.proc where name="foo4" and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 drop procedure foo; drop procedure foo2; drop procedure foo3; @@ -202,16 +214,22 @@ select fn3(); fn3() 0 select * from mysql.proc where db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); -end root@localhost # # +end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +return unix_timestamp(); +end mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); -end zedjzlcsjhd@localhost # # +end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +return unix_timestamp(); +end mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin return 0; -end root@localhost # # +end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +return 0; +end select * from t1; a 1000000000 @@ -220,16 +238,22 @@ select * from t1; a 1000000000 select * from mysql.proc where db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); -end root@localhost # # +end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +return unix_timestamp(); +end mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); -end zedjzlcsjhd@localhost # # +end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +return unix_timestamp(); +end mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin return 0; -end root@localhost # # +end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +return 0; +end delete from t2; alter table t2 add unique (a); drop function fn1; @@ -337,26 +361,26 @@ DROP FUNCTION IF EXISTS f1; ---> Checking on master... SHOW CREATE PROCEDURE p1; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() -SET @a = 1 +SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION f1; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) -RETURN 0 +RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci ---> Synchronizing slave with master... ---> connection: master ---> Checking on slave... SHOW CREATE PROCEDURE p1; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() -SET @a = 1 +SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION f1; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) -RETURN 0 +RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci ---> connection: master diff --git a/mysql-test/r/rpl_trigger.result b/mysql-test/r/rpl_trigger.result index 815a87eede5..b4ce3ee1d36 100644 --- a/mysql-test/r/rpl_trigger.result +++ b/mysql-test/r/rpl_trigger.result @@ -868,8 +868,8 @@ Tables_in_test (t_) t1 t2 SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer -trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER NULL +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER NULL latin1 latin1_swedish_ci latin1_swedish_ci SELECT * FROM t1; c 1 @@ -895,7 +895,7 @@ RESET SLAVE; SHOW TABLES LIKE 't_'; Tables_in_test (t_) SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation RESET MASTER; START SLAVE; diff --git a/mysql-test/r/rpl_view.result b/mysql-test/r/rpl_view.result index 0d862a2a912..12b7b46ffed 100644 --- a/mysql-test/r/rpl_view.result +++ b/mysql-test/r/rpl_view.result @@ -88,8 +88,8 @@ Field Type Null Key Default Extra a int(11) YES NULL b decimal(32,0) YES NULL show create table v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a` latin1 latin1_swedish_ci select * from v1; a b 1 6 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 66cd929ee05..180968b3f96 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -617,48 +617,48 @@ DROP VIEW IF EXISTS v1; DROP PROCEDURE IF EXISTS p1; CREATE VIEW v1 AS SELECT 1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_CACHE 1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_NO_CACHE 1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache 1 AS `1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache 1 AS `1` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT NOW(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select now() AS `NOW()` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select now() AS `NOW()` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_CACHE NOW(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache now() AS `NOW()` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache now() AS `NOW()` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_NO_CACHE NOW(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE NOW(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_NO_CACHE SQL_CACHE NOW(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE SQL_CACHE NOW(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary DROP VIEW v1; CREATE PROCEDURE p1() BEGIN @@ -669,8 +669,8 @@ DROP PREPARE stmt; END | CALL p1(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1` binary binary DROP PROCEDURE p1; DROP VIEW v1; SHOW TABLES FROM no_such_database; @@ -754,4 +754,76 @@ drop table `été`; set names latin1; show columns from `#mysql50#????????`; Got one of the listed errors +DROP TABLE IF EXISTS t1; +DROP PROCEDURE IF EXISTS p1; +CREATE TABLE t1(c1 INT); +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1; +SHOW CREATE TRIGGER t1_bi; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CREATE PROCEDURE p1() SHOW CREATE TRIGGER t1_bi; +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +CALL p1(); +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +PREPARE stmt1 FROM 'SHOW CREATE TRIGGER t1_bi'; +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +EXECUTE stmt1; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +DROP TABLE t1; +DROP PROCEDURE p1; +DEALLOCATE PREPARE stmt1; End of 5.1 tests diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result index 0961ffd734c..6bb8cbea2f1 100644 --- a/mysql-test/r/skip_grants.result +++ b/mysql-test/r/skip_grants.result @@ -35,16 +35,16 @@ SELECT 3; CREATE DEFINER=a@'' FUNCTION f3() RETURNS INT RETURN 3; SHOW CREATE VIEW v3; -View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`a`@`` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`c` AS `c` from `t1` +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`a`@`` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`c` AS `c` from `t1` latin1 latin1_swedish_ci SHOW CREATE PROCEDURE p3; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p3 CREATE DEFINER=`a`@`` PROCEDURE `p3`() -SELECT 3 +SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION f3; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation f3 CREATE DEFINER=`a`@`` FUNCTION `f3`() RETURNS int(11) -RETURN 3 +RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci DROP TRIGGER t1_bi; DROP TRIGGER ti_ai; DROP TRIGGER ti_bu; diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result index 4df8086c84e..ae294f05b25 100644 --- a/mysql-test/r/sp-destruct.result +++ b/mysql-test/r/sp-destruct.result @@ -37,26 +37,33 @@ insert into mysql.proc ( db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, -sql_mode, comment +sql_mode, comment, character_set_client, collation_connection, db_collation, +body_utf8 ) values ( 'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'select count(*) from mysql.user', -'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' +'root@localhost', NOW() , '0000-00-00 00:00:00', '', '', +'', '', '', +'select count(*) from mysql.user' ), ( 'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'begin declare x int; select count(*) into x from mysql.user; end', -'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' +'root@localhost', NOW() , '0000-00-00 00:00:00', '', '', +'', '', '', +'begin declare x int; select count(*) into x from mysql.user; end' ), ( 'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO', 'DEFINER', '', '', 'alksj wpsj sa ^#!@ ', -'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' +'root@localhost', NOW() , '0000-00-00 00:00:00', '', '', +'', '', '', +'alksj wpsj sa ^#!@ ' ); select bug14233_1(); ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) @@ -78,6 +85,6 @@ drop function bug14233_1; drop function bug14233_2; drop procedure bug14233_3; show procedure status; -Db Name Type Definer Modified Created Security_type Comment +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation show function status; -Db Name Type Definer Modified Created Security_type Comment +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 0f043a73f85..675a59f1fb7 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -682,8 +682,8 @@ create procedure bug17015_012345678901234567890123456789012345678901234567890123 begin end| show procedure status like 'bug17015%'| -Db Name Type Definer Modified Created Security_type Comment -test bug17015_0123456789012345678901234567890123456789012345678901234 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test bug17015_0123456789012345678901234567890123456789012345678901234 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci drop procedure bug17015_0123456789012345678901234567890123456789012345678901234| drop procedure if exists bug10969| create procedure bug10969() @@ -1087,8 +1087,8 @@ create procedure p2() select version(); ERROR 3D000: No database selected use mysqltest2; show procedure status; -Db Name Type Definer Modified Created Security_type Comment -mysqltest2 p1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +mysqltest2 p1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci drop database mysqltest2; use test; DROP FUNCTION IF EXISTS bug13012| @@ -1177,8 +1177,8 @@ call ` bug15658`(); 1 1 show procedure status; -Db Name Type Definer Modified Created Security_type Comment -test bug15658 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test bug15658 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci drop procedure ` bug15658`; drop function if exists bug14270; drop table if exists t1; diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 7315ef40083..1a1645ca971 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -12,8 +12,8 @@ insert into t1 values('test', 0); create procedure stamp(i int) insert into db1_secret.t1 values (user(), i); show procedure status like 'stamp'; -Db Name Type Definer Modified Created Security_type Comment -db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci create function db() returns varchar(64) begin declare v varchar(64); @@ -21,8 +21,8 @@ select u into v from t1 limit 1; return v; end| show function status like 'db'; -Db Name Type Definer Modified Created Security_type Comment -db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci call stamp(1); select * from t1; u i @@ -71,12 +71,12 @@ user1@localhost 2 anon@localhost 3 alter procedure stamp sql security invoker; show procedure status like 'stamp'; -Db Name Type Definer Modified Created Security_type Comment -db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER latin1 latin1_swedish_ci latin1_swedish_ci alter function db sql security invoker; show function status like 'db'; -Db Name Type Definer Modified Created Security_type Comment -db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER latin1 latin1_swedish_ci latin1_swedish_ci call stamp(4); select * from t1; u i @@ -365,21 +365,21 @@ Note 1449 There is no 'a @ b @ c'@'localhost' registered ---> connection: con1root use mysqltest; SHOW CREATE PROCEDURE wl2897_p1; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation wl2897_p1 CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`() -SELECT 1 +SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE PROCEDURE wl2897_p3; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation wl2897_p3 CREATE DEFINER=`a @ b @ c`@`localhost` PROCEDURE `wl2897_p3`() -SELECT 3 +SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION wl2897_f1; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation wl2897_f1 CREATE DEFINER=`mysqltest_2`@`localhost` FUNCTION `wl2897_f1`() RETURNS int(11) -RETURN 1 +RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION wl2897_f3; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation wl2897_f3 CREATE DEFINER=`a @ b @ c`@`localhost` FUNCTION `wl2897_f3`() RETURNS int(11) -RETURN 3 +RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci DROP USER mysqltest_1@localhost; DROP USER mysqltest_2@localhost; DROP DATABASE mysqltest; @@ -443,14 +443,14 @@ SET a=1; SELECT a; END // SHOW CREATE PROCEDURE test.sp19857; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation sp19857 CREATE DEFINER=`user19857`@`localhost` PROCEDURE `sp19857`() DETERMINISTIC BEGIN DECLARE a INT; SET a=1; SELECT a; -END +END latin1 latin1_swedish_ci latin1_swedish_ci DROP PROCEDURE IF EXISTS test.sp19857; ---> connection: root diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 98d73f7536c..b060bfb081a 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -787,11 +787,11 @@ sql security definer comment 'Characteristics procedure test' insert into t1 values ("chistics", 1)| show create procedure chistics| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation chistics CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`() MODIFIES SQL DATA COMMENT 'Characteristics procedure test' -insert into t1 values ("chistics", 1) +insert into t1 values ("chistics", 1) latin1 latin1_swedish_ci latin1_swedish_ci call chistics()| select * from t1| id data @@ -799,12 +799,12 @@ chistics 1 delete from t1| alter procedure chistics sql security invoker| show create procedure chistics| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation chistics CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`() MODIFIES SQL DATA SQL SECURITY INVOKER COMMENT 'Characteristics procedure test' -insert into t1 values ("chistics", 1) +insert into t1 values ("chistics", 1) latin1 latin1_swedish_ci latin1_swedish_ci drop procedure chistics| drop function if exists chistics| create function chistics() returns int @@ -814,12 +814,12 @@ sql security invoker comment 'Characteristics procedure test' return 42| show create function chistics| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation chistics CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11) DETERMINISTIC SQL SECURITY INVOKER COMMENT 'Characteristics procedure test' -return 42 +return 42 latin1 latin1_swedish_ci latin1_swedish_ci select chistics()| chistics() 42 @@ -827,13 +827,13 @@ alter function chistics no sql comment 'Characteristics function test'| show create function chistics| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation chistics CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11) NO SQL DETERMINISTIC SQL SECURITY INVOKER COMMENT 'Characteristics function test' -return 42 +return 42 latin1 latin1_swedish_ci latin1_swedish_ci drop function chistics| insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)| set @@sql_mode = 'ANSI'| @@ -1223,12 +1223,12 @@ n f 20 2432902008176640000 drop table t3| show function status like '%f%'| -Db Name Type Definer Modified Created Security_type Comment -test fac FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test fac FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci drop procedure ifac| drop function fac| show function status like '%f%'| -Db Name Type Definer Modified Created Security_type Comment +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation drop table if exists t3| create table t3 ( i int unsigned not null primary key, @@ -1290,7 +1290,7 @@ end; end while; end| show create procedure opp| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation opp CREATE DEFINER=`root`@`localhost` PROCEDURE `opp`(n bigint unsigned, out pp bool) begin declare r double; @@ -1316,11 +1316,11 @@ set s = s+1; end; end if; end loop; -end +end latin1 latin1_swedish_ci latin1_swedish_ci show procedure status like '%p%'| -Db Name Type Definer Modified Created Security_type Comment -test ip PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER -test opp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test ip PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +test opp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci call ip(200)| select * from t3 where i=45 or i=100 or i=199| i p @@ -1331,7 +1331,7 @@ drop table t3| drop procedure opp| drop procedure ip| show procedure status like '%p%'| -Db Name Type Definer Modified Created Security_type Comment +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation drop table if exists t3| create table t3 ( f bigint unsigned not null )| drop procedure if exists fib| @@ -1383,19 +1383,19 @@ create procedure bar(x char(16), y int) comment "111111111111" sql security invoker insert into test.t1 values (x, y)| show procedure status like 'bar'| -Db Name Type Definer Modified Created Security_type Comment -test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER 111111111111 +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER 111111111111 latin1 latin1_swedish_ci latin1_swedish_ci alter procedure bar comment "2222222222" sql security definer| alter procedure bar comment "3333333333"| alter procedure bar| show create procedure bar| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation bar CREATE DEFINER=`root`@`localhost` PROCEDURE `bar`(x char(16), y int) COMMENT '3333333333' -insert into test.t1 values (x, y) +insert into test.t1 values (x, y) latin1 latin1_swedish_ci latin1_swedish_ci show procedure status like 'bar'| -Db Name Type Definer Modified Created Security_type Comment -test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER 3333333333 +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER 3333333333 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure bar| drop procedure if exists p1| create procedure p1 () @@ -1960,24 +1960,24 @@ show create function bug2267_4; end| create function bug2267_4() returns int return 100| call bug2267_1()| -Db Name Type Definer Modified Created Security_type Comment -test bug2267_1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER -test bug2267_2 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER -test bug2267_3 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER -test bug2267_4 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test bug2267_1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +test bug2267_2 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +test bug2267_3 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +test bug2267_4 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci call bug2267_2()| -Db Name Type Definer Modified Created Security_type Comment -test bug2267_4 FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test bug2267_4 FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci call bug2267_3()| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation bug2267_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug2267_1`() begin show procedure status; -end +end latin1 latin1_swedish_ci latin1_swedish_ci call bug2267_4()| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug2267_4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug2267_4`() RETURNS int(11) -return 100 +return 100 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure bug2267_1| drop procedure bug2267_2| drop procedure bug2267_3| @@ -2308,22 +2308,22 @@ create function bug2564_4(x int, y int) returns int return x || y$ set @@sql_mode = ''| show create procedure bug2564_1| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation bug2564_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug2564_1`() COMMENT 'Joe''s procedure' -insert into `t1` values ("foo", 1) +insert into `t1` values ("foo", 1) latin1 latin1_swedish_ci latin1_swedish_ci show create procedure bug2564_2| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation bug2564_2 ANSI_QUOTES CREATE DEFINER="root"@"localhost" PROCEDURE "bug2564_2"() -insert into "t1" values ('foo', 1) +insert into "t1" values ('foo', 1) latin1 latin1_swedish_ci latin1_swedish_ci show create function bug2564_3| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug2564_3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug2564_3`(x int, y int) RETURNS int(11) -return x || y +return x || y latin1 latin1_swedish_ci latin1_swedish_ci show create function bug2564_4| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug2564_4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI CREATE DEFINER="root"@"localhost" FUNCTION "bug2564_4"(x int, y int) RETURNS int(11) -return x || y +return x || y latin1 latin1_swedish_ci latin1_swedish_ci drop procedure bug2564_1| drop procedure bug2564_2| drop function bug2564_3| @@ -3999,11 +3999,11 @@ main_loop: begin return 42; end */;; show create function bug14723;; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug14723 CREATE DEFINER=`root`@`localhost` FUNCTION `bug14723`() RETURNS bigint(20) main_loop: begin return 42; -end +end latin1 latin1_swedish_ci latin1_swedish_ci select bug14723();; bug14723() 42 @@ -4012,11 +4012,11 @@ main_loop: begin select 42; end */;; show create procedure bug14723;; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation bug14723 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug14723`() main_loop: begin select 42; -end +end latin1 latin1_swedish_ci latin1_swedish_ci call bug14723();; 42 42 @@ -5071,21 +5071,21 @@ RETURN ""| CREATE FUNCTION mysqltest2.bug16211_f4() RETURNS CHAR(10) CHARSET koi8r RETURN ""| SHOW CREATE FUNCTION bug16211_f1| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug16211_f1 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f1`() RETURNS char(10) CHARSET utf8 -RETURN "" +RETURN "" latin1 latin1_swedish_ci utf8_general_ci SHOW CREATE FUNCTION bug16211_f2| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug16211_f2 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f2`() RETURNS char(10) CHARSET koi8r -RETURN "" +RETURN "" latin1 latin1_swedish_ci utf8_general_ci SHOW CREATE FUNCTION mysqltest2.bug16211_f3| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug16211_f3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f3`() RETURNS char(10) CHARSET utf8 -RETURN "" +RETURN "" latin1 latin1_swedish_ci utf8_general_ci SHOW CREATE FUNCTION mysqltest2.bug16211_f4| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug16211_f4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f4`() RETURNS char(10) CHARSET koi8r -RETURN "" +RETURN "" latin1 latin1_swedish_ci utf8_general_ci SELECT dtd_identifier FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"| @@ -5121,21 +5121,21 @@ koi8r ALTER DATABASE mysqltest1 CHARACTER SET cp1251| ALTER DATABASE mysqltest2 CHARACTER SET cp1251| SHOW CREATE FUNCTION bug16211_f1| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug16211_f1 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f1`() RETURNS char(10) CHARSET utf8 -RETURN "" +RETURN "" latin1 latin1_swedish_ci utf8_general_ci SHOW CREATE FUNCTION bug16211_f2| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug16211_f2 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f2`() RETURNS char(10) CHARSET koi8r -RETURN "" +RETURN "" latin1 latin1_swedish_ci utf8_general_ci SHOW CREATE FUNCTION mysqltest2.bug16211_f3| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug16211_f3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f3`() RETURNS char(10) CHARSET utf8 -RETURN "" +RETURN "" latin1 latin1_swedish_ci utf8_general_ci SHOW CREATE FUNCTION mysqltest2.bug16211_f4| -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation bug16211_f4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f4`() RETURNS char(10) CHARSET koi8r -RETURN "" +RETURN "" latin1 latin1_swedish_ci utf8_general_ci SELECT dtd_identifier FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"| @@ -5380,9 +5380,9 @@ ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghi drop procedure if exists bug21416| create procedure bug21416() show create procedure bug21416| call bug21416()| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation bug21416 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug21416`() -show create procedure bug21416 +show create procedure bug21416 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure bug21416| DROP PROCEDURE IF EXISTS bug21414| CREATE PROCEDURE bug21414() SELECT 1| @@ -5395,7 +5395,7 @@ DROP PROCEDURE bug21414| set names utf8| drop database if exists това_е_дълго_име_за_база_данни_нали| create database това_е_дълго_име_за_база_данни_нали| -INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','')| +INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','', 'utf8', 'utf8_general_ci', 'utf8_general_ci', 'n/a')| call това_е_дълго_име_за_база_данни_нали.това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго()| ERROR HY000: Failed to load routine това_е_дълго_име_за_база_данни_нали.това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) drop database това_е_дълго_име_за_база_данни_нали| @@ -6240,9 +6240,9 @@ DROP FUNCTION bug5274_f2| drop procedure if exists proc_21513| create procedure proc_21513()`my_label`:BEGIN END| show create procedure proc_21513| -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation proc_21513 CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_21513`() -`my_label`:BEGIN END +`my_label`:BEGIN END utf8 utf8_general_ci latin1_swedish_ci drop procedure proc_21513| End of 5.0 tests. drop table t1,t2; @@ -6276,8 +6276,8 @@ INSERT INTO t1 VALUES (1),(2); CREATE FUNCTION metered(a INT) RETURNS INT RETURN 12; CREATE VIEW v1 AS SELECT test.metered(a) as metered FROM t1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`metered`(`t1`.`a`) AS `metered` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`metered`(`t1`.`a`) AS `metered` from `t1` utf8 utf8_general_ci DROP VIEW v1; DROP FUNCTION metered; DROP TABLE t1; @@ -6314,7 +6314,7 @@ select 1 /*!,2*/ /*!00000,3*/ /*!99999,4*/ ; end $$ show create procedure proc_25411_a; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation proc_25411_a CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_a`() begin /* real comment */ @@ -6323,7 +6323,7 @@ select 1; select 3; select 4; -end +end utf8 utf8_general_ci latin1_swedish_ci call proc_25411_a(); 1 1 @@ -6334,7 +6334,7 @@ call proc_25411_a(); 4 4 show create procedure proc_25411_b; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation proc_25411_b CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_b`( /* real comment */ p1 int, @@ -6343,7 +6343,7 @@ proc_25411_b CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_b`( ) begin select p1, p2; -end +end utf8 utf8_general_ci latin1_swedish_ci select name, param_list, body from mysql.proc where name like "%25411%"; name param_list body proc_25411_a begin @@ -6373,7 +6373,7 @@ call proc_25411_b(10, 20); p1 p2 10 20 show create procedure proc_25411_c; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation proc_25411_c CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_c`() begin select 1,2,3; @@ -6381,7 +6381,7 @@ select 1 ,2 ,3; select 1,2 ,3 ; select 1 ,2 ,3 ; select 1 ,2 ,3 ; -end +end utf8 utf8_general_ci latin1_swedish_ci call proc_25411_c(); 1 2 3 1 2 3 @@ -6400,9 +6400,9 @@ drop procedure if exists proc_26302; create procedure proc_26302() select 1 /* testing */; show create procedure proc_26302; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation proc_26302 CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_26302`() -select 1 /* testing */ +select 1 /* testing */ utf8 utf8_general_ci latin1_swedish_ci select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME = "proc_26302"; ROUTINE_NAME ROUTINE_DEFINITION diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index 9998a51fdc8..2b34ff8c021 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -426,37 +426,37 @@ a\b a\'b a"\b a"\'b SET @@SQL_MODE=''; create function `foo` () returns int return 5; show create function `foo`; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation foo CREATE DEFINER=`root`@`localhost` FUNCTION `foo`() RETURNS int(11) -return 5 +return 5 latin1 latin1_swedish_ci latin1_swedish_ci SET @@SQL_MODE='ANSI_QUOTES'; show create function `foo`; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation foo CREATE DEFINER=`root`@`localhost` FUNCTION `foo`() RETURNS int(11) -return 5 +return 5 latin1 latin1_swedish_ci latin1_swedish_ci drop function `foo`; create function `foo` () returns int return 5; show create function `foo`; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation foo ANSI_QUOTES CREATE DEFINER="root"@"localhost" FUNCTION "foo"() RETURNS int(11) -return 5 +return 5 latin1 latin1_swedish_ci latin1_swedish_ci SET @@SQL_MODE=''; show create function `foo`; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation foo ANSI_QUOTES CREATE DEFINER="root"@"localhost" FUNCTION "foo"() RETURNS int(11) -return 5 +return 5 latin1 latin1_swedish_ci latin1_swedish_ci drop function `foo`; SET @@SQL_MODE=''; create table t1 (a int); create table t2 (a int); create view v1 as select a from t1; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci SET @@SQL_MODE='ANSI_QUOTES'; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VIEW "v1" AS select "t1"."a" AS "a" from "t1" +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VIEW "v1" AS select "t1"."a" AS "a" from "t1" latin1 latin1_swedish_ci create view v2 as select a from t2 where a in (select a from v1); drop view v2, v1; drop table t1, t2; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 5acbace480a..7696afdf06d 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -203,6 +203,10 @@ proc CREATE TABLE `proc` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, PRIMARY KEY (`db`,`name`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' show create table event; @@ -226,6 +230,10 @@ event CREATE TABLE `event` ( `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `originator` int(10) NOT NULL, `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' show create table general_log; diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 9cb4a6b2427..46724de4281 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -111,8 +111,8 @@ v1 CREATE TEMPORARY TABLE `v1` ( `A` varchar(19) NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'This is view' AS `A` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'This is view' AS `A` latin1 latin1_swedish_ci drop view v1; select * from v1; A diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result index 068bf6c6968..1609707fb09 100644 --- a/mysql-test/r/trigger-compat.result +++ b/mysql-test/r/trigger-compat.result @@ -32,9 +32,9 @@ Warnings: Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger. SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name; -TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER -NULL mysqltest_db1 wl2818_trg1 INSERT NULL mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL -NULL mysqltest_db1 wl2818_trg2 INSERT NULL mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest_db1 wl2818_trg1 INSERT NULL mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci +NULL mysqltest_db1 wl2818_trg2 INSERT NULL mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci DROP TRIGGER wl2818_trg1; Warnings: Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger. diff --git a/mysql-test/r/trigger-grant.result b/mysql-test/r/trigger-grant.result index 49c36513fbc..14b8c98f2fa 100644 --- a/mysql-test/r/trigger-grant.result +++ b/mysql-test/r/trigger-grant.result @@ -137,9 +137,9 @@ Note 1449 There is no 'mysqltest_nonexs'@'localhost' registered INSERT INTO t1 VALUES(6); ERROR HY000: There is no 'mysqltest_nonexs'@'localhost' registered SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer -trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost -trg2 INSERT t1 SET @new_sum = 0 AFTER NULL mysqltest_nonexs@localhost +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg2 INSERT t1 SET @new_sum = 0 AFTER NULL mysqltest_nonexs@localhost latin1 latin1_swedish_ci latin1_swedish_ci DROP TRIGGER trg1; DROP TRIGGER trg2; CREATE TRIGGER trg1 BEFORE INSERT ON t1 @@ -169,12 +169,12 @@ Warnings: Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger. SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name; -TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER -NULL mysqltest_db1 trg1 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL -NULL mysqltest_db1 trg2 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @ -NULL mysqltest_db1 trg3 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@ -NULL mysqltest_db1 trg4 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname -NULL mysqltest_db1 trg5 DELETE NULL mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +NULL mysqltest_db1 trg1 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci +NULL mysqltest_db1 trg2 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @ latin1 latin1_swedish_ci latin1_swedish_ci +NULL mysqltest_db1 trg3 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@ latin1 latin1_swedish_ci latin1_swedish_ci +NULL mysqltest_db1 trg4 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname latin1 latin1_swedish_ci latin1_swedish_ci +NULL mysqltest_db1 trg5 DELETE NULL mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci ---> connection: default DROP USER mysqltest_dfn@localhost; diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index ecaef458e92..f901fd783e8 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -600,9 +600,9 @@ select @a; @a 10 show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer -t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI root@localhost -t1_af INSERT t1 set @a=10 AFTER # root@localhost +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +t1_af INSERT t1 set @a=10 AFTER # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci drop table t1; set sql_mode="traditional"; create table t1 (a date); @@ -622,8 +622,8 @@ t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show triggers; -Trigger Event Table Statement Timing Created sql_mode Definer -t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE # root@localhost +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci drop table t1; create table t1 (id int); create trigger t1_ai after insert on t1 for each row reset query cache; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 88e12e26c4a..cfad70a9bb5 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -37,11 +37,11 @@ c 6 11 show create table v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci show create view t1; ERROR HY000: 'test.t1' is not VIEW drop table t1; @@ -60,8 +60,8 @@ Warnings: Note 1003 select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1` create algorithm=temptable view v2 (c) as select b+1 from t1; show create view v2; -View Create View -v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci select c from v2; c 3 @@ -576,8 +576,8 @@ set sql_mode='ansi'; create table t1 ("a*b" int); create view v1 as select "a*b" from t1; show create view v1; -View Create View -v1 CREATE VIEW "v1" AS select "t1"."a*b" AS "a*b" from "t1" +View Create View character_set_client collation_connection +v1 CREATE VIEW "v1" AS select "t1"."a*b" AS "a*b" from "t1" latin1 latin1_swedish_ci drop view v1; drop table t1; set sql_mode=default; @@ -682,8 +682,8 @@ drop view v1; drop table t1; CREATE VIEW v1 (f1,f2,f3,f4) AS SELECT connection_id(), pi(), current_user(), version(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select connection_id() AS `f1`,pi() AS `f2`,current_user() AS `f3`,version() AS `f4` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select connection_id() AS `f1`,pi() AS `f2`,current_user() AS `f3`,version() AS `f4` latin1 latin1_swedish_ci drop view v1; create table t1 (s1 int); create table t2 (s2 int); @@ -716,14 +716,14 @@ create table t2 (a int); create view v1 as select a from t1; create view v2 as select a from t2 where a in (select a from v1); show create view v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `t2`.`a` in (select `v1`.`a` AS `a` from `v1`) +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `t2`.`a` in (select `v1`.`a` AS `a` from `v1`) latin1 latin1_swedish_ci drop view v2, v1; drop table t1, t2; CREATE VIEW `v 1` AS select 5 AS `5`; show create view `v 1`; -View Create View -v 1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v 1` AS select 5 AS `5` +View Create View character_set_client collation_connection +v 1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v 1` AS select 5 AS `5` latin1 latin1_swedish_ci drop view `v 1`; create database mysqltest; create table mysqltest.t1 (a int, b int); @@ -790,15 +790,15 @@ select * from v3; a b 1 1 show create view v3; -View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `v1`.`col1` AS `a`,`v2`.`col1` AS `b` from (`v1` join `v2`) where (`v1`.`col1` = `v2`.`col1`) +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `v1`.`col1` AS `a`,`v2`.`col1` AS `b` from (`v1` join `v2`) where (`v1`.`col1` = `v2`.`col1`) latin1 latin1_swedish_ci drop view v3, v2, v1; drop table t2, t1; create function `f``1` () returns int return 5; create view v1 as select test.`f``1` (); show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`f``1`() AS `test.``f````1`` ()` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`f``1`() AS `test.``f````1`` ()` latin1 latin1_swedish_ci select * from v1; test.`f``1` () 5 @@ -814,11 +814,11 @@ drop function a; create table t2 (col1 char collate latin1_german2_ci); create view v2 as select col1 collate latin1_german1_ci from t2; show create view v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2` latin1 latin1_swedish_ci show create view v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2` latin1 latin1_swedish_ci drop view v2; drop table t2; create table t1 (a int); @@ -844,9 +844,12 @@ drop view v1; drop table t1; create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 99999999999999999999999999999999999999999999999999999 AS `col1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 99999999999999999999999999999999999999999999999999999 AS `col1` latin1 latin1_swedish_ci drop view v1; +SET @old_cs_client = @@character_set_client; +SET @old_cs_results = @@character_set_results; +SET @old_cs_connection = @@character_set_connection; set names utf8; create table tü (cü char); create view vü as select cü from tü; @@ -856,7 +859,9 @@ cü ü drop view vü; drop table tü; -set names latin1; +SET character_set_client = @old_cs_client; +SET character_set_results = @old_cs_results; +SET character_set_connection = @old_cs_connection; create table t1 (a int, b int); insert into t1 values (1,2), (1,3), (2,4), (2,5), (3,10); create view v1(c) as select a+1 from t1 where b >= 4; @@ -867,8 +872,8 @@ drop view v1; drop table t1; create view v1 as select cast(1 as char(3)); show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1 as char(3) charset latin1) AS `cast(1 as char(3))` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1 as char(3) charset latin1) AS `cast(1 as char(3))` latin1 latin1_swedish_ci select * from v1; cast(1 as char(3)) 1 @@ -1199,20 +1204,20 @@ drop table t1; create table t1 (a int); create view v1 as select * from t1; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci alter algorithm=undefined view v1 as select * from t1 with check option; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED CHECK OPTION +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci alter algorithm=merge view v1 as select * from t1 with cascaded check option; show create view v1; -View Create View -v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED CHECK OPTION +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci alter algorithm=temptable view v1 as select * from t1; show create view v1; -View Create View -v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci drop view v1; drop table t1; create table t1 (s1 int); @@ -1885,25 +1890,25 @@ create table t1 (a timestamp default now()); create table t2 (b timestamp default now()); create view v1 as select a,b,t1.a < now() from t1,t2 where t1.a < now(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < now()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < now()) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < now()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < now()) latin1 latin1_swedish_ci drop view v1; drop table t1, t2; CREATE TABLE t1 ( a varchar(50) ); CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = CURRENT_USER(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = current_user()) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = current_user()) latin1 latin1_swedish_ci DROP VIEW v1; CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = VERSION(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = version()) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = version()) latin1 latin1_swedish_ci DROP VIEW v1; CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = DATABASE(); SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = database()) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = database()) latin1 latin1_swedish_ci DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (col1 time); @@ -2005,8 +2010,8 @@ drop table t1; create table t1 (s1 int); create view v1 as select var_samp(s1) from t1; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select var_samp(`t1`.`s1`) AS `var_samp(s1)` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select var_samp(`t1`.`s1`) AS `var_samp(s1)` from `t1` latin1 latin1_swedish_ci drop view v1; drop table t1; set sql_mode='strict_all_tables'; @@ -2251,16 +2256,16 @@ CREATE TABLE t1 (date DATE NOT NULL); INSERT INTO t1 VALUES ('2005-09-06'); CREATE VIEW v1 AS SELECT DAYNAME(date) FROM t1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select dayname(`t1`.`date`) AS `DAYNAME(date)` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select dayname(`t1`.`date`) AS `DAYNAME(date)` from `t1` latin1 latin1_swedish_ci CREATE VIEW v2 AS SELECT DAYOFWEEK(date) FROM t1; SHOW CREATE VIEW v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select dayofweek(`t1`.`date`) AS `DAYOFWEEK(date)` from `t1` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select dayofweek(`t1`.`date`) AS `DAYOFWEEK(date)` from `t1` latin1 latin1_swedish_ci CREATE VIEW v3 AS SELECT WEEKDAY(date) FROM t1; SHOW CREATE VIEW v3; -View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select weekday(`t1`.`date`) AS `WEEKDAY(date)` from `t1` +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select weekday(`t1`.`date`) AS `WEEKDAY(date)` from `t1` latin1 latin1_swedish_ci SELECT DAYNAME('2005-09-06'); DAYNAME('2005-09-06') Tuesday @@ -2419,13 +2424,13 @@ test.v1 repair error Corrupt DROP VIEW v1; create definer = current_user() sql security invoker view v1 as select 1; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci drop view v1; create definer = current_user sql security invoker view v1 as select 1; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci drop view v1; create table t1 (id INT, primary key(id)); insert into t1 values (1),(2); @@ -2454,8 +2459,8 @@ end; // call p1(); show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci drop view v1; drop procedure p1; CREATE VIEW v1 AS SELECT 42 AS Meaning; @@ -2560,8 +2565,8 @@ drop table t1; show create view v1; drop view v1; // -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`id` AS `id` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`id` AS `id` from `t1` latin1 latin1_swedish_ci create table t1(f1 int, f2 int); create view v1 as select ta.f1 as a, tb.f1 as b from t1 ta, t1 tb where ta.f1=tb .f1 and ta.f2=tb.f2; @@ -2677,8 +2682,8 @@ CREATE VIEW v1 AS SELECT id, date(d) + INTERVAL TIME_TO_SEC(d) SECOND AS t, COUNT(*) FROM t1 GROUP BY id, t; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) AS `t`,count(0) AS `COUNT(*)` from `t1` group by `t1`.`id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) AS `t`,count(0) AS `COUNT(*)` from `t1` group by `t1`.`id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) latin1 latin1_swedish_ci SELECT * FROM v1; id t COUNT(*) DROP VIEW v1; @@ -2705,8 +2710,8 @@ CREATE VIEW v1 AS SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75) latin1 latin1_swedish_ci set timestamp=1136066400; SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75; Age @@ -2835,12 +2840,12 @@ DROP TABLE t1; CREATE TABLE t1 (x INT, y INT); CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x` from `t1` latin1 latin1_swedish_ci ALTER VIEW v1 AS SELECT x, y FROM t1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x`,`t1`.`y` AS `y` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x`,`t1`.`y` AS `y` from `t1` latin1 latin1_swedish_ci DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (s1 char); @@ -2900,8 +2905,8 @@ USE test; create table t1 (f1 datetime); create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute)) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute)) latin1 latin1_swedish_ci drop view v1; drop table t1; DROP TABLE IF EXISTS t1; @@ -2977,8 +2982,8 @@ t2.ver = (SELECT MAX(t.ver) FROM t2 t WHERE t.org = t2.org); SHOW WARNINGS; Level Code Message SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk` from (`t1` join `t2` on(((`t2`.`fk` = `t1`.`pk`) and (`t2`.`ver` = (select max(`t`.`ver`) AS `MAX(t.ver)` from `t2` `t` where (`t`.`org` = `t2`.`org`)))))) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk` from (`t1` join `t2` on(((`t2`.`fk` = `t1`.`pk`) and (`t2`.`ver` = (select max(`t`.`ver`) AS `MAX(t.ver)` from `t2` `t` where (`t`.`org` = `t2`.`org`)))))) latin1 latin1_swedish_ci DROP VIEW v1; DROP TABLE t1, t2; DROP FUNCTION IF EXISTS f1; @@ -3041,8 +3046,8 @@ DROP VIEW v1, v2; DROP TABLE t1; CREATE VIEW v AS SELECT !0 * 5 AS x FROM DUAL; SHOW CREATE VIEW v; -View Create View -v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select ((not(0)) * 5) AS `x` +View Create View character_set_client collation_connection +v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select ((not(0)) * 5) AS `x` latin1 latin1_swedish_ci SELECT !0 * 5 AS x FROM DUAL; x 5 @@ -3056,8 +3061,8 @@ SELECT * FROM v1; TheEnd TheEnd SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'The\ZEnd' AS `TheEnd` +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 DROP VIEW v1; CREATE TABLE t1 (mydate DATETIME); INSERT INTO t1 VALUES @@ -3278,8 +3283,8 @@ old_isfalse int(1) NO 0 a IS NOT FALSE int(1) NO 0 old_isnotfalse int(1) NO 0 show create view view_24532_b; -View Create View -view_24532_b CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_24532_b` AS select (`table_24532`.`a` is true) AS `a IS TRUE`,if(ifnull(`table_24532`.`a`,0),1,0) AS `old_istrue`,(`table_24532`.`a` is not true) AS `a IS NOT TRUE`,if(ifnull(`table_24532`.`a`,0),0,1) AS `old_isnottrue`,(`table_24532`.`a` is false) AS `a IS FALSE`,if(ifnull(`table_24532`.`a`,1),0,1) AS `old_isfalse`,(`table_24532`.`a` is not false) AS `a IS NOT FALSE`,if(ifnull(`table_24532`.`a`,1),1,0) AS `old_isnotfalse` from `table_24532` +View Create View character_set_client collation_connection +view_24532_b CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_24532_b` AS select (`table_24532`.`a` is true) AS `a IS TRUE`,if(ifnull(`table_24532`.`a`,0),1,0) AS `old_istrue`,(`table_24532`.`a` is not true) AS `a IS NOT TRUE`,if(ifnull(`table_24532`.`a`,0),0,1) AS `old_isnottrue`,(`table_24532`.`a` is false) AS `a IS FALSE`,if(ifnull(`table_24532`.`a`,1),0,1) AS `old_isfalse`,(`table_24532`.`a` is not false) AS `a IS NOT FALSE`,if(ifnull(`table_24532`.`a`,1),1,0) AS `old_isnotfalse` from `table_24532` latin1 latin1_swedish_ci insert into table_24532 values (0, 0, 0, 0); select * from view_24532_b; a IS TRUE old_istrue a IS NOT TRUE old_isnottrue a IS FALSE old_isfalse a IS NOT FALSE old_isnotfalse @@ -3377,8 +3382,8 @@ col decimal(7,5) NO 0.00000 DROP VIEW v1; CREATE VIEW v1 AS SELECT CAST(1.23456789 AS DECIMAL(8,0)) AS col; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1.23456789 as decimal(8,0)) AS `col` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1.23456789 as decimal(8,0)) AS `col` latin1 latin1_swedish_ci DROP VIEW v1; CREATE TABLE t1 (a INT); CREATE TABLE t2 (b INT, c INT DEFAULT 0); diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index 0a32b3b3fcd..49c98d8e03f 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -27,8 +27,8 @@ ERROR 42000: CREATE VIEW command denied to user 'mysqltest_1'@'localhost' for ta create view v2 as select * from mysqltest.t2; ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2' show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci grant create view,drop,select on test.* to mysqltest_1@localhost; use test; alter view v1 as select * from mysqltest.t1; @@ -127,28 +127,28 @@ explain select c from mysqltest.v1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found show create view mysqltest.v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci explain select c from mysqltest.v2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table show create view mysqltest.v2; -View Create View -v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v2` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v2` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci explain select c from mysqltest.v3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 system NULL NULL NULL NULL 0 const row not found show create view mysqltest.v3; -View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v3` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v3` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci explain select c from mysqltest.v4; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table show create view mysqltest.v4; -View Create View -v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` +View Create View character_set_client collation_connection +v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; drop database mysqltest; @@ -308,8 +308,8 @@ grant select on mysqltest.t1 to mysqltest_1@localhost; grant create view,select on test.* to mysqltest_1@localhost; create view v1 as select * from mysqltest.t1; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci revoke select on mysqltest.t1 from mysqltest_1@localhost; select * from v1; ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them @@ -476,15 +476,15 @@ grant all on test.* to 'test14256'@'%'; use test; create view v1 as select 42; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42` latin1 latin1_swedish_ci select definer into @v1def1 from information_schema.views where table_schema = 'test' and table_name='v1'; drop view v1; create definer=`test14256`@`%` view v1 as select 42; show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42` latin1 latin1_swedish_ci select definer into @v1def2 from information_schema.views where table_schema = 'test' and table_name='v1'; drop view v1; @@ -500,8 +500,8 @@ use mysqltest; CREATE TABLE t1 (i INT); CREATE VIEW v1 AS SELECT * FROM t1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost; use mysqltest; LOCK TABLES v1 READ; @@ -519,11 +519,11 @@ create definer=some_user@localhost sql security invoker view v2 as select 1; Warnings: Note 1449 There is no 'some_user'@'localhost' registered show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci show create view v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select 1 AS `1` +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select 1 AS `1` latin1 latin1_swedish_ci drop view v1; drop view v2; CREATE DATABASE mysqltest1; @@ -602,8 +602,8 @@ CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1; Warnings: Note 1449 There is no 'no-such-user'@'localhost' registered SHOW CREATE VIEW v; -View Create View -v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1` +View Create View character_set_client collation_connection +v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci Warnings: Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them SELECT * FROM v; @@ -619,14 +619,14 @@ CREATE TABLE t1 (f1 INTEGER); CREATE VIEW view1 AS SELECT * FROM t1; SHOW CREATE VIEW view1; -View Create View -view1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view1` AS select `t1`.`f1` AS `f1` from `t1` +View Create View character_set_client collation_connection +view1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci CREATE VIEW view2 AS SELECT * FROM view1; # Here comes a suspicious warning SHOW CREATE VIEW view2; -View Create View -view2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view2` AS select `view1`.`f1` AS `f1` from `view1` +View Create View character_set_client collation_connection +view2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view2` AS select `view1`.`f1` AS `f1` from `view1` latin1 latin1_swedish_ci # But the view view2 is usable SELECT * FROM view2; f1 @@ -783,8 +783,8 @@ ALTER VIEW v2 AS SELECT f2 FROM t1; ERROR 42000: DROP command denied to user 'u26813'@'localhost' for table 'v2' ALTER VIEW v3 AS SELECT f2 FROM t1; SHOW CREATE VIEW v3; -View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f2` AS `f2` from `t1` +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f2` AS `f2` from `t1` latin1 latin1_swedish_ci DROP USER u26813@localhost; DROP DATABASE db26813; DROP DATABASE IF EXISTS mysqltest1; @@ -882,28 +882,28 @@ CREATE TABLE t1 (i INT); CREATE VIEW v1 AS SELECT * FROM t1; ALTER VIEW v1 AS SELECT * FROM t1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1; Warnings: Note 1449 There is no 'no_such'@'user_1' registered SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci Warnings: Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci Warnings: Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1; Warnings: Note 1449 There is no 'no_such'@'user_2' registered SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci Warnings: Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them DROP VIEW v1; diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test new file mode 100644 index 00000000000..c3475c98428 --- /dev/null +++ b/mysql-test/t/ddl_i18n_koi8r.test @@ -0,0 +1,1112 @@ +# Objects to test: +# - stored procedures/functions; +# - triggers; +# - events; +# - views; +# +# For stored routines: +# - create a database with collation utf8_unicode_ci; +# - create an object, which +# - contains SP-var with explicit CHARSET-clause; +# - contains SP-var without CHARSET-clause; +# - contains text constant; +# - has localized routine/parameter names; +# - check: +# - execute; +# - SHOW CREATE output; +# - SHOW output; +# - SELECT FROM INFORMATION_SCHEMA output; +# - alter database character set; +# - change connection collation; +# - check again; +# - dump definition using mysqldump; +# - drop object; +# - restore object; +# + +########################################################################### +# +# NOTE: this file contains text in UTF8 and KOI8-R encodings. +# +########################################################################### + +--source include/have_utf8.inc +--source include/have_cp866.inc +--source include/have_cp1251.inc +--source include/have_koi8r.inc + +########################################################################### + +set names koi8r; +delimiter |; + +########################################################################### +# +# * Views. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo Views +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +CREATE TABLE t1( INT)| +INSERT INTO t1 VALUES(1)| + +# - Create views; + +--echo + +CREATE VIEW v1 AS + SELECT '' AS c1, AS c2 + FROM t1| + +--echo + +CREATE VIEW v2 AS SELECT _utf8'тест' as c1| + +--echo + +# +# First-round checks. +# + +--source include/ddl_i18n.check_views.inc + +# +# Change running environment (alter database character set, change session +# variables). +# + +--echo +--echo + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| + +# +# Second-round checks: +# + +# - Change connection to flush cache; + +--connect (con2,localhost,root,,) +--echo +--echo ---> connection: con2 + +# - Switch environment variables and trigger loading views; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +--disable_result_log +SELECT * FROM mysqltest1.v1| +SELECT * FROM mysqltest1.v2| +--enable_result_log + +use mysqltest1| + +# - Restore environment; + +set names koi8r| + +# - Check! + +--source include/ddl_i18n.check_views.inc + +# +# Check mysqldump. +# + +# - Dump mysqltest1; + +--echo +--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.views.mysqltest1.sql + +--exec $MYSQL_DUMP --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.views.mysqltest1.sql + +# - Clean mysqltest1; + +--echo +--echo + +DROP DATABASE mysqltest1| + +# - Restore mysqltest1; + +--echo +--echo + +--echo ---> Restoring mysqltest1... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.views.mysqltest1.sql + +# +# Third-round checks. +# + +# - Change connection to flush cache; + +--connect (con3,localhost,root,,) +--echo +--echo ---> connection: con3 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +--disable_result_log +SELECT * FROM mysqltest1.v1| +SELECT * FROM mysqltest1.v2| +--enable_result_log + +use mysqltest1| + +# - Restore environment; + +set names koi8r| + +# - Check! + +--source include/ddl_i18n.check_views.inc + +# +# Cleanup. +# + +--connection default +--echo +--echo ---> connection: default + +--disconnect con2 +--disconnect con3 + +use test| + +DROP DATABASE mysqltest1| + +########################################################################### +# +# * Stored procedures/functions. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo Stored procedures/functions +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +# - Create two stored routines -- with and without explicit +# CHARSET-clause for SP-variable; +# + +--echo + +# - Procedure p1 + +CREATE PROCEDURE p1( + INOUT 1 CHAR(10), + OUT 2 CHAR(10)) +BEGIN + DECLARE 1 CHAR(10); + + SELECT + COLLATION(1) AS c1, + COLLATION(1) AS c2, + COLLATION(2) AS c3; + + SELECT + COLLATION('') AS c4, + COLLATION(_koi8r '') AS c5, + COLLATION(_utf8 'текст') AS c6, + @@collation_connection AS c7, + @@character_set_client AS c8; + + SET 1 = 'a'; + SET 2 = 'b'; +END| + +--echo + +# - Procedure p2 + +CREATE PROCEDURE p2( + INOUT 1 CHAR(10) CHARACTER SET utf8, + OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN + DECLARE 1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(1) AS c1, + COLLATION(1) AS c2, + COLLATION(2) AS c3; + + SELECT + COLLATION('') AS c4, + COLLATION(_koi8r '') AS c5, + COLLATION(_utf8 'текст') AS c6, + @@collation_connection AS c7, + @@character_set_client AS c8; + + SET 1 = 'a'; + SET 2 = 'b'; +END| + +--echo + +# - Procedure p3 + +CREATE PROCEDURE mysqltest2.p3( + INOUT 1 CHAR(10), + OUT 2 CHAR(10)) +BEGIN + DECLARE 1 CHAR(10); + + SELECT + COLLATION(1) AS c1, + COLLATION(1) AS c2, + COLLATION(2) AS c3; + + SELECT + COLLATION('') AS c4, + COLLATION(_koi8r '') AS c5, + COLLATION(_utf8 'текст') AS c6, + @@collation_connection AS c7, + @@character_set_client AS c8; + + SET 1 = 'a'; + SET 2 = 'b'; +END| + +--echo + +# - Procedure p4 + +CREATE PROCEDURE mysqltest2.p4( + INOUT 1 CHAR(10) CHARACTER SET utf8, + OUT 2 CHAR(10) CHARACTER SET utf8) +BEGIN + DECLARE 1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(1) AS c1, + COLLATION(1) AS c2, + COLLATION(2) AS c3; + + SELECT + COLLATION('') AS c4, + COLLATION(_koi8r '') AS c5, + COLLATION(_utf8 'текст') AS c6, + @@collation_connection AS c7, + @@character_set_client AS c8; + + SET 1 = 'a'; + SET 2 = 'b'; +END| + +# +# First-round checks. +# + +--source include/ddl_i18n.check_sp.inc + +# +# Change running environment (alter database character set, change session +# variables). +# + +--echo +--echo + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +# +# Second-round checks: +# + +# - Change connection to flush SP-cache; + +--connect (con2,localhost,root,,mysqltest1) +--echo +--echo ---> connection: con2 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +CALL p1(@a, @b)| +CALL p2(@a, @b)| +CALL mysqltest2.p3(@a, @b)| +CALL mysqltest2.p4(@a, @b)| + +# - Restore environment; + +set names koi8r| + +# - Check! + +--source include/ddl_i18n.check_sp.inc + +# +# Check mysqldump. +# + +# - Dump mysqltest1, mysqltest2; + +--echo +--echo ---> Dump of mysqltest1 + +--exec $MYSQL_DUMP --compact --routines --databases mysqltest1 + +--echo +--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql + +--exec $MYSQL_DUMP --compact --routines --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.sp.mysqltest1.sql + +--echo +--echo ---> Dump of mysqltest2 + +--exec $MYSQL_DUMP --compact --routines --databases mysqltest2 + +--echo +--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql + +--exec $MYSQL_DUMP --compact --routines --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.sp.mysqltest2.sql + +# - Clean mysqltest1, mysqltest2; + +--echo +--echo + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +# - Restore mysqltest1; + +--echo +--echo + +--echo ---> Restoring mysqltest1... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.sp.mysqltest1.sql + +--echo ---> Restoring mysqltest2... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.sp.mysqltest2.sql + +# +# Third-round checks. +# + +# - Change connection to flush SP-cache; + +--connect (con3,localhost,root,,mysqltest1) +--echo +--echo ---> connection: con3 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +CALL p1(@a, @b)| +CALL p2(@a, @b)| +CALL mysqltest2.p3(@a, @b)| +CALL mysqltest2.p4(@a, @b)| + +# - Restore environment; + +set names koi8r| + +# - Check! + +--source include/ddl_i18n.check_sp.inc + +# +# Cleanup. +# + +--connection default +--echo +--echo ---> connection: default + +--disconnect con2 +--disconnect con3 + +use test| + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +########################################################################### +# +# * Triggers. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo Triggers +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set; + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +# - Create tables for triggers; + +CREATE TABLE t1(c INT)| +CREATE TABLE mysqltest2.t1(c INT)| + +# - Create log tables; + +CREATE TABLE log(msg VARCHAR(255))| +CREATE TABLE mysqltest2.log(msg VARCHAR(255))| + + +# - Create triggers -- with and without explicit CHARSET-clause for +# SP-variable; +# + +--echo + +# - Trigger trg1 + +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN + DECLARE 1 CHAR(10); + + INSERT INTO log VALUES(COLLATION(1)); + INSERT INTO log VALUES(COLLATION('')); + INSERT INTO log VALUES(COLLATION(_koi8r '')); + INSERT INTO log VALUES(COLLATION(_utf8 'текст')); + INSERT INTO log VALUES(@@collation_connection); + INSERT INTO log VALUES(@@character_set_client); + + SET @a1 = ''; + SET @a1 = _koi8r ''; + SET @a2 = _utf8 'текст'; +END| + +--echo + +# - Trigger trg2 + +CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN + DECLARE 1 CHAR(10) CHARACTER SET utf8; + + INSERT INTO log VALUES(COLLATION(1)); + INSERT INTO log VALUES(COLLATION('')); + INSERT INTO log VALUES(COLLATION(_koi8r '')); + INSERT INTO log VALUES(COLLATION(_utf8 'текст')); + INSERT INTO log VALUES(@@collation_connection); + INSERT INTO log VALUES(@@character_set_client); + + SET @b1 = ''; + SET @b1 = _koi8r ''; + SET @b2 = _utf8 'текст'; +END| + +--echo + +# - Trigger trg3 + +CREATE TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN + DECLARE 1 CHAR(10); + + INSERT INTO log VALUES(COLLATION(1)); + INSERT INTO log VALUES(COLLATION('')); + INSERT INTO log VALUES(COLLATION(_koi8r '')); + INSERT INTO log VALUES(COLLATION(_utf8 'текст')); + INSERT INTO log VALUES(@@collation_connection); + INSERT INTO log VALUES(@@character_set_client); + + SET @a1 = ''; + SET @a1 = _koi8r ''; + SET @a2 = _utf8 'текст'; +END| + +--echo + +# - Trigger trg4 + +CREATE TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN + DECLARE 1 CHAR(10) CHARACTER SET utf8; + + INSERT INTO log VALUES(COLLATION(1)); + INSERT INTO log VALUES(COLLATION('')); + INSERT INTO log VALUES(COLLATION(_koi8r '')); + INSERT INTO log VALUES(COLLATION(_utf8 'текст')); + INSERT INTO log VALUES(@@collation_connection); + INSERT INTO log VALUES(@@character_set_client); + + SET @b1 = ''; + SET @b1 = _koi8r ''; + SET @b2 = _utf8 'текст'; +END| + +--echo + +# +# First-round checks. +# + +--source include/ddl_i18n.check_triggers.inc + +# +# Change running environment (alter database character set, change session +# variables). +# + +--echo +--echo + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +# +# Second-round checks: +# + +# - Flush table cache; + +ALTER TABLE t1 ADD COLUMN fake INT| +ALTER TABLE t1 DROP COLUMN fake| + +ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest2.t1 DROP COLUMN fake| + +# - Switch environment variables and initiate loading of triggers +# (connect using NULL database); + +--connect (con2,localhost,root,,) +--echo +--echo ---> connection: con2 + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +INSERT INTO mysqltest1.t1 VALUES(0)| +INSERT INTO mysqltest2.t1 VALUES(0)| + +DELETE FROM mysqltest1.log| +DELETE FROM mysqltest2.log| + +# - Restore environment; + +set names koi8r| + +use mysqltest1| + +# - Check! + +--source include/ddl_i18n.check_triggers.inc + +# +# Check mysqldump. +# + +# - Dump mysqltest1, mysqltest2; + +--echo +--echo ---> Dump of mysqltest1 + +--exec $MYSQL_DUMP --compact --triggers --databases mysqltest1 + +--echo +--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql + +--exec $MYSQL_DUMP --compact --triggers --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.triggers.mysqltest1.sql + +--echo +--echo ---> Dump of mysqltest2 + +--exec $MYSQL_DUMP --compact --triggers --databases mysqltest2 + +--echo +--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql + +--exec $MYSQL_DUMP --compact --triggers --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.triggers.mysqltest2.sql + +# - Clean mysqltest1, mysqltest2; + +--echo +--echo + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +# - Restore mysqltest1; + +--echo +--echo + +--echo ---> Restoring mysqltest1... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.triggers.mysqltest1.sql + +--echo ---> Restoring mysqltest2... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.triggers.mysqltest2.sql + +# +# Third-round checks. +# + +# - Flush table cache; + +ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest1.t1 DROP COLUMN fake| + +ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest2.t1 DROP COLUMN fake| + +# - Switch environment variables and initiate loading of triggers +# (connect using NULL database); + +--connect (con3,localhost,root,,) +--echo +--echo ---> connection: con3 + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +INSERT INTO mysqltest1.t1 VALUES(0)| +INSERT INTO mysqltest2.t1 VALUES(0)| + +DELETE FROM mysqltest1.log| +DELETE FROM mysqltest2.log| + +# - Restore environment; + +set names koi8r| + +use mysqltest1| + +# - Check! + +--source include/ddl_i18n.check_triggers.inc + +# +# Cleanup. +# + +--connection default +--echo +--echo ---> connection: default + +--disconnect con2 +--disconnect con3 + +use test| + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +########################################################################### +# +# * Events +# +# We don't have EXECUTE EVENT so far, so this test is limited. It checks that +# event with non-latin1 symbols can be created, dumped, restored and SHOW +# statements work properly. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo Events +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +# - Create two stored routines -- with and without explicit +# CHARSET-clause for SP-variable; +# + +--echo + +# - Event ev1 + +CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN + DECLARE 1 CHAR(10); + + SELECT + COLLATION(1) AS c1, + COLLATION('') AS c2, + COLLATION(_koi8r '') AS c3, + COLLATION(_utf8 'текст') AS c4, + @@collation_connection AS c5, + @@character_set_client AS c6; +END| + +--echo + +# - Event ev2 + +CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN + DECLARE 1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(1) AS c1, + COLLATION('') AS c2, + COLLATION(_koi8r '') AS c3, + COLLATION(_utf8 'текст') AS c4, + @@collation_connection AS c5, + @@character_set_client AS c6; +END| + +--echo + +# - Event ev3 + +CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN + DECLARE 1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(1) AS c1, + COLLATION('') AS c2, + COLLATION(_koi8r '') AS c3, + COLLATION(_utf8 'текст') AS c4, + @@collation_connection AS c5, + @@character_set_client AS c6; +END| + +--echo + +# - Event ev4 + +CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN + DECLARE 1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(1) AS c1, + COLLATION('') AS c2, + COLLATION(_koi8r '') AS c3, + COLLATION(_utf8 'текст') AS c4, + @@collation_connection AS c5, + @@character_set_client AS c6; +END| + +--echo + + +# +# First-round checks. +# + +--source include/ddl_i18n.check_events.inc + +# +# Change running environment (alter database character set, change session +# variables). +# + +--echo +--echo + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +# +# Second-round checks: +# + +# - Change connection to flush cache; + +--connect (con2,localhost,root,,mysqltest1) +--echo +--echo ---> connection: con2 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +--disable_result_log +SHOW CREATE EVENT ev1| +SHOW CREATE EVENT ev2| +SHOW CREATE EVENT mysqltest2.ev3| +SHOW CREATE EVENT mysqltest2.ev4| +--enable_result_log + +# - Restore environment; + +set names koi8r| + +# - Check! + +--source include/ddl_i18n.check_events.inc + +# +# Check mysqldump. +# + +# - Dump mysqltest1, mysqltest2; + +--echo +--echo ---> Dump of mysqltest1 + +--exec $MYSQL_DUMP --compact --events --databases mysqltest1 + +--echo +--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.events.mysqltest1.sql + +--exec $MYSQL_DUMP --compact --events --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.events.mysqltest1.sql + +--echo +--echo ---> Dump of mysqltest2 + +--exec $MYSQL_DUMP --compact --events --databases mysqltest2 + +--echo +--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.events.mysqltest2.sql + +--exec $MYSQL_DUMP --compact --events --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.events.mysqltest2.sql + +# - Clean mysqltest1, mysqltest2; + +--echo +--echo + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +# - Restore mysqltest1; + +--echo +--echo + +--echo ---> Restoring mysqltest1... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.events.mysqltest1.sql + +--echo ---> Restoring mysqltest2... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.events.mysqltest2.sql + +# +# Third-round checks. +# + +# - Change connection to flush cache; + +--connect (con3,localhost,root,,mysqltest1) +--echo +--echo ---> connection: con3 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +--disable_result_log +SHOW CREATE EVENT ev1| +SHOW CREATE EVENT ev2| +SHOW CREATE EVENT mysqltest2.ev3| +SHOW CREATE EVENT mysqltest2.ev4| +--enable_result_log + +# - Restore environment; + +set names koi8r| + +# - Check! + +--source include/ddl_i18n.check_events.inc + +########################################################################### +# +# * DDL statements inside stored routine. +# +# Here we check that DDL statements use actual database collation even if they +# are called from stored routine. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo DDL statements within stored routine. +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +# - Create procedures; + +--echo + +CREATE PROCEDURE p1() +BEGIN + CREATE TABLE t1(col1 VARCHAR(10)); + SHOW CREATE TABLE t1; +END| + +--echo + +CREATE PROCEDURE mysqltest2.p2() +BEGIN + CREATE TABLE t2(col1 VARCHAR(10)); + SHOW CREATE TABLE t2; +END| + +--echo + +# +# First-round checks. +# + +CALL p1()| + +--echo + +SHOW CREATE TABLE t1| + +--echo +--echo + +CALL mysqltest2.p2()| + +--echo + +SHOW CREATE TABLE mysqltest2.t2| + +# +# Alter database. +# + +--echo + +ALTER DATABASE mysqltest1 COLLATE cp1251_general_cs| +ALTER DATABASE mysqltest2 COLLATE cp1251_general_cs| + +DROP TABLE t1| +DROP TABLE mysqltest2.t2| + +--echo + +# +# Second-round checks. +# + +CALL p1()| + +--echo + +SHOW CREATE TABLE t1| + +--echo +--echo + +CALL mysqltest2.p2()| + +--echo + +SHOW CREATE TABLE mysqltest2.t2| + +########################################################################### +# +# That's it. +# +########################################################################### + +# +# Cleanup. +# + +--connection default +--echo +--echo ---> connection: default + +--disconnect con2 +--disconnect con3 + +use test| + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test new file mode 100644 index 00000000000..8fbf819a1b0 --- /dev/null +++ b/mysql-test/t/ddl_i18n_utf8.test @@ -0,0 +1,1112 @@ +# Objects to test: +# - stored procedures/functions; +# - triggers; +# - events; +# - views; +# +# For stored routines: +# - create a database with collation utf8_unicode_ci; +# - create an object, which +# - contains SP-var with explicit CHARSET-clause; +# - contains SP-var without CHARSET-clause; +# - contains text constant; +# - has localized routine/parameter names; +# - check: +# - execute; +# - SHOW CREATE output; +# - SHOW output; +# - SELECT FROM INFORMATION_SCHEMA output; +# - alter database character set; +# - change connection collation; +# - check again; +# - dump definition using mysqldump; +# - drop object; +# - restore object; +# + +########################################################################### +# +# NOTE: this file contains text in UTF8 and KOI8-R encodings. +# +########################################################################### + +--source include/have_utf8.inc +--source include/have_cp866.inc +--source include/have_cp1251.inc +--source include/have_koi8r.inc + +########################################################################### + +set names utf8; +delimiter |; + +########################################################################### +# +# * Views. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo Views +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +CREATE TABLE t1(кол INT)| +INSERT INTO t1 VALUES(1)| + +# - Create views; + +--echo + +CREATE VIEW v1 AS + SELECT 'тест' AS c1, кол AS c2 + FROM t1| + +--echo + +CREATE VIEW v2 AS SELECT _koi8r'' as c1| + +--echo + +# +# First-round checks. +# + +--source include/ddl_i18n.check_views.inc + +# +# Change running environment (alter database character set, change session +# variables). +# + +--echo +--echo + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| + +# +# Second-round checks: +# + +# - Change connection to flush cache; + +--connect (con2,localhost,root,,) +--echo +--echo ---> connection: con2 + +# - Switch environment variables and trigger loading views; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +--disable_result_log +SELECT * FROM mysqltest1.v1| +SELECT * FROM mysqltest1.v2| +--enable_result_log + +use mysqltest1| + +# - Restore environment; + +set names utf8| + +# - Check! + +--source include/ddl_i18n.check_views.inc + +# +# Check mysqldump. +# + +# - Dump mysqltest1; + +--echo +--echo ---> Dumping mysqltest1 to ddl_i18n_utf8views.mysqltest1.sql + +--exec $MYSQL_DUMP --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8views.mysqltest1.sql + +# - Clean mysqltest1; + +--echo +--echo + +DROP DATABASE mysqltest1| + +# - Restore mysqltest1; + +--echo +--echo + +--echo ---> Restoring mysqltest1... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8views.mysqltest1.sql + +# +# Third-round checks. +# + +# - Change connection to flush cache; + +--connect (con3,localhost,root,,) +--echo +--echo ---> connection: con3 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +--disable_result_log +SELECT * FROM mysqltest1.v1| +SELECT * FROM mysqltest1.v2| +--enable_result_log + +use mysqltest1| + +# - Restore environment; + +set names utf8| + +# - Check! + +--source include/ddl_i18n.check_views.inc + +# +# Cleanup. +# + +--connection default +--echo +--echo ---> connection: default + +--disconnect con2 +--disconnect con3 + +use test| + +DROP DATABASE mysqltest1| + +########################################################################### +# +# * Stored procedures/functions. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo Stored procedures/functions +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +# - Create two stored routines -- with and without explicit +# CHARSET-clause for SP-variable; +# + +--echo + +# - Procedure p1 + +CREATE PROCEDURE p1( + INOUT парам1 CHAR(10), + OUT парам2 CHAR(10)) +BEGIN + DECLARE перем1 CHAR(10); + + SELECT + COLLATION(перем1) AS c1, + COLLATION(парам1) AS c2, + COLLATION(парам2) AS c3; + + SELECT + COLLATION('текст') AS c4, + COLLATION(_utf8 'текст') AS c5, + COLLATION(_koi8r '') AS c6, + @@collation_connection AS c7, + @@character_set_client AS c8; + + SET парам1 = 'a'; + SET парам2 = 'b'; +END| + +--echo + +# - Procedure p2 + +CREATE PROCEDURE p2( + INOUT парам1 CHAR(10) CHARACTER SET utf8, + OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN + DECLARE перем1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(перем1) AS c1, + COLLATION(парам1) AS c2, + COLLATION(парам2) AS c3; + + SELECT + COLLATION('текст') AS c4, + COLLATION(_utf8 'текст') AS c5, + COLLATION(_koi8r '') AS c6, + @@collation_connection AS c7, + @@character_set_client AS c8; + + SET парам1 = 'a'; + SET парам2 = 'b'; +END| + +--echo + +# - Procedure p3 + +CREATE PROCEDURE mysqltest2.p3( + INOUT парам1 CHAR(10), + OUT парам2 CHAR(10)) +BEGIN + DECLARE перем1 CHAR(10); + + SELECT + COLLATION(перем1) AS c1, + COLLATION(парам1) AS c2, + COLLATION(парам2) AS c3; + + SELECT + COLLATION('текст') AS c4, + COLLATION(_utf8 'текст') AS c5, + COLLATION(_koi8r '') AS c6, + @@collation_connection AS c7, + @@character_set_client AS c8; + + SET парам1 = 'a'; + SET парам2 = 'b'; +END| + +--echo + +# - Procedure p4 + +CREATE PROCEDURE mysqltest2.p4( + INOUT парам1 CHAR(10) CHARACTER SET utf8, + OUT парам2 CHAR(10) CHARACTER SET utf8) +BEGIN + DECLARE перем1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(перем1) AS c1, + COLLATION(парам1) AS c2, + COLLATION(парам2) AS c3; + + SELECT + COLLATION('текст') AS c4, + COLLATION(_utf8 'текст') AS c5, + COLLATION(_koi8r '') AS c6, + @@collation_connection AS c7, + @@character_set_client AS c8; + + SET парам1 = 'a'; + SET парам2 = 'b'; +END| + +# +# First-round checks. +# + +--source include/ddl_i18n.check_sp.inc + +# +# Change running environment (alter database character set, change session +# variables). +# + +--echo +--echo + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +# +# Second-round checks: +# + +# - Change connection to flush SP-cache; + +--connect (con2,localhost,root,,mysqltest1) +--echo +--echo ---> connection: con2 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +CALL p1(@a, @b)| +CALL p2(@a, @b)| +CALL mysqltest2.p3(@a, @b)| +CALL mysqltest2.p4(@a, @b)| + +# - Restore environment; + +set names utf8| + +# - Check! + +--source include/ddl_i18n.check_sp.inc + +# +# Check mysqldump. +# + +# - Dump mysqltest1, mysqltest2; + +--echo +--echo ---> Dump of mysqltest1 + +--exec $MYSQL_DUMP --compact --routines --databases mysqltest1 + +--echo +--echo ---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql + +--exec $MYSQL_DUMP --compact --routines --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8sp.mysqltest1.sql + +--echo +--echo ---> Dump of mysqltest2 + +--exec $MYSQL_DUMP --compact --routines --databases mysqltest2 + +--echo +--echo ---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql + +--exec $MYSQL_DUMP --compact --routines --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8sp.mysqltest2.sql + +# - Clean mysqltest1, mysqltest2; + +--echo +--echo + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +# - Restore mysqltest1; + +--echo +--echo + +--echo ---> Restoring mysqltest1... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8sp.mysqltest1.sql + +--echo ---> Restoring mysqltest2... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8sp.mysqltest2.sql + +# +# Third-round checks. +# + +# - Change connection to flush SP-cache; + +--connect (con3,localhost,root,,mysqltest1) +--echo +--echo ---> connection: con3 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +CALL p1(@a, @b)| +CALL p2(@a, @b)| +CALL mysqltest2.p3(@a, @b)| +CALL mysqltest2.p4(@a, @b)| + +# - Restore environment; + +set names utf8| + +# - Check! + +--source include/ddl_i18n.check_sp.inc + +# +# Cleanup. +# + +--connection default +--echo +--echo ---> connection: default + +--disconnect con2 +--disconnect con3 + +use test| + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +########################################################################### +# +# * Triggers. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo Triggers +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set; + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +# - Create tables for triggers; + +CREATE TABLE t1(c INT)| +CREATE TABLE mysqltest2.t1(c INT)| + +# - Create log tables; + +CREATE TABLE log(msg VARCHAR(255))| +CREATE TABLE mysqltest2.log(msg VARCHAR(255))| + + +# - Create triggers -- with and without explicit CHARSET-clause for +# SP-variable; +# + +--echo + +# - Trigger trg1 + +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN + DECLARE перем1 CHAR(10); + + INSERT INTO log VALUES(COLLATION(перем1)); + INSERT INTO log VALUES(COLLATION('текст')); + INSERT INTO log VALUES(COLLATION(_utf8 'текст')); + INSERT INTO log VALUES(COLLATION(_koi8r '')); + INSERT INTO log VALUES(@@collation_connection); + INSERT INTO log VALUES(@@character_set_client); + + SET @a1 = 'текст'; + SET @a2 = _utf8 'текст'; + SET @a3 = _koi8r ''; +END| + +--echo + +# - Trigger trg2 + +CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +BEGIN + DECLARE перем1 CHAR(10) CHARACTER SET utf8; + + INSERT INTO log VALUES(COLLATION(перем1)); + INSERT INTO log VALUES(COLLATION('текст')); + INSERT INTO log VALUES(COLLATION(_utf8 'текст')); + INSERT INTO log VALUES(COLLATION(_koi8r '')); + INSERT INTO log VALUES(@@collation_connection); + INSERT INTO log VALUES(@@character_set_client); + + SET @b1 = 'текст'; + SET @b2 = _utf8 'текст'; + SET @b3 = _koi8r ''; +END| + +--echo + +# - Trigger trg3 + +CREATE TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN + DECLARE перем1 CHAR(10); + + INSERT INTO log VALUES(COLLATION(перем1)); + INSERT INTO log VALUES(COLLATION('текст')); + INSERT INTO log VALUES(COLLATION(_utf8 'текст')); + INSERT INTO log VALUES(COLLATION(_koi8r '')); + INSERT INTO log VALUES(@@collation_connection); + INSERT INTO log VALUES(@@character_set_client); + + SET @a1 = 'текст'; + SET @a2 = _utf8 'текст'; + SET @a3 = _koi8r ''; +END| + +--echo + +# - Trigger trg4 + +CREATE TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +BEGIN + DECLARE перем1 CHAR(10) CHARACTER SET utf8; + + INSERT INTO log VALUES(COLLATION(перем1)); + INSERT INTO log VALUES(COLLATION('текст')); + INSERT INTO log VALUES(COLLATION(_utf8 'текст')); + INSERT INTO log VALUES(COLLATION(_koi8r '')); + INSERT INTO log VALUES(@@collation_connection); + INSERT INTO log VALUES(@@character_set_client); + + SET @b1 = 'текст'; + SET @b2 = _utf8 'текст'; + SET @b3 = _koi8r ''; +END| + +--echo + +# +# First-round checks. +# + +--source include/ddl_i18n.check_triggers.inc + +# +# Change running environment (alter database character set, change session +# variables). +# + +--echo +--echo + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +# +# Second-round checks: +# + +# - Flush table cache; + +ALTER TABLE t1 ADD COLUMN fake INT| +ALTER TABLE t1 DROP COLUMN fake| + +ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest2.t1 DROP COLUMN fake| + +# - Switch environment variables and initiate loading of triggers +# (connect using NULL database); + +--connect (con2,localhost,root,,) +--echo +--echo ---> connection: con2 + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +INSERT INTO mysqltest1.t1 VALUES(0)| +INSERT INTO mysqltest2.t1 VALUES(0)| + +DELETE FROM mysqltest1.log| +DELETE FROM mysqltest2.log| + +# - Restore environment; + +set names utf8| + +use mysqltest1| + +# - Check! + +--source include/ddl_i18n.check_triggers.inc + +# +# Check mysqldump. +# + +# - Dump mysqltest1, mysqltest2; + +--echo +--echo ---> Dump of mysqltest1 + +--exec $MYSQL_DUMP --compact --triggers --databases mysqltest1 + +--echo +--echo ---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql + +--exec $MYSQL_DUMP --compact --triggers --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8triggers.mysqltest1.sql + +--echo +--echo ---> Dump of mysqltest2 + +--exec $MYSQL_DUMP --compact --triggers --databases mysqltest2 + +--echo +--echo ---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql + +--exec $MYSQL_DUMP --compact --triggers --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8triggers.mysqltest2.sql + +# - Clean mysqltest1, mysqltest2; + +--echo +--echo + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +# - Restore mysqltest1; + +--echo +--echo + +--echo ---> Restoring mysqltest1... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8triggers.mysqltest1.sql + +--echo ---> Restoring mysqltest2... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8triggers.mysqltest2.sql + +# +# Third-round checks. +# + +# - Flush table cache; + +ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest1.t1 DROP COLUMN fake| + +ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT| +ALTER TABLE mysqltest2.t1 DROP COLUMN fake| + +# - Switch environment variables and initiate loading of triggers +# (connect using NULL database); + +--connect (con3,localhost,root,,) +--echo +--echo ---> connection: con3 + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +INSERT INTO mysqltest1.t1 VALUES(0)| +INSERT INTO mysqltest2.t1 VALUES(0)| + +DELETE FROM mysqltest1.log| +DELETE FROM mysqltest2.log| + +# - Restore environment; + +set names utf8| + +use mysqltest1| + +# - Check! + +--source include/ddl_i18n.check_triggers.inc + +# +# Cleanup. +# + +--connection default +--echo +--echo ---> connection: default + +--disconnect con2 +--disconnect con3 + +use test| + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +########################################################################### +# +# * Events +# +# We don't have EXECUTE EVENT so far, so this test is limited. It checks that +# event with non-latin1 symbols can be created, dumped, restored and SHOW +# statements work properly. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo Events +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +# - Create two stored routines -- with and without explicit +# CHARSET-clause for SP-variable; +# + +--echo + +# - Event ev1 + +CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN + DECLARE перем1 CHAR(10); + + SELECT + COLLATION(перем1) AS c1, + COLLATION('текст') AS c2, + COLLATION(_utf8 'текст') AS c3, + COLLATION(_koi8r '') AS c4, + @@collation_connection AS c5, + @@character_set_client AS c6; +END| + +--echo + +# - Event ev2 + +CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN + DECLARE перем1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(перем1) AS c1, + COLLATION('текст') AS c2, + COLLATION(_utf8 'текст') AS c3, + COLLATION(_koi8r '') AS c4, + @@collation_connection AS c5, + @@character_set_client AS c6; +END| + +--echo + +# - Event ev3 + +CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN + DECLARE перем1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(перем1) AS c1, + COLLATION('текст') AS c2, + COLLATION(_utf8 'текст') AS c3, + COLLATION(_koi8r '') AS c4, + @@collation_connection AS c5, + @@character_set_client AS c6; +END| + +--echo + +# - Event ev4 + +CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO +BEGIN + DECLARE перем1 CHAR(10) CHARACTER SET utf8; + + SELECT + COLLATION(перем1) AS c1, + COLLATION('текст') AS c2, + COLLATION(_utf8 'текст') AS c3, + COLLATION(_koi8r '') AS c4, + @@collation_connection AS c5, + @@character_set_client AS c6; +END| + +--echo + + +# +# First-round checks. +# + +--source include/ddl_i18n.check_events.inc + +# +# Change running environment (alter database character set, change session +# variables). +# + +--echo +--echo + +ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| +ALTER DATABASE mysqltest2 COLLATE cp866_general_ci| + +# +# Second-round checks: +# + +# - Change connection to flush cache; + +--connect (con2,localhost,root,,mysqltest1) +--echo +--echo ---> connection: con2 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +--disable_result_log +SHOW CREATE EVENT ev1| +SHOW CREATE EVENT ev2| +SHOW CREATE EVENT mysqltest2.ev3| +SHOW CREATE EVENT mysqltest2.ev4| +--enable_result_log + +# - Restore environment; + +set names utf8| + +# - Check! + +--source include/ddl_i18n.check_events.inc + +# +# Check mysqldump. +# + +# - Dump mysqltest1, mysqltest2; + +--echo +--echo ---> Dump of mysqltest1 + +--exec $MYSQL_DUMP --compact --events --databases mysqltest1 + +--echo +--echo ---> Dumping mysqltest1 to ddl_i18n_utf8events.mysqltest1.sql + +--exec $MYSQL_DUMP --compact --events --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8events.mysqltest1.sql + +--echo +--echo ---> Dump of mysqltest2 + +--exec $MYSQL_DUMP --compact --events --databases mysqltest2 + +--echo +--echo ---> Dumping mysqltest2 to ddl_i18n_utf8events.mysqltest2.sql + +--exec $MYSQL_DUMP --compact --events --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8events.mysqltest2.sql + +# - Clean mysqltest1, mysqltest2; + +--echo +--echo + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| + +# - Restore mysqltest1; + +--echo +--echo + +--echo ---> Restoring mysqltest1... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8events.mysqltest1.sql + +--echo ---> Restoring mysqltest2... +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8events.mysqltest2.sql + +# +# Third-round checks. +# + +# - Change connection to flush cache; + +--connect (con3,localhost,root,,mysqltest1) +--echo +--echo ---> connection: con3 + +# - Switch environment variables and trigger loading stored procedures; + +SET @@character_set_client= cp1251| +SET @@character_set_results= cp1251| +SET @@collation_connection= cp1251_general_ci| + +--disable_result_log +SHOW CREATE EVENT ev1| +SHOW CREATE EVENT ev2| +SHOW CREATE EVENT mysqltest2.ev3| +SHOW CREATE EVENT mysqltest2.ev4| +--enable_result_log + +# - Restore environment; + +set names utf8| + +# - Check! + +--source include/ddl_i18n.check_events.inc + +########################################################################### +# +# * DDL statements inside stored routine. +# +# Here we check that DDL statements use actual database collation even if they +# are called from stored routine. +# +########################################################################### + +--echo +--echo ------------------------------------------------------------------- +--echo DDL statements within stored routine. +--echo ------------------------------------------------------------------- +--echo + +# +# Preparation: +# + +# - Create database with fixed, pre-defined character set. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| + +use mysqltest1| + +# - Create procedures; + +--echo + +CREATE PROCEDURE p1() +BEGIN + CREATE TABLE t1(col1 VARCHAR(10)); + SHOW CREATE TABLE t1; +END| + +--echo + +CREATE PROCEDURE mysqltest2.p2() +BEGIN + CREATE TABLE t2(col1 VARCHAR(10)); + SHOW CREATE TABLE t2; +END| + +--echo + +# +# First-round checks. +# + +CALL p1()| + +--echo + +SHOW CREATE TABLE t1| + +--echo +--echo + +CALL mysqltest2.p2()| + +--echo + +SHOW CREATE TABLE mysqltest2.t2| + +# +# Alter database. +# + +--echo + +ALTER DATABASE mysqltest1 COLLATE cp1251_general_cs| +ALTER DATABASE mysqltest2 COLLATE cp1251_general_cs| + +DROP TABLE t1| +DROP TABLE mysqltest2.t2| + +--echo + +# +# Second-round checks. +# + +CALL p1()| + +--echo + +SHOW CREATE TABLE t1| + +--echo +--echo + +CALL mysqltest2.p2()| + +--echo + +SHOW CREATE TABLE mysqltest2.t2| + +########################################################################### +# +# That's it. +# +########################################################################### + +# +# Cleanup. +# + +--connection default +--echo +--echo ---> connection: default + +--disconnect con2 +--disconnect con3 + +use test| + +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index dcb591352a8..d7232705b81 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -185,7 +185,30 @@ set names cp1251; create event 21 on schedule every '50:23:59:95' day_second COMMENT ' 1251 ' do select 1; --replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT 21; -insert into mysql.event (db, name, body, definer, interval_value, interval_field, originator) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND", 1); +insert into mysql.event ( + db, + name, + body, + definer, + interval_value, + interval_field, + originator, + character_set_client, + collation_connection, + db_collation, + body_utf8) +values ( + database(), + "root22", + "select 1", + user(), + 100, + "SECOND_MICROSECOND", + 1, + 'utf8', + 'utf8_general_ci', + 'utf8_general_ci', + 'select 1'); --error ER_NOT_SUPPORTED_YET show create event root22; --error ER_NOT_SUPPORTED_YET diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 755419cbf52..9babeddbae2 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -825,7 +825,7 @@ drop table t1; use mysql; INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL', 'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03', -'2006-03-02 18:40:03','',''); +'2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a'); select routine_name from information_schema.routines; delete from proc where name=''; use test; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index af2c044ee10..bca2ce7101a 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -599,4 +599,55 @@ set names latin1; --error ER_NO_SUCH_TABLE,ER_FILE_NOT_FOUND show columns from `#mysql50#????????`; +# +# SHOW CREATE TRIGGER test. +# + +# Prepare. + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP PROCEDURE IF EXISTS p1; +--enable_warnings + +CREATE TABLE t1(c1 INT); + +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1; + +# Test. + +SHOW CREATE TRIGGER t1_bi; + +CREATE PROCEDURE p1() SHOW CREATE TRIGGER t1_bi; + +CALL p1(); +CALL p1(); +CALL p1(); +CALL p1(); +CALL p1(); +CALL p1(); +CALL p1(); +CALL p1(); +CALL p1(); +CALL p1(); + +PREPARE stmt1 FROM 'SHOW CREATE TRIGGER t1_bi'; + +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; + +# Cleanup. + +DROP TABLE t1; +DROP PROCEDURE p1; +DEALLOCATE PREPARE stmt1; + --echo End of 5.1 tests diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index df07091d2de..04a581ab45f 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -94,26 +94,33 @@ insert into mysql.proc ( db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, - sql_mode, comment + sql_mode, comment, character_set_client, collation_connection, db_collation, + body_utf8 ) values ( 'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'select count(*) from mysql.user', - 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' + 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '', + '', '', '', + 'select count(*) from mysql.user' ), ( 'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'begin declare x int; select count(*) into x from mysql.user; end', - 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' + 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '', + '', '', '', + 'begin declare x int; select count(*) into x from mysql.user; end' ), ( 'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO', 'DEFINER', '', '', 'alksj wpsj sa ^#!@ ', - 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' + 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '', + '', '', '', + 'alksj wpsj sa ^#!@ ' ); --error ER_SP_PROC_TABLE_CORRUPT diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 29e759d7881..f5bad05a40a 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6331,7 +6331,7 @@ set names utf8| drop database if exists това_е_дълго_име_за_база_данни_нали| --enable_warnings create database това_е_дълго_име_за_база_данни_нали| -INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','')| +INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','', 'utf8', 'utf8_general_ci', 'utf8_general_ci', 'n/a')| --error ER_SP_PROC_TABLE_CORRUPT call това_е_дълго_име_за_база_данни_нали.това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго()| drop database това_е_дълго_име_за_база_данни_нали| diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index c441c7b5efc..ee807a1ae25 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -752,6 +752,11 @@ drop view v1; # # VIEWs with national characters # + +SET @old_cs_client = @@character_set_client; +SET @old_cs_results = @@character_set_results; +SET @old_cs_connection = @@character_set_connection; + set names utf8; create table tü (cü char); create view vü as select cü from tü; @@ -759,7 +764,10 @@ insert into vü values ('ü'); select * from vü; drop view vü; drop table tü; -set names latin1; + +SET character_set_client = @old_cs_client; +SET character_set_results = @old_cs_results; +SET character_set_connection = @old_cs_connection; # # problem with used_tables() of outer reference resolved in VIEW |