SQL errors

The next generation of server controlling with clean and powerful user interface

Moderators: oliverde8, reaby, NADEO

Post Reply
bass
Posts: 85
Joined: 21 Sep 2011, 23:36

SQL errors

Post by bass »

Hi seeing these errors after I updated server to php 7.. Any ideas what might be broken?

Thanks.

Code: Select all

[2016-09-14T21:18:05+02:00] 
    Occured on 14.09.2016 at 21:18:05 at process with ID #22239
    ---------------------------------
 -> ManiaLive\Database\QueryException with code 1055
    Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'eXpansion.r1.record_score' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
  - in /home/TMServer/eXpansion/vendor/maniaplanet/manialive-lib/ManiaLive/Database/MySQLI/Connection.php on line 147
  - Stack: #0 /home/TMServer/eXpansion/vendor/ml-expansion/expansion/LocalRecords/LocalBase.php(1513): ManiaLive\Database\MySQLI\Connection->execute('INSERT INTO exp...')
           #1 /home/TMServer/eXpansion/vendor/ml-expansion/expansion/LocalRecords/LocalBase.php(509): ManiaLivePlugins\eXpansion\LocalRecords\LocalBase->updateRanks('erm4Vw69DiARmau...', 1, true)
           #2 /home/TMServer/eXpansion/vendor/maniaplanet/manialive-lib/ManiaLive/DedicatedApi/Callback/Event.php(71): ManiaLivePlugins\eXpansion\LocalRecords\LocalBase->onEndMatch(Array, -1)
           #3 /home/TMServer/eXpansion/vendor/maniaplanet/manialive-lib/ManiaLive/Event/Dispatcher.php(132): ManiaLive\DedicatedApi\Callback\Event->fireDo(Object(ManiaLivePlugins\eXpansion\LocalRecords\LocalRecords))
           #4 /home/TMServer/eXpansion/vendor/maniaplanet/manialive-lib/ManiaLive/Application/Application.php(123): ManiaLive\Event\Dispatcher::dispatch(Object(ManiaLive\DedicatedApi\Callback\Event))
           #5 /home/TMServer/eXpansion/bootstrapper.php(79): ManiaLive\Application\Application->run()
           #6 {main}

[2016-09-14T21:30:13+02:00] 
    Occured on 14.09.2016 at 21:30:13 at process with ID #22239
    ---------------------------------
 -> ManiaLive\Database\QueryException with code 1055
    Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'eXpansion.r1.record_score' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
  - in /home/TMServer/eXpansion/vendor/maniaplanet/manialive-lib/ManiaLive/Database/MySQLI/Connection.php on line 147
  - Stack: #0 /home/TMServer/eXpansion/vendor/ml-expansion/expansion/LocalRecords/LocalBase.php(1513): ManiaLive\Database\MySQLI\Connection->execute('INSERT INTO exp...')
           #1 /home/TMServer/eXpansion/vendor/ml-expansion/expansion/LocalRecords/LocalBase.php(509): ManiaLivePlugins\eXpansion\LocalRecords\LocalBase->updateRanks('hWQFIMMlC6ZXCFA...', 1, true)
           #2 /home/TMServer/eXpansion/vendor/maniaplanet/manialive-lib/ManiaLive/DedicatedApi/Callback/Event.php(71): ManiaLivePlugins\eXpansion\LocalRecords\LocalBase->onEndMatch(Array, -1)
           #3 /home/TMServer/eXpansion/vendor/maniaplanet/manialive-lib/ManiaLive/Event/Dispatcher.php(132): ManiaLive\DedicatedApi\Callback\Event->fireDo(Object(ManiaLivePlugins\eXpansion\LocalRecords\LocalRecords))
           #4 /home/TMServer/eXpansion/vendor/maniaplanet/manialive-lib/ManiaLive/Application/Application.php(123): ManiaLive\Event\Dispatcher::dispatch(Object(ManiaLive\DedicatedApi\Callback\Event))
           #5 /home/TMServer/eXpansion/bootstrapper.php(79): ManiaLive\Application\Application->run()
           #6 {main}
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: SQL errors

Post by oliverde8 »

For some reasons you have the only_full_group_by option enabled in your MYSQL; that should not be the case by default.

Are you running Linux(which distribution)? Or Windows (wamp, xampp) ?
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: SQL errors

Post by undef.de »

It seem that the ONLY_FULL_GROUP_BY is now enabled by default:
As of MySQL 5.7.5, the default SQL mode includes ONLY_FULL_GROUP_BY.
http://dev.mysql.com/doc/refman/5.7/en/ ... l_group_by

Maybe this helps:

Code: Select all

SET GLOBAL sql_mode = '';
SET SESSION sql_mode = '';
But note http://stackoverflow.com/a/31058962
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: SQL errors

Post by oliverde8 »

Well, I started using DB with Oracle DB, which actually didn't allow to have this scenario. Until quite recently I never did queries in MYSQL without having all the SELECTS in the group by.
But so many applications are using group by this way, I started doing it as well :( .

I am going to fix this in eXpansion it shouldn't be to complicated I hope there isn't many of them.

I think the best way for now is to change the mysql/my.cnf

Add this to the end of the file
[mysqld]
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Then restart,
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
bass
Posts: 85
Joined: 21 Sep 2011, 23:36

Re: SQL errors

Post by bass »

Thx guys.. helpful as usual :thumbsup:
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: SQL errors

Post by undef.de »

oliverde8 wrote:[mysqld]
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Not fully visible because off no code block, here is the complete list:

Code: Select all

[mysqld]
sql_mode = "STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION"
8-)
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: SQL errors

Post by oliverde8 »

bass wrote:Thx guys.. helpful as usual :thumbsup:
Which version of mysql are you using? I can't reproduce the bug with mysql 5.7.14
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
Post Reply

Return to “eXpansion”

Who is online

Users browsing this forum: No registered users and 2 guests