Skip to content

jdbc test faild with runtime error: index out of range #29570

@aytrack

Description

@aytrack

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. git clone tidb-test
  2. cd jdbc_test
  3. start tidb, replace the host and port and run the following command.
 mvn "-Dcom.mysql.jdbc.testsuite.url=jdbc:mysql://$HOST:$PORT/test?user=root&useSSL=false&useServerPrepStmts=true" '-Dtest=CursorFetchTest' test

2. What did you expect to see? (Required)

execute successfully

3. What did you see instead (Required)

RROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.475 s <<< FAILURE! - in pingcap.tidb.test.regression.CursorFetchTest
[ERROR] testBasicFetch(pingcap.tidb.test.regression.CursorFetchTest)  Time elapsed: 0.383 s  <<< ERROR!
java.sql.SQLException: runtime error: index out of range [0] with length 0
        at pingcap.tidb.test.regression.CursorFetchTest.testBasicFetch(CursorFetchTest.java:42)

[ERROR] testFetchPart(pingcap.tidb.test.regression.CursorFetchTest)  Time elapsed: 0.064 s  <<< ERROR!
java.sql.SQLException: runtime error: index out of range [0] with length 0
        at pingcap.tidb.test.regression.CursorFetchTest.testFetchPart(CursorFetchTest.java:67)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   CursorFetchTest.testBasicFetch:42 » SQL runtime error: index out of range [0] ...
[ERROR]   CursorFetchTest.testFetchPart:67 » SQL runtime error: index out of range [0] w...
[INFO]
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.309 s
[INFO] Finished at: 2021-11-08T18:15:53+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test (default-test) on project tidb-jdbc-test: There are test failures.
[ERROR]

this maybe introduced by #28969, the test would be pass before this pr

4. What is your TiDB version? (Required)

╰─$ ./bin/tidb-server -V
Release Version: v5.4.0-alpha-40-gfdfba3e
Edition: Community
Git Commit Hash: fdfba3e4fafee8906d2dde6d737721608035aa6a
Git Branch: HEAD
UTC Build Time: 2021-11-08 10:14:53
GoVersion: go1.16.1
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions