MyBB Community Forums

Full Version: MySQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am getting the Permission Denied error (after I updated from 1.4.2 to 1.4.4) when I try to move my threads, so I searched for a way to fix it. I found that I needed to revert "showthread_moderationoptions" but when I go to ACP > Templates & Style > Templates > Find Updated Templates I get the following error.

Quote:SQL Error:
1104 - The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
Query:
SELECT COUNT(*) AS updated_count FROM mybb_templates t LEFT JOIN mybb_templates m ON (m.title=t.title AND m.sid=-2 AND m.version > t.version) WHERE t.sid > 0 AND m.template != t.template
Well I don't know how to fix that error, but put this code in the showthread_moderationoptions template (it's the default, what it would be reverted to).

{$inlinemod}
<form action="moderation.php" method="post" style="margin-top: 0; margin-bottom: 0;" id="moderator_options">
	<input type="hidden" name="modtype" value="thread" />
	<input type="hidden" name="tid" value="{$tid}" />
	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
	<span class="smalltext">
	<strong>{$lang->moderation_options}</strong></span>
	<select name="action" onchange="$('moderator_options').submit();">
		<optgroup label="{$lang->standard_mod_tools}">
			<option value="threadnotes">{$lang->thread_notes}</option>
			<option value="openclosethread">{$lang->open_close_thread}</option>
			<option value="deletethread">{$lang->delete_thread}</option>
			{$adminpolloptions}
			<option value="deleteposts">{$lang->delete_posts}</option>
			<option value="move">{$lang->move_thread}</option>
			<option value="stick">{$lang->stick_unstick_thread}</option>
			<option value="split">{$lang->split_thread}</option>
			<option value="merge">{$lang->merge_threads}</option>
			<option value="mergeposts">{$lang->merge_posts}</option>
			<option value="removeredirects">{$lang->remove_redirects}</option>
			<option value="removesubscriptions">{$lang->remove_subscriptions}</option>
			{$approveunapprovethread}
		</optgroup>
		{$customthreadtools}
	</select>
	{$gobutton}
</form>
<br />
The query must be against a large database - it will look at more information than is allowed by your host at one time (if I remember right), so to perform the action you might need to discuss increasing the limitations...
Try this, it may or may not work:

In global.php, find:
// Load main MyBB core file which begins all of the magic
require_once $working_dir."/inc/init.php";
After that line, add:
$db->query("SET SQL_BIG_SELECTS=1");