[Commits] a77f80b79ea: Merge branch '10.0' into 10.1
revision-id: a77f80b79eab4f7d9740086425fbf8d1f684e11b (mariadb-10.1.37-9-ga77f80b79ea) parent(s): 9e23171c70b57c2af40a976fcd62bdbac6b26349 a84d87fde8c0bc325c8e00f06ea02bcd84a75d55 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-11-15 17:20:26 +0100 message: Merge branch '10.0' into 10.1 mysql-test/r/bigint.result | 11 ++ .../suite/engines/iuds/r/insert_number.result | 100 +++++++++++ .../engines/iuds/r/update_delete_number.result | 17 ++ mysql-test/t/bigint.test | 9 + sql/item.h | 4 + sql/item_cmpfunc.cc | 190 +++++++++++---------- sql/item_cmpfunc.h | 5 + sql/sql_type_int.h | 28 +++ 8 files changed, 277 insertions(+), 87 deletions(-) diff --cc sql/item_cmpfunc.cc index de886ba8ecb,a0c5798cb69..2c1320f82b3 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@@ -2131,10 -2364,9 +2136,10 @@@ void Item_func_between::fix_length_and_ */ if (!args[0] || !args[1] || !args[2]) return; - if (agg_cmp_type(&m_compare_type, args, 3)) - if (agg_cmp_type(&cmp_type, args, 3, false)) ++ if (agg_cmp_type(&m_compare_type, args, 3, false)) return; - if (cmp_type == STRING_RESULT && + + if (m_compare_type == STRING_RESULT && agg_arg_charsets_for_comparison(cmp_collation, args, 3)) return; @@@ -2207,95 -2530,16 +2303,15 @@@ longlong Item_func_between::val_int( null_value= value >= a; break; } - case STRING_RESULT: - { - String *value,*a,*b; - value=args[0]->val_str(&value0); - if ((null_value=args[0]->null_value)) - return 0; - a=args[1]->val_str(&value1); - b=args[2]->val_str(&value2); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((sortcmp(value,a,cmp_collation.collation) >= 0 && - sortcmp(value,b,cmp_collation.collation) <= 0) != - negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - // Set to not null if false range. - null_value= sortcmp(value,b,cmp_collation.collation) <= 0; - } - else - { - // Set to not null if false range. - null_value= sortcmp(value,a,cmp_collation.collation) >= 0; - } - break; - } + return val_int_cmp_string(); case INT_RESULT: - { - longlong value=args[0]->val_int(), a, b; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a=args[1]->val_int(); - b=args[2]->val_int(); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((value >= a && value <= b) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - null_value= value <= b; // not null if false range. - } - else - { - null_value= value >= a; - } - break; - } + return val_int_cmp_int(); case DECIMAL_RESULT: - { - my_decimal dec_buf, *dec= args[0]->val_decimal(&dec_buf), - a_buf, *a_dec, b_buf, *b_dec; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a_dec= args[1]->val_decimal(&a_buf); - b_dec= args[2]->val_decimal(&b_buf); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((my_decimal_cmp(dec, a_dec) >= 0 && - my_decimal_cmp(dec, b_dec) <= 0) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - null_value= (my_decimal_cmp(dec, b_dec) <= 0); - else - null_value= (my_decimal_cmp(dec, a_dec) >= 0); - break; - } + return val_int_cmp_decimal(); case REAL_RESULT: - { - double value= args[0]->val_real(),a,b; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a= args[1]->val_real(); - b= args[2]->val_real(); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((value >= a && value <= b) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - null_value= value <= b; // not null if false range. - } - else - { - null_value= value >= a; - } - break; - } + return val_int_cmp_real(); case ROW_RESULT: - case IMPOSSIBLE_RESULT: DBUG_ASSERT(0); null_value= 1; return 0; diff --cc sql/item_cmpfunc.h index 8d85bc8afca,eec3684c2c1..eb1da504e7c --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@@ -833,19 -697,12 +833,24 @@@ public bool eval_not_null_tables(uchar *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge); bool count_sargable_conds(uchar *arg); + void add_key_fields(JOIN *join, KEY_FIELD **key_fields, + uint *and_level, table_map usable_tables, + SARGABLE_PARAM **sargables); + SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr); + Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) + { + Item_args::propagate_equal_fields(thd, + Context(ANY_SUBST, + m_compare_type, + compare_collation()), + cond); + return this; + } + + longlong val_int_cmp_string(); + longlong val_int_cmp_int(); + longlong val_int_cmp_real(); + longlong val_int_cmp_decimal(); };
participants (1)
-
Oleksandr Byelkin