Customizing SMF > SMF Coding Discussion

Database Error when use search and showposts from profile.[MySQL BUG or?]

(1/4) > >>

whiterabbit:
Database Error when use search and view recent posts from profile view.

I have no idea what went wrong. I just play with SMF for awhile, post, delete,
(many times) change group... etc.

And then I click search try to search for something.
I got this when a match occure.

Database Error
Please try again. If you come back to this error screen, report the error to an administrator.  

So. I went back to my profile to see what were in those recent posts.
(action=profile;u=3;sa=showPosts)

Bamm... got the same error.

Database Error
Please try again. If you come back to this error screen, report the error to an administrator

....
I tried to track down the problem.
It's end at function boardsAllowedTo($permission) in Security.php
It error while executed this query when parameter $permission was post_reply_own

--- Code: ---// Fetch boards that have the permission globally.
$request = db_query("
SELECT b.ID_BOARD
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}board_permissions AS bp ON (bp.ID_BOARD = 0 AND bp.ID_GROUP IN (" . implode(', ', $groups) . ") AND bp.permission = '$permission')
LEFT JOIN {$db_prefix}moderators AS mod ON (mod.ID_MEMBER = $ID_MEMBER AND mod.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}board_permissions AS mod_bp ON (mod_bp.ID_BOARD = 0 AND mod_bp.ID_GROUP = 3 AND mod_bp.permission = '$permission')
WHERE b.use_local_permissions = 0
AND bp.addDeny = 1
AND (!ISNULL(bp.ID_BOARD) OR (!ISNULL(mod_bp.ID_BOARD) AND !ISNULL(mod.ID_MEMBER)))", __FILE__, __LINE__);


--- End code ---
All those error above did not happen to Admin because Admin
didn't require to run the query, so there's no problem.
I just realize that I never tried these feature with regular user before :P
....
Anybody have an idea what go wrong here? and How to fix it?
What could have cause this?
umm.. Might it be a BUG when use SMF with MySQL 4.1.1a alpha-nt ?

It happen on my test server at home:
--------
Apache Version  Apache/2.0.48 (Win32) PHP/4.3.4 
PHP Version 4.3.4
MySQL 4.1.1a alpha-nt
---------

Thanks..
-JZ-the WhiteRabbit

pulpitfire:
did you try Admin/Forum Maintenance/Find and repair errors?

whiterabbit:
Yes I already tried that and almost all functions in Forum Maintenance  :-[
But nothing solved that.

I even did a new clean install to test it, yet it still has the problem on the first try  :'(

[Unknown]:
I sorta doubt it's that query... what shows up in your error log?  (the database error should be logged in there...)

-[Unknown]

whiterabbit:

--- Quote ---http://localhost:8080/testboard/index.php?action=search2

Database Error: 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 'mod ON (mod.ID_MEMBER = 2 AND mod.ID_BOARD = b.ID_BOARD)
LE
File: E:\inetpub\wwwroot\htdocs\testboard\Sources\Security.php
Line: 485

--- End quote ---

This was shown in my forum errorlog  :-[

Navigation

[0] Message Index

[#] Next page

Go to full version