Skip to content
New issue

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

P1-[4.0 bug hunting]-[SELECT query]-Wrong error returned #75

Open
zhangysh1995 opened this issue May 11, 2020 · 2 comments
Open

P1-[4.0 bug hunting]-[SELECT query]-Wrong error returned #75

zhangysh1995 opened this issue May 11, 2020 · 2 comments

Comments

@zhangysh1995
Copy link

zhangysh1995 commented May 11, 2020

Bug Report

1. What did you do?

mysql> select * from user where user((((((((((((((((((((( True ) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR  False )) AND ((( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) OR  False )) AND ((( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) OR  False )) AND ((( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))))) AND ((( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))))) AND ((((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))))) AND (((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) OR (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))));
ERROR 1582 (42000): Incorrect parameter count in the call to native function 'user

2. What did you expect to see?

mysql> select * from user where user((((((((((((((((((((( True ) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR  False )) AND ((( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) OR  False )) AND ((( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) OR  False )) AND ((( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) OR  False )) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))) AND (((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) AND (( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))))) AND ((( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (( 1 <=( 4751 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (( 1 <=( 4751 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) AND ((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR (( 1856 = 7703761045 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))))) AND ((((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ( 1 <=( 4751 ))) OR ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 )))))) AND (((( 1856 = 7703761045 )) OR (( 1856 = 7703761045 )) OR ( 1 <=( 4751 ))) OR (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))) AND ((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR (( 1856 = 7703761045 ))))));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(((((((((((((((((((( True ) AND (((( 1856 = 7703761045 )) OR ( 1 <=( 4751 )) OR ' at line 1

3. What did you see instead?

ERROR 1582 (42000): Incorrect parameter count in the call to native function 'user'

4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)

mysql> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                        |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-rc
Git Commit Hash: 79db9e30ab8f98ac07c8ae55c66dfecc24b43d56
Git Branch: heads/refs/tags/v4.0.0-rc
UTC Build Time: 2020-04-08 07:32:25
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

@shuke987
Copy link

/bug P2

@shuke987
Copy link

hi @zhangysh1995 , both MySQL and TiDB report an error, but different error code. So it is a compatibility issue, we give it a P2 level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants