Welcome to Geeklog Monday, October 26 2020 @ 05:58 pm EDT

Geeklog Forums

MySQL errors in 1.7.0


James

Anonymous
We are getting a bunch of MySQL errors in our site. We just upgraded to 1.7.0 a couple of weeks ago. Here is one of them we get several times a day.

SELECT COUNT(*) FROM%'Wink AND (title LIKE '%youtube%' OR introtext LIKE '%youtube%' OR bodytext LIKE '%youtube%'Wink)

Any suggestions of where to find this error and how to fix?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
Can you reproduce the error when you enter that search term?

The SQL query is missing the table name. The introtext/bodytext looks like this would be related to stories, but I'd doubt that we have such a glaring bug there. Could this come from a plugin that's making use of stories?

bye, Dirk
 Quote

James

Anonymous
Hi Dirk,

I can't reproduce the issue my self, but I see it continuously in the logs. This is on the mac os x hints site, which we upgraded a few weeks ago. I did the upgrade for them, with Robs input.

Here are more lines from just an hour ago:

PHP Formatted Code
Mon 24 May 2010 05:45:54 PDT - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%') AND (title LIKE '%safari%' OR introtext LIKE '%safari%' OR bodytext LIKE '%s' at line 1. SQL in question: SELECT COUNT(*) FROM%') AND (title LIKE '%safari%' OR introtext LIKE '%safari%' OR bodytext LIKE '%safari%'))  
Mon 24 May 2010 05:45:54 PDT - 256 - An SQL error has occurred. Please see error.log for details. @ /web/macosxhints.com/system/databases/mysql.class.php line 261


The plugins in the plugins folder:

calendar
captcha
commentsfeeds
links
polls
rating
spamx
staticpages
xmlsitemap
 Quote

James

Anonymous
No thoughts on this issue?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
I had a look through the code and to me this doesn't look like it's an SQL request produced by Geeklog. But since it doesn't happen all the time, I may have missed something, so I've asked Sami for a second opinion. He's travelling this week though, so it may take a few days for him to get back to us.

It would help if you could find a way to reproduce the error.

bye, Dirk
 Quote

Status: offline

sbarakat

Forum User
Junior
Registered: 22/04/08
Posts: 27
Location:Norwich, United Kingdom
Quote by: James


PHP Formatted Code
Mon 24 May 2010 05:45:54 PDT - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%') AND (title LIKE '%safari%' OR introtext LIKE '%safari%' OR bodytext LIKE '%s' at line 1. SQL in question: SELECT COUNT(*) FROM%') AND (title LIKE '%safari%' OR introtext LIKE '%safari%' OR bodytext LIKE '%safari%'))  
Mon 24 May 2010 05:45:54 PDT - 256 - An SQL error has occurred. Please see error.log for details. @ /web/macosxhints.com/system/databases/mysql.class.php line 261

As Dirk mentioned it does look like it fails searching the stories of the site. But I think there are two terms being used here. If I match it up against a SELECT statment that works (alignment may be a bit out)
PHP Formatted Code
SELECT COUNT(*)         FROM%') AND (title LIKE '%safari%' OR introtext LIKE '%safari%' OR bodytext LIKE '%safari%'))
SELECT ... FROM ... WHERE ...  AND ((title LIKE '
%safari%' OR introtext LIKE '%safari%' OR bodytext LIKE '%safari%'))
You can see that if it were one search term there would be a double bracket after the AND, eg. AND (( instead of %' ) AND ( which is what the SELECT statment would look like when using two or more terms.
So it would appear the search term is something along the lines of "... FROM safari," testing this on geeklog.net causes an error. I've just commited a patch that should fix the issue.
 Quote

All times are EDT. The time is now 05:58 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content