We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First open a mysql client with option --column-type-info, such as mysql --comments --column-type-info --host 127.0.0.1 --port 3306 -u root -p.
--column-type-info
mysql --comments --column-type-info --host 127.0.0.1 --port 3306 -u root -p
Then by executing a statement with nested CAST(), such as select cast(cast(1 as binary) as binary);, it can be found that the length field is wrong.
CAST()
select cast(cast(1 as binary) as binary);
mysql> select cast(cast(1 as binary) as binary); Field 1: `cast(cast(1 as binary) as binary)` Catalog: `def` Database: `` Table: `` Org_table: `` Type: VAR_STRING Collation: binary (63) Length: 2 Max_length: 1 Decimals: 31 Flags: BINARY +----------------------------------------------------------------------+ | cast(cast(1 as binary) as binary) | +----------------------------------------------------------------------+ | 0x31 | +----------------------------------------------------------------------+ 1 row in set (0.00 sec)
mysql> select cast(cast(1 as binary) as binary); Field 1: `cast(cast(1 as binary) as binary)` Catalog: `def` Database: `` Table: `` Org_table: `` Type: VAR_STRING Collation: binary (63) Length: 0 Max_length: 1 Decimals: 31 Flags: NOT_NULL BINARY +----------------------------------------------------------------------+ | cast(cast(1 as binary) as binary) | +----------------------------------------------------------------------+ | 0x31 | +----------------------------------------------------------------------+ 1 row in set (0.00 sec)
| Release Version: v6.1.0-alpha-490-g9d0d45981 Edition: Community Git Commit Hash: 9d0d459816705e60205d074f3183c8773086e2b0 Git Branch: master UTC Build Time: 2022-05-23 14:59:53 GoVersion: go1.18.2 Race Enabled: false TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 Check Table Before Drop: false |
The text was updated successfully, but these errors were encountered:
Does this bug has anything to do with this one #34823 ?
Sorry, something went wrong.
Oh, this is a separate one and is not relevant to #34823.
1d4514a
Successfully merging a pull request may close this issue.
Bug Report
1. Minimal reproduce step (Required)
First open a mysql client with option
--column-type-info
, such asmysql --comments --column-type-info --host 127.0.0.1 --port 3306 -u root -p
.Then by executing a statement with nested
CAST()
, such asselect cast(cast(1 as binary) as binary);
, it can be found that the length field is wrong.2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: