即使禁用严格模式,MySQL错误1055

时间:2019-06-26 19:37:59

标签: mysql

即使禁用了严格模式,运行存储过程时我仍然会收到错误1055

在具有MySQL 5.7.26的Ubuntu 19.04上,我尝试了my.cnf中sql-mode的每种选项组合,并设置了有意义的global。仅包括sql-mode ='',但它仍然表现为启用了严格模式。

mysql> SHOW VARIABLES LIKE 'sql_mode';
| Variable_name | Value
| sql_mode      | IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

甚至sql模式为空

mysql> SHOW VARIABLES LIKE 'sql_mode';
| Variable_name | Value |
| sql_mode      |       |

我得到的错误是only_full_group_by仍在...

mysql> CALL getReadyToInvoiceOrders(480,-1,-1,'','','','','','');
ERROR 1055 (42000): Expression #14 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'axistms_transport_local.BPBCR.currentAwardedID' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

您可以看到“ STRICT_TRANS_TABLES”和“ ONLY_FULL_GROUP_BY”已被删除,但错误1055仍然存在

1 个答案:

答案 0 :(得分:0)

删除子句ONLY_FULL_GROUP_BY:

javax.net.debug=ssl

在5.7版MySQL中,默认设置为ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION