diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-03-11 16:41:56 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-03-14 12:40:00 +0100 |
commit | 75ac5789b4f6b0b3c95829130c7865247d0e7edc (patch) | |
tree | 078ffcb643c07e2810fc8c983f3af6fb45711e79 | |
parent | bf1ca14ff3f3faa9f7a018097b25aa0f66d068cd (diff) | |
download | mariadb-git-75ac5789b4f6b0b3c95829130c7865247d0e7edc.tar.gz |
cleanup: typos, comments, whitespace
-rw-r--r-- | mysql-test/r/type_time.result | 4 | ||||
-rw-r--r-- | mysql-test/t/type_time.test | 4 | ||||
-rw-r--r-- | sql/item.h | 6 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 15 | ||||
-rw-r--r-- | sql/item_cmpfunc.h | 5 |
5 files changed, 16 insertions, 18 deletions
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 8b80177104d..0e627bdb915 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -822,7 +822,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' and <cache>(length(TIME'10:20:30')) = 30 + rand() -# Old mode, TIMESTAMP literal, zon-zero YYYYMMDD, no propagation +# Old mode, TIMESTAMP literal, non-zero YYYYMMDD, no propagation SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30'; a 34:20:30 @@ -860,7 +860,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' and <cache>(length(TIME'10:20:30')) = 30 + rand() -# Old mode, TIMESTAMP-alike literal, zon-zero YYYYMMDD, no propagation +# Old mode, TIMESTAMP-alike literal, non-zero YYYYMMDD, no propagation SELECT * FROM t1 WHERE a='0000-00-01 10:20:30'; a 34:20:30 diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index 6841af41e11..ab496408c32 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -506,7 +506,7 @@ SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=8; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=30+RAND(); ---echo # Old mode, TIMESTAMP literal, zon-zero YYYYMMDD, no propagation +--echo # Old mode, TIMESTAMP literal, non-zero YYYYMMDD, no propagation SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30'; SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=8; EXPLAIN EXTENDED @@ -522,7 +522,7 @@ SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=8; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=30+RAND(); ---echo # Old mode, TIMESTAMP-alike literal, zon-zero YYYYMMDD, no propagation +--echo # Old mode, TIMESTAMP-alike literal, non-zero YYYYMMDD, no propagation SELECT * FROM t1 WHERE a='0000-00-01 10:20:30'; SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; EXPLAIN EXTENDED diff --git a/sql/item.h b/sql/item.h index 325514d19aa..40350ba1a2c 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1365,7 +1365,7 @@ public: /* Get time with automatic DATE/DATETIME to TIME conversion. - Performce a reserve operation to get_date_with_conversion(). + Performes a reverse operation to get_date_with_conversion(). Suppose: - we have a set of items (typically with the native MYSQL_TYPE_TIME type) whose item->get_date() return TIME1 value, and @@ -3842,7 +3842,7 @@ class Item_date_literal_for_invalid_dates: public Item_date_literal Item_date_literal_for_invalid_dates::get_date() (unlike the regular Item_date_literal::get_date()) - does not check the result for NO_ZERO_IN_DATE and NO_ZER_DATE, + does not check the result for NO_ZERO_IN_DATE and NO_ZERO_DATE, always returns success (false), and does not produce error/warning messages. We need these _for_invalid_dates classes to be able to rewrite: @@ -5588,7 +5588,7 @@ public: virtual void store(Item *item); virtual bool cache_value()= 0; bool basic_const_item() const - { return MY_TEST(example && example->basic_const_item()); } + { return example && example->basic_const_item(); } virtual void clear() { null_value= TRUE; value_cached= FALSE; } bool is_null() { return !has_value(); } virtual bool is_expensive() diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 7d4c646abee..14e4b2c36f6 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -525,8 +525,7 @@ void Item_bool_rowready_func2::fix_length_and_dec() int Arg_comparator::set_compare_func(Item_func_or_sum *item, Item_result type) { owner= item; - func= comparator_matrix[type] - [is_owner_equal_func()]; + func= comparator_matrix[type][is_owner_equal_func()]; switch (type) { case TIME_RESULT: @@ -708,7 +707,7 @@ int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg, @return cache item or original value. */ -Item** Arg_comparator::cache_converted_constant(THD *thd_arg, Item **value, +Item** Arg_comparator::cache_converted_constant(THD *thd, Item **value, Item **cache_item, Item_result type) { @@ -717,12 +716,12 @@ Item** Arg_comparator::cache_converted_constant(THD *thd_arg, Item **value, Also, get_datetime_value creates Item_cache internally. Unless fixed, we should not do it here. */ - if (!thd_arg->lex->is_ps_or_view_context_analysis() && + if (!thd->lex->is_ps_or_view_context_analysis() && (*value)->const_item() && type != (*value)->result_type() && type != TIME_RESULT) { - Item_cache *cache= Item_cache::get_cache(thd_arg, *value, type); - cache->setup(thd_arg, *value); + Item_cache *cache= Item_cache::get_cache(thd, *value, type); + cache->setup(thd, *value); *cache_item= cache; return cache_item; } @@ -2172,7 +2171,7 @@ void Item_func_between::fix_length_and_dec() if (m_compare_type == TIME_RESULT) compare_as_dates= find_date_time_item(args, 3, 0); - /* See the comment about the similar block in Item_bool_func2 */ + /* See the comment for Item_func::convert_const_compared_to_int_field */ if (args[0]->real_item()->type() == FIELD_ITEM && !thd->lex->is_ps_or_view_context_analysis()) { @@ -4286,7 +4285,7 @@ void Item_func_in::fix_length_and_dec() values on the right can be compared as integers and adjust the comparison type accordingly. - See the comment about the similar block in Item_bool_func2 + And see the comment for Item_func::convert_const_compared_to_int_field */ if (args[0]->real_item()->type() == FIELD_ITEM && !thd->lex->is_view_context_analysis() && m_compare_type != INT_RESULT) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 20435b3fa4b..7ce883e7214 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -529,14 +529,13 @@ public: clone->cmp.comparators= 0; } return clone; - } - + } }; /** XOR inherits from Item_bool_func because it is not optimized yet. Later, when XOR is optimized, it needs to inherit from - Item_cond instead. See WL#5800. + Item_cond instead. See WL#5800. */ class Item_func_xor :public Item_bool_func { |