Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Multithread aggregation occur crash when has decimal #1402

Closed
3 tasks done
haitaoguan opened this issue Mar 17, 2023 · 9 comments · Fixed by #1506
Closed
3 tasks done

bug: Multithread aggregation occur crash when has decimal #1402

haitaoguan opened this issue Mar 17, 2023 · 9 comments · Fixed by #1506
Assignees
Labels
A-bug Something isn't working prio: high High priority

Comments

@haitaoguan
Copy link
Collaborator

haitaoguan commented Mar 17, 2023

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

#0  0x00007f76a8d89acf in raise () from /lib64/libc.so.6
#1  0x00007f76a8d5cea5 in abort () from /lib64/libc.so.6
#2  0x00007f76a8d5cd79 in __assert_fail_base.cold.0 () from /lib64/libc.so.6
#3  0x00007f76a8d82426 in __assert_fail () from /lib64/libc.so.6
#4  0x000000000323d061 in count_trailing_zeroes (i=1, val=0) at /root/work/stonedb-dev-20230323/strings/decimal.c:283
#5  0x000000000323dafc in digits_bounds (from=0x7f6db497fdd0, start_result=0x7f7624ff740c, end_result=0x7f7624ff7408) at /root/work/stonedb-dev-20230323/strings/decimal.c:580
#6  0x000000000323df95 in decimal_shift (dec=0x7f6db497fdd0, shift=-3) at /root/work/stonedb-dev-20230323/strings/decimal.c:683
#7  0x000000000305db6a in Tianmu::core::my_decimal_shift (mask=4294967295, res=0x7f6db497fdd0, shift=-3) at /root/work/stonedb-dev-20230323/storage/tianmu/core/item_tianmu_field.h:36
#8  0x000000000305ee5c in Tianmu::core::Item_tianmudecimal::Set (this=0x7f6db497fd30, val=19730) at /root/work/stonedb-dev-20230323/storage/tianmu/core/item_tianmu_field.cpp:244
#9  0x000000000305e58a in Tianmu::core::Item_tianmufield::FeedValue (this=0x7f6db497f880) at /root/work/stonedb-dev-20230323/storage/tianmu/core/item_tianmu_field.cpp:123
#10 0x000000000305e7ce in Tianmu::core::Item_tianmufield::val_decimal (this=0x7f6db497f880, decimal_value=0x7f7624ff75a0)
    at /root/work/stonedb-dev-20230323/storage/tianmu/core/item_tianmu_field.cpp:154
#11 0x0000000001df61a1 in Arg_comparator::compare_decimal (this=0x7f6db400f5a8) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:1778
#12 0x0000000001e0a8b5 in Arg_comparator::compare (this=0x7f6db400f5a8) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.h:99
#13 0x0000000001df8727 in Item_func_gt::val_int (this=0x7f6db400f4d0) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:2639
#14 0x0000000001dc9760 in Item::val_bool (this=0x7f6db400f4d0) at /root/work/stonedb-dev-20230323/sql/item.cc:218
#15 0x0000000001e03fa9 in Item_cond_and::val_int (this=0x7f6db40075e8) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:6202
#16 0x0000000001dc9760 in Item::val_bool (this=0x7f6db40075e8) at /root/work/stonedb-dev-20230323/sql/item.cc:218
#17 0x0000000001dfc7e3 in Item_func_case::find_item (this=0x7f6db40078d8, str=0x7f7624ff7800) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:3833
#18 0x0000000001dfccf4 in Item_func_case::val_int (this=0x7f6db40078d8) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:3900
#19 0x0000000003073a3a in Tianmu::core::MysqlExpression::ItemInt2ValueOrNull (item=0x7f6db40078d8) at /root/work/stonedb-dev-20230323/storage/tianmu/core/mysql_expression.cpp:559
#20 0x0000000003073271 in Tianmu::core::MysqlExpression::Evaluate (this=0x7f6db4981a70) at /root/work/stonedb-dev-20230323/storage/tianmu/core/mysql_expression.cpp:459
#21 0x0000000002e69e17 in Tianmu::vcolumn::ExpressionColumn::GetValueInt64Impl (this=0x7f6db4984f10, mit=...) at /root/work/stonedb-dev-20230323/storage/tianmu/vc/expr_column.cpp:119
#22 0x0000000002d4d9c8 in Tianmu::vcolumn::VirtualColumnBase::GetValueInt64 (this=0x7f6db4984f10, mit=...) at /root/work/stonedb-dev-20230323/storage/tianmu/vc/virtual_column_base.h:93
#23 0x000000000304d22e in Tianmu::core::GroupTable::PutAggregatedValue (this=0x7f76a1bde298, col=1, row=5, mit=..., factor=1, as_string=false)
    at /root/work/stonedb-dev-20230323/storage/tianmu/core/group_table.cpp:591
#24 0x0000000003059d2f in Tianmu::core::GroupByWrapper::PutAggregatedValue (this=0x7f76a1bde1d0, gr_a=1, pos=5, mit=..., factor=1)
    at /root/work/stonedb-dev-20230323/storage/tianmu/core/groupby_wrapper.cpp:520
#25 0x0000000002feb8ec in Tianmu::core::AggregationAlgorithm::AggregatePackrow (this=0x7f76a1bde560, gbw=..., mit=0x7f7624ff7e00, cur_tuple=376, mem_used=0x7f76a1bdde08)
    at /root/work/stonedb-dev-20230323/storage/tianmu/core/aggregation_algorithm.cpp:648
#26 0x0000000002fec7fb in Tianmu::core::AggregationWorkerEnt::TaskAggrePacks (this=0x7f76a1bdde10, taskIterator=0x7f6db4989840, dims=0x7f76a1bddb90, mit=0x7f76a1bdde60, 
    task=0x7f6db49896f0, gbw=0x7f76a1bde1d0, ci=0x7f6db4034210, mem_used=0x7f76a1bdde08) at /root/work/stonedb-dev-20230323/storage/tianmu/core/aggregation_algorithm.cpp:923
#27 0x0000000002ffcf26 in _ZSt13__invoke_implIvRMN6Tianmu4core20AggregationWorkerEntEFvPNS1_10MIIteratorEPNS1_15DimensionVectorES4_PNS1_5CTaskEPNS1_14GroupByWrapperEPNS1_11TransactionEPmERPS2_IRS4_RS6_SJ_RS8_RSA_RSC_RSD_EET_St21__invoke_memfun_derefOT0_OT1_DpOT2_ (__f=
    @0x7f6db408f7a8: (void (Tianmu::core::AggregationWorkerEnt::*)(Tianmu::core::AggregationWorkerEnt * const, Tianmu::core::MIIterator *, Tianmu::core::DimensionVector *, Tianmu::core::MIIterator *, Tianmu::core::CTask *, Tianmu::core::GroupByWrapper *, Tianmu::core::Transaction *, unsigned long *)) 0x2fec6b8 <Tianmu::core::AggregationWorkerEnt::TaskAggrePacks(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, 
    __t=@0x7f6db408f7f0: 0x7f76a1bdde10) at /usr/include/c++/8/bits/invoke.h:73
#28 0x0000000002ffca81 in std::__invoke<void (Tianmu::core::AggregationWorkerEnt::*&)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*&, Tianmu::core::MIIterator*&, Tianmu::core::DimensionVector*&, Tianmu::core::MIIterator*&, Tianmu::core::CTask*&, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&> (__fn=
    @0x7f6db408f7a8: (void (Tianmu::core::AggregationWorkerEnt::*)(Tianmu::core::AggregationWorkerEnt * const, Tianmu::core::MIIterator *, Tianmu::core::DimensionVector *, Tianmu::core::MIIterator *, Tianmu::core::CTask *, Tianmu::core::GroupByWrapper *, Tianmu::core::Transaction *, unsigned long *)) 0x2fec6b8 <Tianmu::core::AggregationWorkerEnt::TaskAggrePacks(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>)
--Type <RET> for more, q to quit, c to continue without paging--
    at /usr/include/c++/8/bits/invoke.h:95
