Skip Menu |

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

Report information
The Basics
Id: 81305
Status: resolved
Priority: 0/
Queue: SQL-Abstract-More

People
Owner: Nobody in particular
Requestors: to.code.perl [...] gmail.com
Cc:
AdminCc:

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



Subject:
Date: Tue, 20 Nov 2012 22:48:50 +0200
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: "to.code.perl" <to.code.perl [...] gmail.com>
Hello, SQL::Abstract::More is an extension of SQL::Abstract and it would be great if it takes into account some deprecated usage, e.g.: https://metacpan.org/module/SQL::Abstract#Deprecated-usage-of-Literal-SQL my %where = ( requestor => \'= submitter' ) $stmt = "WHERE requestor = submitter" This used to be the only way to compare columns. Use the superior "-ident" method for all new code. For example an identifier declared in such a way will be properly quoted if "quote_char" is properly set, while the legacy form will remain as supplied. same \'= usage is suggested in https://metacpan.org/module/SQL::Abstract::More#Join-specifications ( "operator and condition" part ) but it doesn't support "-ident" method
Subject: Re: [rt.cpan.org #81305]
Date: Wed, 21 Nov 2012 09:37:46 +0100
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: laurent dami <laurent.dami [...] free.fr>
Le 20.11.2012 21:49, to.code.perl via RT a écrit : Show quoted text
> Tue Nov 20 15:49:07 2012: Request 81305 was acted upon. > Transaction: Ticket created by to.code.perl@gmail.com > Queue: SQL-Abstract-More > Subject: (No subject given) > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: to.code.perl@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81305 > > > > Hello, > > SQL::Abstract::More is an extension of SQL::Abstract and it would be great > if it takes into account some deprecated usage, e.g.: > > https://metacpan.org/module/SQL::Abstract#Deprecated-usage-of-Literal-SQL > > my %where = ( requestor => \'= submitter' ) > > $stmt = "WHERE requestor = submitter" > > This used to be the only way to compare columns. Use the superior "-ident" > method for all new code. For example an identifier declared in such a way > will be properly quoted if "quote_char" is properly set, while the legacy > form will remain as supplied. > > > > same \'= usage is suggested in > https://metacpan.org/module/SQL::Abstract::More#Join-specifications ( > "operator and condition" part ) but it doesn't support "-ident" method > >
Hi, OK, thanks for the suggestion. I changed the internal translation, see https://github.com/damil/SQL-Abstract-More . However, this stuff is only used internally, while translating user input into plain SQL::Abstract syntax, so it will not change anything for end users. User input is usually based on plain strings, i.e. $sqla->join(qw/ left requestor=submitter right/) or it was already possible to use the -ident syntax, as in $sqla->join('left', {'left.requestor' => {-ident => 'right.submitter'}}, 'right') so apart from being an internal cleanup, I don't really see the point of this ticket. Did you have any special use case in mind ? Best regards, Laurent Dami
Subject: Re: [rt.cpan.org #81305]
Date: Wed, 21 Nov 2012 21:08:25 +0200
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: "to.code.perl" <to.code.perl [...] gmail.com>
Hi, Sorry, I had to check the SQL::Abstract version first... 1.72 has been used... with 1.73 everything works perfectly ( as expected ) although the example with -ident below doesn't work ( and it's correct ). just test cases to confirm: $join = $sqla->join(qw/ left requestor=submitter right/); is_same_sql_bind( $join->{sql}, $join->{bind}, "left INNER JOIN right ON left.requestor = right.submitter", [], ); ok $join = $sqla->join('left', {operator => '<=>', condition => {'left.requestor' => {-ident => 'right.submitter'}}}, 'right'); is_same_sql_bind( $join->{sql}, $join->{bind}, "left INNER JOIN right ON left.requestor = right.submitter", [], ); ok $join = $sqla->join('left', {operator => '<=>', condition => {'left.requestor' => {'=' => {-ident => 'right.submitter'}}}}, 'right'); is_same_sql_bind( $join->{sql}, $join->{bind}, "left INNER JOIN right ON left.requestor = right.submitter", [], ); ok $join = $sqla->join('left', {'left.requestor' => {-ident => 'right.submitter'}}, 'right'); is_same_sql_bind( $join->{sql}, $join->{bind}, "left INNER JOIN right ON left.requestor = right.submitter", [], ); failed - Thanks On Wed, Nov 21, 2012 at 10:37 AM, laurent.dami@free.fr via RT < bug-SQL-Abstract-More@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=81305 > > > Le 20.11.2012 21:49, to.code.perl via RT a écrit :
> > Tue Nov 20 15:49:07 2012: Request 81305 was acted upon. > > Transaction: Ticket created by to.code.perl@gmail.com > > Queue: SQL-Abstract-More > > Subject: (No subject given) > > Broken in: (no value) > > Severity: (no value) > > Owner: Nobody > > Requestors: to.code.perl@gmail.com > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81305 > > > > > > > Hello, > > > > SQL::Abstract::More is an extension of SQL::Abstract and it would be
> great
> > if it takes into account some deprecated usage, e.g.: > > > >
> https://metacpan.org/module/SQL::Abstract#Deprecated-usage-of-Literal-SQL
> > > > my %where = ( requestor => \'= submitter' ) > > > > $stmt = "WHERE requestor = submitter" > > > > This used to be the only way to compare columns. Use the superior
> "-ident"
> > method for all new code. For example an identifier declared in such a way > > will be properly quoted if "quote_char" is properly set, while the legacy > > form will remain as supplied. > > > > > > > > same \'= usage is suggested in > > https://metacpan.org/module/SQL::Abstract::More#Join-specifications ( > > "operator and condition" part ) but it doesn't support "-ident" method > > > >
> Hi, > > OK, thanks for the suggestion. I changed the internal translation, see > https://github.com/damil/SQL-Abstract-More . > > However, this stuff is only used internally, while translating user > input into plain SQL::Abstract syntax, so it will not change anything > for end users. > User input is usually based on plain strings, i.e. > > $sqla->join(qw/ left requestor=submitter right/) > > or it was already possible to use the -ident syntax, as in > > $sqla->join('left', {'left.requestor' => {-ident => > 'right.submitter'}}, 'right') > > so apart from being an internal cleanup, I don't really see the point of > this ticket. Did you have any special use case in mind ? > > Best regards, Laurent Dami > >