You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
use test;
drop table if exists t;
create table t(a int, b int);
insert into t values(1,2),(1,3),(2,3),(-1,1),(-1,-1);
prepare stmt from "select sum(b) over w, nth_value(b, ?) over w from t window w as (partition by a)";
set @a=1;
execute stmt using @a;
2. What did you expect to see?
mysql> execute stmt using @a;
+---------------+------------------------+
| sum(b) over w | nth_value(b, ?) over w |
+---------------+------------------------+
| 0 | 1 |
| 0 | 1 |
| 5 | 2 |
| 5 | 2 |
| 3 | 3 |
+---------------+------------------------+
5 rows in set (0.00 sec)
3. What did you see instead?
mysql> execute stmt using @a;
ERROR 1210 (HY000): Incorrect arguments to nth_value
4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)
Release Version: v4.0.0-rc-11-g78922a8ab
Git Commit Hash: 78922a8abef2f21e4d8990d37c6c67ac7b0eef42
Git Branch: HEAD
UTC Build Time: 2020-04-14 08:35:18
GoVersion: go1.13.1
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:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)The text was updated successfully, but these errors were encountered: