|
[F] Duplicate session key in insert SQL with spider bot
|
|
09-25-2008, 02:49 PM
(This post was last modified: 09-25-2008 03:11 PM by koziolek.)
Post: #1
|
|||
|
|||
|
[F] Duplicate session key in insert SQL with spider bot
MyBB 1.4.2, PHP 5.2, MySQL 5.0
I can see multiple errors in error_log: Code: <error>It should not happen, because in session->create_session() we have a delete_query()... but it happens. I cannot reproduce it even when simulating GoogleBot with spoofed useragent. Update: Just reproduced with Firefox + spoofed agent (Alexa) + many tabs + many reloads. It happens on high load - multiple requests from one bot. Probably between the delete_query() in create_session() and insert_query() other thread inserts his own bot record. Possible solution for MySQL - use INSERT IGNORE or REPLACE. In file db_mysql.php FIND: PHP Code: function insert_query($table, $array)PHP Code: function insert_query($table, $array, $ignore = FALSE)PHP Code: $onlinedata['location1'] = intval($speciallocs['1']);PHP Code: $onlinedata['location1'] = intval($speciallocs['1']);www.kozik.net.pl - So... Maybe you shouldn't have hacked it. - And why don't you try not breathing. Hurts, dunnit. (userfriendly.org) |
|||
|
09-25-2008, 06:42 PM
Post: #2
|
|||
|
|||
|
RE: Duplicate session key in insert SQL with spider bot
using IGNORE isn't a very good fix. I'm not sure if it's supported in either MySQL versions either. Might want to look into REPLACE to fix it
|
|||
|
09-27-2008, 01:05 PM
Post: #3
|
|||
|
|||
|
RE: Duplicate session key in insert SQL with spider bot
Could you try this instead?
In inc/class_session.php, find $db->insert_query and replace with $db->replace_query Thanks! |
|||
|
09-27-2008, 01:56 PM
Post: #4
|
|||
|
|||
RE: Duplicate session key in insert SQL with spider bot
(09-27-2008 01:05 PM)ZiNgA BuRgA Wrote: Could you try this instead?Sure. It should resolve this problem (in a cleaner way - it do not require changing DB class - I did not saw replace_query() method). Thanks. www.kozik.net.pl - So... Maybe you shouldn't have hacked it. - And why don't you try not breathing. Hurts, dunnit. (userfriendly.org) |
|||
|
09-29-2008, 03:48 AM
Post: #5
|
|||
|
|||
|
[F] Duplicate session key in insert SQL with spider bot
Thank you for your bug report.
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated. With regards, MyBB Group |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Search
Member List
Calendar
Help