#29 0x0000000002ffc47a in std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>::__call<void, , 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul>) (this=0x7f6db408f7a8, __args=empty std::tuple) at /usr/include/c++/8/functional:400
#30 0x0000000002ffb7c6 in std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>::operator()<, void>() (this=0x7f6db408f7a8) at /usr/include/c++/8/functional:484
#31 0x0000000002ffaf79 in std::__invoke_impl<void, std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>&>(std::__invoke_other, std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>&) (__f=...) at /usr/include/c++/8/bits/invoke.h:60
#32 0x0000000002ffa874 in std::__invoke<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>&>(std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>&) (__fn=...) at /usr/include/c++/8/bits/invoke.h:95
#33 0x0000000002ffa1f3 in std::__future_base::_Task_state<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, std::allocator<int>, void ()>::_M_run()::{lambda()#1}::operator()() const (this=0x7f6db408f780) at /usr/include/c++/8/future:1421
#34 0x0000000002ffb86d in std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, std::allocator<int>, void ()>::_M_run()::{lambda()#1}, void>::operator()() const (this=0x7f7624ff8590)
    at /usr/include/c++/8/future:1362
#35 0x0000000002ffaff8 in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, std::allocator<int>, void ()>::_M_run()::{lambda()#1}, void> >::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/8/bits/std_function.h:283
#36 0x0000000002cb0ba1 in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const (this=0x7f7624ff8590)
    at /usr/include/c++/8/bits/std_function.h:687
#37 0x0000000002caabd9 in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) (this=0x7f6db408f780, __f=0x7f7624ff8590, __did_set=0x7f7624ff84f7) at /usr/include/c++/8/future:561
#38 0x0000000002cbfda1 in std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>*> (__f=
    @0x7f7624ff8510: (void (std::__future_base::_State_baseV2::*)(std::__future_base::_State_baseV2 * const, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x2caabb2 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>, __t=@0x7f7624ff8508: 0x7f6db408f780) at /usr/include/c++/8/bits/invoke.h:73
#39 0x0000000002cb81eb in std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter--Type <RET> for more, q to quit, c to continue without paging--
> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) (__fn=
    @0x7f7624ff8510: (void (std::__future_base::_State_baseV2::*)(std::__future_base::_State_baseV2 * const, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x2caabb2 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>) at /usr/include/c++/8/bits/invoke.h:95
#40 0x0000000002cb079e in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#1}::operator()() const (
    this=0x7f7624ff8480) at /usr/include/c++/8/mutex:672
#41 0x0000000002cb0809 in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#2}::operator()() const (this=0x0)
    at /usr/include/c++/8/mutex:677
#42 0x0000000002cb081a in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#2}::_FUN() ()
    at /usr/include/c++/8/mutex:677
#43 0x00007f76abcfae67 in __pthread_once_slow () from /lib64/libpthread.so.0
#44 0x0000000002ca4739 in __gthread_once (__once=0x7f6db408f798, __func=0x7f76abfccb90 <__once_proxy>) at /usr/include/c++/8/x86_64-redhat-linux/bits/gthr-default.h:699
#45 0x0000000002cb08c4 in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) (__once=..., __f=
    @0x7f7624ff8510: (void (std::__future_base::_State_baseV2::*)(std::__future_base::_State_baseV2 * const, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x2caabb2 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>) at /usr/include/c++/8/mutex:684
#46 0x0000000002caa821 in std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) (this=0x7f6db408f780, __res=..., __ignore_failure=false) at /usr/include/c++/8/future:401
#47 0x0000000002ffa252 in std::__future_base::_Task_state<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, std::allocator<int>, void ()>::_M_run() (
    this=0x7f6db408f780) at /usr/include/c++/8/future:1423
#48 0x0000000002cbcfe1 in std::packaged_task<void ()>::operator()() (this=0x7f6db40a1c60) at /usr/include/c++/8/future:1556
#49 0x0000000002ff0336 in Tianmu::utils::thread_pool::add_task<void (Tianmu::core::AggregationWorkerEnt::*)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&>(void (Tianmu::core::AggregationWorkerEnt::*&&)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*&&, Tianmu::core::MIIterator*&&, Tianmu::core::DimensionVector*&&, Tianmu::core::MIIterator*&&, Tianmu::core::CTask*&&, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&)::{lambda()#1}::operator()() const (this=0x7f6db498a070) at /root/work/stonedb-dev-20230323/storage/tianmu/util/thread_pool.h:94
#50 0x0000000002ff5f95 in std::_Function_handler<void (), Tianmu::utils::thread_pool::add_task<void (Tianmu::core::AggregationWorkerEnt::*)(Tianmu::core::MIIterator*, Tianmu::core::Dimension--Type <RET> for more, q to quit, c to continue without paging--
Vector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&>(void (Tianmu::core::AggregationWorkerEnt::*&&)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*&&, Tianmu::core::MIIterator*&&, Tianmu::core::DimensionVector*&&, Tianmu::core::MIIterator*&&, Tianmu::core::CTask*&&, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/8/bits/std_function.h:297
#51 0x0000000002caf9d2 in std::function<void ()>::operator()() const (this=0x7f7624ff86a0) at /usr/include/c++/8/bits/std_function.h:687
#52 0x0000000002cab083 in Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}::operator()() const (__closure=0x608c7e8) at /root/work/stonedb-dev-20230323/storage/tianmu/util/thread_pool.h:61
#53 0x0000000002ccef3c in std::__invoke_impl<void, Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}>(std::__invoke_other, Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}&&) (__f=...) at /usr/include/c++/8/bits/invoke.h:60
#54 0x0000000002cc8109 in std::__invoke<Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}>(std::__invoke_result&&, (Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}&&)...) (__fn=...) at /usr/include/c++/8/bits/invoke.h:95
#55 0x0000000002cdd796 in std::thread::_Invoker<std::tuple<Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x608c7e8) at /usr/include/c++/8/thread:244
#56 0x0000000002cdd0eb in std::thread::_Invoker<std::tuple<Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}> >::operator()() (this=0x608c7e8) at /usr/include/c++/8/thread:253
#57 0x0000000002cdc284 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}> > >::_M_run() (this=0x608c7e0) at /usr/include/c++/8/thread:196
#58 0x00007f76abfcdb13 in execute_native_thread_routine () from /lib64/libstdc++.so.6
#59 0x00007f76abcf31ca in start_thread () from /lib64/libpthread.so.0
#60 0x00007f76a8d74e73 in clone () from /lib64/libc.so.6

Expected behavior

No response

How To Reproduce

No response

Environment

./mysqld Ver 5.7.36-StoneDB-v1.0.3 for Linux on x86_64 (build-)
build information as follow:
Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
Branch name: stonedb-5.7-dev
Last commit ID: fb58421
Last commit time: Date: Wed Mar 15 19:32:42 2023 +0800
Build time: Date: Fri Mar 17 09:01:20 CST 2023

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@haitaoguan haitaoguan added the A-bug Something isn't working label Mar 17, 2023
@haitaoguan
Copy link
Collaborator Author

lALPJx8Z0_9kMJ3NByPNDM8_3279_1827

@haitaoguan
Copy link
Collaborator Author

lALPKGJl2JIMrTfNByPNDM8_3279_1827

@haitaoguan haitaoguan added the prio: high High priority label Mar 20, 2023
@adofsauron
Copy link
Collaborator

ACK

@adofsauron adofsauron self-assigned this Mar 21, 2023
@wisehead wisehead added this to the stonedb_5.7_v1.0.4 milestone Mar 22, 2023
@adofsauron adofsauron changed the title bug: A decimal overflow results in an instance crash. bug: Multithread aggregation occur crash. Mar 23, 2023
@adofsauron
Copy link
Collaborator


set global tianmu_groupby_parallel_degree=0;

@adofsauron
Copy link
Collaborator

adofsauron commented Mar 24, 2023

  members of Tianmu::core::Item_tianmufield: 
  varID = std::vector of length 1, capacity 1 = {{
      tab = -1, 
      col = 34
    }}, 
  ifield = 0x7f6db400f3b0, 
  tianmu_type = {
--Type <RET> for more, q to quit, c to continue without paging--
    valtype = Tianmu::core::DataType::ValueType::VT_FIXED, 
    attrtype = Tianmu::common::ColumnType::NUM, 
    fixscale = 3, 
    fixmax = 9999999999, 
    collation = {
      collation = 0x445fae0 <my_charset_latin1>, 
      derivation = DERIVATION_NUMERIC, 
      repertoire = 3
    }, 
    precision = 10, 
    unsigned_flag_ = false
  }, 
  buf = 0x7f6db40a0d90, 
  isBufOwner = true, 
  ivalue = 0x7f6db497fd30, 
  was_aggregation = false, 
  aggregation_result = STRING_RESULT, 
  fullname = "tianmufield of 0x7f6db400f3b0\000\000"
}

@adofsauron
Copy link
Collaborator

The problem is with decimal, changing the aggregated attributes from decimal to other types of attributes will work

@adofsauron adofsauron changed the title bug: Multithread aggregation occur crash. bug: Multithread aggregation occur crash when has decimal Mar 24, 2023
@adofsauron
Copy link
Collaborator

#0  0x00007f97af3f9acf in raise () from /lib64/libc.so.6
#1  0x00007f97af3ccea5 in abort () from /lib64/libc.so.6
#2  0x00007f97af3ccd79 in __assert_fail_base.cold.0 () from /lib64/libc.so.6
#3  0x00007f97af3f2426 in __assert_fail () from /lib64/libc.so.6
#4  0x000000000323d071 in count_trailing_zeroes (i=1, val=0) at /root/work/stonedb-dev-20230323/strings/decimal.c:283
#5  0x000000000323db0c in digits_bounds (from=0x7f8ebc97feb0, start_result=0x7f972affb02c, end_result=0x7f972affb028) at /root/work/stonedb-dev-20230323/strings/decimal.c:580
#6  0x000000000323dfa5 in decimal_shift (dec=0x7f8ebc97feb0, shift=-3) at /root/work/stonedb-dev-20230323/strings/decimal.c:683
#7  0x000000000305db6a in Tianmu::core::my_decimal_shift (mask=4294967295, res=0x7f8ebc97feb0, shift=-3) at /root/work/stonedb-dev-20230323/storage/tianmu/core/item_tianmu_field.h:37
#8  0x000000000305ee6e in Tianmu::core::Item_tianmudecimal::Set (this=0x7f8ebc97fe10, val=20920) at /root/work/stonedb-dev-20230323/storage/tianmu/core/item_tianmu_field.cpp:245
#9  0x000000000305e58a in Tianmu::core::Item_tianmufield::FeedValue (this=0x7f8ebc97fa08) at /root/work/stonedb-dev-20230323/storage/tianmu/core/item_tianmu_field.cpp:123
#10 0x000000000305e8a4 in Tianmu::core::Item_tianmufield::val_str (this=0x7f8ebc97fa08, str=0x7f972affb540) at /root/work/stonedb-dev-20230323/storage/tianmu/core/item_tianmu_field.cpp:167
#11 0x00000000022aa48d in Item_func_trim::val_str (this=0x7f8ebc006458, str=0x7f972affb540) at /root/work/stonedb-dev-20230323/sql/item_strfunc.cc:1752
#12 0x00000000022a4ce0 in Item_str_func::val_real (this=0x7f8ebc006458) at /root/work/stonedb-dev-20230323/sql/item_strfunc.cc:142
#13 0x0000000001df6069 in Arg_comparator::compare_real (this=0x7f8ebc011320) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:1757
#14 0x0000000001e0a8b5 in Arg_comparator::compare (this=0x7f8ebc011320) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.h:99
#15 0x0000000001df8727 in Item_func_gt::val_int (this=0x7f8ebc011248) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:2639
#16 0x0000000001dc9760 in Item::val_bool (this=0x7f8ebc011248) at /root/work/stonedb-dev-20230323/sql/item.cc:218
#17 0x0000000001e03fa9 in Item_cond_and::val_int (this=0x7f8ebc0066d8) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:6202
#18 0x0000000001dc9760 in Item::val_bool (this=0x7f8ebc0066d8) at /root/work/stonedb-dev-20230323/sql/item.cc:218
#19 0x0000000001dfc7e3 in Item_func_case::find_item (this=0x7f8ebc0103d0, str=0x7f972affb800) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:3833
#20 0x0000000001dfccf4 in Item_func_case::val_int (this=0x7f8ebc0103d0) at /root/work/stonedb-dev-20230323/sql/item_cmpfunc.cc:3900
#21 0x0000000003073a4c in Tianmu::core::MysqlExpression::ItemInt2ValueOrNull (item=0x7f8ebc0103d0) at /root/work/stonedb-dev-20230323/storage/tianmu/core/mysql_expression.cpp:559
#22 0x0000000003073283 in Tianmu::core::MysqlExpression::Evaluate (this=0x7f8ebc9819f0) at /root/work/stonedb-dev-20230323/storage/tianmu/core/mysql_expression.cpp:459
#23 0x0000000002e69e17 in Tianmu::vcolumn::ExpressionColumn::GetValueInt64Impl (this=0x7f8ebc984e90, mit=...) at /root/work/stonedb-dev-20230323/storage/tianmu/vc/expr_column.cpp:119
#24 0x0000000002d4d9c8 in Tianmu::vcolumn::VirtualColumnBase::GetValueInt64 (this=0x7f8ebc984e90, mit=...) at /root/work/stonedb-dev-20230323/storage/tianmu/vc/virtual_column_base.h:93
#25 0x000000000304d22e in Tianmu::core::GroupTable::PutAggregatedValue (this=0x7f8e70007098, col=1, row=64, mit=..., factor=1, as_string=false)
    at /root/work/stonedb-dev-20230323/storage/tianmu/core/group_table.cpp:591
#26 0x0000000003059d2f in Tianmu::core::GroupByWrapper::PutAggregatedValue (this=0x7f8e70006fd0, gr_a=1, pos=64, mit=..., factor=1)
    at /root/work/stonedb-dev-20230323/storage/tianmu/core/groupby_wrapper.cpp:520
#27 0x0000000002feb8ec in Tianmu::core::AggregationAlgorithm::AggregatePackrow (this=0x7f97a824e560, gbw=..., mit=0x7f972affbe00, cur_tuple=2292248, mem_used=0x7f97a824de08)
    at /root/work/stonedb-dev-20230323/storage/tianmu/core/aggregation_algorithm.cpp:648
#28 0x0000000002fec7fb in Tianmu::core::AggregationWorkerEnt::TaskAggrePacks (this=0x7f97a824de10, taskIterator=0x7f8ebc9898a8, dims=0x7f97a824db90, mit=0x7f97a824de60, 
    task=0x7f8ebc989548, gbw=0x7f8e70006fd0, ci=0x7f8ebc0342f0, mem_used=0x7f97a824de08) at /root/work/stonedb-dev-20230323/storage/tianmu/core/aggregation_algorithm.cpp:923
