MyBB Community Forums

Full Version: [F] Search Bug w/ "and" [R] [C-StefanT]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
If you search "and" (without quotes) you get error:

Quote:SQL Error:
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 ')' at line 3
Query:
SELECT t.tid, t.firstpost FROM mybb_threads t WHERE 1=1 AND t.visible >= '0' AND t.closed NOT LIKE 'moved|%' AND ()

Doesn't happen here at Mybboard.net but it does at HF, Mybbcentral, mybbsource, mybbfans, and my clean install beta board.

It doesn't happen a few sites so not sure what the difference is. I run mysqli version 5 on my sites.
Only happens if "Search Type" is set to 'Standard'; if its set to Full Text; it gets replaced by "+" so it doesn't throw an error just a no results page =P
Ahh...that explains why it doesn't work for some. I was just looking into that lex...thanks for finding it so fast.
Can't be reproduced, meaby a modded/older set of files?
MyBB 1.4.6
I can reproduce on a clean install on localhost.
I can also reproduce.

/sidenote also happens with "or"
Just for confirmation, can we test if this only happens if "and" or "or" is the only keyword searched?
(2009-06-05, 09:30 AM)Tomm M Wrote: [ -> ]Just for confirmation, can we test if this only happens if "and" or "or" is the only keyword searched?

I have tested a few things, and it seems as though it only happens if "and" or "or" is the first word. If you use and/or within the search, it's fine, but if you start with them it shows the error.

Reproduce:

Search for "or my name is nickman"->Error
Search for "my name is nickman or Tomm M"->No error
Pages: 1 2