Hi there,
I need help with the correct syntax and where exactly to add the statement. I'm having issue with Stock management in Ps 1.7.3 and i need to add SQL_BIG_SELEC=1 before the select. It's not possible to change server settings. Below is the function with the query in it. I know i have to add one of those statement but dont know where to insert it. Actually shouldn't be SET SESSION... Too many unknows for me.
Db::getInstance()->execute('SET SQL_BIG_SELECTS=1');
Db::getInstance(_PS_USE_SQL_SLAVE_)->execute('SET SQL_BIG_SELECTS=1');
StockRepository.php
protected function selectSql( $andWhereClause = '', $having = '', $orderByClause = null ) { if (is_null($orderByClause)) { $orderByClause = $this->orderByProductIds(); } return str_replace( array( '{left_join}', '{and_where}', '{having}', '{order_by}', '{table_prefix}', ), array( $this->joinLimitingCombinationsPerProduct(), $andWhereClause, $having, $orderByClause, $this->tablePrefix, ), 'SELECT SQL_CALC_FOUND_ROWS p.id_product AS product_id, ...... ....... GROUP BY p.id_product, COALESCE(pa.id_product_attribute, 0) HAVING 1 {having} {order_by} '); }
check that link for the full code https://github.com/PrestaShop/PrestaShop/blob/develop/src/PrestaShopBundle/Entity/Repository/StockRepository.php
.png.022b5452a8f28f552bc9430097a16da2.png)