#29 0x0000000002ffcf26 in _ZSt13__invoke_implIvRMN6Tianmu4core20AggregationWorkerEntEFvPNS1_10MIIteratorEPNS1_15DimensionVectorES4_PNS1_5CTaskEPNS1_14GroupByWrapperEPNS1_11TransactionEPmERPS2_IRS4_RS6_SJ_RS8_RSA_RSC_RSD_EET_St21__invoke_memfun_derefOT0_OT1_DpOT2_ (__f=
    @0x7f8ebc0914c8: (void (Tianmu::core::AggregationWorkerEnt::*)(Tianmu::core::AggregationWorkerEnt * const, Tianmu::core::MIIterator *, Tianmu::core::DimensionVector *, Tianmu::core::MIIterator *, Tianmu::core::CTask *, Tianmu::core::GroupByWrapper *, Tianmu::core::Transaction *, unsigned long *)) 0x2fec6b8 <Tianmu::core::AggregationWorkerEnt::TaskAggrePacks(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, 
    __t=@0x7f8ebc091510: 0x7f97a824de10) at /usr/include/c++/8/bits/invoke.h:73
#30 0x0000000002ffca81 in std::__invoke<void (Tianmu::core::AggregationWorkerEnt::*&)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*&, Tianmu::core::MIIterator*&, Tianmu::core::DimensionVector*&, Tianmu::core::MIIterator*&, Tianmu::core::CTask*&, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&> (__fn=
    @0x7f8ebc0914c8: (void (Tianmu::core::AggregationWorkerEnt::*)(Tianmu::core::AggregationWorkerEnt * const, Tianmu::core::MIIterator *, Tianmu::core::DimensionVector *, Tianmu::core::MIIterator *, Tianmu::core::CTask *, Tianmu::core::GroupByWrapper *, Tianmu::core::Transaction *, unsigned long *)) 0x2fec6b8 <Tianmu::core::AggregationWorkerEnt::TaskAggrePacks(Tianmu::core::MI--Type <RET> for more, q to quit, c to continue without paging--
Iterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>)
    at /usr/include/c++/8/bits/invoke.h:95
