Skip Menu |

This queue is for tickets about the SQL-SplitStatement CPAN distribution.

Report information
The Basics
Id: 60401
Status: resolved
Priority: 0/
Queue: SQL-SplitStatement

People
Owner: Nobody in particular
Requestors: ed.shrock [...] livetext.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05003
Fixed in: 0.10000



Subject: MySQL Delimiter statement not recognized
I'm using DBIx::MultiStatementDo which utilizes the subject module to split the SQL statements. Consider this MySQL: DROP TRIGGER IF EXISTS user_change_password; delimiter // CREATE TRIGGER user_change_password AFTER UPDATE ON user FOR EACH ROW my_block: BEGIN IF NEW.password != OLD.password THEN UPDATE user_authentication_results AS uar SET password_changed = 1 WHERE uar.user_id = NEW.user_id; END IF; END my_block; // delimiter ; The "delimiter" statement is used to allow redefining the usual delimiter (;) temporarily while defining stored procedures and triggers. Unfortunately, the module does not recognize this statement, giving this error: DBD::mysql::db do failed: 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 'delimiter' at line 1 [for Statement "delimiter"] at /usr/local/share/perl/5.8.8/DBIx/MultiStatementDo.pm line 91, <$fh> line 1.
Subject: Re: [rt.cpan.org #60401] MySQL Delimiter statement not recognized
Date: Thu, 19 Aug 2010 16:32:00 +0200
To: bug-SQL-SplitStatement [...] rt.cpan.org
From: Emanuele Zeppieri <emazep [...] cpan.org>
Thank you for your bug report and the included test case. I'll try to solve this in the next SQL::SplitStatement release, which should hit CPAN the next week. Cheers -Emanuele On Mon, Aug 16, 2010 at 10:37 PM, Ed Shrock via RT <bug-SQL-SplitStatement@rt.cpan.org> wrote: Show quoted text
> Mon Aug 16 16:37:39 2010: Request 60401 was acted upon. > Transaction: Ticket created by edshrock >       Queue: SQL-SplitStatement >     Subject: MySQL Delimiter statement not recognized >   Broken in: 0.05003 >    Severity: Important >       Owner: Nobody >  Requestors: ed.shrock@livetext.com >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=60401 > > > > I'm using DBIx::MultiStatementDo which utilizes the subject module to > split the SQL statements. > > Consider this MySQL: > > DROP TRIGGER IF EXISTS user_change_password; > delimiter // > CREATE TRIGGER user_change_password AFTER UPDATE ON user >  FOR EACH ROW my_block: BEGIN >    IF NEW.password != OLD.password THEN >      UPDATE user_authentication_results AS uar >        SET password_changed = 1 >        WHERE uar.user_id = NEW.user_id; >    END IF; >  END my_block; // > delimiter ; > > > The "delimiter" statement is used to allow redefining the usual > delimiter (;) temporarily while defining stored procedures and triggers. > > Unfortunately, the module does not recognize this statement, giving this > error: > > DBD::mysql::db do failed: 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 'delimiter' at line 1 [for Statement "delimiter"] at > /usr/local/share/perl/5.8.8/DBIx/MultiStatementDo.pm line 91, <$fh> line 1.
This has been solved in v0.10000, now present on CPAN. Sorry for my late and thanks again! -Emanuele