PHP Classes

Found a bug

Recommend this page to a friend!

      SQL Parse Convert to Tree Array  >  All threads  >  Found a bug  >  (Un) Subscribe thread alerts  
Subject:Found a bug
Summary:Query in brackets
Messages:3
Author:thijsdj
Date:2009-06-02 12:39:49
Update:2009-06-02 13:34:08
 

 


  1. Found a bug   Reply   Report abuse  
Picture of thijsdj thijsdj - 2009-06-02 12:39:49
Hi,

I like your class! We use it a lot here.

I found a bug, when parsing this query:
"(select count(*) || ' : 02-06-2009, 14:25124394551987' from fooooo)"

Yes, including the brackets at the start and the end. That's the problem.

The TABLE in the parsed response is called "fooooo)".

Here's the complete result:

array(1) {
["SQL"]=>
array(3) {
["_a"]=>
int(0)
["_z"]=>
int(67)
["SELECT"]=>
array(2) {
["FROM"]=>
array(1) {
["TABLE"]=>
string(7) "fooooo)"
}
["0|*SELECT"]=>
array(3) {
["0|*AS"]=>
array(1) {
["FIELD"]=>
string(8) "count(*)"
}
["1|*AS"]=>
array(1) {
["FIELD"]=>
string(2) "||"
}
["2|*AS"]=>
array(1) {
["VAL"]=>
string(34) "' : 02-06-2009, 14:25124394551987'"
}
}
}
}
}

We wrote a small workaround, but I just wanted to let you know this is a bug.

Regards,
Thijs

  2. Re: Found a bug   Reply   Report abuse  
Picture of François NEUMANN-RYSTOW François NEUMANN-RYSTOW - 2009-06-02 13:31:09 - In reply to message 1 from thijsdj
I have to take a serious look at brackets use in SQL.
Personnaly I use postgres and table
that are full uppercase need to be in brackets,
but some databases system can interpret brackets as quote (string value).

What is sure, is that actually, the class doesnt have some code to handle brackets !

  3. Re: Found a bug   Reply   Report abuse  
Picture of François NEUMANN-RYSTOW François NEUMANN-RYSTOW - 2009-06-02 13:34:08 - In reply to message 2 from François NEUMANN-RYSTOW
i have to code operator support to
(operator || is used in your query)