Tidb5.0 java jdbc8 select column 出现其他列数据

Bug 反馈
清晰准确地描述您发现的问题,提供任何可能复现问题的步骤有助于研发同学及时处理问题
【 Bug 的影响】
影响产线数据查询,获取数据错误
【可能的问题复现步骤】
使用mysql jdbc8 查看,


发现uuid 列展示的是其他列数据,meeting_all_minutes 数据也没这么大,
使用select * 得到的结果都是正确的

【看到的非预期行为】
返回数据不对
【期望看到的行为】

【相关组件及具体版本】

【其他背景信息或者截图】
如集群拓扑,系统和内核版本,应用 app 信息等;如果问题跟 SQL 有关,请提供 SQL 语句和相关表的 Schema 信息;如果节点日志存在关键报错,请提供相关节点的日志内容或文件;如果一些业务敏感信息不便提供,请留下联系方式,我们与您私下沟通。

最新进展,使用java code直接查询还好没有出现数据偏差情况,贴下查询代码

        DriverManager.registerDriver(new com.mysql.jdbc.Driver());
        Connection connection = DriverManager.getConnection("jdbc:mysql://tidb-sjc.webex.com:4000/insights", "root", "");
        Statement statement = connection.createStatement();
        String sql = "select uuid,meeting_all_minutes,meeting_people from people_insights_data_detail_day_and_week where uuid='428ff6a1-bb37-42ac-9883-33d7a29961e6' and date_type='last1_7day'";
        ResultSet resultSet = statement.executeQuery(sql);
        while (resultSet.next()) {
            String uuid = resultSet.getString("uuid");
            Long meeting_all_minutes = resultSet.getLong("meeting_all_minutes");
            Long meeting_people = resultSet.getLong("meeting_people");
            System.out.println("uuid: " + uuid + " meeting_all_minutes: " + meeting_all_minutes + " meeting_people: " + meeting_people);
        }
        statement.close();
        connection.close();

结果:

uuid: 428ff6a1-bb37-42ac-9883-33d7a29961e6 meeting_all_minutes: 298 meeting_people: 55
uuid: 428ff6a1-bb37-42ac-9883-33d7a29961e6 meeting_all_minutes: 263 meeting_people: 42
uuid: 428ff6a1-bb37-42ac-9883-33d7a29961e6 meeting_all_minutes: 336 meeting_people: 33
uuid: 428ff6a1-bb37-42ac-9883-33d7a29961e6 meeting_all_minutes: 278 meeting_people: 33
uuid: 428ff6a1-bb37-42ac-9883-33d7a29961e6 meeting_all_minutes: 327 meeting_people: 54
uuid: 428ff6a1-bb37-42ac-9883-33d7a29961e6 meeting_all_minutes: 314 meeting_people: 33
uuid: 428ff6a1-bb37-42ac-9883-33d7a29961e6 meeting_all_minutes: 237 meeting_people: 33
uuid: 428ff6a1-bb37-42ac-9883-33d7a29961e6 meeting_all_minutes: 151 meeting_people: 53

感觉是最新5.0版本和dbeaver 或者idea 集成出现了问题,4.0版本没有这个问题

我们尽快看一下,稍等哈~ 有进展及时同步一下。

这边查到的一些错误日志,希望有帮助,因为有的sql 直接index 越界了

[conn.go:736] [“connection running loop panic”] [conn=588469] [lastSQL="/* ApplicationName=IntelliJ IDEA 2019.3.5 */ select meeting_all_num, meeting_all_minutes, meeting_people from people_insights_data_detail_day_and_week where uuid=‘428ff6a1-bb37-42ac-9883-33d7a29961e6’ and date_type=‘day’"] [err=“runtime error: index out of range [80] with length 75”] [stack=“goroutine 460763579 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x4004660, 0xc0109b6c00, 0xc0554d2200)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:734 +0xee\ panic(0x3799860, 0xc0456b0140)\ \t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/server.(*clientConn).writeResultset.func1(0xc0452b9100, 0x4004660, 0xc0452e0930, 0xc0554d2200)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1749 +0x4e2\ panic(0x3799860, 0xc0456b0140)\ \t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/util/chunk.(*Column).GetInt64(…)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/chunk/column.go:503\ngithub.com/pingcap/tidb/util/chunk.Row.GetInt64(...)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/chunk/row.go:52\ github.com/pingcap/tidb/server.dumpTextRow(0xc00ec80000, 0x4, 0x400, 0xc0456a0700, 0x3, 0x4, 0xc045526af0, 0xa, 0xc00ec80000, 0x22, …)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/util.go:306 +0x18bf\ngithub.com/pingcap/tidb/server.(*clientConn).writeChunks(0xc0554d2200, 0x4004660, 0xc0452e0930, 0x4024d60, 0xc045526aa0, 0xc000029000, 0x1dfad36, 0x3678a20, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1840 +0x427\ngithub.com/pingcap/tidb/server.(*clientConn).writeResultset(0xc0554d2200, 0x4004660, 0xc0452e0930, 0x4024d60, 0xc045526aa0, 0x24d00, 0x0, 0x0, 0x0, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1762 +0x201\ngithub.com/pingcap/tidb/server.(*clientConn).handleStmt(0xc0554d2200, 0x4004660, 0xc0452e0930, 0x402b2a0, 0xc0535d9200, 0x5f96f80, 0x0, 0x0, 0x1, 0x0, …)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1656 +0x242\ngithub.com/pingcap/tidb/server.(*clientConn).handleQuery(0xc0554d2200, 0x40045a0, 0xc0450e71c0, 0xc0435b88c1, 0xdd, 0x0, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1503 +0x44f\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch(0xc0554d2200, 0x40045a0, 0xc0450e71c0, 0xc0435b88c0, 0xde, 0xdd, 0x0, 0x0)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1037 +0x6f2\ngithub.com/pingcap/tidb/server.(*clientConn).Run(0xc0554d2200, 0x4004660, 0xc0109b6c00)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:795 +0x293\ngithub.com/pingcap/tidb/server.(*Server).onConn(0xc00137a1a0, 0xc0554d2200)\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/server.go:477 +0xb1b\ created by github.com/pingcap/tidb/server.(*Server).Run\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/server.go:380 +0x8a5\ ”]

谢谢!请问,是否可以提供一下表结构?

另外,也请提供一下这条查询的 explain 结果:

explain select meeting_all_num, meeting_all_minutes, meeting_people from people_insights_data_detail_day_and_week where uuid=‘428ff6a1-bb37-42ac-9883-33d7a29961e6’ and date_type=‘day’

谢谢!

已经复现,确定是一个 bug,我们尽快修复

1 个赞