From 0f476f3e98c29764d4fb3776347ae786c7fe81a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Leroy?= Date: Tue, 25 Oct 2005 14:45:19 +0000 Subject: [PATCH] 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 --- phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php b/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php index 2f9cc4cc13..2d929fc92d 100644 --- a/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php +++ b/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php @@ -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 { } } -?> \ No newline at end of file +?>