#include <field.h>
Inheritance diagram for Field_num:


Public Member Functions | |
| Field_num (char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, const char *field_name_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg) | |
| Item_result | result_type () const |
| void | prepend_zeros (String *value) |
| void | add_zerofill_and_unsigned (String &res) const |
| void | make_field (Send_field *) |
| uint | decimals () const |
| uint | size_of () const |
| bool | eq_def (Field *field) |
| int | store_decimal (const my_decimal *) |
| my_decimal * | val_decimal (my_decimal *) |
| uint | is_equal (create_field *new_field) |
Public Attributes | |
| const uint8 | dec |
| bool | zerofill |
| bool | unsigned_flag |
Friends | |
| class | create_field |
Definition at line 383 of file field.h.
| Field_num::Field_num | ( | char * | ptr_arg, | |
| uint32 | len_arg, | |||
| uchar * | null_ptr_arg, | |||
| uchar | null_bit_arg, | |||
| utype | unireg_check_arg, | |||
| const char * | field_name_arg, | |||
| uint8 | dec_arg, | |||
| bool | zero_arg, | |||
| bool | unsigned_arg | |||
| ) |
Definition at line 1027 of file field.cc.
References Field::flags, UNSIGNED_FLAG, unsigned_flag, zerofill, and ZEROFILL_FLAG.
01031 :Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, 01032 unireg_check_arg, field_name_arg), 01033 dec(dec_arg),zerofill(zero_arg),unsigned_flag(unsigned_arg) 01034 { 01035 if (zerofill) 01036 flags|=ZEROFILL_FLAG; 01037 if (unsigned_flag) 01038 flags|=UNSIGNED_FLAG; 01039 }
| void Field_num::add_zerofill_and_unsigned | ( | String & | res | ) | const |
Definition at line 1289 of file field.cc.
References String::append(), STRING_WITH_LEN, unsigned_flag, and zerofill.
Referenced by Field_double::sql_type(), Field_float::sql_type(), Field_long::sql_type(), Field_medium::sql_type(), Field_short::sql_type(), Field_tiny::sql_type(), Field_new_decimal::sql_type(), and Field_decimal::sql_type().
01290 { 01291 if (unsigned_flag) 01292 res.append(STRING_WITH_LEN(" unsigned")); 01293 if (zerofill) 01294 res.append(STRING_WITH_LEN(" zerofill")); 01295 }
Here is the call graph for this function:

Here is the caller graph for this function:

| uint Field_num::decimals | ( | ) | const [inline, virtual] |
Reimplemented from Field.
Definition at line 8018 of file field.cc.
References dec, Field::eq_def(), unsigned_flag, Field::zero_pack(), and zerofill.
08019 { 08020 if (!Field::eq_def(field)) 08021 return 0; 08022 Field_num *from_num= (Field_num*) field; 08023 08024 if (unsigned_flag != from_num->unsigned_flag || 08025 zerofill && !from_num->zerofill && !zero_pack() || 08026 dec != from_num->dec) 08027 return 0; 08028 return 1; 08029 }
Here is the call graph for this function:

| uint Field_num::is_equal | ( | create_field * | new_field | ) | [virtual] |
Reimplemented from Field.
Reimplemented in Field_new_decimal.
Definition at line 8032 of file field.cc.
References AUTO_INCREMENT_FLAG, Field::flags, Field::max_length(), Field::new_field(), Field::real_type(), Field::sql_type(), and UNSIGNED_FLAG.
08033 { 08034 return ((new_field->sql_type == real_type()) && 08035 ((new_field->flags & UNSIGNED_FLAG) == (uint) (flags & 08036 UNSIGNED_FLAG)) && 08037 ((new_field->flags & AUTO_INCREMENT_FLAG) == 08038 (uint) (flags & AUTO_INCREMENT_FLAG)) && 08039 (new_field->length <= max_length())); 08040 }
Here is the call graph for this function:

| void Field_num::make_field | ( | Send_field * | ) | [virtual] |
Reimplemented from Field.
Definition at line 1423 of file field.cc.
References dec, Send_field::decimals, and Field::make_field().
01424 { 01425 Field::make_field(field); 01426 field->decimals= dec; 01427 }
Here is the call graph for this function:

