Post by sicotommo » Fri May 31, 2019 5:11 am

Hi all

I have a problem of moving a site (OC V3.0.2) and database: whenever i import the mysql db through phpmyadmin and connect the site to it i get an error that i don't get on the original site and db, even though they are on the same host:

"PHP Fatal error: Uncaught Exception: Error: 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<br />Error No: 1104<br />SELECT p.product_id, (SELECT AVG(rating)............on system/library/db/mysqli.php on line 40"

I have to use "SET SQL_BIG_SELECTS=1" but i wouldn't know where to set it, can anyone offer any assistance?

Thanks for your help in advance.

Regards

New member

Posts

Joined
Wed Jul 27, 2011 8:55 am

Post by kestas » Fri May 31, 2019 3:24 pm


Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by knowband.plugins » Fri May 31, 2019 4:32 pm

Open the MySQL DB backup file (.sql) & write the line at the top of the file & save the same.

SET SESSION SQL_BIG_SELECTS=1

Let us know if the issue still persists.

Regards,
Knowband Team

Opencart Plugins: Knowband Store
Email: support@knowband.com


User avatar
Active Member

Posts

Joined
Thu Aug 04, 2016 2:56 pm


Post by paulfeakins » Fri May 31, 2019 7:59 pm

sicotommo wrote:
Fri May 31, 2019 5:11 am
The SELECT would examine more than MAX_JOIN_SIZE rows
Send this to your web host, they should fix.

If not move hosts (we and others provide OpenCart specific hosting).

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by sicotommo » Fri May 31, 2019 10:56 pm

Thanks all

I get the following error doing that: PHP Parse error: syntax error, unexpected 'SQL_BIG_SELECTS' (T_STRING) in /system/library/db/mysqli.php on line 2

This is the file, where do i put it?

Code: Select all

<?php
namespace DB;
final class MySQLi {
	private $connection;

	public function __construct($hostname, $username, $password, $database, $port = '3306') {
		$this->connection = new \mysqli($hostname, $username, $password, $database, $port);

		if ($this->connection->connect_error) {
			throw new \Exception('Error: ' . $this->connection->error . '<br />Error No: ' . $this->connection->errno);
		}

		$this->connection->set_charset("utf8");
		$this->connection->query("SET SQL_MODE = ''");
	}

	public function query($sql) {
		$query = $this->connection->query($sql);

		if (!$this->connection->errno) {
			if ($query instanceof \mysqli_result) {
				$data = array();

				while ($row = $query->fetch_assoc()) {
					$data[] = $row;
				}

				$result = new \stdClass();
				$result->num_rows = $query->num_rows;
				$result->row = isset($data[0]) ? $data[0] : array();
				$result->rows = $data;

				$query->close();

				return $result;
			} else {
				return true;
			}
		} else {
			throw new \Exception('Error: ' . $this->connection->error  . '<br />Error No: ' . $this->connection->errno . '<br />' . $sql);
		}
	}

	public function escape($value) {
		return $this->connection->real_escape_string($value);
	}
	
	public function countAffected() {
		return $this->connection->affected_rows;
	}

	public function getLastId() {
		return $this->connection->insert_id;
	}
	
	public function connected() {
		return $this->connection->ping();
	}
	
	public function __destruct() {
		$this->connection->close();
	}
}
Thanks for your help!!

New member

Posts

Joined
Wed Jul 27, 2011 8:55 am
Who is online

Users browsing this forum: AndreyPopov and 34 guests