Skip Menu |

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

Report information
The Basics
Id: 83831
Status: resolved
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: JDS [...] cpan.org
Cc: josediazseng [...] gmx.de
AdminCc:

Bug Information
Severity: Important
Broken in: 0.11016
Fixed in: (no value)



CC: josediazseng [...] gmx.de
Subject: SQLite parser does not handle multi-word ON DELETE/UPDATE actions
I was playing around with sqlt-graph to generate a graph based on the DBICTest schema included in the DBIx::Class distribution 0.08209. The source SQL script for SQLite had been written by create_ddl_dir. The SQL script contains "ON DELETE SET NULL" actions, which SQL::Translator::Parser::SQLite cannot handle since it expects ON DELETE and ON UPDATE actions specified by a single word. So, for SQLite the actions "RESTRICT" AND "CASCADE" are parsed correctly, but not "NO ACTION", "SET NULL" and "SET DEFAULT".
I would fix it by not using (\w+) when parsing, but explicit ((NO ACTION|RESTRICT|...)) instead. I can submit a patch if you like.
Subject: Re: [rt.cpan.org #83831] SQLite parser does not handle multi-word ON DELETE/UPDATE actions
Date: Sat, 9 Mar 2013 02:31:00 +1100
To: José Diaz Seng via RT <bug-SQL-Translator [...] rt.cpan.org>
From: Peter Rabbitson <ribasushi [...] cpan.org>
On Fri, Mar 08, 2013 at 10:27:12AM -0500, José Diaz Seng via RT wrote: Show quoted text
> Queue: SQL-Translator > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83831 > > > I would fix it by not using (\w+) when parsing, but explicit ((NO > ACTION|RESTRICT|...)) instead. I can submit a patch if you like.
Yes please. Patch/pull-req/whatever.
RT-Send-CC: ribasushi [...] cpan.org
I did a pull request (https://github.com/dbsrgits/sql-translator/pull/27), but had overlooked another pull request with the same content (and tests / more comments!) existed. The other pull request has been accepted ( https://github.com/dbsrgits/sql-translator/pull/21), so the current bug has been fixed.