Bug #23622 mysqldump/mysql do not dump/show triggers with cp1251 chars
| Submitted: | 25 Oct 2006 11:24 | Modified: | 23 Jan 2007 12:57 |
|---|---|---|---|
| Reporter: | Igor Jakuszewski | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 5.0.26, 5.0.24a, 5.1 BK | OS: | Linux (Linux, Windows) |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
| Tags: | triggers | ||
[26 Oct 2006 11:28]
Sveta Smirnova
Thank you for the report. Verified as described on Linux using last BK sources. Version 5.1 is affected too. Simpliest test: drop database if exists bug23622; create database bug23622; use bug23622; create table bug23622(id int) default character set=cp1251; delimiter | create trigger bug23622_bi before insert on bug23622 for each row begin select 'тест' into @a; end| delimiter ;
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: When triggers contain string literals in cp1251 encoding, then mysqldump in its output skips the commands of the trigger from the first cp1251 character till the end of the trigger. The same is true for mysql command-line client and for the GUI Query Browser when executing SHOW TRIGGERS command. How to repeat: Create any trigger with cp1251 strings, e.g.: SET NAMES cp1251; DELIMITER // CREATE TRIGGER trans_after_upd AFTER UPDATE ON zip.trans FOR EACH ROW BEGIN DECLARE a INTEGER DEFAULT 0; DECLARE m VARCHAR(500) DEFAULT ''; SELECT auto INTO a FROM transtype tt WHERE tt.transclass=NEW.transclass AND tt.transtype=NEW.transtype; IF a=1 THEN CALL calc_ledger(NEW.transid); END IF; IF NEW.transclass<>OLD.transclass THEN SET m=m||_cp1251'класс '; END IF; IF NEW.transtype <>OLD.transtype THEN SET m=m||_cp1251'тип '; END IF; IF NEW.transdate <>OLD.transdate THEN SET m=m||_cp1251'дата '; END IF; IF NEW.amount <>OLD.amount THEN SET m=m||_cp1251'сумма '; END IF; IF NEW.amount2 <>OLD.amount2 THEN SET m=m||_cp1251'себест. '; END IF; IF NEW.amount_usd<>OLD.amount_usd THEN SET m=m||_cp1251'суммаUSD '; END IF; IF NEW.amount_eur<>OLD.amount_eur THEN SET m=m||_cp1251'суммаEUR '; END IF; IF NEW.cash <>OLD.cash THEN SET m=m||_cp1251'оплата '; END IF; IF NEW.status_id <>OLD.status_id THEN SET m=m||_cp1251'стадия '; END IF; IF NEW.fromplace <>OLD.fromplace THEN SET m=m||_cp1251'откуда '; END IF; IF NEW.toplace <>OLD.toplace THEN SET m=m||_cp1251'куда '; END IF; IF IFNULL(NEW.c_id,'') <>IFNULL(OLD.c_id,'') THEN SET m=m||_cp1251'контакт '; END IF; IF IFNULL(NEW.ord_id,'')<>IFNULL(OLD.ord_id,'') THEN SET m=m||_cp1251'заказ '; END IF; INSERT INTO upd_log(table_name, table_key, upd_type, emp_id, descr) VALUES('t', NEW.transid, '=', USER(), m); END;// DELIMITER ; This trigger is successfully created and works, but is shown/dumped only until the beginnig of the word "класс".