Expand Condition error

thread: 16 messages  |  last: about 7 years ago  |  started: friday, december 14, 2007, 2:20 pm pst


#1  |  VexedPanda (Calgary, AB) Canada
Friday, December 14, 2007, 2:20 PM PST

I'm trying to use the following Expand, and getting SQL errors:

<?
QQ::Expand(
    QQN::T1()->T2s, 
    QQ::AndCondition(
        QQ::In(QQN::T1()->T2s->T3->UserId, 17),
        QQ::Equal(QQN::T1()->T2s->IsActive, true)
        )
    );
?>

The DB structure is:
T1
--
id

T2
--
id
t1_id
t3_id
is_active

T3
--
id
user_id

The SQL that comes back is:

SELECT

    `t1`.`id` AS `a0`,
    `t2`.`id` AS `a1`,
    `t2`.`t3_id` AS `a2`,
    `t2`.`t1_id` AS `a3`,
    `t2`.`is_active` AS `a4`
FROM
    `t1` AS `t1`
    LEFT JOIN `t2` AS `t2` ON `t1`.`id` = `t2`.`t1_id` AND ( `t1`.`user_id` = '17' AND `t2`.`is_active` != 0 )

Note that t3 is never joined, and that it's trying to access a user_id column in t1 that does not exist.

Any suggestions? I desperately need this to work in QQ

#2  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Friday, December 14, 2007, 5:00 PM PST

are you on the latest dev version of qcodo?

#3  |  VexedPanda (Calgary, AB) Canada
Monday, December 17, 2007, 7:43 AM PST

I'm using 0.3.42, which appears to be the newest, yes.

#4  |  VexedPanda (Calgary, AB) Canada
Tuesday, December 18, 2007, 2:59 PM PST

Sorry to be impatient, but this bug is affecting one of the main pages on my site, and I would greatly appreciate being able to get it resolved.

#5  |  VexedPanda (Calgary, AB) Canada
Wednesday, January 2, 2008, 12:53 PM PST

bump

#6  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Wednesday, January 2, 2008, 8:38 PM PST

VP, sorry for the delay on this... things have been incredibly swamped.

I just wanted to give you a head's up that I likely won't be able to look into this until later next week at the earliest.

My apologies for this.

#7  |  VexedPanda (Calgary, AB) Canada
Friday, March 7, 2008, 2:03 PM PST

bump

#8  |  VexedPanda (Calgary, AB) Canada
Monday, April 14, 2008, 11:13 AM PDT

bump

#9  |  fimbulvetr (Denver, CO)
Sunday, May 4, 2008, 12:01 PM PDT

Any luck on this VP, I'm running into the same issue.

#10  |  fimbulvetr (Denver, CO)
Sunday, May 4, 2008, 12:54 PM PDT

I figured mine out. It's a very specific bug and probably unrelated to yours, but after several hours of troubleshooting, I've found that order of Conditions matters alot - it have wierdness when it comes to doing clauses with expands with conditions.

I'm not even sure if you can call it a bug - any program capable of dealing with this sort of issue would be close to human.



Copyright © 2005 - 2019, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.