Skip to content

empty body for triggers #2577

Description

@dsan0815

Description

Since a few updates to HeidiSQL (currently using version 12.21), some of my triggers are no longer displayed; more precisely, they have an empty body.

Log msg: /* Result from previous query does not contain expected pattern: (\sDEFINER=(["]?[^"]+[`"]..........

The beginning of the CREATE TRIGGER statement:

[Trigger is displayed -> image "trigger_OK"]
CREATE DEFINER=root@localhost TRIGGER items_a_AFTER_INSERT AFTER INSERT ON items_a FOR EACH ROW BEGIN ..... (one line no line breaks)

[Trigger is not displayed -> image "trigger_empty"]
CREATE DEFINER=daniel@% TRIGGER items_a4_BEFORE_INSERT
BEFORE INSERT ON items_a
FOR EACH
ROW BEGIN
..... (line breaks before AFTER, FOR, BEGIN)

Is this a bug? Does this have anything to do with line breaks?

My current thought:
/* Result from previous query does not contain expected pattern: (\sDEFINER=(["]?[^"]+["]?@["]?[^`"]+[`"]?))?\s+TRIGGER\s+(IF\s+NOT\s+EXISTS\s+)?["]?[^"]+["]?\s+(BEFORE|AFTER)\s+(INSERT|UPDATE|DELETE)\s+ON\s+(["]?[^`"]+[`"]?)\s+FOR\s+EACH\s+ROW\s+(.+)$ */

FOR\s+EACH\s+ROW\s+(.+)$ -->> "(.+)" the dot suppress line-breaks (?)

Normally I write my trigger in as a raw string in notepad or HeidiSQL, the statements with line breaks comes from my Backup-Tool (is a easy trigger export with MySqlBackup.NET (nuget, C#))

trigger_empty:
Image
trigger_OK
Image

HeidiSQL version and OS

12.21 Windows

Database server version

MariaDB 10.11.

Reproduction recipe

trigger OK, run:
CREATE DEFINER=root@localhost TRIGGER items_a_AFTER_INSERT AFTER INSERT ON items_a FOR EACH ROW BEGIN
declare v0, v00 int;
........

trigger empty, run:
CREATE DEFINER=daniel TRIGGER items_a4_BEFORE_INSERT
BEFORE INSERT ON items_a
FOR EACH
ROW BEGIN
DECLARE v1,v2 varchar(45);
......

Error/Backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefective behaviour in HeidiSQL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions