Hi Aleksey, Sergei, On 04/11/2018 01:34 AM, Aleksey Midenkov wrote:
Hi Alexander!
On Tue, Apr 10, 2018 at 12:15 PM, Alexander Barkov <bar@mariadb.com> wrote:
Hi Aleksey,
You added Type_handler_hybrid_field_type::m_vers_trx_id.
Is it really needed? It seems to be always "false". So this code in aggregate_for_comparison() seems to be a dead code:
if (m_vers_trx_id && (a == STRING_RESULT || b == STRING_RESULT)) m_type_handler= &type_handler_datetime;
Can I remove m_vers_trx_id and this dead code?
Sure, please remove. Thanks!
Please find a patch attached. It does the following: 1. Makes Field_vers_trx_id::type_handler() return &type_handler_vers_trx_id rather than &type_handler_longlong. Fixes Item_func::convert_const_compared_to_int_field() to test field_item->type_handler() against &type_handler_vers_trx_id, instead of testing field_item->vers_trx_id(). 2. Removes VERS_TRX_ID related code from Type_handler_hybrid_field_type::aggregate_for_comparison(), because "BIGINT UNSIGNED GENERATED ALWAYS AS ROW {START|END}" columns behave just like a BIGINT in a regular comparison, i.e. when not inside AS OF. 3. Removes - Type_handler_hybrid_field_type::m_vers_trx_id; - Type_handler_hybrid_field_type::m_flags; because a "BIGINT UNSIGNED GENERATED ALWAYS AS ROW {START|END}" behaves like a regular BIGINT column when in UNION. 4. Removes Field::vers_trx_id(), Item::vers_trx_id(), Item::field_flags() They are not needed anymore. See N1. All tests pass. Thanks!
Thanks!