[rt-users] RT 3.0.10 -> 3.0.12 upgrade; bug introduced

Ben Goodwin ben at atomicmatrix.net
Wed Oct 6 13:49:29 EDT 2004


This bug is introduced at the 3.0.10 to 3.0.11 upgrade.
This code

my $tickets = new RT::Tickets($RT::SystemUser);
$tickets->LimitTransactionDate(VALUE => "2004-09-17 15:22:50", OPERATOR =>
'>');
$tickets->DEBUG(1);
$tickets->Next();

Produces this

SELECT DISTINCT main.* FROM Tickets main , Transactions Transactions_1,
Attachments Attachments_2  WHERE ((main.EffectiveId = main.id)) AND
((main.Status != 'deleted')) AND ((main.Type = 'ticket')) AND ( (  (
(Attachments_2.TransactionId = Transactions_1.id)AND(main.id =
Transactions_1.Ticket)(Attachments_2.Created > '2004-09-17 15:22:50') )  ) )

I'm still no closer to finding out how to fix this.  Can someone help me
through this?  Perhaps show me how to debug clause building so I can find
out why there's no "AND" above?

BTW if I have two LimitTransactionDate() statements, such as

$tickets->LimitTransactionDate(VALUE => "2004-09-17 15:22:50", OPERATOR =>
'>');
$tickets->LimitTransactionDate(VALUE => "2004-09-24 15:22:50", OPERATOR =>
'<');

Check out what happens:

SELECT DISTINCT main.* FROM Tickets main , Transactions Transactions_1,
Attachments Attachments_2  WHERE ((main.EffectiveId = main.id)) AND
((main.Status != 'deleted')) AND ((main.Type = 'ticket')) AND ( (  (
(Attachments_2.TransactionId = Transactions_1.id)AND(main.id =
Transactions_1.Ticket)(Attachments_2.Created > '2004-09-17 15:22:50') ) AND
( (Attachments_2.TransactionId = Transactions_1.id)AND(main.id =
Transactions_1.Ticket)AND(Attachments_2.Created < '2004-09-24 15:22:50') )
) )

The "Attachments_2.TransactionId = Transactions_1.id)AND(main.id =
Transactions_1.Ticket)" clause is duplicated as well as the missind AND
word.

Any help would be greatly appreciated.  I'm really slamming into a wall on
this one.

(please note my software revisions previously mentioned in this thread)

Thanks,

	-=| Ben




More information about the rt-users mailing list