[Phplib-trackers] [ phplib-Bugs-470493 ] bug in db_mysql.inc function lock (?)
Brought to you by:
nhruby,
richardarcher
|
From: <no...@so...> - 2001-10-12 16:10:08
|
Bugs item #470493, was opened at 2001-10-12 00:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=470493&group_id=31885 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: bug in db_mysql.inc function lock (?) Initial Comment: Hello, Line 174 of the file db_mysql.inc (v. phplib-7.2d) if ($key=="read" && $key!=0) This test looks strange. $key!=0 will only be evaluated when $key=="read" so the next test $key!=0 is not usefull as we already knows that $key is "read" when we enter the second part of the test. As you put the mode "write" or "read" in the variable $mode I presume it's a typo error and the test should be if ($mode=="read"...) /* public: table locking */ function lock($table, $mode="write") { $this->connect(); $query="lock tables "; if (is_array($table)) { while (list($key,$value)=each($table)) { if ($key=="read" && $key!=0) { <======= HERE $query.="$value read, "; } else { $query.="$value $mode, "; } } $query=substr($query,0,-2); Kind regards, Olivier Boudry ---------------------------------------------------------------------- Comment By: Layne Weathers (layne_weathers) Date: 2001-10-12 09:10 Message: Logged In: YES user_id=278685 In addition to this issue, I am disturbed by 1) lock() only allowing 'read' and 'write' as locking modes and 2) neither lock() nor unlock() use the query(). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=470493&group_id=31885 |