Skip Menu |

This queue is for tickets about the DBD-AnyData CPAN distribution.

Report information
The Basics
Id: 63322
Status: open
Priority: 0/
Queue: DBD-AnyData

People
Owner: Nobody in particular
Requestors: dodger [...] burnet.ru
Cc:
AdminCc:

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



Subject: two hyphens in VALUES item results in "Mismatched single quote before"
Date: Thu, 25 Nov 2010 09:59:02 +0800
To: bug-DBD-AnyData [...] rt.cpan.org
From: "Anthony G. Nickolayev" <dodger [...] burnet.ru>
Hi! This simple script: ---------------------------------------------- #!/usr/bin/perl -w use DBI; my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); $dbh->func ( 'msg_list', 'ARRAY', ( [ 'id' ] ), 'ad_import' ); $dbh->do("INSERT INTO msg_list (id) VALUES ('--');"); ----------------------------------------------- Has caused an error: ----------------------------------------------- Mismatched single quote before: 'INSERT INTO msg_list (id) VALUES ('' at /usr/local/lib/perl5/site_perl/5.8.8/SQL/Statement.pm line 86 DBD::AnyData::db do failed: Mismatched single quote before: 'INSERT INTO msg_list (id) VALUES ('' at /usr/local/lib/perl5/site_perl/5.8.8/SQL/Statement.pm line 86 [for Statement "INSERT INTO msg_list (id) VALUES ('--');"] at ./test.pl line 18. --------------------------------------- Modules: * AnyData-0.10 * DBD-AnyData-0.110 * DBI-1.615 * SQL-Statement-1.31 OS: FreeBSD 8.0-RELEASE #0 ---- -- Anthony G. Nickolayev telematic services engineer JSC "AC Mobiltelecom" +7-(3012)-29-70-21 dodger@burnet.ru
Hi Anthony, you're error exists, because you try to search for "SQL comment begin" ('--'). SQL::Parser don't parse this correctly. If you need it, please use placeholders. I do not plan to fix this behavior very soon (see https://rt.cpan.org/Ticket/Display.html? id=55190 and http://search.cpan.org/dist/SQL- Statement/lib/SQL/Statement.pm#SUPPORT). Jens
Subject: Re: [rt.cpan.org #63322] two hyphens in VALUES item results in "Mismatched single quote before"
Date: Fri, 26 Nov 2010 16:14:35 +0800
To: bug-DBD-AnyData [...] rt.cpan.org
From: "Anthony G. Nickolayev" <dodger [...] burnet.ru>
Hi, Jens! Thank you very much. I would never find this myself :) Could you be more specificly about placeholders? How exactly can i use it in this case? We have a problem with this, because some of our customers use russian punnycode converted domain names, for example: xn--90aoxid7ec. For now i workaround it by replacing any number of hyphens with a single one, but it is not a solution at all. On Thu, 25 Nov 2010 03:10:58 -0500 "Jens Rehsack via RT" <bug-DBD-AnyData@rt.cpan.org> wrote: Show quoted text
Show quoted text
> you're error exists, because you try to search for "SQL comment begin" ('--'). > SQL::Parser don't parse this correctly. If you need it, please use placeholders. > > I do not plan to fix this behavior very soon (see https://rt.cpan.org/Ticket/Display.html? > id=55190 and http://search.cpan.org/dist/SQL- > Statement/lib/SQL/Statement.pm#SUPPORT).
---- -- Anthony G. Nickolayev telematic services engineer JSC "AC Mobiltelecom" +7-(3012)-29-70-21 dodger@burnet.ru
On Fri Nov 26 03:13:08 2010, dodger@burnet.ru wrote: Show quoted text
> Hi, Jens! > > Thank you very much. I would never find this myself :)
Than probably read http://www.catb.org/~esr/faqs/smart-questions.html :) Show quoted text
> Could you be more specificly about placeholders? How exactly can i use > it in this case?
http://search.cpan.org/dist/DBI/DBI.pm#Placeholders_and_Bind_Values Show quoted text
> We have a problem with this, because some of our customers use russian > punnycode > converted domain names, for example: xn--90aoxid7ec. For now i > workaround it by > replacing any number of hyphens with a single one, but it is not a > solution at all.
Placeholders is one of the major benefits of DBI. I strongly suggest reading DBI documentation (better twice or three times ^^). Jens Show quoted text
> On Thu, 25 Nov 2010 03:10:58 -0500 > "Jens Rehsack via RT" <bug-DBD-AnyData@rt.cpan.org> wrote: > >
> > you're error exists, because you try to search for "SQL comment
> begin" ('--').
> > SQL::Parser don't parse this correctly. If you need it, please use
> placeholders.
> > > > I do not plan to fix this behavior very soon (see
> https://rt.cpan.org/Ticket/Display.html?
> > id=55190 and http://search.cpan.org/dist/SQL- > > Statement/lib/SQL/Statement.pm#SUPPORT).
> > > ---- > -- > Anthony G. Nickolayev > telematic services engineer > JSC "AC Mobiltelecom" > +7-(3012)-29-70-21 > dodger@burnet.ru