Skip to content

Conversation

@trasher
Copy link
Contributor

@trasher trasher commented Nov 20, 2025

No description provided.

@trasher trasher force-pushed the check/ONLY_FULL_GROUP_BY branch from 21a4113 to 03a46d2 Compare November 20, 2025 07:24
// force mysqlnd to return int and float types correctly (not as strings)
$this->dbh->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, 1);

$this->dbh->query("SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''))");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this would be sufficient. If it is possible, it would be better to not add an extra query on every GLPI request.

Suggested change
$this->dbh->query("SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''))");
if ($this->dbh->query("SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''))") === false) {
throw new RuntimeException('Unable to disable the ONLY_FULL_GROUP_BY SQL mode.');
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mo-wcma please try this alternative as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(indeed it would be better to have only 1 query)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants