Problem with MAX_JOIN_SIZE using Cakephp
I got strange error message when trying to upload to remote server. My client buy hosting and probably a shared hosting. The error message is this
Error: SQLSTATE[42000]: Syntax error or access violation: 1104 The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
So i start to figure out, i believe this is related with server setting because the application run correctly locally without any error. So after google, i found fast solution to fix this problem
Edit /lib/Cake/Model/AclNode.php and add this line text after line 112. I am using cakephp 2.1.3
$db->query(‘SET SQL_BIG_SELECTS=1’); //Add this line
$result = $db->read($this, $queryData, -1);
$path = array_values($path);
It seem problem only on shared hosting. I hope this articles help you