[Phplib-trackers] [ phplib-Bugs-541551 ] db_mysql lock tables
Brought to you by:
nhruby,
richardarcher
|
From: <no...@so...> - 2002-04-09 16:19:40
|
Bugs item #541551, was opened at 2002-04-09 09:02 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=541551&group_id=31885 Category: None Group: None >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: NickM (terado) Assigned to: Nobody/Anonymous (nobody) Summary: db_mysql lock tables Initial Comment: When issuing a lock command with an array of values, e.g.: $db->lock(array("table1"=>"read", "table2"=>"read")); this is resolved wrongly in the lock function, and instead attempts: lock tables read table1, read table2 now if the array is created the other way the obviously "read" would be the index and be overwritten!! Resolve: $key/$value other way around:- while (list($key,$value) = each($table)) { if (!is_int($key)) { // lock modes are "read", "read local", "write", "low priority write" $query .= "$key $value, "; } else { $query .= "$key $mode, "; } } ---------------------------------------------------------------------- >Comment By: Layne Weathers (layne_weathers) Date: 2002-04-09 11:19 Message: Logged In: YES user_id=278685 > When issuing a lock command with an array of values, > e.g.: > $db->lock(array("table1"=>"read", "table2"=>"read")); > > this is resolved wrongly in the lock function, and > instead attempts: > > lock tables read table1, read table2 That has never been the correct way to call lock(), even before the recent changes to lock(). The online documentation at <http://www.sanisoft.com/phplib/manual/DB_SqlMethods.php> was vague, so I added some examples. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=541551&group_id=31885 |