| void Field_num::prepend_zeros | ( | String * | value | ) |
Definition at line 1042 of file field.cc.
References bfill, bmove_upp(), Field::field_length, and value.
01043 { 01044 int diff; 01045 if ((diff= (int) (field_length - value->length())) > 0) 01046 { 01047 bmove_upp((char*) value->ptr()+field_length,value->ptr()+value->length(), 01048 value->length()); 01049 bfill((char*) value->ptr(),diff,'0'); 01050 value->length(field_length); 01051 (void) value->c_ptr_quick(); // Avoid warnings in purify 01052 } 01053 }
Here is the call graph for this function:

| Item_result Field_num::result_type | ( | ) | const [inline, virtual] |
Implements Field.
Reimplemented in Field_new_decimal, Field_tiny, Field_short, Field_medium, and Field_long.
Definition at line 391 of file field.h.
References REAL_RESULT.
Referenced by val_decimal().
00391 { return REAL_RESULT; }
Here is the caller graph for this function:

| uint Field_num::size_of | ( | ) | const [inline, virtual] |
| int Field_num::store_decimal | ( | const my_decimal * | ) | [virtual] |
Implements Field.
Reimplemented in Field_real, and Field_new_decimal.
Definition at line 1376 of file field.cc.
References ASSERT_COLUMN_MARKED_FOR_WRITE, Field::convert_decimal2longlong(), err, Field::store(), test, and unsigned_flag.
01377 { 01378 ASSERT_COLUMN_MARKED_FOR_WRITE; 01379 int err= 0; 01380 longlong i= convert_decimal2longlong(val, unsigned_flag, &err); 01381 return test(err | store(i, unsigned_flag)); 01382 }
Here is the call graph for this function:

| my_decimal * Field_num::val_decimal | ( | my_decimal * | ) | [virtual] |
Reimplemented from Field.
Reimplemented in Field_real, and Field_new_decimal.
Definition at line 1401 of file field.cc.
References ASSERT_COLUMN_MARKED_FOR_READ, DBUG_ASSERT, E_DEC_FATAL_ERROR, int2my_decimal(), INT_RESULT, result_type(), unsigned_flag, and Field::val_int().
01402 { 01403 ASSERT_COLUMN_MARKED_FOR_READ; 01404 DBUG_ASSERT(result_type() == INT_RESULT); 01405 longlong nr= val_int(); 01406 int2my_decimal(E_DEC_FATAL_ERROR, nr, unsigned_flag, decimal_value); 01407 return decimal_value; 01408 }
Here is the call graph for this function:

friend class create_field [friend] |
| const uint8 Field_num::dec |
Definition at line 385 of file field.h.
Referenced by decimals(), eq_def(), Field_new_decimal::Field_new_decimal(), Field_new_decimal::is_equal(), make_field(), Field_decimal::overflow(), Field_double::send_binary(), Field_float::send_binary(), Field_double::sql_type(), Field_float::sql_type(), Field_new_decimal::sql_type(), Field_decimal::sql_type(), Field_double::store(), Field_float::store(), Field_decimal::store(), Field_new_decimal::store_value(), and Field_new_decimal::val_decimal().
Definition at line 386 of file field.h.
Referenced by add_zerofill_and_unsigned(), Field_long::cmp(), Field_medium::cmp(), Field_short::cmp(), Field_tiny::cmp(), eq_def(), Field_num(), Field_long::key_type(), Field_medium::key_type(), Field_short::key_type(), Field_tiny::key_type(), Field_decimal::overflow(), Field_new_decimal::set_value_on_overflow(), Field_decimal::sql_type(), Field_double::store(), Field_float::store(), Field_long::store(), Field_medium::store(), Field_short::store(), Field_tiny::store(), Field_decimal::store(), store_decimal(), Field_new_decimal::store_value(), val_decimal(), Field_long::val_int(), Field_medium::val_int(), Field_short::val_int(), Field_tiny::val_int(), Field_new_decimal::val_int(), Field_decimal::val_int(), Field_long::val_real(), Field_medium::val_real(), Field_short::val_real(), and Field_tiny::val_real().
Definition at line 386 of file field.h.
Referenced by add_zerofill_and_unsigned(), eq_def(), Field_num(), Field_decimal::key_type(), Field_decimal::overflow(), and Field_decimal::store().
1.4.7

