We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 369df6a commit 21a4113Copy full SHA for 21a4113
src/DBmysql.php
@@ -266,6 +266,18 @@ public function connect($choice = null)
266
267
$this->dbh->query("SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''))");
268
269
+ //check if previous query was successful
270
+ $req = $this->doQuery("SELECT @@sql_mode as mode");
271
+ if (($data = $req->fetch_array())) {
272
+ if (!str_contains(strtoupper($data['mode']), 'ONLY_FULL_GROUP_BY')) {
273
+ trigger_error(
274
+ 'GLPI requires ONLY_FULL_GROUP_BY mode to be disabled; but this cannot be achieved programmatically. Please fix your database configuration.',
275
+ E_USER_ERROR
276
+ );
277
+ }
278
279
+
280
281
$this->connected = true;
282
283
$this->setTimezone($this->guessTimezone());
0 commit comments