#31 0x0000000002ffc47a in std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>::__call<void, , 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul>) (this=0x7f8ebc0914c8, __args=empty std::tuple) at /usr/include/c++/8/functional:400
#32 0x0000000002ffb7c6 in std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>::operator()<, void>() (this=0x7f8ebc0914c8) at /usr/include/c++/8/functional:484
#33 0x0000000002ffaf79 in std::__invoke_impl<void, std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>&>(std::__invoke_other, std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>&) (__f=...) at /usr/include/c++/8/bits/invoke.h:60
#34 0x0000000002ffa874 in std::__invoke<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>&>(std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>&) (__fn=...) at /usr/include/c++/8/bits/invoke.h:95
#35 0x0000000002ffa1f3 in std::__future_base::_Task_state<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, std::allocator<int>, void ()>::_M_run()::{lambda()#1}::operator()() const (this=0x7f8ebc0914a0) at /usr/include/c++/8/future:1421
#36 0x0000000002ffb86d in std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, std::allocator<int>, void ()>::_M_run()::{lambda()#1}, void>::operator()() const (this=0x7f972affc590)
    at /usr/include/c++/8/future:1362
#37 0x0000000002ffaff8 in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, std::allocator<int>, void ()>::_M_run()::{lambda()#1}, void> >::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/8/bits/std_function.h:283
#38 0x0000000002cb0ba1 in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const (this=0x7f972affc590)
    at /usr/include/c++/8/bits/std_function.h:687
