SHOW CREATE TRIGGER shows mysql error 1064 on mySQL 5.0.51

[expired user #8405]'s profile image [expired user #8405] posted 10 years ago in General Permalink
Hello,

the HeidiSQL 8.3.0.4840 try to send

--- snip ---
SHOW TRIGGERS FROM `<database>`;
SHOW CREATE TRIGGER `<database>`.`<trigger>`;
--- snip ---

for geting a trigger code.

At mySQL version 5.0.51 the SHOW CREATE TRIGGER command isn't supported. So a mysql error 1064 is generated. All works, but the message:

--- snip ---
/* SQL Fehler (1064): 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 'TRIGGER `<datebase>`.`<trigger>`' at line 1 */
--- snip ---

is displayed in the command window. This error is repeated every trigger i try to view. If you know, this mysql server version didn't understand this command, you can skip it in the next time!

Martin
ansgar's profile image ansgar posted 10 years ago Permalink
That's a newly introduced bug. See this thread for the reason.

http://dev.mysql.com/doc/refman/5.1/en/show-create-trigger.html :

SHOW CREATE TRIGGER was added in MySQL 5.1.21.



I will add a version conditional here.
Code modification/commit from ansgar.becker, 10 years ago, revision 8.3.0.4842
Keep compatibility with older MySQL servers when getting a trigger's CREATE CODE. See here: http://www.heidisql.com/forum.php?t=16662
ansgar's profile image ansgar posted 10 years ago Permalink
Done in r4842
[expired user #10665]'s profile image [expired user #10665] posted 7 years ago Permalink

Hello,

This bug still exists (9.4.0.5169)

I have MySQL v5.7 installed locally, and routinely connect to an old system with v5.0 installed. Every query autocomplete tentative results in a unhandeled exception being thrown due to the SHOW CREATE TRIGGER command.

Regards,

nostra

Please login to leave a reply, or register at first.