ZhengPeiRu21 / mod-playerbots

AzerothCore Playerbots Module
MIT License
193 stars 91 forks source link

40 random bot accounts with 0 characters available #139

Open justaswell opened 1 year ago

justaswell commented 1 year ago

I changed the default bots count to 40, and got this issues:

Building random item cache from 46096 items [1055] Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'acore_world.c.map' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by Unhandled MySQL errno 1055. Unexpected behaviour possible.

i don't know the reason.

lipengg commented 1 year ago

原因:使用GROUP BY 语句违背了sql_mode=only_full_group_by。因为mysql版本5.7之后默认的模式是ONLY_FULL_GROUP_BY。需要去掉这个设置。按下面这样设置: 1.先使用下面SQL预计查询 sql_mode: SELECT @@GLOBAL.sql_mode; 可以得到下面结果: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION 2.然后调用下面sql语句重新设置sql_mode,删除ONLY_FULL_GROUP_BY: SET GLOBAL.sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

Dreathean commented 1 year ago

@justaswell I believe this issue has been resolved if you can confirm and close out this issue. Thanks!