#39 0x0000000002caabd9 in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) (this=0x7f8ebc0914a0, __f=0x7f972affc590, __did_set=0x7f972affc4f7) at /usr/include/c++/8/future:561
#40 0x0000000002cbfda1 in std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>*> (__f=
    @0x7f972affc510: (void (std::__future_base::_State_baseV2::*)(std::__future_base::_State_baseV2 * const, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x2caabb2 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>, __t=@0x7f972affc508: 0x7f8ebc0914a0) at /usr/include/c++/8/bits/invoke.h:73
--Type <RET> for more, q to quit, c to continue without paging--
#41 0x0000000002cb81eb in std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) (__fn=
    @0x7f972affc510: (void (std::__future_base::_State_baseV2::*)(std::__future_base::_State_baseV2 * const, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x2caabb2 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>) at /usr/include/c++/8/bits/invoke.h:95
#42 0x0000000002cb079e in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#1}::operator()() const (
    this=0x7f972affc480) at /usr/include/c++/8/mutex:672
#43 0x0000000002cb0809 in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#2}::operator()() const (this=0x0)
    at /usr/include/c++/8/mutex:677
#44 0x0000000002cb081a in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#2}::_FUN() ()
    at /usr/include/c++/8/mutex:677
#45 0x00007f97b236ae67 in __pthread_once_slow () from /lib64/libpthread.so.0
#46 0x0000000002ca4739 in __gthread_once (__once=0x7f8ebc0914b8, __func=0x7f97b263cb90 <__once_proxy>) at /usr/include/c++/8/x86_64-redhat-linux/bits/gthr-default.h:699
#47 0x0000000002cb08c4 in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) (__once=..., __f=
    @0x7f972affc510: (void (std::__future_base::_State_baseV2::*)(std::__future_base::_State_baseV2 * const, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x2caabb2 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>) at /usr/include/c++/8/mutex:684
#48 0x0000000002caa821 in std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) (this=0x7f8ebc0914a0, __res=..., __ignore_failure=false) at /usr/include/c++/8/future:401
#49 0x0000000002ffa252 in std::__future_base::_Task_state<std::_Bind<void (Tianmu::core::AggregationWorkerEnt::*(Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*))(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*)>, std::allocator<int>, void ()>::_M_run() (
    this=0x7f8ebc0914a0) at /usr/include/c++/8/future:1423
#50 0x0000000002cbcfe1 in std::packaged_task<void ()>::operator()() (this=0x7f8ebc98a090) at /usr/include/c++/8/future:1556
#51 0x0000000002ff0336 in Tianmu::utils::thread_pool::add_task<void (Tianmu::core::AggregationWorkerEnt::*)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&>(void (Tianmu::core::AggregationWorkerEnt::*&&)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*&&, Tianmu::core::MIIterator*&&, Tianmu::core::DimensionVector*&&, Tianmu::core::MIIterator*&&, Tianmu::core::CTask*&&, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&)::{lambda()#1}::operator()() const (this=0x7f8ebc98a120) at /root/work/stonedb-dev-20230323/storage/tianmu/util/thread_pool.h:94
--Type <RET> for more, q to quit, c to continue without paging--
#52 0x0000000002ff5f95 in std::_Function_handler<void (), Tianmu::utils::thread_pool::add_task<void (Tianmu::core::AggregationWorkerEnt::*)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*, Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&>(void (Tianmu::core::AggregationWorkerEnt::*&&)(Tianmu::core::MIIterator*, Tianmu::core::DimensionVector*, Tianmu::core::MIIterator*, Tianmu::core::CTask*, Tianmu::core::GroupByWrapper*, Tianmu::core::Transaction*, unsigned long*), Tianmu::core::AggregationWorkerEnt*&&, Tianmu::core::MIIterator*&&, Tianmu::core::DimensionVector*&&, Tianmu::core::MIIterator*&&, Tianmu::core::CTask*&&, Tianmu::core::GroupByWrapper*&, Tianmu::core::Transaction*&, unsigned long*&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/8/bits/std_function.h:297
#53 0x0000000002caf9d2 in std::function<void ()>::operator()() const (this=0x7f972affc6a0) at /usr/include/c++/8/bits/std_function.h:687
#54 0x0000000002cab083 in Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}::operator()() const (__closure=0x55b07e8) at /root/work/stonedb-dev-20230323/storage/tianmu/util/thread_pool.h:61
#55 0x0000000002ccef3c in std::__invoke_impl<void, Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}>(std::__invoke_other, Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}&&) (__f=...) at /usr/include/c++/8/bits/invoke.h:60
#56 0x0000000002cc8109 in std::__invoke<Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}>(std::__invoke_result&&, (Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}&&)...) (__fn=...) at /usr/include/c++/8/bits/invoke.h:95
#57 0x0000000002cdd796 in std::thread::_Invoker<std::tuple<Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x55b07e8) at /usr/include/c++/8/thread:244
#58 0x0000000002cdd0eb in std::thread::_Invoker<std::tuple<Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}> >::operator()() (this=0x55b07e8) at /usr/include/c++/8/thread:253
#59 0x0000000002cdc284 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<Tianmu::utils::thread_pool::thread_pool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)::{lambda()#1}> > >::_M_run() (this=0x55b07e0) at /usr/include/c++/8/thread:196
#60 0x00007f97b263db13 in execute_native_thread_routine () from /lib64/libstdc++.so.6
#61 0x00007f97b23631ca in start_thread () from /lib64/libpthread.so.0
#62 0x00007f97af3e4e73 in clone () from /lib64/libc.so.6


@adofsauron
Copy link
Collaborator

The root cause of the error is that the decimal data type changes during runtime. However, in the case of multithreaded aggregation, because multiple worker threads modify the column properties during operation, and the column properties are referenced by multiple threads, thread safety issues arise in the case of decimal when multiple worker threads run. But the double type is read-only and does not change at run time, so the double is not a problem when multithreaded aggregation

@adofsauron
Copy link
Collaborator

adofsauron commented Mar 24, 2023

void Item_tianmudecimal::Set(int64_t val) {
  std::fill(decimal_value.buf, decimal_value.buf + decimal_value.len, 0);
  if (val) {
    int2my_decimal((uint)-1, val, 0, &decimal_value);
    my_decimal_shift((uint)-1, &decimal_value, -scale);
  } else {
    my_decimal_set_zero(&decimal_value);
  }
  decimal_value.frac = scale;
}

@mergify mergify bot closed this as completed in #1506 Mar 31, 2023
mergify bot pushed a commit that referenced this issue Mar 31, 2023
    1. Fix the crash first
    2. then redesign the entire aggregated data stream
RingsC added a commit that referenced this issue Jun 29, 2023
* docs(downlaod):update the docs of download(#1453)

* fix(mtr):Resolve the nightly run error problem(#1458)

* fix(workflow): fix can not run lcov in workflow

* feat(tianmu):New configuration parameters: "tianmu_mandatory" and "tianmu_no_key_error (#1462)"
In version 1.0.4, we will discard "MANDATORY_TIANMU" and "NO_KEY_ERROR" in (sql_mode)

Specifies whether to enable mandatory Tianmu engine in table. if yes ,set tianmu_mandatory to ON, otherwise set the variable to OFF.
Specifies whether to to directly skip DDL statements that are not supported by the SQL layer, instead of reporting errors.
if yes ,set tianmu_no_key_error to ON, otherwise set the variable to OFF.

* feat(tianmu):Discard "MANDATORY_TIANMU" and "NO_KEY_ERROR" in (sql_mode)

* feat(tianmu):Resolve the issue of warning messages when setting new parameters

* fix(tianmu):(Primary/Secondary)Error 1032 occasionally occurs during primary/secondary synchronization if UUIDs are used as the primary key(#1464)

Cause of the problem:
When performing a primary key scan under the master slave, "ha_tianmu:: position()" is called first to obtain the primary key value from the "record",
However, in this scenario, after calling the "key_copy()" function, the "record" will be cleared, resulting in the subsequent "GetKeys()" obtaining a null primary key value.
Solution:
Because the value "handler->ref" is not used in the future, you can simply delete the call to "key_copy()".

* test(mtr): add integer/unsigned/in subquery/create temporary testcases and update escape.test(#1196)

* docs(v1.0.3): update the docs for v1.0.3

* fix(dcoker): FixDocker deployment commands(#1499)

* feat: add Baidu statistics script(#1498)

* fix(website): fix Baidu statistics script(#1502)

* test(mtr): Optimize parallel scheduling to execute more innodb engine testcases, add date type and std func testcase(#1196)

* fix crash when the aggregated element was decimal (#1402)
    1. Fix the crash first
    2. then redesign the entire aggregated data stream

* build(deps): bump nth-check and unist-util-select in /website

Bumps [nth-check](https://github.com/fb55/nth-check) to 2.1.1 and updates ancestor dependency [unist-util-select](https://github.com/syntax-tree/unist-util-select). These dependencies need to be updated together.


Updates `nth-check` from 1.0.2 to 2.1.1
- [Release notes](https://github.com/fb55/nth-check/releases)
- [Commits](fb55/nth-check@v1.0.2...v2.1.1)

Updates `unist-util-select` from 2.0.2 to 4.0.1
- [Release notes](https://github.com/syntax-tree/unist-util-select/releases)
- [Commits](syntax-tree/unist-util-select@2.0.2...4.0.1)

---
updated-dependencies:
- dependency-name: nth-check
  dependency-type: indirect
- dependency-name: unist-util-select
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* docs(deploy): Update the document and fix the link

* update the copyright

* update the readme(#1324)

* Create FUNDING.yml

update the Sponsor button

* Update FUNDING.yml

fix the link of opencollective

* remove dup lines in git workflow

* feat(tianmu): mv func from public to protected(#1501)

* style change

* strip spaces

* remove dup lines

* change to uint

* fix(tianmu):Resolve DDL and insert inot select Possible space inflation issues(#366)

Cause of the problem:
1. For multiple versions, Tianmu needs to first copy an original pack when performing DML operations,
Modify the copied package and use append write or overwrite write after modification
(If there is invalid space in the DATA file that can be written to the current pack, use overwrite write, otherwise use append write) to write to the file,
After the latest package is written to a file, the latest version chain will point to the address that was last written.
There is a problem with the current (TianmuAttr:: LoadData) logic. Every time you call (TianmuAttr:: LoadData),
Will write data to disk,
If there are multiple rows written in a transaction, there will be multiple copies of data,
"Because the current transaction has not been committed, the space for previous repeated writes has not been released, so the logic of overwriting writes will not be reached.",
"I only follow the logic of additional writing, which is the fundamental reason for the skyrocketing space.".
If you encounter a particularly large multiline write transaction, it will lead to a space explosion.
Moreover, disk IO is performed once per load line, which can also lead to degraded insert performance.
Solution:
To optimize the logic of (TianmuAttr:: LoadData), it is necessary to determine whether the data in the pack is full before saving changes,
Is whether to reach 65536 lines, and if so, write again,
If it cannot be reached, it is necessary to write again in the commit phase.

* feat(tianmu):Reconstruct direct insert into parallel execution, improving direct insert performance.

* feat(tianmu):Add code comments for easy understanding

* fix(tianmu):The myloader cann't work if the autocommit is closed. (#1510)

Currently, TIANMU does not support manual transactions and only supports automatic commit.
However, it does determine whether to commit the transaction based on the automatic commit parameters of MySQL.
If automatic commit is turned off, automatic commit will not be performed on the transaction

* fix(core): fix bug: The instance occasionally crashes if both fields specified for an equi-join are of the string data types (#1476)

* fix: page hover font style

* feat(mtr): To fix the mtr usage

The disabeld mtr use cases should follow the mtr conventional rules.
Adds a disabled.def to indeciate which case is disabled or not.

* fix(tianmu):The mysqld is crashed when you are starting replication.(#1523)

It is possible to update null values with null values in the delta layer,
For example:
update t set name="xiaohua" where id=1;
update t set name=null where id=1;
So when encountering this situation, directly return

* feat(tianmu):Add delta layer mtr

* bug 1538:The instance occasionally crashes when the parallel degree is enabled of the right table #1538

* feat(tianmu): To support vocalno framwork

The PRs to support vocalno framwork include a serials of PR.
Part1: Refine framework of code to make it clean and clear to read.

* docs(quickstart): add stonedb-8.0 compiling guide #1449

* fix(website): fix website error #1449

* feat(tianmu): support volcano framewrok (#1546)

* feat(tianmu): To support volcano framework

This is a serial of PRs, part2: To remove global var `ha_kvstore`, which should be in an engine.
To support volcano framework. and In order to do that, at secondly, ha_kvstore_,
a global variable removed to the engine. That follows innodb conventional rules.

* fix(tianmu): revert code, mv ret value from try block back to catch block

[summary]

The logic of this modification is as follows:
Previously, set ret action has been moved to try block, which is not efficient because every time we do truncate success, ret will be setted to 1. This time we will move the set ret action back to catch block, which will only trigged when truncate failed.

* feat(tiamnu): hard code in defs.h (#1481)
change magic number to readable const

* docs:update the compile guides #1562

* test(mtr): add more innodb testcases and tianmu range testcase(#1196)

* fix(tianmu):Remove excess log printing and add some code comments(#1545)

* fix(tianmu): fix mysqld crash when exec query with AggregateRough, assert failed on i < m_idx.size() at tianmu_attr.h:387, msg: [bad dpn index 0/0] (#1580)

* fix(website): fix the download link of 5.7(#1518)

* feat(website): update the latest content(#1587)

* feat(tianmu): support volcano framework (#1554)

Part3: To remove the `ha_tianmu_engine`, and gets it from hton's data. This makes
it behavior just like innodb.  MySQL gets innodb handler instance from table->s->file.
and it will make the code logic more concise.

* fix: max-width navbar search style

* feat(website): upgrade the docusaurus version(#1604)
fix #1604

* fix(website): fix Roadmap module location(#1597)

* website(community): update the content

* feat(website): update the logo of XinChuang(#1590)

* fix(tianmu):The instance occasionally crashes when the memory leak. (#1549)

* fix(tianmu):Modify merge_ The assignment method of ID, delaying the assignment to ensure that the final value is correct

* fix(tianmu):Fix bug in delta layer initialization

* fix(tianmu):Resolve the issue of assertion failure caused by memory allocation bugs in (pack_int)

* fix(tianmu):Code format adjustment

* fix(website): fix the wrong QR code(#1624)

* feat(tianmu):Add delta layer information output and table name output

* fix(tianmu):Perfect atomic operations for delta_table

* feat(tianmu):Optimize delta layer merge operations to remove useless logic

* fix(tianmu):assert failed on ptr == buff.get() + data_.sum_len at pack_str.cpp:584(#1620)

* fix(tianmu):assert failed on oldv <= dpn_->max_i at pack_int.cpp:337 (#1610)

* feat(tianmu):Increase assertion printing information and optimize code logic(#1617)

* fix(tianmu): fix mysqld crash when query where JOIN::propagate_dependencies (#1628)

* fix(tianmu): fix MySQL server has gone away when exec query (#1641 #1640)

* fix(tianmu):Support insert ignore syntax (#1637)

* fix(tianmu): fix query input variables wrong result (#1647)

* fix(tianmu): fix result of the query using the subquery derived table is incorrect (#1662)

* fix(tianmu): fix results of two queries using a derived table and a custom face change are incorrect (#1696)

* feat(tianmu): Test cases that supplement custom variables (#1703)

* fix(tianmu): fix mysqld crash when assigning return values using both custom variables and derived tables (#1707)

* fix(tianmu): Insert ignore can insert duplicate values.(#1699)

* fix(tianmu): fix error occurred in the union all query result (#1599)

* remove unused code block

* fix bug and change test case exptected result

* add stonedb-8.0 compiling guide for CentOS 7.x

* docs(quickstart): add stonedb-8.0 compiling guide(Chinese) for CentOS 7.x

* fix(tianmu):Even if a primary key is defined, duplicate data may be imported.(#1648)

* add delete/drop into tianmu log stat

* open log for all cmds

* fit format

* fix(tianmu): fix Error result set of the IN subquery with semi join (#1764)

* doc(develop-guide): modify method for complie stonedb using docker

1. change the version of the stonedb from 5.6 to 5.7 in docs.
2. list both manual install and automatic install in docs.
3. update the reference in zh-doc to a valid one:
可以参考:[StoneDB快速部署手册](https://stonedb.io/zh/docs/getting-started/quick-deployment)
可以参考:[StoneDB快速部署手册](https://stonedb.io/zh/docs/quick-deployment)

* docs:add docker compile guide of stonedb8.0.(#1780)

* feature: remove DBUG_OFF and repalce DEBUG_ASSERT with assert

* automatically formatting

* fix: fix storage of DT type

* fix incorrect result of TIME type by distinguishing the processing of TIME type from other time types

* fix(tinmu): fix tianmu crash when set varchar to num when order by

* docs(website): update the documentation for Compile StoneDB 8.0 in Docker(#1823)

* fix(tianmu): fix up the incompatible type

1) In result value setup phase, it only deals with num, but in some case, some non-num types
involved, therefore, we should also deal with these types.

2) To fixup the boundary of the error codes.

* fix(tianmu): Fix up the unknown exception after instance killed randomly (#1841)

If the instance was killed by `kill -9 'pid'` randomly, the new inserted data will not be written into `DATA` file under
the param of `tianmu_insert_delayed` was set to 0. Under this configuration, the data will write to memory not a `DATA`
file. Therefore, when the instance was killed and restarted, the data will be lost, and the `DATA` can not be found, and
an TianmuError exception will be thrown.

changed the writing behavior of instance from writting data into memory to writting data into `DATA` file immediately as
that of `tianmu_insert_delayed=1`.

* fix(tianmu): fix up the incorrect meta-info leads unexpected behavior (#1840)

In `ColumnShare::scan_dpn`, it will throw an exception to identify the in-consistent meta-data,
which the offset violates the rules. Now, the deleted DPNs should not be added to `segs`.

And, some auxiliary functions are added for helping to identify the status of files.

* fix(workflow): nightly build failed #1830

[summary]
Currently we disable tar pkg in ci/cd.

* feat(tianmu): revert assert() --> debug_assert() #1551

[summary]
To avoid some cases of some assert failed in release mode.

* feat(tianmu): fixup the default delimeter for load data (#1843)

Tianmu default delimiter is ';' not '\t'. In order to follow the mysql convention,
we change the default delimeter to `\t`.

* fix(tianmu): revert PR #1841. (#1850)

Due to the disk space flattion, this PR is used to revert PR #1841. But this will lead to data in-consistent after the
instance killed at randomly because the new data inserted into memory, and will lost. The root cause pls ref to discussion
in #1621.

* fix(tianmu): fix up mtr test case for delim of load data command (#1854)

To fix up some MTR test cases because the delim of load data is changed from ; to \t.

* fix(tianmu): fix up the `group_concat` function in tianmu (#1852)

To allow `group_concat` function executed in tianmu, and Changes `SI` to `SpecialInstruction`.
Some exceptions are catched.

* fix(tianmu): To fixup the instance crashed if the result of aggregate function goes out of bounds (#1856)

To caculate `sum(length())` will lead a corruption in destructor of `ValueOrNull`, frees an array of
char. Before the array deletes, the validity of that should be checked, and after that the pointer of
that arrary should also be set to nullptr, which make sure it's a safe code piece.

* docs(developer-guide): update the compiling guide of stonedb 8.0 for centos7.x(#1817)

* fix(tianmu): Fixup the mem leakage of aggregation function

1: Fixup the memory leakage of aggregation function, which may lead to failed of malloc.
2: Re-impl the operator= of `ValueOrNull`.
3: Fixup the assertion of `dow_cast` in ` Query::ClearSubselectTransformation`, `Item_func_trig_cond`.

* fix(tianmu): fix UNION of non-matching columns (column no 0)

* test(tianmu): add order by sentence in the mtr case various_join.test

* test(mtr): add more test cases for tianmu(#1196)

[summary]
case_when.test
drop_restric.test
empty_string_not_null.test
left_right_func.test
like_not_like.test
multi_join.test
order_by.test
ssb_small.test
union_case.test

* test(mtr): add order by sentence in the mtr case various_join.test

* ci(codecov): update the config

* fix(tianmu): To suuport ignore option for update statement

To support `update ignore` statement. The logic of uniqueness check is re-implemented.

* ci(codecov): update the codecov congfig

* docs(intro): update the support for 8.0

* wokflow(codecov): Filter out excess code files

* workflow(coverage): Update the lcov running logic

* fix(tianmu): default value of the field take unaffect in load #1865

Cause:
  in the function ParsingStrategy::ParseResult ParsingStrategy::GetOneRow
field->val_str(str) cannot distinguish 0 and NULL value.
Solution:
  Check whether field's default value is NULL.

* fix(tianmu): To support union(all) the statement which is without from clause

1: To fixup unsupport union or union all a sql statement which is without from clause.
2: Re-format some codes and functions.

* fix(tianmu): To remove unnessary optimization in tianmu

1:Removes the unnessary optimization in stage of compiliation of tianmu. It doesnot have any helps for us.
and may introuduce unexepected behaviors.
2:Refine MTR: issue848, issue1865, alter_table1, issue1523

* fix(tianmu): hotfix corruption in ValueOrNull under multi-thread

In multi-thread aggregation, ExpressionColumn will occur double free due to without
protection. Thread A will do ValueOrNull::operator ==, but in thread B, it will try to
free it. Therefore, it leads to instance crash.

* fix(tianmu): incorrect result when using where expr and args > bigint_max #1564

[summary]
1. static_cast<int64_t>(18446744073709551601) = -15
2. Item will set 18446744073709551601 with unsigned flag, but in tianmu
transform to ValueOrNot, the value will be set to `-15`.
3. add `unsigned flag` in value_or_null & TianmuNum & tianmu expr.

* fix(tianmu): add TIME_to_ulonglong_time_round process and fix up precision loss problem (#1173)

When converting TIME/DATETIME to ulonglong numeric, tianmu engine does not take the
TIME_to_ulonglong_time_round process. This causes the results different from innodb.
Furthermore, when we close the tianmu_insert_delayed parameter and execute an insert SQL,
the TIME/DATETIME/TIMESTAMP type's data will loss precision due to incomplete attribute copying.

PR Close #1173

* fix(tianmu): fix format using clang-format #792

* feat: rm files after rebase leftover #1217

files deleted:
        storage/tianmu/core/rc_attr_typeinfo.h
        storage/tianmu/handler/tianmu_handler.cpp
        storage/tianmu/handler/tianmu_handler_com.cpp
        storage/tianmu/types/rc_data_types.cpp
        storage/tianmu/types/rc_num.cpp
        storage/tianmu/types/rc_num.h
        storage/tianmu/types/rc_value_object.cpp

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: LiMK <[email protected]>
Co-authored-by: lihongjian <[email protected]>
Co-authored-by: shizhao <[email protected]>
Co-authored-by: adofsauron <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: StoneAtom <[email protected]>
Co-authored-by: zzzz-vincent <[email protected]>
Co-authored-by: wisehead <[email protected]>
Co-authored-by: Agility6 <[email protected]>
Co-authored-by: Double0101 <[email protected]>
Co-authored-by: dysprosium0626 <[email protected]>
Co-authored-by: augety <[email protected]>
Co-authored-by: xuxinqiang <[email protected]>
Co-authored-by: Jinrong Duan <[email protected]>
Co-authored-by: unknown <adofsauron>
Co-authored-by: hustjieke <[email protected]>
RingsC added a commit that referenced this issue Jun 30, 2023
* docs(downlaod):update the docs of download(#1453)

* fix(mtr):Resolve the nightly run error problem(#1458)

* fix(workflow): fix can not run lcov in workflow

* feat(tianmu):New configuration parameters: "tianmu_mandatory" and "tianmu_no_key_error (#1462)"
In version 1.0.4, we will discard "MANDATORY_TIANMU" and "NO_KEY_ERROR" in (sql_mode)

Specifies whether to enable mandatory Tianmu engine in table. if yes ,set tianmu_mandatory to ON, otherwise set the variable to OFF.
Specifies whether to to directly skip DDL statements that are not supported by the SQL layer, instead of reporting errors.
if yes ,set tianmu_no_key_error to ON, otherwise set the variable to OFF.

* feat(tianmu):Discard "MANDATORY_TIANMU" and "NO_KEY_ERROR" in (sql_mode)

* feat(tianmu):Resolve the issue of warning messages when setting new parameters

* fix(tianmu):(Primary/Secondary)Error 1032 occasionally occurs during primary/secondary synchronization if UUIDs are used as the primary key(#1464)

Cause of the problem:
When performing a primary key scan under the master slave, "ha_tianmu:: position()" is called first to obtain the primary key value from the "record",
However, in this scenario, after calling the "key_copy()" function, the "record" will be cleared, resulting in the subsequent "GetKeys()" obtaining a null primary key value.
Solution:
Because the value "handler->ref" is not used in the future, you can simply delete the call to "key_copy()".

* test(mtr): add integer/unsigned/in subquery/create temporary testcases and update escape.test(#1196)

* docs(v1.0.3): update the docs for v1.0.3

* fix(dcoker): FixDocker deployment commands(#1499)

* feat: add Baidu statistics script(#1498)

* fix(website): fix Baidu statistics script(#1502)

* test(mtr): Optimize parallel scheduling to execute more innodb engine testcases, add date type and std func testcase(#1196)

* fix crash when the aggregated element was decimal (#1402)
    1. Fix the crash first
    2. then redesign the entire aggregated data stream

* build(deps): bump nth-check and unist-util-select in /website

Bumps [nth-check](https://github.com/fb55/nth-check) to 2.1.1 and updates ancestor dependency [unist-util-select](https://github.com/syntax-tree/unist-util-select). These dependencies need to be updated together.


Updates `nth-check` from 1.0.2 to 2.1.1
- [Release notes](https://github.com/fb55/nth-check/releases)
- [Commits](fb55/nth-check@v1.0.2...v2.1.1)

Updates `unist-util-select` from 2.0.2 to 4.0.1
- [Release notes](https://github.com/syntax-tree/unist-util-select/releases)
- [Commits](syntax-tree/unist-util-select@2.0.2...4.0.1)

---
updated-dependencies:
- dependency-name: nth-check
  dependency-type: indirect
- dependency-name: unist-util-select
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* docs(deploy): Update the document and fix the link

* update the copyright

* update the readme(#1324)

* Create FUNDING.yml

update the Sponsor button

* Update FUNDING.yml

fix the link of opencollective

* remove dup lines in git workflow

* feat(tianmu): mv func from public to protected(#1501)

* style change

* strip spaces

* remove dup lines

* change to uint

* fix(tianmu):Resolve DDL and insert inot select Possible space inflation issues(#366)

Cause of the problem:
1. For multiple versions, Tianmu needs to first copy an original pack when performing DML operations,
Modify the copied package and use append write or overwrite write after modification
(If there is invalid space in the DATA file that can be written to the current pack, use overwrite write, otherwise use append write) to write to the file,
After the latest package is written to a file, the latest version chain will point to the address that was last written.
There is a problem with the current (TianmuAttr:: LoadData) logic. Every time you call (TianmuAttr:: LoadData),
Will write data to disk,
If there are multiple rows written in a transaction, there will be multiple copies of data,
"Because the current transaction has not been committed, the space for previous repeated writes has not been released, so the logic of overwriting writes will not be reached.",
"I only follow the logic of additional writing, which is the fundamental reason for the skyrocketing space.".
If you encounter a particularly large multiline write transaction, it will lead to a space explosion.
Moreover, disk IO is performed once per load line, which can also lead to degraded insert performance.
Solution:
To optimize the logic of (TianmuAttr:: LoadData), it is necessary to determine whether the data in the pack is full before saving changes,
Is whether to reach 65536 lines, and if so, write again,
If it cannot be reached, it is necessary to write again in the commit phase.

* feat(tianmu):Reconstruct direct insert into parallel execution, improving direct insert performance.

* feat(tianmu):Add code comments for easy understanding

* fix(tianmu):The myloader cann't work if the autocommit is closed. (#1510)

Currently, TIANMU does not support manual transactions and only supports automatic commit.
However, it does determine whether to commit the transaction based on the automatic commit parameters of MySQL.
If automatic commit is turned off, automatic commit will not be performed on the transaction

* fix(core): fix bug: The instance occasionally crashes if both fields specified for an equi-join are of the string data types (#1476)

* fix: page hover font style

* feat(mtr): To fix the mtr usage

The disabeld mtr use cases should follow the mtr conventional rules.
Adds a disabled.def to indeciate which case is disabled or not.

* fix(tianmu):The mysqld is crashed when you are starting replication.(#1523)

It is possible to update null values with null values in the delta layer,
For example:
update t set name="xiaohua" where id=1;
update t set name=null where id=1;
So when encountering this situation, directly return

* feat(tianmu):Add delta layer mtr

* bug 1538:The instance occasionally crashes when the parallel degree is enabled of the right table #1538

* feat(tianmu): To support vocalno framwork

The PRs to support vocalno framwork include a serials of PR.
Part1: Refine framework of code to make it clean and clear to read.

* docs(quickstart): add stonedb-8.0 compiling guide #1449

* fix(website): fix website error #1449

* feat(tianmu): support volcano framewrok (#1546)

* feat(tianmu): To support volcano framework

This is a serial of PRs, part2: To remove global var `ha_kvstore`, which should be in an engine.
To support volcano framework. and In order to do that, at secondly, ha_kvstore_,
a global variable removed to the engine. That follows innodb conventional rules.

* fix(tianmu): revert code, mv ret value from try block back to catch block

[summary]

The logic of this modification is as follows:
Previously, set ret action has been moved to try block, which is not efficient because every time we do truncate success, ret will be setted to 1. This time we will move the set ret action back to catch block, which will only trigged when truncate failed.

* feat(tiamnu): hard code in defs.h (#1481)
change magic number to readable const

* docs:update the compile guides #1562

* test(mtr): add more innodb testcases and tianmu range testcase(#1196)

* fix(tianmu):Remove excess log printing and add some code comments(#1545)

* fix(tianmu): fix mysqld crash when exec query with AggregateRough, assert failed on i < m_idx.size() at tianmu_attr.h:387, msg: [bad dpn index 0/0] (#1580)

* fix(website): fix the download link of 5.7(#1518)

* feat(website): update the latest content(#1587)

* feat(tianmu): support volcano framework (#1554)

Part3: To remove the `ha_tianmu_engine`, and gets it from hton's data. This makes
it behavior just like innodb.  MySQL gets innodb handler instance from table->s->file.
and it will make the code logic more concise.

* fix: max-width navbar search style

* feat(website): upgrade the docusaurus version(#1604)
fix #1604

* fix(website): fix Roadmap module location(#1597)

* website(community): update the content

* feat(website): update the logo of XinChuang(#1590)

* fix(tianmu):The instance occasionally crashes when the memory leak. (#1549)

* fix(tianmu):Modify merge_ The assignment method of ID, delaying the assignment to ensure that the final value is correct

* fix(tianmu):Fix bug in delta layer initialization

* fix(tianmu):Resolve the issue of assertion failure caused by memory allocation bugs in (pack_int)

* fix(tianmu):Code format adjustment

* fix(website): fix the wrong QR code(#1624)

* feat(tianmu):Add delta layer information output and table name output

* fix(tianmu):Perfect atomic operations for delta_table

* feat(tianmu):Optimize delta layer merge operations to remove useless logic

* fix(tianmu):assert failed on ptr == buff.get() + data_.sum_len at pack_str.cpp:584(#1620)

* fix(tianmu):assert failed on oldv <= dpn_->max_i at pack_int.cpp:337 (#1610)

* feat(tianmu):Increase assertion printing information and optimize code logic(#1617)

* fix(tianmu): fix mysqld crash when query where JOIN::propagate_dependencies (#1628)

* fix(tianmu): fix MySQL server has gone away when exec query (#1641 #1640)

* fix(tianmu):Support insert ignore syntax (#1637)

* fix(tianmu): fix query input variables wrong result (#1647)

* fix(tianmu): fix result of the query using the subquery derived table is incorrect (#1662)

* fix(tianmu): fix results of two queries using a derived table and a custom face change are incorrect (#1696)

* feat(tianmu): Test cases that supplement custom variables (#1703)

* fix(tianmu): fix mysqld crash when assigning return values using both custom variables and derived tables (#1707)

* fix(tianmu): Insert ignore can insert duplicate values.(#1699)

* fix(tianmu): fix error occurred in the union all query result (#1599)

* remove unused code block

* fix bug and change test case exptected result

* add stonedb-8.0 compiling guide for CentOS 7.x

* docs(quickstart): add stonedb-8.0 compiling guide(Chinese) for CentOS 7.x

* fix(tianmu):Even if a primary key is defined, duplicate data may be imported.(#1648)

* add delete/drop into tianmu log stat

* open log for all cmds

* fit format

* fix(tianmu): fix Error result set of the IN subquery with semi join (#1764)

* doc(develop-guide): modify method for complie stonedb using docker

1. change the version of the stonedb from 5.6 to 5.7 in docs.
2. list both manual install and automatic install in docs.
3. update the reference in zh-doc to a valid one:
可以参考:[StoneDB快速部署手册](https://stonedb.io/zh/docs/getting-started/quick-deployment)
可以参考:[StoneDB快速部署手册](https://stonedb.io/zh/docs/quick-deployment)

* docs:add docker compile guide of stonedb8.0.(#1780)

* feature: remove DBUG_OFF and repalce DEBUG_ASSERT with assert

* automatically formatting

* fix: fix storage of DT type

* fix incorrect result of TIME type by distinguishing the processing of TIME type from other time types

* fix(tinmu): fix tianmu crash when set varchar to num when order by

* docs(website): update the documentation for Compile StoneDB 8.0 in Docker(#1823)

* fix(tianmu): fix up the incompatible type

1) In result value setup phase, it only deals with num, but in some case, some non-num types
involved, therefore, we should also deal with these types.

2) To fixup the boundary of the error codes.

* fix(tianmu): Fix up the unknown exception after instance killed randomly (#1841)

If the instance was killed by `kill -9 'pid'` randomly, the new inserted data will not be written into `DATA` file under
the param of `tianmu_insert_delayed` was set to 0. Under this configuration, the data will write to memory not a `DATA`
file. Therefore, when the instance was killed and restarted, the data will be lost, and the `DATA` can not be found, and
an TianmuError exception will be thrown.

changed the writing behavior of instance from writting data into memory to writting data into `DATA` file immediately as
that of `tianmu_insert_delayed=1`.

* fix(tianmu): fix up the incorrect meta-info leads unexpected behavior (#1840)

In `ColumnShare::scan_dpn`, it will throw an exception to identify the in-consistent meta-data,
which the offset violates the rules. Now, the deleted DPNs should not be added to `segs`.

And, some auxiliary functions are added for helping to identify the status of files.

* fix(workflow): nightly build failed #1830

[summary]
Currently we disable tar pkg in ci/cd.

* feat(tianmu): revert assert() --> debug_assert() #1551

[summary]
To avoid some cases of some assert failed in release mode.

* feat(tianmu): fixup the default delimeter for load data (#1843)

Tianmu default delimiter is ';' not '\t'. In order to follow the mysql convention,
we change the default delimeter to `\t`.

* fix(tianmu): revert PR #1841. (#1850)

Due to the disk space flattion, this PR is used to revert PR #1841. But this will lead to data in-consistent after the
instance killed at randomly because the new data inserted into memory, and will lost. The root cause pls ref to discussion
in #1621.

* fix(tianmu): fix up mtr test case for delim of load data command (#1854)

To fix up some MTR test cases because the delim of load data is changed from ; to \t.

* fix(tianmu): fix up the `group_concat` function in tianmu (#1852)

To allow `group_concat` function executed in tianmu, and Changes `SI` to `SpecialInstruction`.
Some exceptions are catched.

* fix(tianmu): To fixup the instance crashed if the result of aggregate function goes out of bounds (#1856)

To caculate `sum(length())` will lead a corruption in destructor of `ValueOrNull`, frees an array of
char. Before the array deletes, the validity of that should be checked, and after that the pointer of
that arrary should also be set to nullptr, which make sure it's a safe code piece.

* docs(developer-guide): update the compiling guide of stonedb 8.0 for centos7.x(#1817)

* fix(tianmu): Fixup the mem leakage of aggregation function

1: Fixup the memory leakage of aggregation function, which may lead to failed of malloc.
2: Re-impl the operator= of `ValueOrNull`.
3: Fixup the assertion of `dow_cast` in ` Query::ClearSubselectTransformation`, `Item_func_trig_cond`.

* fix(tianmu): fix UNION of non-matching columns (column no 0)

* test(tianmu): add order by sentence in the mtr case various_join.test

* test(mtr): add more test cases for tianmu(#1196)

[summary]
case_when.test
drop_restric.test
empty_string_not_null.test
left_right_func.test
like_not_like.test
multi_join.test
order_by.test
ssb_small.test
union_case.test

* test(mtr): add order by sentence in the mtr case various_join.test

* ci(codecov): update the config

* fix(tianmu): To suuport ignore option for update statement

To support `update ignore` statement. The logic of uniqueness check is re-implemented.

* ci(codecov): update the codecov congfig

* docs(intro): update the support for 8.0

* wokflow(codecov): Filter out excess code files

* workflow(coverage): Update the lcov running logic

* fix(tianmu): default value of the field take unaffect in load #1865

Cause:
  in the function ParsingStrategy::ParseResult ParsingStrategy::GetOneRow
field->val_str(str) cannot distinguish 0 and NULL value.
Solution:
  Check whether field's default value is NULL.

* fix(tianmu): To support union(all) the statement which is without from clause

1: To fixup unsupport union or union all a sql statement which is without from clause.
2: Re-format some codes and functions.

* fix(tianmu): To remove unnessary optimization in tianmu

1:Removes the unnessary optimization in stage of compiliation of tianmu. It doesnot have any helps for us.
and may introuduce unexepected behaviors.
2:Refine MTR: issue848, issue1865, alter_table1, issue1523

* fix(tianmu): hotfix corruption in ValueOrNull under multi-thread

In multi-thread aggregation, ExpressionColumn will occur double free due to without
protection. Thread A will do ValueOrNull::operator ==, but in thread B, it will try to
free it. Therefore, it leads to instance crash.

* fix(tianmu): incorrect result when using where expr and args > bigint_max #1564

[summary]
1. static_cast<int64_t>(18446744073709551601) = -15
2. Item will set 18446744073709551601 with unsigned flag, but in tianmu
transform to ValueOrNot, the value will be set to `-15`.
3. add `unsigned flag` in value_or_null & TianmuNum & tianmu expr.

* fix(tianmu): add TIME_to_ulonglong_time_round process and fix up precision loss problem (#1173)

When converting TIME/DATETIME to ulonglong numeric, tianmu engine does not take the
TIME_to_ulonglong_time_round process. This causes the results different from innodb.
Furthermore, when we close the tianmu_insert_delayed parameter and execute an insert SQL,
the TIME/DATETIME/TIMESTAMP type's data will loss precision due to incomplete attribute copying.

PR Close #1173

* fix(tianmu): fix format using clang-format #792

* feat: rm files after rebase leftover #1217

files deleted:
        storage/tianmu/core/rc_attr_typeinfo.h
        storage/tianmu/handler/tianmu_handler.cpp
        storage/tianmu/handler/tianmu_handler_com.cpp
        storage/tianmu/types/rc_data_types.cpp
        storage/tianmu/types/rc_num.cpp
        storage/tianmu/types/rc_num.h
        storage/tianmu/types/rc_value_object.cpp

* fix(sql,tianmu):fix when binlog format is row, the load data statement cannot be recorded(#1876)

1. Actually, tianmu uses its own code to handle load which lacks support of row format of binlog
2. When tianmu parsing rows,  write table map event first
3. Once tianmu constructs a row, just add it to the rows log event, when parsing is done,
the rows log event will also be ready, then write it to the binlog

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: LiMK <[email protected]>
Co-authored-by: lihongjian <[email protected]>
Co-authored-by: shizhao <[email protected]>
Co-authored-by: adofsauron <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: StoneAtom <[email protected]>
Co-authored-by: zzzz-vincent <[email protected]>
Co-authored-by: wisehead <[email protected]>
Co-authored-by: Agility6 <[email protected]>
Co-authored-by: Double0101 <[email protected]>
Co-authored-by: dysprosium0626 <[email protected]>
Co-authored-by: augety <[email protected]>
Co-authored-by: xuxinqiang <[email protected]>
Co-authored-by: Jinrong Duan <[email protected]>
Co-authored-by: unknown <adofsauron>
Co-authored-by: hustjieke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working prio: high High priority
Projects
None yet
3 participants