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?
create table t1(
id varchar(36) not null primary key,
org_id varchar(36) not null,
status tinyint default 1 not null,
ns varchar(36) default '' not null
);
create table t2(
id varchar(36) not null primary key,
order_id varchar(36) not null,
begin_time timestamp(3) default CURRENT_TIMESTAMP(3) not null
);
create index idx_oid on t2(order_id);
insert into t1 value (1,1,1,'a');
insert into t1 value (2,1,2,'a');
insert into t1 value (3,1,3,'a');
insert into t2 value (1,2,CURRENT_TIMESTAMP(3));
# v3.1.0 works, but NOT v3.1.1
SELECT COUNT(*)
FROM t1
LEFT JOIN t2 ON t1.id = t2.order_id
WHERE t1.ns = 'a'
AND t1.org_id IN (1)
AND t1.status IN (2,6,10)
AND MONTH(t2.begin_time) = MONTH('2020-05-06 10:17:24');
# using proper args for left side works
SELECT COUNT(*)
FROM t1
LEFT JOIN t2 ON t1.id = t2.order_id
WHERE t1.ns = 'a'
AND t1.org_id IN (1)
AND t1.status IN (2,6,10)
AND MONTH(DATE(t2.begin_time)) = MONTH('2020-05-06 10:17:24');
OR changing t1.status to CONVERT(t1.status, CHAR) also works.
2. What did you expect to see?
count return
3. What did you see instead?
Wrong plan type for dataReaderBuilder
4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)
Release Version: v3.1.1
Git Commit Hash: df4c9f05c49c6b8de74083d3befc20ecd8cefbfd
Git Branch: heads/refs/tags/v3.1.1
UTC Build Time: 2020-04-30 10:25:16
GoVersion: go version go1.13 linux/amd64
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?
count return
3. What did you see instead?
Wrong plan type for dataReaderBuilder
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: