apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.67k stars 3.27k forks source link

[Bug](vec) "where column like NULL" statement in vectorized engine will cause BE coredump #10625

Open yinzhijian opened 2 years ago

yinzhijian commented 2 years ago

Search before asking

Version

master

What's Wrong?

Executing the "where column like NULL" statement in vec engine will cause BE coredump

select * from table where username like NULL
*** Aborted at 1657021225 (unix time) try "date -d @1657021225" if you are using GNU date ***
*** SIGABRT unkown detail explain (@0x20c0000ae8e) received by PID 44686 (TID 0x7f2d367d5700) from PID 44686; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at be/src/common/signal_handler.h:407
 1# 0x00007F2D5233D570 in /lib64/libc.so.6
 2# gsignal in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# __gnu_cxx::__verbose_terminate_handler() [clone .cold] in be/lib/palo_be
 5# __cxxabiv1::__terminate(void (*)()) in be/lib/palo_be
 6# 0x00007F2D5E6B8321 in be/lib/palo_be
 7# 0x00007F2D5E6B8475 in be/lib/palo_be
 8# doris::vectorized::ColumnNullable const* typeid_cast<doris::vectorized::ColumnNullable const*, doris::vectorized::IColumn const>(doris::vectorized::IColumn const*) at /h
ome/disk4/yintao03/baidu/bdg/doris/core/be/src/vec/common/typeid_cast.h:60
 9# doris::vectorized::ColumnNullable const* doris::vectorized::check_and_get_column<doris::vectorized::ColumnNullable>(doris::vectorized::IColumn const&) at /home/disk4/yin
tao03/baidu/bdg/doris/core/be/src/vec/columns/column.h:525
10# doris::vectorized::Block::filter_block(doris::vectorized::Block*, int, int) at be/src/vec/core/block.cpp:627
11# doris::vectorized::VExprContext::filter_block(doris::vectorized::VExprContext*, doris::vectorized::Block*, int) at be/src/vec/e
xprs/vexpr_context.cpp:126
12# doris::vectorized::VOlapScanner::get_block(doris::RuntimeState*, doris::vectorized::Block*, bool*) at be/src/vec/exec/volap_sca
nner.cpp:297
13# doris::vectorized::VOlapScanNode::scanner_thread(doris::vectorized::VOlapScanner*) at be/src/vec/exec/volap_scan_node.cpp:509
14# void std::__invoke_impl<void, void (doris::vectorized::VOlapScanNode::*&)(doris::vectorized::VOlapScanner*), doris::vectorized::VOlapScanNode*&, doris::vectorized::VOlap
Scanner*&>(std::__invoke_memfun_deref, void (doris::vectorized::VOlapScanNode::*&)(doris::vectorized::VOlapScanner*), doris::vectorized::VOlapScanNode*&, doris::vectorized::
VOlapScanner*&) atpalo-toolchain/ldb_toolchain/include/c++/11/bits/invoke.h:74
15# std::__invoke_result<void (doris::vectorized::VOlapScanNode::*&)(doris::vectorized::VOlapScanner*), doris::vectorized::VOlapScanNode*&, doris::vectorized::VOlapScanner*&
>::type std::__invoke<void (doris::vectorized::VOlapScanNode::*&)(doris::vectorized::VOlapScanner*), doris::vectorized::VOlapScanNode*&, doris::vectorized::VOlapScanner*&>(v
oid (doris::vectorized::VOlapScanNode::*&)(doris::vectorized::VOlapScanner*), doris::vectorized::VOlapScanNode*&, doris::vectorized::VOlapScanner*&) at /home/disk4/yintao03/
baidu/bdg/doris/palo-toolchain/ldb_toolchain/include/c++/11/bits/invoke.h:97
16# void std::_Bind<void (doris::vectorized::VOlapScanNode::*(doris::vectorized::VOlapScanNode*, doris::vectorized::VOlapScanner*))(doris::vectorized::VOlapScanner*)>::__cal
l<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) atpalo-toolchain/ldb_toolchain/include/c++/11/functional:422
17# void std::_Bind<void (doris::vectorized::VOlapScanNode::*(doris::vectorized::VOlapScanNode*, doris::vectorized::VOlapScanner*))(doris::vectorized::VOlapScanner*)>::opera
tor()<, void>() atpalo-toolchain/ldb_toolchain/include/c++/11/functional:505
18# void std::__invoke_impl<void, std::_Bind<void (doris::vectorized::VOlapScanNode::*(doris::vectorized::VOlapScanNode*, doris::vectorized::VOlapScanner*))(doris::vectorize
d::VOlapScanner*)>&>(std::__invoke_other, std::_Bind<void (doris::vectorized::VOlapScanNode::*(doris::vectorized::VOlapScanNode*, doris::vectorized::VOlapScanner*))(doris::v
ectorized::VOlapScanner*)>&) atpalo-toolchain/ldb_toolchain/include/c++/11/bits/invoke.h:61

What You Expected?

return result like rowset engine

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

stalary commented 2 years ago

In mysql, [42000][1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like null' at line 1, It seems that this syntax is not allowed, does it meet your requirements to forbid it directly at the sql parse?