为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
- 【TiDB 版本】:5.7.25-TiDB-v4.0.0-rc
- 【问题描述】:
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出打印结果,请务必全选并复制粘贴上传。
很奇怪的问题,使用C#程序连接TIDB数据库,连接串如下:
Database=test;Data Source=127.0.0.1;User Id=root;Password=123456;pooling=true;CharSet=utf8;port=4000;Allow User Variables=True
如上连接时,程序执行含groupby的语句会提示
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘test.c_date’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
如果将连接串中的CharSet=utf8;去掉,改成如下连接串:
Database=test;Data Source=127.0.0.1;User Id=root;Password=123456;pooling=true;port=4000;Allow User Variables=True
相同语句就不会报错。同时,直接在tidb中运行语句,也不会报错。