PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / Framework / Database / Actions / EnableBigSqlSelects.php

EnableBigSqlSelects.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/Framework/Database/Actions/EnableBigSqlSelects.php

35 lines 1023 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Give\Framework\Database\Actions;
6
7 class EnableBigSqlSelects
8 {
9 /**
10 * @since 2.22.0
11 *
12 * Enables mysql big selects for the session using a session system variable.
13 *
14 * This is necessary for hosts that have an arbitrary MAX_JOIN_SIZE limit, which prevents more complex queries from
15 * running properly. Setting SQL_BIG_SELECTS ignores this limit. This is also done by WooCommerce, supporting the
16 * idea that this is a viable option. There also doesn't seem to be a way for hosts to prevent this.
17 *
18 * @see https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_sql_big_selects
19 * @see https://dev.mysql.com/doc/refman/5.7/en/system-variable-privileges.html
20 *
21 */
22 public function __invoke()
23 {
24 static $bigSelects = false;
25
26 if (!$bigSelects) {
27 global $wpdb;
28
29 $wpdb->query('SET SESSION SQL_BIG_SELECTS=1;');
30
31 $bigSelects = true;
32 }
33 }
34 }
35