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

Results are different when tidb_enable_vectorized_expression is off #29434

Closed
guo-shaoge opened this issue Nov 4, 2021 · 2 comments · Fixed by #29438
Closed

Results are different when tidb_enable_vectorized_expression is off #29434

guo-shaoge opened this issue Nov 4, 2021 · 2 comments · Fixed by #29438
Assignees
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. severity/major type/bug The issue is confirmed as a bug.

Comments

@guo-shaoge
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1;
create table t1(c1 datetime);
insert into t1 values('2021-12-12 10:10:10.000');
set tidb_enable_vectorized_expression = on;
select greatest(c1, '99999999999999') from t1;
set tidb_enable_vectorized_expression = off;
select greatest(c1, '99999999999999') from t1;

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

Result should be same.

3. What did you see instead (Required)

mysql> set tidb_enable_vectorized_expression = on;
Query OK, 0 rows affected (0.01 sec)

mysql> select greatest(datetime_1, '999999999999') from test_GREATEST;
+--------------------------------------+
| greatest(datetime_1, '999999999999') |
+--------------------------------------+
| 999999999999                         |
+--------------------------------------+
1 row in set, 1 warning (0.04 sec)

mysql> set tidb_enable_vectorized_expression = off;
Query OK, 0 rows affected (0.01 sec)

mysql> select greatest(datetime_1, '999999999999') from test_GREATEST;
+--------------------------------------+
| greatest(datetime_1, '999999999999') |
+--------------------------------------+
| 2021-10-20 10:10:10                  |
+--------------------------------------+
1 row in set, 1 warning (1.94 sec)

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                              |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.3.0-alpha-1317-ga0cd121f19
Edition: Community
Git Commit Hash: a0cd121f19ef6d33b26b8bcc19a177e7c920291f
Git Branch: master
UTC Build Time: 2021-11-04 00:24:48
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.03 sec)
@guo-shaoge guo-shaoge added the type/bug The issue is confirmed as a bug. label Nov 4, 2021
@guo-shaoge guo-shaoge self-assigned this Nov 4, 2021
@guo-shaoge
Copy link
Collaborator Author

According to the mysql bug report, the result should be "999999999999 ".

@github-actions
Copy link

github-actions bot commented Nov 4, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants