[Phplib-trackers] [ phplib-Bugs-450711 ] MySQL and duplicate session records
Brought to you by:
nhruby,
richardarcher
From: <no...@so...> - 2001-08-14 06:58:04
|
Bugs item #450711, was opened at 2001-08-13 23:13 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450711&group_id=31885 Category: None Group: None >Status: Closed >Resolution: Out of Date >Priority: 1 Submitted By: Richard Archer (richardarcher) Assigned to: Nobody/Anonymous (nobody) Summary: MySQL and duplicate session records Initial Comment: reposted from mailing list At 4:52 PM +0200 14/5/01, Markus Dobel wrote: >I saw this problem several times here on the mailing list and now had >the same here. With MySQL, affected_rows() returns 0 for updates where >actually no data is changed. (e.g. "update bla set fasel=fasel" affects >all rows but actually changes none.). This happens in phplib, when >session data are stored unchanged *twice* in one second. > >The implemented workaround for this is not working, but here's a patch >which should solve the problem. > >Regards, Markus > >--- cut here --- > >@@ -103,14 +103,15 @@ > # no changes to the table data (i.e. UPDATE tbl SET col = 'x', when > # "col" is _already_ set to 'x') so then, > # SECOND, query(SELECT...) on the sid to determine if the row is in >- # fact there, >+ # fact there, fetch the result > # THIRD, verify that there is at least one row present, and if there > # is not, then > # FOURTH, insert the row as we've determined that it does not exist. > > if ( $this->db->affected_rows() == 0 > && $this->db->query($squery) >- && $this->db->f(1) == 0 >+ && $this->db->next_record() >+ && $this->db->f(0) == 0 > && !$this->db->query($iquery)) { > > $ret = false; > ---------------------------------------------------------------------- >Comment By: Richard Archer (richardarcher) Date: 2001-08-13 23:58 Message: Logged In: YES user_id=279311 Oops, already applied to 7.2d. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450711&group_id=31885 |