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
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL)engine=stonedb;
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
##The error results are as follows
Empty set (0.00 sec)
Expected behavior
##The following is:innodb test result
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
+---------------------+------------+
| a | b |
+---------------------+------------+
| 2001-01-01 00:00:00 | 2001-01-01 |
+---------------------+------------+
1 row in set (0.00 sec)
How To Reproduce
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL)engine=stonedb;
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
Environment
StoneDB for mysql5.7 (release)
Ubuntu 20.04.4
Are you interested in submitting a PR to solve the problem?
Yes, I will!
The text was updated successfully, but these errors were encountered:
simplifying the sql to SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b; the result is wrong because the Optimizer turns the original filter condition(a='2001-01-01 00:00:00' AND a=b) into a='2001-01-01 00:00:00' AND b=2001-01-01 00:00:00, and b is a string type, value is 2001-01-01(!='2001-01-01 00:00:00'), while innodb is correct because its term contains extra information (Arg_comparator::compare_datetime), tianmu's CQTerm does not have this information.
This query can currently be supported by modifying the sql to
SELECT*FROM t1 WHERE a='2001-01-01'AND a=b AND b='2001-01-01';
Describe the problem
Expected behavior
How To Reproduce
Environment
Are you interested in submitting a PR to solve the problem?
The text was updated successfully, but these errors were encountered: