Bug #4467 [NEW]: mysql transactions don't work properly
| From: | jlintervo at suomi24 dot fi | Date: | Sun, 29 May 2005 15:21:34 +0000 |
| Subject: | Bug #4467 [NEW]: mysql transactions don't work properly | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-6119@lists.php.net to get a copy of this message | ||
From: jlintervo at suomi24 dot fi
Operating system: Windows NT4
PHP version: 5.0.4
Package: Documentation
Bug Type: Bug
Bug description: mysql transactions don't work properly
Description:
------------
I have had trouble getting transaction work with mysql + php/pearDB.
i located the problem in DB:isManip($query), which returns false for
reasonable sql queries.
I suppose there is something with the regexp syntax.
Reproduce code:
---------------
SCRIPT 1:
---------
$db->autoCommit(false);
$sql="SELECT * FROM sess WHERE id='1' LOCK IN SHARE MODE;";
$db->$query($sql);
sleep(10);
$db->commit();
SCRIPT 2:
---------
$sql="UPDATE sess SET id=2 WHERE id=1;";
$db->query($sql);
Expected result:
----------------
when running simultaneously, script 1 started first, script 2 query should
wait for script 1 to commit. this doesn't happen. it seems that
pear-storage-driver for mysql doesn't send the 'SET AUTOCOMMIT=0' and
'BEGIN' when autoCommit is called.
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=4467&edit=1
--