Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to execute SQL for trigger definitions in DibiConnection::loadFile without SQL errors #119

Closed
wants to merge 1 commit into from

Conversation

dasim
Copy link

@dasim dasim commented Jan 3, 2014

For example, if you have trigger in myslqdump’s generated SQL file, it might look similar to this:

DELIMITER ;;
    /*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `after_insert_table_a`
    AFTER INSERT ON `table_a` FOR EACH ROW
        BEGIN
            UPDATE `table_b` SET
            `column_a` = 0
            WHERE `column_b` = 0 AND `id` = NEW.`table_b_id`; 
        END */;;
DELIMITER ;

When loading file with such part, you get some kind of You have an error in your SQL syntax exception.

Change in attached commit takes anything between DELIMITER statements and executes it at once which works fine (mentioned in dibi forum).

@Majkl578
Copy link

Majkl578 commented Jan 3, 2014

We were already solving this in userland, see here.

@dg dg closed this in 738c0c9 Feb 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants