Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions administrator/components/com_config/forms/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,20 @@
showon="dbtype:mysql,mysqli[AND]dbencryption:2"
/>

<field
name="dbsqlbigselects"
type="list"
label="COM_CONFIG_FIELD_DATABASE_SQL_BIG_SELECTS_LABEL"
default="0"
showon="dbtype:mysql,mysqli"
filter="integer"
validate="options"
>
<option value="0">COM_CONFIG_FIELD_DATABASE_SQL_BIG_SELECTS_VALUE_NONE</option>
<option value="1">JNO</option>
<option value="2">JYES</option>
</field>

</fieldset>

<fieldset
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/com_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ COM_CONFIG_FIELD_DATABASE_NAME_LABEL="Database Name"
COM_CONFIG_FIELD_DATABASE_PASSWORD_DESC="Do not edit this field unless absolutely necessary (eg after the transfer of the database to a new hosting provider)."
COM_CONFIG_FIELD_DATABASE_PASSWORD_LABEL="Database Password"
COM_CONFIG_FIELD_DATABASE_PREFIX_LABEL="Database Tables Prefix"
COM_CONFIG_FIELD_DATABASE_SQL_BIG_SELECTS_LABEL="Allow large queries"
COM_CONFIG_FIELD_DATABASE_SQL_BIG_SELECTS_VALUE_NONE="No change (server controlled)"
COM_CONFIG_FIELD_DATABASE_TYPE_DESC="Do not change this to a different database technology e.g. from MySQLi (MySQL database technology) to PostgreSQL (Postgres database technology); it will break your site."
COM_CONFIG_FIELD_DATABASE_TYPE_LABEL="Database Type"
COM_CONFIG_FIELD_DATABASE_USERNAME_LABEL="Database Username"
Expand Down
1 change: 1 addition & 0 deletions installation/configuration.php-dist
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class JConfig
public $dbsslcert = '';
public $dbsslca = '';
public $dbsslcipher = '';
public $dbsqlbigselects = 0;

/* Server Settings */
public $secret = ''; // Use something very secure. For example on linux the following command `cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-16} | head -n 1`
Expand Down
10 changes: 10 additions & 0 deletions libraries/src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,16 @@ protected static function createDbo()
}
}

// Set sql_big_selects variable for mysql adapters
if (in_array($conf->get('dbtype'), ['mysql', 'mysqli'])) {
$sqlbigselects = (int) $conf->get('dbsqlbigselects');

// Only set option if enforced by configuration
if ($sqlbigselects !== 0) {
$options['sqlBigSelects'] = $sqlbigselects === 2;
}
}

try {
$db = DatabaseDriver::getInstance($options);
} catch (\RuntimeException $e) {
Expand Down
10 changes: 10 additions & 0 deletions libraries/src/Service/Provider/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ function (Container $container) {
$options['charset'] = 'utf8mb4';
}

// Set sql_big_selects variable for mysql adapters
if (in_array(strtolower($dbtype), ['mysql', 'mysqli'])) {
$sqlbigselects = (int) $conf->get('dbsqlbigselects');

// Only set option if enforced by configuration
if ($sqlbigselects !== 0) {
$options['sqlBigSelects'] = $sqlbigselects === 2;
}
}

if (JDEBUG) {
$options['monitor'] = new \Joomla\Database\Monitor\DebugMonitor();
}
Expand Down