mysql8 compatibility issue/fix

Community Support for Booked Scheduler
Post Reply
malc
Posts: 1
Joined: Fri Apr 30, 2021 9:48 am

mysql8 compatibility issue/fix

Post by malc »

Posting solution here because I didn't find it.

Issue:

Dashboard fails to load, everything else works just great. Error logs have:

2021-04-30T09:30:16+00:00 [853634] ERROR default - [User=**** (****@***.com)] Uncaught exception: Exception: There was an error executing your query\nExpression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'bookedscheduler.rs.date_created' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /var/www/html/rrt/lib/Database/MySQL/MySqlConnection.php:124

Booked: v2.10.1 / mysql Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))

Cause:

The code in `Database/MySQL/MySqlConnection.php` *tries* to set more relaxed sqlmode, but silently fails because 'NO_AUTO_CREATE_USER' is no longer a valid option.

Code: Select all

mysqli_query($this->_db, "SET SESSION sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");
Fix (for me@mysql8 at least) - remove the option.

Code: Select all

mysqli_query($this->_db, "SET SESSION sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'");
A more robust fix would be to check the result of that command and fall thru various compatibility options until one works.

Thanks for a great tool,
malc.

herby1620
Posts: 13
Joined: Tue Jul 28, 2020 9:32 pm

Re: mysql8 compatibility issue/fix

Post by herby1620 »

Booked 2.10.1??
Shouldn't you talk to the vendor? You paid for it?

Post Reply