Commit 69693c26 authored by Alexander Nozdrin's avatar Alexander Nozdrin

A patch for Bug#48874 (Test "is_triggers" fails because of wrong charset info).

The thing is that the following attributes are fixed (remembered) when a trigger
is created:
  - character_set_client
  - character_set_results
  - collation_connection

There are two triggers created in mysql-test/include/mtr_warnings.sql.
They were created using "current default" character set / collation.
is_triggers.test shows definition of these triggers including recorded
character set information.

The problem was that if "current default" changed, the recorded character
set information was not accurate.

There might be two ways to fix that:
  a) update is_triggers.test so that it does not put character-set information
     into result-file;
  b) update mtr_warnings.sql so that the triggers are created using
     hard-coded character sets.

This patch implements option b).
parent 7d64c364
......@@ -16,6 +16,12 @@ CREATE TABLE test_suppressions (
-- no invalid patterns can be inserted
-- into test_suppressions
--
SET @character_set_client_saved = @@character_set_client||
SET @character_set_results_saved = @@character_set_results||
SET @collation_connection_saved = @@collation_connection||
SET @@character_set_client = latin1||
SET @@character_set_results = latin1||
SET @@collation_connection = latin1_swedish_ci||
/*!50002
CREATE DEFINER=root@localhost TRIGGER ts_insert
BEFORE INSERT ON test_suppressions
......@@ -24,6 +30,9 @@ FOR EACH ROW BEGIN
SELECT "" REGEXP NEW.pattern INTO dummy;
END
*/||
SET @@character_set_client = @character_set_client_saved||
SET @@character_set_results = @character_set_results_saved||
SET @@collation_connection = @collation_connection_saved||
--
......@@ -38,6 +47,12 @@ CREATE TABLE global_suppressions (
-- no invalid patterns can be inserted
-- into global_suppressions
--
SET @character_set_client_saved = @@character_set_client||
SET @character_set_results_saved = @@character_set_results||
SET @collation_connection_saved = @@collation_connection||
SET @@character_set_client = latin1||
SET @@character_set_results = latin1||
SET @@collation_connection = latin1_swedish_ci||
/*!50002
CREATE DEFINER=root@localhost TRIGGER gs_insert
BEFORE INSERT ON global_suppressions
......@@ -46,6 +61,9 @@ FOR EACH ROW BEGIN
SELECT "" REGEXP NEW.pattern INTO dummy;
END
*/||
SET @@character_set_client = @character_set_client_saved||
SET @@character_set_results = @character_set_results_saved||
SET @@collation_connection = @collation_connection_saved||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment