noisepage icon indicating copy to clipboard operation
noisepage copied to clipboard

Optimizer does not insert casts for differently-typed operands.

Open lmwnshn opened this issue 4 years ago • 1 comments

Feature Request

Optimizer does not insert casts for differently-typed operands.

Summary

In working on #1377, we originally planned to remove all implicit casts.

However, this breaks a ton of queries, such as select 1+1.0;. @pmenon points out that the casts should be part of the plan, which is probably somewhere in the optimizer that needs tweaking.

Right now, #1377 will address this by including a legacy implicit casting code path surrounded by braces. Once this is addressed, go to sema_checking.cpp and erase the brace-enclosed blocks of code that all start with // TODO(WAN): Legacy implicit casting code since the optimizer does not give us the right plan.

lmwnshn avatar Dec 08 '20 20:12 lmwnshn

Whoever fixes this, please uncomment the test in sema_expr_test.cpp which tests that implicit casting has been removed. Search for #1385 in that file to find it.

lmwnshn avatar Dec 08 '20 23:12 lmwnshn