Skip Menu |
 

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

Report information
The Basics
Id: 55190
Status: stalled
Priority: 0/
Queue: SQL-Statement

People
Owner: Nobody in particular
Requestors: joseignacio.hernando [...] upm.es
kennedyri [...] gmail.com
rafaeldomingues [...] ubix.com.br
Cc:
AdminCc:

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



MIME-Version: 1.0
X-Spam-Status: No, hits=-0.1 required=8.0 tests=DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_PASS
Content-Type: text/plain; charset=UTF-8
Message-ID: <bbb130481003031032h61954cb1v5aba1ddbe61ee6af [...] mail.gmail.com>
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id C7BB619B8024 for <bug-SQL-Statement [...] rt.cpan.org>; Wed, 3 Mar 2010 13:33:03 -0500 (EST)
Received: (qmail 4884 invoked by uid 103); 3 Mar 2010 18:33:03 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 3 Mar 2010 18:33:03 -0000
Received: from mail-yw0-f187.google.com (HELO mail-yw0-f187.google.com) (209.85.211.187) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 03 Mar 2010 10:32:27 -0800
Received: by ywh17 with SMTP id 17so671832ywh.27 for <bug-SQL-Statement [...] rt.cpan.org>; Wed, 03 Mar 2010 10:32:16 -0800 (PST)
Received: by 10.150.213.18 with SMTP id l18mr1360069ybg.157.1267641136006; Wed, 03 Mar 2010 10:32:16 -0800 (PST)
Delivered-To: cpan-bug+SQL-Statement [...] diesel.bestpractical.com
Subject: Parser strips comments from within quoted strings
Return-Path: <kennedyri [...] gmail.com>
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LlRFSTzq2zUoroxLUPQcVAob/1hnaZb9dW/Gzc9YWmlIjuGc/Ry9NOo4m275FaSHql wtkP6BM1Ge/83ItIlHZrQ8hCAcJnEi+4wnJhYhZkTtjm43lmjhohxXkTT9o3s84oaAJl VV/ZzIQBqAXVHlfbKr2wRwaWRPJQ8SSFupnTA=
X-Original-To: bug-SQL-Statement [...] rt.cpan.org
X-Spam-Check-BY: 16.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=CIDn6itpD3z6rkRcmSjDEHqdsi5LEdP25zEjEHNuFCA=; b=Z3lI355esDDGXHK9uE5U/P/srzyEeMwkZzD0jqn4n64n2dOZaSRmN9/gBXqF+Lwu1y dwWGbhYTBmQfxkVPeNpXFbiMi4BZpl5idt1iYwoYMrhDdHZhwdth6OiUydKf+RFZ55Il 6sMV4uN4aqfAz1+MCOEgadGHcvQnoyR7T0XQQ=
Date: Wed, 3 Mar 2010 12:32:15 -0600
X-Spam-Level: *
To: bug-SQL-Statement <bug-SQL-Statement [...] rt.cpan.org>
From: Rob Kennedy <kennedyri [...] gmail.com>
X-RT-Original-Encoding: utf-8
Content-Length: 990
Download (untitled) / with headers
text/plain 990b
When an SQL statement contains two consecutive dashes, SQL::Parser::parse strips the remainder of the line, even when those dashes are part of another token. use SQL::Statement; $parser = SQL::Parser->new(); $stmt = SQL::Statement->new("select a from b where good = 'good' ", $parser); $stmt = SQL::Statement->new("select a from b where passes = '--'\n' ", $parser); $stmt = SQL::Statement->new("select a from b where bad = '--' ", $parser); The "good" case is fine. The "passes" case should fail due to the extra apostrophe at the end of the input, after the newline, but the parser accepts it. The "bad" case should pass because the dashes are inside a quoted string. The error I get: Mismatched single quote before: 'select a from b where bad = '' I'm using SQL::Statement 1.23 with Perl 5.10.0 on Solaris 10. It's clear from Parser.pm line 85 what the problem is. The regular expression to strip the first comment gets applied before any tokenization. -- Rob Kennedy
MIME-Version: 1.0
In-Reply-To: <bbb130481003031032h61954cb1v5aba1ddbe61ee6af [...] mail.gmail.com>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <bbb130481003031032h61954cb1v5aba1ddbe61ee6af [...] mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-12687-1267694059-928.55190-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 250
Download (untitled) / with headers
text/plain 250b
From my point of view it's another result of the bug described in RT#53416 and exactly a duplicate of ticket #53617 (https://rt.cpan.org/Ticket/Display.html?id=53617) in the right module. Do you agree? I suggest using the described workaround there.
MIME-Version: 1.0
X-Spam-Status: No, hits=-0.1 required=8.0 tests=DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_PASS
In-Reply-To: <rt-3.8.HEAD-12687-1267694059-356.55190-6-0 [...] rt.cpan.org>
References: <RT-Ticket-55190 [...] rt.cpan.org> <bbb130481003031032h61954cb1v5aba1ddbe61ee6af [...] mail.gmail.com> <rt-3.8.HEAD-12687-1267694059-356.55190-6-0 [...] rt.cpan.org>
Message-ID: <bbb130481003040744l185164f1x74c8626a19d54f46 [...] mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id D11CB4D8002 for <bug-SQL-Statement [...] rt.cpan.org>; Thu, 4 Mar 2010 10:45:08 -0500 (EST)
Received: (qmail 30176 invoked by uid 103); 4 Mar 2010 15:45:07 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 4 Mar 2010 15:45:07 -0000
Received: from mail-yx0-f179.google.com (HELO mail-yx0-f179.google.com) (209.85.210.179) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 04 Mar 2010 07:44:33 -0800
Received: by yxe9 with SMTP id 9so1336034yxe.22 for <bug-SQL-Statement [...] rt.cpan.org>; Thu, 04 Mar 2010 07:44:22 -0800 (PST)
Received: by 10.101.131.4 with SMTP id i4mr544002ann.27.1267717462475; Thu, 04 Mar 2010 07:44:22 -0800 (PST)
Delivered-To: cpan-bug+SQL-Statement [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #55190] Parser strips comments from within quoted strings
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Yee+U8JDXh6VulFqZaf+nbDYF659fB4DMifa8mdyYCz13KGWx7tgJTC2Eq/Gto3UBj tImK+JYeEiHAL+3CrL5xGLgMeI5doP+sn1rSm/w6VeSLvZMW8MzXR/YaZngReSumpFNE Jf/IYVM5Zvmn618/kmc4h37bXjwrs34CD8WkU=
Return-Path: <kennedyri [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=YmE6uZ5Svf2BzG+t2RKbA+VI+E23blJVWRErzHF+5l4=; b=UKOnIZeon/wQ+V5jSGsCe5T5EDgfgHZgLjapJq2I/zPgSgzPXqgeJGRaHx3IjiMn7Y V3tPKnU/d8jngibpiL9ZpZVK6gn28fG/kLvMVBaCWEsPoUmcamadZnkdGtOVFJLJHdnp u52LDyLIqma0mRZcvr5b2+xyqXPI6s5qh9BkY=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-SQL-Statement [...] rt.cpan.org
Date: Thu, 4 Mar 2010 09:44:22 -0600
X-Spam-Level: *
To: bug-SQL-Statement [...] rt.cpan.org
From: Rob Kennedy <kennedyri [...] gmail.com>
RT-Message-ID: <rt-3.8.HEAD-12694-1267717520-1528.55190-0-0 [...] rt.cpan.org>
Content-Length: 610
Download (untitled) / with headers
text/plain 610b
Yes, I agree it's the same bug as the one described in #53617. It's similar to #53416 inasmuch as they're both caused by Parser "jumping" to the next expected pattern without regard for what it jumped over. In my case, I can't use the placeholder workaround since I'm not in control of the SQL I'm parsing. It's generated during a Sybase database dump. I have no need to execute the SQL, just get table and column names, so I've abandoned SQL::Statement for this project and gone with Parse::RecDescent instead, adapting the grammar at http://www.adp-gmbh.ch/perl/erd.html to handle the few commands I need.
From joseignacio.hernando [...] upm.es Mon Nov 14 17: 03:28 2011
MIME-Version: 1.0
Bounce-To: "jose ignacio hernando" <joseignacio.hernando [...] upm.es>
X-Spam-Status: No, score=-6.844 tagged_above=-99.9 required=10 tests=[AWL=-0.055, BAYES_00=-1.9, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_HI=-5, SPF_FAIL=0.001, T_DKIM_INVALID=0.01] autolearn=ham
X-Mailer: IlohaMail/0.8.13 (On: www.upm.es)
Errors-To: "jose ignacio hernando" <joseignacio.hernando [...] upm.es>
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Reply-To: "jose ignacio hernando" <joseignacio.hernando [...] upm.es>
Message-ID: <xQ7MhZHi.1321308198.7920250.joseignacio.hernando [...] upm.es>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -6.844
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 8523F240DE1 for <cpan-bug+SQL-Statement [...] hipster.bestpractical.com>; Mon, 14 Nov 2011 17:03:28 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0xH3eMWCSdxv for <cpan-bug+SQL-Statement [...] hipster.bestpractical.com>; Mon, 14 Nov 2011 17:03:26 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id A9789240BD0 for <bug-SQL-Statement [...] rt.cpan.org>; Mon, 14 Nov 2011 17:03:26 -0500 (EST)
Received: (qmail 32033 invoked by uid 103); 14 Nov 2011 22:03:25 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 14 Nov 2011 22:03:25 -0000
Received: from edison.ccupm.upm.es (HELO smtp.upm.es) (138.100.198.71) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Mon, 14 Nov 2011 14:03:23 -0800
Received: from www.upm.es (jarama.ccupm.upm.es [138.100.199.7]) by smtp.upm.es (8.14.3/8.14.3/edison-001) with SMTP id pAEM3ILe015223 for <bug-SQL-Statement [...] rt.cpan.org.>; Mon, 14 Nov 2011 23:03:18 +0100
Received: from 138.100.198.7 (auth. user joseignacio.hernando [...] correo.upm.es) by www.upm.es with HTTP; Mon, 14 Nov 2011 23:03:18 +0100
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=softfail (invalid, public key: not available) header.i= [...] upm.es
Delivered-To: cpan-bug+SQL-Statement [...] hipster.bestpractical.com
Subject: problem with '--'
Return-Path: <joseignacio.hernando [...] upm.es>
X-RT-Mail-Extension: sql-statement
X-Original-To: cpan-bug+SQL-Statement [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=simple/simple; d=upm.es; s=upm.key; t=1321308198; bh=kviwUXakU9nfNmfpCbLXg3H0wq6eSz3NnBtCBvzcoxg=; h=To:Subject:Date:Message-ID:From:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding; b=U03iZYVT/mD/D8ascgOxpLyM eStBUFa+N5HRBt8MOxMYqtEHW5ByuahHVqv7fu4XPQOopUbXWwmEIzYxuYZ9A21I0FH 7DE/VdkNKkiLlJG3SDqRvWkL5B6tljBf/TuCqIyCKa40BdIWieOmFKzfOmfh8fFUfmF 0sX5Hz9mXngDs=
Date: Mon, 14 Nov 2011 23:03:18 +0100
X-Spam-Level:
To: bug-SQL-Statement [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: "jose ignacio hernando" <joseignacio.hernando [...] upm.es>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 826
Download (untitled) / with headers
text/plain 826b
*Distribution name and version DBD::Excel is up to date (0.06). Spreadsheet::WriteExcel is up to date (2.37). Spreadsheet::ParseExcel is up to date (0.59). SQL::Statement is up to date (1.33). DBI is up to date (1.616). *Perl version C:\Documents and Settings\etsam>perl -v This is perl 5, version 12, subversion 3 (v5.12.3) built for MSWin32-x86-multi-thread *Operating System vendor and version windows xp delete from excel_quiz where name='c1:test 7:1' and intro='<!--hello-->' Mismatched single quote before: < and intro='<!> at C:/strawberry/perl/site/lib/SQL/Statement.pm line 88 Command 'AND' not recognized or not supported! at C:/strawberry/perl/site/lib/SQL/Statement.pm line 88 The problem is '--' (two -) in the second string
MIME-Version: 1.0
In-Reply-To: <xQ7MhZHi.1321308198.7920250.joseignacio.hernando [...] upm.es>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <xQ7MhZHi.1321308198.7920250.joseignacio.hernando [...] upm.es>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-6893-1321346091-1881.72423-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 52
Duplicate - merge into origin to keep you up-to-date
From rafaeldomingues [...] ubix.com.br Thu Aug 2 19: 40:47 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-6.899 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5] autolearn=ham
X-Spam-Flag: NO
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
Content-Type: multipart/alternative; boundary=e89a8ff1c146f9366904c650efb6
Message-ID: <CACqS5sQxg7fU=--RrkGY7=jF7H3L=ZDWNyo3yXQkHx8ADyHp7A [...] mail.gmail.com>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -6.899
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 188752405B5 for <cpan-bug+SQL-Statement [...] hipster.bestpractical.com>; Thu, 2 Aug 2012 19:40:47 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TJIZP1UQ6YgE for <cpan-bug+SQL-Statement [...] hipster.bestpractical.com>; Thu, 2 Aug 2012 19:40:43 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 81B0C2404F7 for <bug-SQL-Statement [...] rt.cpan.org>; Thu, 2 Aug 2012 19:40:40 -0400 (EDT)
Received: (qmail 29523 invoked by uid 103); 2 Aug 2012 23:40:39 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 2 Aug 2012 23:40:39 -0000
Received: from mail-ob0-f178.google.com (HELO mail-ob0-f178.google.com) (209.85.214.178) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Thu, 02 Aug 2012 16:40:35 -0700
Received: by obbwd20 with SMTP id wd20so160545obb.9 for <bug-SQL-Statement [...] rt.cpan.org>; Thu, 02 Aug 2012 16:40:32 -0700 (PDT)
Received: by 10.60.29.230 with SMTP id n6mr40712290oeh.22.1343950832612; Thu, 02 Aug 2012 16:40:32 -0700 (PDT)
Received: by 10.76.73.105 with HTTP; Thu, 2 Aug 2012 16:40:32 -0700 (PDT)
Delivered-To: cpan-bug+SQL-Statement [...] hipster.bestpractical.com
Subject: DBD::CSV parses into quoted data
Return-Path: <rafaeldomingues [...] ubix.com.br>
X-RT-Mail-Extension: sql-statement
X-Original-To: cpan-bug+SQL-Statement [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=jicgkuwcvL7mwyWvMmnJJLxF+X6mu1x5fqpFEa9koJs=; b=n0ioIPArPCNX5GcxLEm7bnkmBO175+WBXbqorMedlmgNLPO+rOJVMpjIeEK7ogeVLL etpVvHNftZgRyYjbEBrfLLrp0Wlai8qcMhZNUEoIAbMsAkdgEchgf/1PAeYm2td9dgCa blRYNmNB7zv2njaKGZkWpu1RVVlePsHmSN9OAMtQbr+rqSsrJY7eXJjPJ8BhsRCNKJEK Wt8Q3qiISdfeo+j0T7OxoDWUdX40rn8MzTCU3ze+d+uv7bNVzT/JVjwig7IWDJgO9+jY np7DI4hXc3Y9V3ERFWJPCQEWaMND+oHmd8Aq37xhRwpwYIjUqfcSepEmzZgpWqX2lCKC a82w==
Date: Thu, 2 Aug 2012 20:40:32 -0300
X-Spam-Level:
X-Originating-Ip: [186.215.116.76]
To: bug-SQL-Statement [...] rt.cpan.org
X-GM-Message-State: ALoCoQlnCNKwqa/ODD84cg3Gb3dHg6vtT4JyQFJEiUGkLWcmUfPbRvcIWy/wrMPDJw66l3pkB9nL
From: Rafael Domingues <rafaeldomingues [...] ubix.com.br>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 1136
Download (untitled) / with headers
text/plain 1.1k
Hello, I've run into a bug when using DBD::CSV on Perl 5.12.4. Basically, if I try to run this script: use DBI; my $destdb = DBI->connect ("dbi:CSV:", "", "", { f_dir => "." }); $destdb->do ("DROP table test"); $destdb->do ("CREATE TABLE test (id INTEGER, value VARCHAR(255))"); $sql="INSERT into test VALUES (1,'--')"; $destdb->do ($sql); I get this error: Mismatched single quote before: <INSERT into test VALUES (1,'> at /opt/local/lib/perl5/site_perl/5.12.4/SQL/Statement.pm line 88 No table name specified! at /opt/local/lib/perl5/site_perl/5.12.4/SQL/Statement.pm line 88 No command found! at /opt/local/lib/perl5/site_perl/5.12.4/SQL/Statement.pm line 88 DBD::CSV::db do failed: No command found! [for Statement "INSERT into test VALUES (1,'--')"] at testfile.pl I've traced it to line 83, on Parser.pm file. I don't know exactly why it's looking for comments there, but if I change the regular expression to not match -- it solves the problem. I wonder why the parser is verifying into quoted data. I believe this can lead to a more serious bug. Thank you for taking your time to check this out. Best regards, Rafael
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 4745
MIME-Version: 1.0
In-Reply-To: <CACqS5sQxg7fU=--RrkGY7=jF7H3L=ZDWNyo3yXQkHx8ADyHp7A [...] mail.gmail.com>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <CACqS5sQxg7fU=--RrkGY7=jF7H3L=ZDWNyo3yXQkHx8ADyHp7A [...] mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-21770-1349179424-1533.78752-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 64
This ticket already exists - please read ticket queue carefully.
MIME-Version: 1.0
In-Reply-To: <bbb130481003031032h61954cb1v5aba1ddbe61ee6af [...] mail.gmail.com>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <bbb130481003031032h61954cb1v5aba1ddbe61ee6af [...] mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-6980-1349179528-1870.55190-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 55
Still no plans to rewrite SQL::Parser due lack of time.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.