mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Polishing: use constants instead of magic numbers.
include/my_global.h: Introduce constants to be used instead of magic numbers. sql/field.cc: Polishing: use contants instead of magic numbers. sql/ha_innodb.cc: Polishing: use contants instead of magic numbers. sql/handler.cc: Polishing: use contants instead of magic numbers. sql/item.cc: Polishing: use contants instead of magic numbers. sql/item.h: Polishing: use contants instead of magic numbers. sql/item_func.cc: Polishing: use contants instead of magic numbers. sql/item_subselect.cc: Polishing: use contants instead of magic numbers. sql/log_event.cc: Polishing: use contants instead of magic numbers. sql/sql_base.cc: Polishing: use contants instead of magic numbers. sql/sql_select.cc: Polishing: use contants instead of magic numbers. sql/sql_show.cc: Polishing: use contants instead of magic numbers. sql/sql_table.cc: Polishing: use contants instead of magic numbers.
This commit is contained in:
parent
980569877a
commit
a0521cd749
13 changed files with 72 additions and 48 deletions
|
|
@ -148,7 +148,7 @@ void
|
|||
Hybrid_type_traits_integer::fix_length_and_dec(Item *item, Item *arg) const
|
||||
{
|
||||
item->decimals= 0;
|
||||
item->max_length= 21;
|
||||
item->max_length= MY_INT64_NUM_DECIMAL_DIGITS;
|
||||
item->unsigned_flag= 0;
|
||||
}
|
||||
|
||||
|
|
@ -2491,7 +2491,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
|
|||
item_result_type= REAL_RESULT;
|
||||
break;
|
||||
case INT_RESULT:
|
||||
set_int(*(longlong*)entry->value, 21);
|
||||
set_int(*(longlong*)entry->value, MY_INT64_NUM_DECIMAL_DIGITS);
|
||||
item_type= Item::INT_ITEM;
|
||||
item_result_type= INT_RESULT;
|
||||
break;
|
||||
|
|
@ -6535,7 +6535,7 @@ uint32 Item_type_holder::display_length(Item *item)
|
|||
case MYSQL_TYPE_SHORT:
|
||||
return 6;
|
||||
case MYSQL_TYPE_LONG:
|
||||
return 11;
|
||||
return MY_INT32_NUM_DECIMAL_DIGITS;
|
||||
case MYSQL_TYPE_FLOAT:
|
||||
return 25;
|
||||
case MYSQL_TYPE_DOUBLE:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue