Skip Menu |

This queue is for tickets about the Catalyst-Plugin-AutoCRUD CPAN distribution.

Report information
The Basics
Id: 46121
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-AutoCRUD

People
Owner: Nobody in particular
Requestors: dluke [...] geeklair.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.44
Fixed in: (no value)



Subject: Invalid SQL being generated
Most of my tables have an integer primary key, Catalyst::Plugin::AutoCRUD is attempting to pull individual values to populate the autogenerated tables with SQL that has: ( LOWER(me.foo_id) = LOWER(?) ) Of course, LOWER() doesn't make sense when operating on an integer, and Postgres complains: [error] FooDB::Foo::item(): DBI Exception: DBD::Pg::st execute failed: ERROR: function lower(integer) does not exist This may be a change in postgres as of 8.3 (as some string functions accepted non-string data types in past versions if they could be stringified). In postgres, this can be worked around by restoring (some of) the old behavior: CREATE FUNCTION text_to_int(TEXT) RETURNS INT4 AS ' SELECT int4in(textout($1)); ' LANGUAGE SQL STRICT IMMUTABLE; CREATE CAST (TEXT AS INT4) WITH FUNCTION text_to_int(TEXT) AS IMPLICIT;
Hi, On Fr. 15. Mai 2009, 12:32:05, dluke@geeklair.net wrote: Show quoted text
> ( LOWER(me.foo_id) = LOWER(?) )
this is really an issue as this bug makes AutoCRUD not usable on PostgreSQL systems. Show quoted text
> In postgres, this can be worked around by restoring (some of) the old > behavior: > > CREATE FUNCTION text_to_int(TEXT) RETURNS INT4 AS ' > SELECT int4in(textout($1)); > ' LANGUAGE SQL STRICT IMMUTABLE; > CREATE CAST (TEXT AS INT4) > WITH FUNCTION text_to_int(TEXT) > AS IMPLICIT;
This is not a real solution because sometimes I don't have direct access to the database system. Will there be a bugfix sometime or should this be a DBIC bug?
On Do. 20. Aug. 2009, 18:27:39, MDIETRICH wrote: Show quoted text
> This is not a real solution because sometimes I don't have direct access > to the database system.
Beside of that, the proposed workaround doesn't work for me on PostgreSQL 8.3?!
Just today I finished the implementation of a fix for this, so I hope to make a new release tomorrow.
On Fri May 15 12:32:05 2009, dluke@geeklair.net wrote: Show quoted text
> Of course, LOWER() doesn't make sense when operating on an integer, > and Postgres complains
Thanks for reporting this bug. I've included a fix for it in a new release of Catalyst::Plugin::AutoCRUD, version 0.47, which is now on CPAN. Please let me know if you have any further issues. regards, oliver.
On So. 23. Aug. 2009, 17:12:34, OLIVER wrote: Show quoted text
> Please let me know if you have any further issues.
Thanks for your new release, it seems to work now! Great work :-)!
Erm, sorry for reopening this ticket -- I thought I'd selected "closed"; cannot close the ticket again (access denied).
On Mon Aug 24 16:42:41 2009, MDIETRICH wrote: Show quoted text
> On So. 23. Aug. 2009, 17:12:34, OLIVER wrote:
> > Please let me know if you have any further issues.
> > Thanks for your new release, it seems to work now! Great work :-)!
That's good to hear :-) If you continue to find the module useful, I'd be grateful if you'd consider rating it: http://cpanratings.perl.org/rate/?distribution=Catalyst-Plugin-AutoCRUD p.s. don't worry about opening the ticket, yes it's normal for the rt.cpan installation of RT. -- regards, oliver.