39 $this->connection =
$resource->getConnection();
40 $this->defaultMaxHeapTableSie = 1024 * 1024 * 64;
51 public function set($maxHeapTableSize =
null)
53 $maxHeapTableSize = (int) (
null === $maxHeapTableSize ? $this->defaultMaxHeapTableSie : $maxHeapTableSize);
54 if (!$maxHeapTableSize) {
55 throw new \InvalidArgumentException(
'Wrong max_heap_table_size parameter');
58 $this->currentMaxHeapTableSize = (int)$this->connection->fetchOne(
'SELECT @@session.max_heap_table_size');
59 if (!$this->currentMaxHeapTableSize) {
60 throw new \RuntimeException(
'Can not extract max_heap_table_size');
63 $this->connection->query(
'SET SESSION max_heap_table_size = ' . $maxHeapTableSize);
74 if (
null === $this->currentMaxHeapTableSize) {
75 throw new \RuntimeException(
'max_heap_table_size parameter is not set');
77 $this->connection->query(
'SET SESSION max_heap_table_size = ' . $this->currentMaxHeapTableSize);
__construct(ResourceConnection $resource)