Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Duplicate
-
3.0.5
-
操作系统:Windows10专业版;
MariaDB Connector/J版本:3.1.4
MySQL Server版本:5.7.24
IntelliJ IDEA: 2019.2
Description
操作系统:Windows10专业版;
MariaDB Connector/J版本:3.1.4
MySQL Server版本:5.7.24
IntelliJ IDEA: 2019.2
客户端代码:
private static String url = "jdbc:mariadb://127.0.0.1:3306/world?useUnicode=true&characterEncoding=utf-8";
public static void main(String args[]) {
try (Connection conn = DriverManager.getConnection(url, "root", "xxxxxx")) {
String sql = "(select json_col from json1) union all (select json_col from json2) order by 1 asc;";
try (Statement statement = conn.createStatement();
ResultSet resultSet = statement.executeQuery(sql)) {
ResultSetMetaData rsmd = resultSet.getMetaData();
while (resultSet.next()) {
}
}
} catch (Throwable e)
}
问题现象:
1、当使用select UNION时(select json_col from json1) union all (select json_col from json2) order by 1 asc;,查询结果集返回列类型为BLOB,是错误的。
无法上传附件截图,可在IDEA中断点查看rsmd的fieldPackets,第一项为BlobColumn(其dataType为BLOB)
2、当未使用select UNION时select json_col from json1 order by 1 asc,查询结果集返回列类型为JSON,是正确的。
无法上传附件截图,可在IDEA中断点查看rsmd的fieldPackets,第一项为JsonColumn(其dataType为JSON);
Attachments
Issue Links
- is duplicated by
-
CONJ-1099 The column type returned by a JSON field in select union is incorrect/JSON类型字段在select union中返回列类型错误
- Closed