Open morningman opened 4 years ago
This should be a problem caused by predicate pass optimization. When the condition is passed to another table, the parameters in the condition need to be converted to the type of the corresponding table. This error will be reported when the type conversion fails. I think if the type conversion fails, the empty set should be returned directly?
https://dev.mysql.com/doc/refman/5.7/en/type-conversion.html MySQL automatically converts strings to numbers as necessary, and vice versa.
If follow the MySQL method, 'abc' will be converted to 0. other examples:
select '2.34' = 2.34,'2.34abc' = 2.34,
'abc2.34' = 2.34, '2 .34abc' = 2.34,
'2 .34abc' = 2, 'abc' = 0, 'abc' = 1;
results:
1 1
0 0
1 1 0
so the
select * from tbl1 join tbl3 on tbl1.k1 = tbl3.k1 where tbl3.k1 in ('abc');
will be rewrite as
select * from tbl1 join tbl3 on tbl1.k1 = tbl3.k1 where tbl3.k1 in (0);
does Doris want to be compatible with this type conversion?
@Astralidea You are right. Doris is want to be compatible with Mysql. We should do it and we could do this work in a single other PR.
Describe the bug
To Reproduce
Expected behavior Not throw error