pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.42k stars 5.85k forks source link

56 cases of `mysql_client_test` failed #44672

Open YangKeao opened 1 year ago

YangKeao commented 1 year ago

Bug Report

0. Background

mysql_client_test is the test cases in mysql repository. It's used to test both the server and the client(libmysql) implementation. As a MySQL-compatible database, I think it'd be better to pass all these tests. It can enrich our test cases on protocol layer.

Unfortunately, tons of the test cases have failed. They can be concluded in the following areas (except known unsupported features):

  1. Cursor. About the server status, behavior, ...
  2. ComFieldList. The type and length of a field is usually different from the expectation of the tests. I'm not sure whether it's expected.
  3. The count of warning is unexpected. (Though, I think this problem is not serious, right?).
  4. Others...

1. Minimal reproduce step (Required)

  1. git clone https://github.com/YangKeao/mysql-server.git -b known-bugs
  2. See the testclients/mysql_client_test.cc, and find "TODO" in it. Several lines are commented out with "TODO: need fix", which means this test case cannot pass on TiDB.
  3. Uncomment any one of them, and compile the target mysql_client_test. Assume the location of mysql_client_test binary is at ./cmake-build-mysql/runtime_output_directory/mysql_client_test
  4. Run MYSQL_TEST_DIR=$(pwd)/mysql-test ./cmake-build-mysql/runtime_output_directory/mysql_client_test -P 4000 -h 127.0.0.1 -u root, you'll see the error output.

For example, if I uncommented test_func_fields, I'll get:

#####################################
25 of (1/1): test_func_fields  
#####################################

 table name: `test_dateformat` (expected: `test_dateformat`)
 table name: `` (expected: ``)
 field name: `YEAR` (expected: `YEAR`)
 field org name: `YEAR` (expected: ``)/home/yangkeao/Downloads/mysql-server/testclients/mysql_client_test.cc:4767: check failed: 'field->org_name[0] == '\0''

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

All tests passed (except those which are known to be unsupported, like procedure, unsupported character set (utf8mb3) and other features).

3. What did you see instead (Required)

A lot of tests failed.

4. What is your TiDB version? (Required)

001319087533872677fff8bd1bf708ba0e5eafe6

YangKeao commented 1 year ago

BTW, remember to turn on auto-tls = true to run this test.

YangKeao commented 1 year ago

A new error is detected in the master: