This is an automated email from the ASF dual-hosted git repository.
dongzonglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new f3f923b #6603, fix incompatible with sql_mode=only_full_group_by when
test with MySQL 5.7.x or above (#6647)
f3f923b is described below
commit f3f923bca34551f684bfdcac1beff09fabacc270
Author: Zhang Yonglun <[email protected]>
AuthorDate: Wed Aug 5 20:37:01 2020 +0800
#6603, fix incompatible with sql_mode=only_full_group_by when test with
MySQL 5.7.x or above (#6647)
---
.../apache/shardingsphere/dbtest/env/datasource/DataSourceUtil.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/datasource/DataSourceUtil.java
b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/datasource/DataSourceUtil.java
index ae15007..220db32 100644
---
a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/datasource/DataSourceUtil.java
+++
b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/datasource/DataSourceUtil.java
@@ -81,6 +81,9 @@ public final class DataSourceUtil {
if ("Oracle".equals(databaseType.getName())) {
result.setConnectionInitSqls(Collections.singleton("ALTER SESSION
SET CURRENT_SCHEMA = " + dataSourceName));
}
+ if ("MySQL".equals(databaseType.getName())) {
+ result.setConnectionInitSqls(Collections.singleton("SET GLOBAL
sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))"));
+ }
return result;
}
@@ -97,6 +100,9 @@ public final class DataSourceUtil {
if ("Oracle".equals(databaseType.getName())) {
result.setConnectionInitSql("ALTER SESSION SET CURRENT_SCHEMA = "
+ dataSourceName);
}
+ if ("MySQL".equals(databaseType.getName())) {
+ result.setConnectionInitSql("SET GLOBAL sql_mode=(SELECT
REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))");
+ }
return new HikariDataSource(result);
}