Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dancer-Plugin-Database CPAN distribution.

Report information
The Basics
Id: 65651
Status: resolved
Priority: 0/
Queue: Dancer-Plugin-Database

People
Owner: Nobody in particular
Requestors: ms [...] 2scale.net
Cc:
AdminCc:

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



Subject: Possible bug in Dancer::Plugin::Database::Handler _quick_query
Date: Fri, 11 Feb 2011 20:17:43 +0100
To: bug-Dancer-Plugin-Database [...] rt.cpan.org
From: Michael Stiller <ms [...] 2scale.net>
Hi there, i guess i may have found a bug in Dancer::Plugin::Database, or rather in Dancer::Plugin::Database::Handle. I run Dancer::Plugin::Database::Handle VERSION 0.02 on OS X 10.6.6 utilizing mysql 5.1.54 using the following config: plugins: Database: driver: 'mysql' database: 'tcsuite' host: 'localhost' username: 'tcuser' password: ******** connection_check_threshold: 10 dbi_params: RaiseError: 1 AutoCommit: 1 on_connect_do: ["SET NAMES 'utf8'", "SET CHARACTER SET 'utf8'" ] The error in question is: 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 ''email','password','first','last','username') VALUES ('ms@2scale.net','whatever'' at line 1 at /Users/ms/perl5/lib/perl5/Dancer/Plugin/Database/Handle.pm line 150. /Users/ms/perl5/lib/perl5/Dancer/Plugin/Database/Handle.pm around line 150 147 Dancer::Logger::debug( 148 "Executing query $sql with params " . join ',', @bind_params 149 ); 150 return $self->do($sql, undef, @bind_params); 151 } 152 153 The problem may be fixed by the following patch: --- Handle.pm 2011-02-11 20:13:48.000000000 +0100 +++ Handle.pm.patched 2011-02-11 20:13:32.000000000 +0100 @@ -128,7 +128,7 @@ }->{$type}; if ($type eq 'INSERT') { $sql .= "(" - . join(',', map { $self->quote($_) } keys %$data) + . join(',', map { $self->quote_identifier($_) } keys %$data) . ") VALUES (" . join(',', map { "?" } values %$data) . ")"; Cheers, Michael -- 2scale GmbH, Karlstr. 88, 40210 Düsseldorf Amtsgericht: Düsseldorf HRB 50718 Geschäftsführer: Georg von Zezschwitz, Dirk Vleugels USt-IdNr.: DE 210936505
Hi Michael, Many thanks for taking the time to submit a detailed and helpful bug report, along with a patch - greatly appreciated! This same problem was also reported by another user, seeing similar problems with Postgres - the fix is indeed exactly as indicated in your patch. I'll be releasing a fixed version later tonight incorporating this fix. The fix has just been pushed in the following commit: https://github.com/bigpresh/Dancer-Plugin-Database/commit/e6d2ed3e7352f7f8ea26b82f7e47141222a65201 Thanks for taking the time to provide such a helpful report, and sorry for the bug! The new version will also include a quick_select() function - it seemed a bit of an omission to have quick_{insert,update,delete} but not quick_select :) Cheers David P
Version 1.10 incorporating this fix has just been uploaded to CPAN :)
Subject: Re: [rt.cpan.org #65651] Possible bug in Dancer::Plugin::Database::Handler _quick_query
Date: Sat, 12 Feb 2011 00:33:50 +0100
To: bug-Dancer-Plugin-Database [...] rt.cpan.org
From: Michael Stiller <ms [...] 2scale.net>
Thanks for the quick new release. -Michael Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=65651 > > > Version 1.10 incorporating this fix has just been uploaded to CPAN :)
-- 2scale GmbH, Karlstr. 88, 40210 Düsseldorf Amtsgericht: Düsseldorf HRB 50718 Geschäftsführer: Georg von Zezschwitz, Dirk Vleugels USt-IdNr.: DE 210936505