[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-doc
Subject:    [PEAR-DOC] [PEAR-BUG] Bug #4467 [NEW]: mysql transactions don't work properly
From:       "jlintervo at suomi24 dot fi" <pear-doc () lists ! php ! net>
Date:       2005-05-29 15:21:34
Message-ID: bug-4467 () pear ! php ! net
[Download RAW message or body]

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
-- 

-- 
PEAR Documentation List Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic