Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Search Bug w/ "and" [R] [C-StefanT]
#1
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.
#2
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
#3
Ahh...that explains why it doesn't work for some. I was just looking into that lex...thanks for finding it so fast.
#4
Can't be reproduced, meaby a modded/older set of files?
Yes, it's true. I'm Hiro Nagamura
#5
MyBB 1.4.6
#6
I can reproduce on a clean install on localhost.
#7
I can also reproduce.

/sidenote also happens with "or"
#8
http://community.mybboard.net/thread-50823.html
#9
Just for confirmation, can we test if this only happens if "and" or "or" is the only keyword searched?
#10
(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


Forum Jump:


Users browsing this thread: 1 Guest(s)