revision-id: f74649b522fd35c4e5f3c2f72f2ac55e2438c0e3 (mariadb-10.2.19-5-gf74649b522f) parent(s): c6838cc646dde24a2a5518a3c07ef210c84f787a a77f80b79eab4f7d9740086425fbf8d1f684e11b author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-11-15 19:21:40 +0100 message: Merge branch '10.1' into 10.2 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.h index 99eacdd6621,79cde008946..da1483a5a80 --- a/sql/item.h +++ b/sql/item.h @@@ -981,20 -857,10 +981,24 @@@ public If value is not null null_value flag will be reset to FALSE. */ virtual longlong val_int()=0; + /** + Get a value for CAST(x AS SIGNED). + Too large positive unsigned integer values are converted + to negative complements. + Values of non-integer data types are adjusted to the SIGNED range. + */ + virtual longlong val_int_signed_typecast(); + /** + Get a value for CAST(x AS UNSIGNED). + Negative signed integer values are converted + to positive complements. + Values of non-integer data types are adjusted to the UNSIGNED range. + */ + virtual longlong val_int_unsigned_typecast(); + Longlong_hybrid to_longlong_hybrid() + { + return Longlong_hybrid(val_int(), unsigned_flag); + } /* This is just a shortcut to avoid the cast. You should still use unsigned_flag to check the sign of the item. diff --cc sql/item_cmpfunc.cc index 57f258be741,2c1320f82b3..7357e57733a --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@@ -2119,9 -2135,9 +2124,9 @@@ bool Item_func_between::fix_length_and_ we have to check for out of memory conditions here */ if (!args[0] || !args[1] || !args[2]) - return; + return TRUE; - if (agg_cmp_type(&m_compare_type, args, 3)) + if (agg_cmp_type(&m_compare_type, args, 3, false)) - return; + return TRUE; if (m_compare_type == STRING_RESULT && agg_arg_charsets_for_comparison(cmp_collation, args, 3)) diff --cc sql/item_cmpfunc.h index 59ac5f56fe1,eb1da504e7c..1b119c743d3 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@@ -896,8 -846,11 +896,13 @@@ public cond); return this; } + Item *get_copy(THD *thd, MEM_ROOT *mem_root) + { return get_item_copy<Item_func_between>(thd, mem_root, this); } + + longlong val_int_cmp_string(); + longlong val_int_cmp_int(); + longlong val_int_cmp_real(); + longlong val_int_cmp_decimal(); };