[SMF 2.1.3] Search function error - Search.php (line1695)

Started by Han, December 11, 2022, 08:18:11 AM

Previous topic - Next topic

Han

Whenever I do a forumsearch I always get this error. (Screenshots added as attachement)
Search.php (line 1695)
Database error: Illegal argument to a regular expression.


We searched this forum and used google for this error but cannot find anything about it. I have no PHP or MySQL experience to figure it out myself. I can alter PHP files when provided copy/paste info to replace old lines for new lines.

Extra info you might need to figure things out:
1) We recently updated our forumsoftware from SMF 2.0.19 to SMF2.1.2 and to SMF2.1.3
The search function worked fine in SMF2.0.19. Have noticed the same error in SMF2.1.2 but took no action on it and forgot all about it, until I had to do a search today on SMF2.1.3

2) I got no errors when updating the forumsoftware to the latest version. In version SMF2.1.2 I had the textlink problem that was corrected in SMF2.1.3. and the search error was present there. At that time I thought no further of it. A bit lazy of me..., I know.

3) My webhost uses MySQL version: 8.0.3.1 and PHP Version: 7.4.33

If you need more info than provided, please ask me for it.


Diego Andrés

- What terms are you searching for?
- If you used the quick search, did you search from inside a topic or a board?

That's a bit more info that could help.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Han

I searched with the word startmenu at the index of my forum but no matter what or from where I start the search I always get this error.

Han

We have done a lot of reading and we comprihend only some of it. We understand that the introduction of MySQL version 8.0 can cause problems because it's not backward compatible anymore. My host has installed MySQL version: 8.0.3.1 on the database server. Could that cause our search problem on our forum?
Could there be a setting wrong at our hosts part?

What are the system requirements (MySQL and PHP)  to succesfully install 2.1.2 and 2.1.3 SMF forum software.
Our search problem started after the upgrade from SMF 2.0.19 to SMF2.1.2 and was still there after the upgrade to SMF2.1.3.

shawnb61

8.0.31 should be fine.

What kind of search index are you using?

How many records in your messages table?

I wonder if changing the db version in place means you need to delete & rebuild the index.  First thing I'd try.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

live627

Quote from: Han on December 11, 2022, 08:18:11 AMWhenever I do a forumsearch I always get this error. (Screenshots added as attachement)
Search.php (line 1695)
Database error: Illegal argument to a regular expression.
I think I might know what's wrong. Could you attach Search.php or send me a link to it?

Han

Quote from: shawnb61 on December 13, 2022, 09:57:04 PM8.0.31 should be fine.

What kind of search index are you using?

How many records in your messages table?

I wonder if changing the db version in place means you need to delete & rebuild the index.  First thing I'd try.

I think you meant this? As far as I see we do not use an searchindex.

Han

Quote from: live627 on December 14, 2022, 12:04:56 AMI think I might know what's wrong. Could you attach Search.php or send me a link to it?

I really hope you guys can find a sollution for our problem. Not having a functional search on a forum is no fun.
My memory about where I can find things is ok, but for sure no replacement for a our searchfunction.  ;)

Attached is my search.php.

Han

Did the my picture and file shed any light on our search problem?

Han

I changed the search method of my forum and my forumsearch works again without the former error.
I now have a custom index (I made a moderate sized index) and "force the use of a search index" is checked.

We recently upgraded our forum from version SMF 2.0.19 to the latest version.
I can not remember that I had to choose a search method in 2.0.1.9 or before that. Is this new since SMF version 2.1.x?
Will my searchindex update itself do i need to do anything to maintain it ?

shawnb61

This is a bug, and reproducible:
https://github.com/SimpleMachines/SMF/issues/7654

This appears to be tied to changes to MySQL 8.0.x, & only happens when you use 'match whole words only' & do not have an index.

Moved to Bug Reports.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Han

I understand from github that there is a solution for it but my php knowledge is not sufficient enough to I understand all of it.
Will this fix be in the next forumupdate?

Kindred

It will be in a future update....   don't know about "the next one".
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Han


Advertisement: