Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 75707
Status: resolved
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: martin.spevak [...] hp.com
Cc:
AdminCc:

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



Subject: Oracle - generate query problem
Date: Mon, 12 Mar 2012 12:06:57 +0100
To: bug-DBIx-Class [...] rt.cpan.org
From: martin spevak <martin.spevak [...] hp.com>
Download (untitled) / with headers
text/plain 2.7k
Hello, Two different queries are generated while I use search->first or find, it looks that find doesn't work. my $user_identificator = '20412542'; my $sessionid = 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3'; my $last_user_session; $last_user_session = $c->model('DBIx::Session')->find({ user_identificator => $user_identificator, id => { '!=' => $sessionid }, expires => { '=' => $c->model('DBIx::Session')->search({ user_identificator => $user_identificator, id => { '!=' => $sessionid }, })->get_column('expires')->max_rs->as_query }, }, { rows => 1, }); $last_user_session = $c->model('DBIx::Session')->search({ user_identificator => $user_identificator, id => { '!=' => $sessionid }, expires => { '=' => $c->model('DBIx::Session')->search({ user_identificator => $user_identificator, id => { '!=' => $sessionid }, })->get_column('expires')->max_rs->as_query }, }, { rows => 1, })->first; has next queries (using DBIC_TRACE=1) SELECT id_session, id, session_data, expires, user_identificator FROM ( SELECT id_session, id, session_data, expires, user_identificator, ROWNUM rownum__index FROM ( SELECT me.id_session, me.id, me.session_data, me.expires, me.user_identificator FROM user_session me WHERE ( me.id != ? ) ) me ) me WHERE rownum__index BETWEEN ? AND ? : 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '1', '1' SELECT id_session, id, session_data, expires, user_identificator FROM ( SELECT id_session, id, session_data, expires, user_identificator, ROWNUM rownum__index FROM ( SELECT me.id_session, me.id, me.session_data, me.expires, me.user_identificator FROM user_session me WHERE ( ( expires = (SELECT MAX( me.expires ) FROM user_session me WHERE ( ( id != ? AND user_identificator = ? ) ) ) AND id != ? AND user_identificator = ? ) ) ) me ) me WHERE rownum__index BETWEEN ? AND ? : 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '20412542', 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '20412542', '1', '1' isectst:~/web-data/infrasec/infrasec/FILES/bin $ uname -a Linux isectst.omc.hp.com 2.6.32-220.4.2.el6.x86_64 #1 SMP Mon Feb 6 16:39:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux isectst:~/web-data/infrasec/infrasec/FILES/bin $ grep 'VERSION =' /usr/share/perl5/vendor_perl/DBIx/Class.pm $VERSION = '0.08196';
Download (untitled) / with headers
text/plain 2.7k
On Mon Mar 12 07:05:27 2012, martin.spevak@hp.com wrote: Show quoted text
> Hello, > > Two different queries are generated while I use search->first or find, > it looks that find doesn't work. > > my $user_identificator = '20412542'; > my $sessionid = > 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3'; > > my $last_user_session; > > $last_user_session = $c->model('DBIx::Session')->find({ > user_identificator => $user_identificator, > id => { '!=' => $sessionid }, > expires => { > '=' => $c->model('DBIx::Session')->search({ > user_identificator => $user_identificator, > id => { '!=' => $sessionid }, > })->get_column('expires')->max_rs->as_query > }, > }, { > rows => 1, > }); > > $last_user_session = $c->model('DBIx::Session')->search({ > user_identificator => $user_identificator, > id => { '!=' => $sessionid }, > expires => { > '=' => $c->model('DBIx::Session')->search({ > user_identificator => $user_identificator, > id => { '!=' => $sessionid }, > })->get_column('expires')->max_rs->as_query > }, > }, { > rows => > 1, > })->first; > > > has next queries (using DBIC_TRACE=1) > > SELECT id_session, id, session_data, expires, user_identificator FROM > ( > SELECT id_session, id, session_data, expires, user_identificator, > ROWNUM rownum__index FROM ( > SELECT me.id_session, me.id, me.session_data, me.expires, > me.user_identificator FROM user_session me WHERE ( me.id != ? ) > ) me > ) me WHERE rownum__index BETWEEN ? AND ? > : 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '1', '1' > > SELECT id_session, id, session_data, expires, user_identificator FROM > ( > SELECT id_session, id, session_data, expires, user_identificator, > ROWNUM rownum__index FROM ( > SELECT me.id_session, me.id, me.session_data, me.expires, > me.user_identificator FROM user_session me WHERE ( ( expires = > (SELECT > MAX( me.expires ) FROM user_session me WHERE ( ( id != ? AND > user_identificator = ? ) ) ) AND id != ? AND user_identificator = ? ) > ) > ) me > ) me WHERE rownum__index BETWEEN ? AND ? > : 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '20412542', > 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '20412542', '1', > '1' > > > isectst:~/web-data/infrasec/infrasec/FILES/bin $ uname -a > Linux isectst.omc.hp.com 2.6.32-220.4.2.el6.x86_64 #1 SMP Mon Feb 6 > 16:39:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux > isectst:~/web-data/infrasec/infrasec/FILES/bin $ grep 'VERSION > =' /usr/share/perl5/vendor_perl/DBIx/Class.pm > $VERSION = '0.08196'; >
Stupid bug confirmed, will be fixed in 0.08197.
Can you confirm that the bug has been fixed in 0.08197 so we can close the ticket?
Download (untitled) / with headers
text/plain 217b
On Wed Nov 21 03:38:46 2012, ABRAXXA wrote: Show quoted text
> Can you confirm that the bug has been fixed in 0.08197 so we can close > the ticket?
Sorry the work to fix it was never done :( I will try real hard to tackle it @ LPW.
Subject: [rt.cpan.org #75707], fixed in DBIx v0.082820
Date: Wed, 23 Sep 2015 10:40:17 +0200
To: bug-DBIx-Class [...] rt.cpan.org
From: Martin Spevak <martin.spevak [...] hpe.com>
Download (untitled) / with headers
text/plain 1.4k
We migrated into new version of DBIx, in this version is bug definitely fixed. Here are generated queries (they are almost same), only one difference is in part WHERE ( (*me.expires* = (SELECT MAX( WHERE ( ( *expires* = (SELECT MAX( but it working in my case SELECT me.id_session, me.id, me.session_data, me.expires, me.user_identificator FROM ( SELECT me.id_session, me.id, me.session_data, me.expires, me.user_identificator FROM user_session me WHERE ( (*me.expires* = (SELECT MAX( me.expires ) FROM user_session me WHERE ( ( id != ? AND user_identificator = ? ) ) ) AND me.id != ? AND me.user_identificator = ? ) ) ) me WHERE ROWNUM <= ? : 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '20412542', 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '20412542', '1' SELECT me.id_session, me.id, me.session_data, me.expires, me.user_identificator FROM ( SELECT me.id_session, me.id, me.session_data, me.expires, me.user_identificator FROM user_session me WHERE ( ( *expires* = (SELECT MAX( me.expires ) FROM user_session me WHERE ( ( id != ? AND user_identificator = ? ) ) ) AND id != ? AND user_identificator = ? ) ) ) me WHERE ROWNUM <= ? : 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '20412542', 'session:5f6e8e9d6abb0b7be5d354fdeea1296bff60cca3', '20412542', '1' -- *Martin (singer) Spevak* HPES Software Development Engineer HPES Network Management Solutions Location: Galvaniho 7/A, Bratislava, Slovakia Tel.: +421 2 5752 5390 Email: martin.spevak@hp.com
Download (untitled) / with headers
text/plain 336b
On Wed Sep 23 10:40:30 2015, martin.spevak@hpe.com wrote: Show quoted text
> We migrated into new version of DBIx, in this version is bug definitely > fixed.
Interesting... I actually did not intend for this to happen, this is a side effect of something else I changed. I will keep this open for a bit, until i find which change made the difference.
Download (untitled) / with headers
text/plain 653b
On Wed Sep 23 10:50:17 2015, RIBASUSHI wrote: Show quoted text
> On Wed Sep 23 10:40:30 2015, martin.spevak@hpe.com wrote:
> > We migrated into new version of DBIx, in this version is bug > > definitely > > fixed.
> > > Interesting... I actually did not intend for this to happen, this is a > side effect of something else I changed. I will keep this open for a > bit, until i find which change made the difference.
Duh! This now works due to '=' recognized correctly as "direct-equality", whereas before it was considered "something". Fixed for good in 0.082800 by https://github.com/dbsrgits/dbix-class/commit/76cc4546#diff-9b89cdbc1a293b41e6c589804977fa2a Cheers


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.