MyBB Community Forums

Full Version: Cannot modify templates: MySQL error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi.

When I try to modify my templates, and SQL error stops it. It occurs when I click on "Expand" on Default Templates. Database prefix is "foro" and my board url is http://limitrek.byethost18.com
There are no more problems in my board, only that. I'm using a custom theme called "Gloss" (obtained in this forum) and a lot of plugins.

MySQLi 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 t1.* FROM forotemplates t1 LEFT JOIN forotemplates t2 ON (t1.title=t2.title AND t2.sid='-2') WHERE t1.sid='1' AND ISNULL(t2.template) ORDER BY t1.title ASC

Screenshoot:
http://i130.photobucket.com/albums/p247/...plates.png

How can I fix it? Or how can I modify a template and upload it?

Thanks.
You might want to ask your webhost if they can fix it through their MySQL settings. Alternatively you can try this modification (but it may or may not work):

In global.php, find:
require_once "./inc/init.php";
After that, add:
$db->query("SET SQL_BIG_SELECTS=1");

See if that works.
We unfortunately can't use this patch in the official release too because other web servers will have problems with that code. Your best bet is you get your web host to change that value.

Cheers,
Tikitiki
Worked fine, thanks a lot!! *o*

Hmm, ok, I hope I will be changing my hosting to another one soon.
I have my forum hosted too in byethost, i modificate that php, but it doesn¡t works Sad

I put a tickett suport on my hosting and they told:

Quote:Hi there,
That means that your forum is trying to query more than 1000000 rows in the mysql servers.
Please trim down any tables that are large (like log tables , etc).

I don't know how to do this Sad i'm new in this world...
There is a screen of my database... if anyone can tell me what to do...

Really thanks Sad
Tell them they're wrong (resisting worse [more correct] words here...) because there isn't even 1,000 rows that are being fetched in total that are in query.
Thank you very much tikitiki, i hope that all the things i am learning here can help in the future in the spanish support forum to others Smile

I'll write to my host (again) to see what's going on... >,<
Me again >.<

They said:
Quote:The SELECT would examine more than MAX_JOIN_SIZE rows..
MAX_JOIN_SIZE == 1 million rows .
The joins between the tables must be wrong , or something else.
Please look at your database schema and resolve.

I don't kwon anything about myslq >.< i'm trying to search webs about the problem (in spanish) but i find nothing Sad if you know any page about the problem, please post it, i am desesperate ...
Thanks very much, you are wasting your time helping me Smile

Edit:
I have deleted the moderator and administrator logs, and there are less rows, but it didn't fix Sad
in MySQL not problems Smile
in MySQLi yes problems Sad
**in byethost**
Tell them to look at this query:

SELECT t1.* FROM mybb_templates t1 LEFT JOIN mybb_templates t2 ON (t1.title=t2.title AND t2.sid='-2') WHERE t1.sid='1' AND ISNULL(t2.template) ORDER BY t1.title ASC

And then tell them to run it via phpMyAdmin and see how many rows are examined.
Pages: 1 2