INSERT may fail if the time is updated twice within the same second.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 1 Jul 2010 11:04:56 +0000 (13:04 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 1 Jul 2010 11:04:56 +0000 (13:04 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
include/banana/forum.inc.php

index 0c54f45..6a6a869 100644 (file)
@@ -131,8 +131,8 @@ class ForumsBanana extends Banana
                            WHERE  uid = {?}',
                          $time, $this->user->id());
             if (XDB::affectedRows() == 0) {
-                XDB::execute('INSERT INTO  forum_profiles (uid, last_seen)
-                                   VALUES  ({?}, FROM_UNIXTIME({?}))',
+                XDB::execute('INSERT IGNORE INTO  forum_profiles (uid, last_seen)
+                                          VALUES  ({?}, FROM_UNIXTIME({?}))',
                              $this->user->id(), $time);
             }
         }