Open davidshiz opened 1 year ago
Simplify sql:
mysql> SELECT a IN ('2019-01-02 01:02:03', a), TO_DAYS(a) from ctimestamp;
Crashed happened in function down_cast
-->assert()
:
/**
Casts from one pointer type to another in a type hierarchy.
In debug mode, we verify the cast is indeed legal.
*/
template<typename Target, typename Source>
inline Target down_cast(Source arg)
{
assert(NULL != dynamic_cast<Target>(arg));
return static_cast<Target>(arg);
}
libc.so.6!__GI_raise(int sig) (/build/glibc-SzIz7B/glibc-2.31/sysdeps/unix/sysv/linux/raise.c:50)
libc.so.6!__GI_abort() (/build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:79)
libc.so.6!__assert_fail_base(const char * fmt, const char * assertion, const char * file, unsigned int line, const char * function) (/build/glibc-SzIz7B/glibc-2.31/assert/assert.c:92)
libc.so.6!__GI___assert_fail(const char * assertion, const char * file, unsigned int line, const char * function) (/build/glibc-SzIz7B/glibc-2.31/assert/assert.c:101)
down_cast<Item_func_in const*, Item const*>(const Item * arg) (/github/stonedb/include/template_utils.h:85)
Tianmu::core::operator==(const Item & left, const Item & right) (/github/stonedb/storage/tianmu/core/mysql_expression.cpp:635)
Tianmu::core::MysqlExpression::operator==(const Tianmu::core::MysqlExpression * const this, const Tianmu::core::MysqlExpression & other) (/github/stonedb/storage/tianmu/core/mysql_expression.cpp:686)
Tianmu::core::Query::VirtualColumnAlreadyExists(Tianmu::core::Query * const this, const Tianmu::core::TabID & tmp_table, Tianmu::core::MysqlExpression * expression) (/github/stonedb/storage/tianmu/core/query.cpp:140)
Tianmu::core::Query::AddColumnForMysqlExpression(Tianmu::core::Query * const this, Tianmu::core::MysqlExpression * mysql_expression, const Tianmu::core::TabID & tmp_table, const char * alias, const Tianmu::common::ColOperation oper, const bool distinct, bool group_by) (/github/stonedb/storage/tianmu/core/query_compile.cpp:933)
Tianmu::core::Query::AddFields(Tianmu::core::Query * const this, List<Item> & fields, const Tianmu::core::TabID & tmp_table, const Tianmu::core::TabID & base_table, const bool group_by_clause, int & num_of_added_fields, bool ignore_minmax, bool & aggregation_used) (/github/stonedb/storage/tianmu/core/query_compile.cpp:507)
Tianmu::core::Query::Compile(Tianmu::core::Query * const this, Tianmu::core::CompiledQuery * compiled_query, SELECT_LEX * selects_list, SELECT_LEX * last_distinct, Tianmu::core::TabID * res_tab, bool ignore_limit, Item * left_expr_for_subselect, Tianmu::common::Operator * oper_for_subselect, bool ignore_minmax, bool for_subq_in_where) (/github/stonedb/storage/tianmu/core/query_compile.cpp:1210)
Tianmu::core::Engine::Execute(Tianmu::core::Engine * const this, THD * thd, LEX * lex, Query_result * result_output, SELECT_LEX_UNIT * unit_for_union) (/github/stonedb/storage/tianmu/core/engine_execute.cpp:472)
Tianmu::core::Engine::HandleSelect(Tianmu::core::Engine * const this, THD * thd, LEX * lex, Query_result *& result, ulong setup_tables_done_option, int & res, int & is_optimize_after_tianmu, int & tianmu_free_join, int with_insert) (/github/stonedb/storage/tianmu/core/engine_execute.cpp:243)
Tianmu::DBHandler::ha_my_tianmu_query(THD * thd, LEX * lex, Query_result *& result_output, ulong setup_tables_done_option, int & res, int & is_optimize_after_tianmu, int & tianmu_free_join, int with_insert) (/github/stonedb/storage/tianmu/sql/ha_my_tianmu.cpp:95)
execute_sqlcom_select(THD * thd, TABLE_LIST * all_tables) (/github/stonedb/sql/sql_parse.cc:5204)
mysql_execute_command(THD * thd, bool first_level) (/github/stonedb/sql/sql_parse.cc:2847)
mysql_parse(THD * thd, Parser_state * parser_state) (/github/stonedb/sql/sql_parse.cc:5642)
dispatch_command(THD * thd, const COM_DATA * com_data, enum_server_command command) (/github/stonedb/sql/sql_parse.cc:1495)
do_command(THD * thd) (/github/stonedb/sql/sql_parse.cc:1034)
handle_connection(void * arg) (/github/stonedb/sql/conn_handler/connection_handler_per_thread.cc:313)
Have you read the Contributing Guidelines on issues?
Please confirm if bug report does NOT exists already ?
Describe the problem
Expected behavior
No response
How To Reproduce
Environment
Are you interested in submitting a PR to solve the problem?