phpbar.de logo

Mailinglisten-Archive

[php] SID in den Bookmarks

[php] SID in den Bookmarks

Markus Dobel php_(at)_phpcenter.de
Fri, 29 Jun 2001 09:27:24 +0200


On Fri, Jun 29, 2001 at 09:10:08AM +0200, Bjoern Schotte wrote:
> * Markus Dobel wrote:
> > obwohl (wie sich nachher herausstellte) schon laenger bekannt (Doppelte
> > Sessions bei MySQL). 
> 
> Welche doppelten Session meinst du damit genau?

Leider ist das phplib-Archiv nicht Verfuegbar. Ich seh gerade, dass ich
natuerlich vergessen habe, dazuzuschreiuben, welche Datei ich da
gepatched hab. Es handelt sich um ct_sql.inc.

Das schoenste war uebrigens, dass es schon einen Workaround extra fuer
das Problem im Code gab. Er funktionierte nur nicht.


Date: Mon, 14 May 2001 16:52:32 +0200
From: Markus Dobel <mdobel_(at)_kawo2.rwth-aachen.de>
To: phplib_(at)_lists.netuse.de
User-Agent: Mutt/1.2.5i
Organization: Foerderverein fuer binaeres Denken
X-Operating-System: Linux 2.2.16-9mdk i586
X-A-D-2101: ALL YOUR BASE ARE BELONG TO US.
Subject: [phplib] Patch: MySQL and duplicate session records

Hi,

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

_(at)__(at)_ -103,14 +103,15 _(at)__(at)_
     #   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;


---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe_(at)_lists.netuse.de
For additional commands, e-mail: phplib-help_(at)_lists.netuse.de

-- 
Spiegel-Leser wissen mehr. Fuer ein Semester-Abo!
http://www.kawo2.rwth-aachen.de/~mdobel/semesterabo.html


php::bar PHP Wiki   -   Listenarchive