Bugfix: RowLock was not working with MySQL. ignore is a reserved word and could be empty. See as well fix on mysql driver for getOne with LIMIT and FOR UPDATE

This commit is contained in:
Régis Leroy 2005-10-25 14:45:19 +00:00
parent 9b4814ba81
commit 0f476f3e98

View File

@ -59,10 +59,15 @@ class ADODB_mysqlt extends ADODB_mysql {
return true;
}
function RowLock($tables,$where,$flds='1 as ignore')
function RowLock($tables,$where,$flds='1 as ignored')
{
if ($this->transCnt==0) $this->BeginTrans();
return $this->GetOne("select $flds from $tables where $where for update");
if (empty($where)) {
$qry = "select $flds from $tables for update";
} else {
$qry = "select $flds from $tables where $where for update";
}
return $this->GetOne($qry);
}
}
@ -133,4 +138,4 @@ class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
}
}
?>
?>