-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Different results of Function :=(Assign a value) #11212
Comments
/assign |
Confirming that this can still be reproduced on master: SELECT 'x' = ( @A := 0 ) ;
..
mysql> SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 0 |
+-------------------+
1 row in set (0.00 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-769-g2024e4463
Edition: Community
Git Commit Hash: 2024e44636f2fb9798982a1cc0ec22176e07f5c1
Git Branch: master
UTC Build Time: 2020-07-14 09:26:07
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) |
For MySQL 5.7.29, the result is the same as TiDB. mysql > SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 1 |
+-------------------+
1 row in set, 1 warning (0.00 sec)
mysql > show warnings;
+---------+------+---------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'x' |
+---------+------+---------------------------------------+
1 row in set (0.01 sec)
mysql > select version();
+-----------+
| version() |
+-----------+
| 5.7.29 |
+-----------+
1 row in set (0.00 sec) Maybe we should close the issue. What's your opinion? @SunRunAway @nullnotnil |
I am not getting the same result in TiDB and MySQL. TiDB returns 0, with MySQL returning either 1 or 2 warnings: tidb> SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 0 |
+-------------------+
1 row in set (0.00 sec)
tidb> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-1463-gff69dfd41-dirty
Edition: Community
Git Commit Hash: ff69dfd41fd3cbeb9478102b38fbbc83e368ca0a
Git Branch: is-client-errors
UTC Build Time: 2020-11-03 02:42:02
GoVersion: go1.13.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
mysql [localhost:5731] {msandbox} ((none)) > SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 1 |
+-------------------+
1 row in set, 1 warning (0.00 sec)
mysql [localhost:8022] {msandbox} ((none)) > SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 1 |
+-------------------+
1 row in set, 2 warnings (0.00 sec) |
/pick-up |
Pick up success. |
@Win-Man Friendly ping~ Do you have any updates on this? |
@ichn-hu I think this problem is caused by rewriteVariable, TiDB handles variable A as But I have not yet figured out how to fix it. |
|
@Win-Man You did not submit PR within 7 days, so give up automatically. |
@lzmhhh123 I tested it, #18973 could fix this problem.
I don't need to fix it by myself. |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
tidb-server -V
or runselect tidb_version();
on TiDB)?0ea1bf0
SIG slack channel
#sig-exec
Score
Mentor
The text was updated successfully, but these errors were encountered: