News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Length of url field in log_spider_hits Table

Started by sah62, August 31, 2018, 11:32:47 AM

Previous topic - Next topic

sah62

SMF 2.0.15

I've recently encountered a spider that consistently produces  values for the url field in the log_spider_hits table that cause a "Database Error: Data too long for column 'url' at row 1" error when attempting to insert a new row in the table. Here's the error:

https://mysite/forum/index.php?topic=3453.0;wap2
Database Error: Data too long for column 'url' at row 1
File: /mysite/public_html/forum/Sources/ManageSearchEngines.php
Line: 562


Here's an example of an offending value:

a:4:{s:5:"topic";i:20433;s:3:"all";s:0:"";s:5:"board";i:19;s:10:"USER_AGENT";s:198:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)";}

The url field is defined as "varchar(255)"; the value above is 286 characters long. I was able to increase the length of the field (I went with varchar(511)) in my installation to eliminate the error, but perhaps this should also be fixed in the code to increase the length of the field so that anyone doing a new installation or an upgrade won't run into the same problem.


live627

Thanks for the report. Won't be fixed in 2.0.x, sorryyy.

Advertisement: