question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CREATE TRIGGER bugged?

See original GitHub issue

I tried to run this query with MariaDB engine:

DELIMITER $$
CREATE TRIGGER bla BEFORE INSERT ON buerger_status
FOR EACH ROW
BEGIN
    IF (new.id = 1) THEN
        SIGNAL SQLSTATE 'bla' SET MESSAGE_TEXT = 'message', MYSQL_ERRNO = 1000;
    END IF;
END;$$
DELIMITER ;

This doesn’t work and reports:

SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '$$' at line 1

Generally I have some troubles with TRIGGERS and DBeaver (sometimes unreproducable 😦!).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
serge-ridercommented, Oct 20, 2016

Yep, you need ALT+X if you going to execute multiple queries. Let’s track scripts processing bugs in other issues.

1reaction
GiantCrocodilecommented, Oct 20, 2016

It does work in console and also in DBeaver with ALT + X. It doesn’t work with CTRL + ENTER, it causes weird behaviour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix this bug when creating this trigger in MySQL? [closed]
I created two triggers that are almost the same. The triggers look like this: Trigger 1 delimiter !! drop trigger if exists updated_movie ......
Read more >
39489: Cannot create or drop triggers without SUPER privilege
Bug #39489, Cannot create or drop triggers without SUPER privilege ... 1) "CREATE TRIGGER requires the TRIGGER privilege for the table ...
Read more >
If Your Trigger Uses UPDATE(), It's Probably Broken.
CREATE OR ALTER TRIGGER dbo.ResetReputation ON dbo.Users AFTER INSERT, UPDATE AS BEGIN /* If they moved locations, reset their reputation.
Read more >
Database triggers not working - DEV Community ‍ ‍
CREATE OR REPLACE FUNCTION update_vote_count() RETURNS trigger LANGUAGE ... The problem is that, this function is not triggering and I don't ...
Read more >
Trigger not working, why? [closed]
First let's create the tables and the triggers: MySQL 5.5.32 Schema Setup: CREATE TABLE bookings(id INT, articlenr INT, amount ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found