Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.7.0

Bug #11544 Arithmetic Operations in (), problem with update and in where clause
Submitted: 2007-07-06 16:55 UTC
From: mrsol Assigned: cybot
Status: Closed Package: SQL_Parser (version CVS)
PHP Version: 5.2.1 OS: Windows
Roadmaps: 0.5.1    
Subscription  


 [2007-07-06 16:55 UTC] mrsol (Oleg Savostin)
Description: ------------ When in update query present `row_name`=(`row_name2 + 3) or `row_name`=(2 + 5) generated error '^ found: "("' and also in where clause if present `row_name`=(`row_name2` - 1) or `row_name`=(2 - 1) generated error found: "1" update `zzz` set `kkk`=(`susus` + 1), `vvv1`='a1b', `ccc`='bbb' where `uccc`='aaa' PEAR_Error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => [message] => Parse error: Expected a value or column name on line 1 update `zzz` set `kkk`=(`susus` + 1), `vvv1`='a1b', `ccc`='bbb' where `uccc`='aaa' ^ found: "(" [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => C:\Prog-work\nusphere\phped\php5\PEAR\PEAR.php [line] => 572 [function] => PEAR_Error [class] => PEAR_Error [type] => -> [args] => Array ( [0] => Parse error: Expected a value or column name on line 1 update `zzz` set `kkk`=(`susus` + 1), `vvv1`='a1b', `ccc`='bbb' where `uccc`='aaa' ^ found: "(" [1] => [2] => 1 [3] => 1024 [4] => ) ) AND update `zzz` set `kkk`=(1 + 1), `vvv1`='a1b', `ccc`='bbb' where `uccc`='aaa' PEAR_Error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => [message] => Parse error: Expected a value or column name on line 1 update `zzz` set `kkk`=(1 + 1), `vvv1`='a1b', `ccc`='bbb' where `uccc`='aaa' ^ found: "(" [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => C:\Prog-work\nusphere\phped\php5\PEAR\PEAR.php [line] => 572 [function] => PEAR_Error AND select * from `abc` where `abc`='tdd' and `cbu`=(`lbu` - 1) PEAR_Error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => [message] => Parse error: Expected ")" on line 1 select * from `abc` where `abc`='tdd' and `cbu`=(`lbu` - 1) ^ found: "1" [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => C:\Prog-work\nusphere\phped\php5\PEAR\PEAR.php [line] => 572 [function] => PEAR_Error

Comments

 [2007-07-13 13:45 UTC] cybot (Sebastian Mendel)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2007-07-23 14:29 UTC] mrsol (Oleg Savostin)
Where is the version cvs with fixed bug? OR how dounload(install) the version in which the given fixed bug?
 [2007-07-24 13:49 UTC] mrsol (Oleg Savostin)
I dounload cvs version and find a bugs. when used in operation minus. Error value in parsed data. sql_query = update `abc` set `minus`=(`minus` - 2), `minus2`=(2 - 3) where `aaa`='bbb' return data Array ( [command] => update [table_names] => Array ( [0] => abc ) [column_names] => Array ( [0] => minus [1] => minus2 ) [values] => Array ( [0] => Array ( [value] => minus02 [type] => identint_valint_val ) [1] => Array ( [value] => 203 [type] => int_valint_valint_val ) ) [where_clause] => Array ( [arg_1] => Array ( [value] => aaa [type] => ident ) [op] => = [arg_2] => Array ( [value] => bbb [type] => text_val ) ) ) In value a sign the minus is replaced with zero. And in type, instead of a sign the minus is put int_val. Also in where clause combination does not work. sql_query = select * from `abc` where `one`=(`two` + 1) [error_message] => Parse error: Expected ")" on line 1 select * from `abc` where `one`=(`two` + 1) ^ found: "1" [error] => 1 or sql_query = select * from `abc` where `one`=(`two` + `three`) [error_message] => Parse error: Expected ")" on line 1 select * from `abc` where `one`=(`two` + `three`) ^ found: "three" [error] => 1
 [2008-07-24 15:22 UTC] cybot (Sebastian Mendel)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.