Skip Menu |

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

Report information
The Basics
Id: 87890
Status: new
Priority: 0/
Queue: SQL-Library

People
Owner: Nobody in particular
Requestors: unlearned [...] gmail.com
Cc:
AdminCc:

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



Subject: Newlines stripped from queries
Date: Fri, 16 Aug 2013 02:21:30 +0000
To: bug-SQL-Library [...] rt.cpan.org
From: Daniel Fackrell <unlearned [...] gmail.com>
SQL::Library's new() splits on newlines, and then inserts the lines of the query without adding them back in. The resulting query when called later is a single line. This causes problems with queries that contain SQL-style comments (though three other types of comments work well), as the rest of the query from that point is considered a comment. While three other types of comments are recognized by the parsing in this module, comments beginning with '--' should work and be passed to the SQL server without modification. Recommended fix: Change: if ( $curr_name ) { $self->{'contents'}->{$curr_name} .= $_; } To: if ( $curr_name ) { $self->{'contents'}->{$curr_name} .= $_ . "\n"; } This adds the newline back to the end of each line, preserving the original query byte for byte.
Subject: Re: [rt.cpan.org #87890] AutoReply: Newlines stripped from queries
Date: Wed, 21 Aug 2013 05:43:22 +0000
To: bug-SQL-Library [...] rt.cpan.org
From: Daniel Fackrell <unlearned [...] gmail.com>
Sorry, this bug report was me misreading the regex being used for the split, combined with not knowing that our code was explicitly removing whitespace. We'll take steps to address it in our code. This report can be closed as "cannot duplicate" or similar. On Fri, Aug 16, 2013 at 2:21 AM, Bugs in SQL-Library via RT <bug-SQL-Library@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Newlines stripped from queries", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #87890]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=87890 > > Please include the string: > > [rt.cpan.org #87890] > > in the subject line of all future correspondence about this issue. To do so, > you may reply to this message. > > Thank you, > bug-SQL-Library@rt.cpan.org > > ------------------------------------------------------------------------- > SQL::Library's new() splits on newlines, and then inserts the lines of > the query without adding them back in. The resulting query when > called later is a single line. > > This causes problems with queries that contain SQL-style comments > (though three other types of comments work well), as the rest of the > query from that point is considered a comment. > > While three other types of comments are recognized by the parsing in > this module, comments beginning with '--' should work and be passed to > the SQL server without modification. > > Recommended fix: > > Change: > > if ( $curr_name ) > { > $self->{'contents'}->{$curr_name} .= $_; > } > > To: > > if ( $curr_name ) > { > $self->{'contents'}->{$curr_name} .= $_ . "\n"; > } > > > This adds the newline back to the end of each line, preserving the > original query byte for byte.