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

Tikv lead function inconsistent behavior with tidb #51880

Closed
Tracked by #51876
yibin87 opened this issue Mar 19, 2024 · 5 comments
Closed
Tracked by #51876

Tikv lead function inconsistent behavior with tidb #51880

yibin87 opened this issue Mar 19, 2024 · 5 comments
Assignees

Comments

@yibin87
Copy link
Contributor

yibin87 commented Mar 19, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set tidb_opt_projection_push_down = 'on';
CREATE TABLE t (c1 VARCHAR(10),
j1 JSON,
i1 INT,
b1 BLOB,
d1 DOUBLE,
e1 DECIMAL(5,4),
e2 DECIMAL(5,2));
INSERT INTO t VALUES (null, '[6]', 6, '6', 6.0, 10.0/3, 20.0/3),
('7', null , 7, '7', 7.0, 10.0/3, 20.0/3),
('8', '[8]' , 7, '8', 8.0, 10.0/3, 20.0/3),
('9', '[9]' , null, '9', 9.0, 10.0/3, 20.0/3),
('0', '[0]' , 0, null, 0.0, 10.0/3, 20.0/3),
('1', '[1]' , 1, '1', null, 10.0/3, 20.0/3),
('2', '[2]' , 2, '2', 2.0, null, 20.0/3),
('3', '[3]' , 3, '3', 3.0, 10.0/3, null);
SELECT LEAD(i1, 100, e1) OVER () lie1, IFNULL(i1, e1) ifn_ie1 FROM t;

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

lie1 ifn_ie1
3.3333 6.0000
3.3333 7.0000
3.3333 7.0000
3.3333 3.3333
3.3333 0.0000
3.3333 1.0000
NULL 2.0000
3.3333 3.0000

3. What did you see instead (Required)

3.3333 6
3.3333 7
3.3333 7
3.3333 3.3333
3.3333 0
3.3333 1
NULL 2
3.3333 3

4. What is your TiDB version? (Required)

| Release Version: v7.4.0-alpha-2012-gfe01d11df6-dirty
Edition: Community
Git Commit Hash: fe01d11
Git Branch: div_increase_prec
UTC Build Time: 2024-03-15 08:10:07

@yibin87 yibin87 added the type/bug The issue is confirmed as a bug. label Mar 19, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Mar 19, 2024

Checked tidb's consistent with mysql.

@yibin87
Copy link
Contributor Author

yibin87 commented Mar 19, 2024

/assign @yibin87

@yibin87 yibin87 changed the title Tikv inconsistent lead function behavior with tidb Tikv lead function inconsistent behavior with tidb Mar 19, 2024
@aytrack aytrack added the sig/execution SIG execution label Mar 19, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented May 21, 2024

Narrow down the case:

mysql> SELECT IFNULL(i1, e1) ifn_ie1 FROM t;
+---------+
| ifn_ie1 |
+---------+
|       6 |
|       7 |
|       7 |
|  3.3333 |
|       0 |
|       1 |
|       2 |
|       3 |
+---------+
8 rows in set (0.00 sec)

@yibin87
Copy link
Contributor Author

yibin87 commented May 22, 2024

Should be closed by tikv/tikv#16914.

@yibin87
Copy link
Contributor Author

yibin87 commented May 22, 2024

Actually duplicated with #51879

@yibin87 yibin87 closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
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

4 participants