自从mysql从5.7.15升级到8.0.19之后,一直问题不断,今天项目大体完成了,因为没有测试,就自己随意点着测试,突然发现有一个统计没有数据了,查看日记,发现提示某个函数不存在,使用Navicat连接到数据库后,发现确实没有那个函数,想来导入数据的时候是一起导入的,为什么会没有了呢。
还是先恢复业务为主,从备份的数据库中拷贝函数到新数据库中,发现一只报错,提示
1418:This function has none of DETERMINISTIC, NO SQL,or READS SQL DATA in its declaration and binary logging is enabled(you might want to use the less safe log_bin_trust_function_creators variable)
参考文档MySQL 创建函数失败提示1418后,问题解决。然而这并不是结束,随后发现这个业务依旧没有数据,查看日志,发现还是原来的问题
java.sql.SQLSyntaxErrorException: Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'd.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
又开始修改sql,问题解决。
在这次问题中,发现自己对mysql的函数,存储过程一无所知,看到导入的函数,居然不知道是什么意思,为什么那么写··· ···
知识永无止境啊!