Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -ruN 216/sql/field.cc 217/sql/field.cc
- --- 216/sql/field.cc 2012-02-15 16:28:19.115145015 +0900
- +++ 217/sql/field.cc 2012-02-15 16:28:27.521161706 +0900
- @@ -1123,9 +1123,8 @@
- 2 error: garbage at the end of string.
- */
- -int Field_num::check_int_truncated(CHARSET_INFO *cs, const char *str,
- - int length, const char *int_end, int error,
- - bool *truncated)
- +int Field_num::check_int(CHARSET_INFO *cs, const char *str, int length,
- + const char *int_end, int error,bool *truncated)
- {
- if (truncated)
- {
- @@ -1142,7 +1141,7 @@
- *truncated= true;
- }
- push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
- - ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
- + ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
- ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
- "integer", tmp.c_ptr(), field_name,
- (ulong) table->in_use->row_count);
- @@ -1185,10 +1184,10 @@
- 1 error
- */
- -bool Field_num::get_int_truncated(CHARSET_INFO *cs, const char *from, uint len,
- - longlong *rnd, ulonglong unsigned_max,
- - longlong signed_min, longlong signed_max,
- - bool *truncated)
- +bool Field_num::get_int(CHARSET_INFO *cs, const char *from, uint len,
- + longlong *rnd, ulonglong unsigned_max,
- + longlong signed_min, longlong signed_max,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -1248,9 +1247,9 @@
- 0 no error or some other errors except overflow
- */
- -int Field::warn_if_overflow_truncated(int op_result, bool *truncated)
- +int Field::warn_if_overflow(int op_result, bool *truncated)
- {
- - if_overflow_truncated(op_result, truncated);
- + if_overflow(op_result, truncated);
- if (op_result == E_DEC_OVERFLOW)
- {
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- @@ -1632,9 +1631,9 @@
- @return
- value converted from val
- */
- -longlong Field::convert_decimal2longlong_truncated(const my_decimal *val,
- - bool unsigned_flag, int *err,
- - bool *truncated)
- +longlong Field::convert_decimal2longlong(const my_decimal *val,
- + bool unsigned_flag, int *err,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -1653,21 +1652,17 @@
- i= 0;
- *err= 1;
- }
- - else if (warn_if_overflow_truncated(my_decimal2int(E_DEC_ERROR &
- - ~E_DEC_OVERFLOW &
- - ~E_DEC_TRUNCATED,
- - val, TRUE, &i),
- - truncated))
- + else if (warn_if_overflow(my_decimal2int(E_DEC_ERROR & ~E_DEC_OVERFLOW &
- + ~E_DEC_TRUNCATED, val, TRUE, &i),
- + truncated))
- {
- i= ~(longlong) 0;
- *err= 1;
- }
- }
- - else if (warn_if_overflow_truncated(my_decimal2int(E_DEC_ERROR &
- - ~E_DEC_OVERFLOW &
- - ~E_DEC_TRUNCATED,
- - val, FALSE, &i),
- - truncated))
- + else if (warn_if_overflow(my_decimal2int(E_DEC_ERROR & ~E_DEC_OVERFLOW &
- + ~E_DEC_TRUNCATED, val, FALSE, &i),
- + truncated))
- {
- i= (val->sign() ? LONGLONG_MIN : LONGLONG_MAX);
- *err= 1;
- @@ -1690,14 +1685,14 @@
- !=0 error
- */
- -int Field_num::store_decimal_truncated(const my_decimal *val, bool *truncated)
- +int Field_num::store_decimal(const my_decimal *val, bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- int err= 0;
- - longlong i= convert_decimal2longlong_truncated(val, unsigned_flag,
- - &err, truncated);
- + longlong i= convert_decimal2longlong(val, unsigned_flag, &err,
- + truncated);
- bool truncated2= false;
- - int result= test(err | store_truncated(i, unsigned_flag, &truncated2));
- + int result= test(err | store(i, unsigned_flag, &truncated2));
- if (truncated)
- {
- *truncated= *truncated || truncated2;
- @@ -1769,15 +1764,15 @@
- !=0 error
- */
- -int Field_str::store_decimal_truncated(const my_decimal *d, bool *truncated)
- +int Field_str::store_decimal(const my_decimal *d, bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- double val;
- /* TODO: use decimal2string? */
- int err= my_decimal2double(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW, d, &val);
- - err= warn_if_overflow_truncated(err, truncated);
- + err= warn_if_overflow(err, truncated);
- bool truncated2= false;
- - int result= err | store_truncated(val, &truncated2);
- + int result= err | store(val, &truncated2);
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -1978,8 +1973,8 @@
- }
- -int Field_decimal::store_truncated(const char *from_arg, uint len,
- - CHARSET_INFO *cs, bool *truncated)
- +int Field_decimal::store(const char *from_arg, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -2332,8 +2327,7 @@
- {
- *truncated= true;
- }
- - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
- - WARN_DATA_TRUNCATED, 1);
- + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
- }
- return 0;
- }
- @@ -2375,7 +2369,7 @@
- }
- -int Field_decimal::store_truncated(double nr, bool *truncated)
- +int Field_decimal::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -2432,7 +2426,7 @@
- }
- -int Field_decimal::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_decimal::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -2720,8 +2714,8 @@
- 1 error
- */
- -bool Field_new_decimal::store_value_truncated(const my_decimal *decimal_value,
- - bool *truncated)
- +bool Field_new_decimal::store_value(const my_decimal *decimal_value,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -2758,11 +2752,9 @@
- }
- #endif
- - if (warn_if_overflow_truncated(my_decimal2binary(E_DEC_FATAL_ERROR &
- - ~E_DEC_OVERFLOW,
- - decimal_value, ptr,
- - precision, dec),
- - truncated))
- + if (warn_if_overflow(my_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
- + decimal_value, ptr, precision, dec),
- + truncated))
- {
- my_decimal buff;
- DBUG_PRINT("info", ("overflow"));
- @@ -2776,9 +2768,8 @@
- }
- -int Field_new_decimal::store_truncated(const char *from, uint length,
- - CHARSET_INFO *charset_arg,
- - bool *truncated)
- +int Field_new_decimal::store(const char *from, uint length,
- + CHARSET_INFO *charset_arg, bool *truncated)
- {
- if (truncated)
- {
- @@ -2851,7 +2842,7 @@
- dbug_decimal_as_string(dbug_buff, &decimal_value)));
- #endif
- bool truncated2= false;
- - store_value_truncated(&decimal_value, &truncated2);
- + store_value(&decimal_value, &truncated2);
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -2866,7 +2857,7 @@
- will return E_DEC_TRUNCATED always correctly
- */
- -int Field_new_decimal::store_truncated(double nr, bool *truncated)
- +int Field_new_decimal::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -2883,7 +2874,7 @@
- TODO: fix following when double2my_decimal when double2decimal
- will return E_DEC_TRUNCATED always correctly
- */
- - if_overflow_truncated(err, truncated);
- + if_overflow(err, truncated);
- if (!err)
- {
- double nr2;
- @@ -2911,7 +2902,7 @@
- table->in_use->got_warning= 0;
- }
- bool truncated2= false;
- - if (store_value_truncated(&decimal_value, &truncated2))
- + if (store_value(&decimal_value, &truncated2))
- err= 1;
- else if (err && !table->in_use->got_warning)
- err= warn_if_overflow(err);
- @@ -2923,8 +2914,7 @@
- }
- -int Field_new_decimal::store_truncated(longlong nr, bool unsigned_val,
- - bool *truncated)
- +int Field_new_decimal::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -2941,12 +2931,12 @@
- {
- set_value_on_overflow(&decimal_value, decimal_value.sign());
- }
- - if_overflow_truncated(err, truncated);
- + if_overflow(err, truncated);
- /* Only issue a warning if store_value doesn't issue an warning */
- table->in_use->got_warning= 0;
- }
- bool truncated2= false;
- - if (store_value_truncated(&decimal_value, &truncated2))
- + if (store_value(&decimal_value, &truncated2))
- err= 1;
- else if (err && !table->in_use->got_warning)
- err= warn_if_overflow(err);
- @@ -2958,11 +2948,11 @@
- }
- -int Field_new_decimal::store_decimal_truncated(const my_decimal *decimal_value,
- - bool *truncated)
- +int Field_new_decimal::store_decimal(const my_decimal *decimal_value,
- + bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- - return store_value_truncated(decimal_value, truncated);
- + return store_value(decimal_value, truncated);
- }
- @@ -3193,20 +3183,20 @@
- ** tiny int
- ****************************************************************************/
- -int Field_tiny::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_tiny::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- int error;
- longlong rnd;
- - error= get_int_truncated(cs, from, len, &rnd, 255, -128, 127, truncated);
- + error= get_int(cs, from, len, &rnd, 255, -128, 127, truncated);
- ptr[0]= unsigned_flag ? (char) (ulonglong) rnd : (char) rnd;
- return error;
- }
- -int Field_tiny::store_truncated(double nr, bool *truncated)
- +int Field_tiny::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -3269,7 +3259,7 @@
- }
- -int Field_tiny::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_tiny::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -3397,16 +3387,16 @@
- Field type short int (2 byte)
- ****************************************************************************/
- -int Field_short::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_short::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- int store_tmp;
- int error;
- longlong rnd;
- - error= get_int_truncated(cs, from, len, &rnd, UINT_MAX16, INT_MIN16,
- - INT_MAX16, truncated);
- + error= get_int(cs, from, len, &rnd, UINT_MAX16, INT_MIN16, INT_MAX16,
- + truncated);
- store_tmp= unsigned_flag ? (int) (ulonglong) rnd : (int) rnd;
- #ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
- @@ -3420,7 +3410,7 @@
- }
- -int Field_short::store_truncated(double nr, bool *truncated)
- +int Field_short::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -3492,7 +3482,7 @@
- }
- -int Field_short::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_short::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -3674,22 +3664,23 @@
- Field type medium int (3 byte)
- ****************************************************************************/
- -int Field_medium::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_medium::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- int store_tmp;
- int error;
- longlong rnd;
- - error= get_int_truncated(cs, from, len, &rnd, UINT_MAX24, INT_MIN24, INT_MAX24, truncated);
- + error= get_int(cs, from, len, &rnd, UINT_MAX24, INT_MIN24, INT_MAX24,
- + truncated);
- store_tmp= unsigned_flag ? (int) (ulonglong) rnd : (int) rnd;
- int3store(ptr, store_tmp);
- return error;
- }
- -int Field_medium::store_truncated(double nr, bool *truncated)
- +int Field_medium::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -3743,7 +3734,7 @@
- }
- -int Field_medium::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_medium::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -3881,16 +3872,16 @@
- ** long int
- ****************************************************************************/
- -int Field_long::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_long::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- long store_tmp;
- int error;
- longlong rnd;
- - error= get_int_truncated(cs, from, len, &rnd, UINT_MAX32, INT_MIN32,
- - INT_MAX32, truncated);
- + error= get_int(cs, from, len, &rnd, UINT_MAX32, INT_MIN32, INT_MAX32,
- + truncated);
- store_tmp= unsigned_flag ? (long) (ulonglong) rnd : (long) rnd;
- #ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
- @@ -3904,7 +3895,7 @@
- }
- -int Field_long::store_truncated(double nr, bool *truncated)
- +int Field_long::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -3965,7 +3956,7 @@
- }
- -int Field_long::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_long::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -4149,8 +4140,8 @@
- Field type longlong int (8 bytes)
- ****************************************************************************/
- -int Field_longlong::store_truncated(const char *from, uint len,
- - CHARSET_INFO *cs, bool *truncated)
- +int Field_longlong::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -4171,8 +4162,8 @@
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- - else if (table->in_use->count_cuted_fields &&
- - check_int_truncated(cs, from, len, end, error, truncated))
- + else if (table->in_use->count_cuted_fields &&
- + check_int(cs, from, len, end, error, truncated))
- error= 1;
- else
- error= 0;
- @@ -4188,7 +4179,7 @@
- }
- -int Field_longlong::store_truncated(double nr, bool *truncated)
- +int Field_longlong::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -4250,7 +4241,7 @@
- }
- -int Field_longlong::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_longlong::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -4467,8 +4458,8 @@
- single precision float
- ****************************************************************************/
- -int Field_float::store_truncated(const char *from, uint len, CHARSET_INFO* cs,
- - bool *truncated)
- +int Field_float::store(const char *from, uint len, CHARSET_INFO* cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -4489,7 +4480,7 @@
- error= error ? 1 : 2;
- }
- bool truncated2= false;
- - Field_float::store_truncated(nr, &truncated2);
- + Field_float::store(nr, &truncated2);
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -4498,10 +4489,10 @@
- }
- -int Field_float::store_truncated(double nr, bool *truncated)
- +int Field_float::store(double nr, bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- - int error= truncate_truncated(&nr, FLT_MAX, truncated);
- + int error= truncate(&nr, FLT_MAX, truncated);
- float j= (float)nr;
- #ifdef WORDS_BIGENDIAN
- @@ -4516,12 +4507,10 @@
- }
- -int Field_float::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_float::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- - return Field_float::store_truncated(unsigned_val ?
- - ulonglong2double((ulonglong) nr) :
- - (double) nr,
- - truncated);
- + return Field_float::store(unsigned_val ? ulonglong2double((ulonglong) nr) :
- + (double) nr, truncated);
- }
- @@ -4745,8 +4734,8 @@
- double precision floating point numbers
- ****************************************************************************/
- -int Field_double::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_double::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -4767,7 +4756,7 @@
- error= error ? 1 : 2;
- }
- bool truncated2= false;
- - Field_double::store_truncated(nr, &truncated2);
- + Field_double::store(nr, &truncated2);
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -4776,10 +4765,10 @@
- }
- -int Field_double::store_truncated(double nr, bool *truncated)
- +int Field_double::store(double nr, bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- - int error= truncate_truncated(&nr, DBL_MAX, truncated);
- + int error= truncate(&nr, DBL_MAX, truncated);
- #ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
- @@ -4793,12 +4782,10 @@
- }
- -int Field_double::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_double::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- - return Field_double::store_truncated(unsigned_val ?
- - ulonglong2double((ulonglong) nr) :
- - (double) nr,
- - truncated);
- + return Field_double::store(unsigned_val ? ulonglong2double((ulonglong) nr) :
- + (double) nr, truncated);
- }
- /*
- @@ -4807,8 +4794,7 @@
- Also ensure that the argument is within [-max_value; max_value] range.
- */
- -int Field_real::truncate_truncated(double *nr, double max_value,
- - bool *truncated)
- +int Field_real::truncate(double *nr, double max_value, bool *truncated)
- {
- if (truncated)
- {
- @@ -4880,11 +4866,11 @@
- }
- -int Field_real::store_decimal_truncated(const my_decimal *dm, bool *truncated)
- +int Field_real::store_decimal(const my_decimal *dm, bool *truncated)
- {
- double dbl;
- my_decimal2double(E_DEC_FATAL_ERROR, dm, &dbl);
- - return store_truncated(dbl, truncated);
- + return store(dbl, truncated);
- }
- double Field_double::val_real(void)
- @@ -5226,8 +5212,8 @@
- }
- -int Field_timestamp::store_truncated(const char *from, uint len,
- - CHARSET_INFO *cs, bool *truncated)
- +int Field_timestamp::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -5286,7 +5272,7 @@
- }
- -int Field_timestamp::store_truncated(double nr, bool *truncated)
- +int Field_timestamp::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -5306,7 +5292,7 @@
- error= 1;
- }
- bool truncated2= false;
- - error|= Field_timestamp::store_truncated((longlong) rint(nr), FALSE, &truncated2);
- + error|= Field_timestamp::store((longlong) rint(nr), FALSE, &truncated2);
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -5315,7 +5301,7 @@
- }
- -int Field_timestamp::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_timestamp::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -5576,8 +5562,8 @@
- ** Stored as a 3 byte unsigned int
- ****************************************************************************/
- -int Field_time::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_time::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -5645,7 +5631,7 @@
- }
- -int Field_time::store_truncated(double nr, bool *truncated)
- +int Field_time::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -5699,7 +5685,7 @@
- }
- -int Field_time::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_time::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -5715,7 +5701,7 @@
- {
- *truncated= true;
- }
- - set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
- + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_DATA_OUT_OF_RANGE, nr,
- MYSQL_TIMESTAMP_TIME, 1);
- error= 1;
- @@ -5727,7 +5713,7 @@
- {
- *truncated= true;
- }
- - set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
- + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_DATA_OUT_OF_RANGE, nr,
- MYSQL_TIMESTAMP_TIME, 1);
- error= 1;
- @@ -5742,7 +5728,7 @@
- {
- *truncated= true;
- }
- - set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
- + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_DATA_OUT_OF_RANGE, nr,
- MYSQL_TIMESTAMP_TIME, 1);
- error= 1;
- @@ -5873,8 +5859,8 @@
- ** Can handle 2 byte or 4 byte years!
- ****************************************************************************/
- -int Field_year::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_year::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -5919,18 +5905,18 @@
- }
- -int Field_year::store_truncated(double nr, bool *truncated)
- +int Field_year::store(double nr, bool *truncated)
- {
- if (nr < 0.0 || nr >= 2155.0)
- {
- - (void) Field_year::store_truncated((longlong) -1, FALSE, truncated);
- + (void) Field_year::store((longlong) -1, FALSE, truncated);
- return 1;
- }
- - return Field_year::store_truncated((longlong) nr, FALSE, truncated);
- + return Field_year::store((longlong) nr, FALSE, truncated);
- }
- -int Field_year::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_year::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -6013,8 +5999,8 @@
- ** Stored as a 4 byte unsigned int
- ****************************************************************************/
- -int Field_date::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_date::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -6060,7 +6046,7 @@
- }
- -int Field_date::store_truncated(double nr, bool *truncated)
- +int Field_date::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -6084,7 +6070,7 @@
- tmp= (longlong) rint(nr);
- bool truncated2= false;
- - int result= Field_date::store_truncated(tmp, TRUE, &truncated2);
- + int result= Field_date::store(tmp, TRUE, &truncated2);
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -6093,7 +6079,7 @@
- }
- -int Field_date::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_date::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -6282,8 +6268,8 @@
- store function.
- */
- -int Field_newdate::store_truncated(const char *from, uint len, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_newdate::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -6330,7 +6316,7 @@
- }
- -int Field_newdate::store_truncated(double nr, bool *truncated)
- +int Field_newdate::store(double nr, bool *truncated)
- {
- if (nr < 0.0 || nr > 99991231235959.0)
- {
- @@ -6343,11 +6329,11 @@
- WARN_DATA_TRUNCATED, nr, MYSQL_TIMESTAMP_DATE);
- return 1;
- }
- - return Field_newdate::store_truncated((longlong) rint(nr), FALSE, truncated);
- + return Field_newdate::store((longlong) rint(nr), FALSE, truncated);
- }
- -int Field_newdate::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_newdate::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -6421,8 +6407,7 @@
- char buff[MAX_DATE_STRING_REP_LENGTH];
- String str(buff, sizeof(buff), &my_charset_latin1);
- make_datetime((DATE_TIME_FORMAT *) 0, ltime, &str);
- - set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_NOTE,
- - WARN_DATA_TRUNCATED,
- + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_NOTE, WARN_DATA_TRUNCATED,
- str.ptr(), str.length(), MYSQL_TIMESTAMP_DATE, 1);
- error= 3;
- }
- @@ -6540,8 +6525,8 @@
- ** Stored as a 8 byte unsigned int. Should sometimes be change to a 6 byte int.
- ****************************************************************************/
- -int Field_datetime::store_truncated(const char *from, uint len,
- - CHARSET_INFO *cs, bool *truncated)
- +int Field_datetime::store(const char *from, uint len, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -6588,7 +6573,7 @@
- }
- -int Field_datetime::store_truncated(double nr, bool *truncated)
- +int Field_datetime::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -6608,8 +6593,7 @@
- error= 1;
- }
- bool truncated2= false;
- - error|= Field_datetime::store_truncated((longlong) rint(nr), FALSE,
- - &truncated2);
- + error|= Field_datetime::store((longlong) rint(nr), FALSE, &truncated2);
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -6618,8 +6602,7 @@
- }
- -int Field_datetime::store_truncated(longlong nr, bool unsigned_val,
- - bool *truncated)
- +int Field_datetime::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -6970,8 +6953,8 @@
- /* Copy a string and fill with space */
- -int Field_string::store_truncated(const char *from, uint length, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_string::store(const char *from, uint length, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -7020,7 +7003,7 @@
- @param nr number
- */
- -int Field_str::store_truncated(double nr, bool *truncated)
- +int Field_str::store(double nr, bool *truncated)
- {
- ASSERT_COLUMN_MARKED_FOR_WRITE;
- char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
- @@ -7102,7 +7085,7 @@
- like inserting 500.0 in char(1)
- */
- DBUG_ASSERT(local_char_length < 5 || length <= local_char_length+1);
- - return store_truncated(buff, length, charset(), truncated);
- + return store(buff, length, charset(), truncated);
- }
- @@ -7123,18 +7106,18 @@
- }
- -int Field_string::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_string::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- char buff[64];
- int l;
- CHARSET_INFO *cs=charset();
- l= (cs->cset->longlong10_to_str)(cs,buff,sizeof(buff),
- unsigned_val ? 10 : -10, nr);
- - return Field_string::store_truncated(buff,(uint)l,cs, truncated);
- + return Field_string::store(buff,(uint)l,cs, truncated);
- }
- -int Field_longstr::store_decimal_truncated(const my_decimal *d, bool *truncated)
- +int Field_longstr::store_decimal(const my_decimal *d, bool *truncated)
- {
- if (truncated)
- {
- @@ -7143,12 +7126,13 @@
- char buff[DECIMAL_MAX_STR_LENGTH+1];
- String str(buff, sizeof(buff), &my_charset_bin);
- int op_result= my_decimal2string(E_DEC_FATAL_ERROR, d, 0, 0, 0, &str);
- - if (truncated && (E_DEC_OVERFLOW == op_result || E_DEC_TRUNCATED == op_result))
- + if (truncated && (E_DEC_OVERFLOW == op_result ||
- + E_DEC_TRUNCATED == op_result))
- {
- *truncated= true;
- }
- bool truncated2= false;
- - int result= store_truncated(str.ptr(), str.length(), str.charset(), &truncated2);
- + int result= store(str.ptr(), str.length(), str.charset(), &truncated2);
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -7180,7 +7164,7 @@
- String tmp(buf, sizeof(buf), cs);
- tmp.copy((char*) ptr, field_length, cs);
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- - ER_TRUNCATED_WRONG_VALUE,
- + ER_TRUNCATED_WRONG_VALUE,
- ER(ER_TRUNCATED_WRONG_VALUE),
- "DOUBLE", tmp.c_ptr());
- }
- @@ -7198,7 +7182,7 @@
- result= my_strntoll(cs, (char*) ptr,field_length,10,&end,&error);
- if (!table->in_use->no_errors &&
- - (error || (field_length != (uint32)(end - (char*) ptr) &&
- + (error || (field_length != (uint32)(end - (char*) ptr) &&
- !check_if_only_end_space(cs, end,
- (char*) ptr + field_length))))
- {
- @@ -7206,7 +7190,7 @@
- String tmp(buf, sizeof(buf), cs);
- tmp.copy((char*) ptr, field_length, cs);
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- - ER_TRUNCATED_WRONG_VALUE,
- + ER_TRUNCATED_WRONG_VALUE,
- ER(ER_TRUNCATED_WRONG_VALUE),
- "INTEGER", tmp.c_ptr());
- }
- @@ -7245,7 +7229,7 @@
- String tmp(buf, sizeof(buf), cs);
- tmp.copy((char*) ptr, field_length, cs);
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- - ER_TRUNCATED_WRONG_VALUE,
- + ER_TRUNCATED_WRONG_VALUE,
- ER(ER_TRUNCATED_WRONG_VALUE),
- "DECIMAL", tmp.c_ptr());
- }
- @@ -7667,8 +7651,8 @@
- return 2;
- }
- -int Field_varstring::store_truncated(const char *from, uint length,
- - CHARSET_INFO *cs, bool *truncated)
- +int Field_varstring::store(const char *from, uint length, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -7706,7 +7690,7 @@
- }
- -int Field_varstring::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_varstring::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- char buff[64];
- uint length;
- @@ -7716,7 +7700,7 @@
- (unsigned_val ? 10:
- -10),
- nr);
- - return Field_varstring::store_truncated(buff, length, field_charset, truncated);
- + return Field_varstring::store(buff, length, field_charset, truncated);
- }
- @@ -8341,8 +8325,8 @@
- }
- -int Field_blob::store_truncated(const char *from, uint length, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_blob::store(const char *from, uint length, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -8440,21 +8424,19 @@
- }
- -int Field_blob::store_truncated(double nr, bool *truncated)
- +int Field_blob::store(double nr, bool *truncated)
- {
- CHARSET_INFO *cs=charset();
- value.set_real(nr, 2, cs);
- - return Field_blob::store_truncated(value.ptr(), (uint) value.length(), cs,
- - truncated);
- + return Field_blob::store(value.ptr(), (uint) value.length(), cs, truncated);
- }
- -int Field_blob::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_blob::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- CHARSET_INFO *cs=charset();
- value.set_int(nr, unsigned_val, cs);
- - return Field_blob::store_truncated(value.ptr(), (uint) value.length(), cs,
- - truncated);
- + return Field_blob::store(value.ptr(), (uint) value.length(), cs, truncated);
- }
- @@ -9000,7 +8982,7 @@
- }
- -int Field_geom::store_truncated(double nr, bool *truncated)
- +int Field_geom::store(double nr, bool *truncated)
- {
- if (truncated)
- {
- @@ -9012,7 +8994,7 @@
- }
- -int Field_geom::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_geom::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -9024,7 +9006,7 @@
- }
- -int Field_geom::store_decimal_truncated(const my_decimal*, bool *truncated)
- +int Field_geom::store_decimal(const my_decimal*, bool *truncated)
- {
- if (truncated)
- {
- @@ -9036,8 +9018,8 @@
- }
- -int Field_geom::store_truncated(const char *from, uint length,
- - CHARSET_INFO *cs, bool *truncated)
- +int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -9137,8 +9119,8 @@
- (if there isn't a empty value in the enum)
- */
- -int Field_enum::store_truncated(const char *from, uint length, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_enum::store(const char *from, uint length, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -9152,7 +9134,7 @@
- /* Convert character set if necessary */
- if (String::needs_conversion(length, cs, field_charset, ¬_used))
- - {
- + {
- uint dummy_errors;
- tmpstr.copy(from, length, cs, field_charset, &dummy_errors);
- from= tmpstr.ptr();
- @@ -9195,13 +9177,13 @@
- }
- -int Field_enum::store_truncated(double nr, bool *truncated)
- +int Field_enum::store(double nr, bool *truncated)
- {
- - return Field_enum::store_truncated((longlong) nr, FALSE, truncated);
- + return Field_enum::store((longlong) nr, FALSE, truncated);
- }
- -int Field_enum::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_enum::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -9378,8 +9360,8 @@
- */
- -int Field_set::store_truncated(const char *from, uint length, CHARSET_INFO *cs,
- - bool *truncated)
- +int Field_set::store(const char *from, uint length, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -9412,7 +9394,7 @@
- if (err || end != from+length ||
- tmp > (ulonglong) (((longlong) 1 << typelib->count) - (longlong) 1))
- {
- - tmp=0;
- + tmp=0;
- if (truncated)
- {
- *truncated= true;
- @@ -9420,7 +9402,7 @@
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
- }
- }
- - else
- + else
- {
- if (got_warning)
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
- @@ -9430,7 +9412,7 @@
- }
- -int Field_set::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_set::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- if (truncated)
- {
- @@ -9754,15 +9736,15 @@
- }
- -uint Field_bit::is_equal(Create_field *new_field)
- +uint Field_bit::is_equal(Create_field *new_field)
- {
- return (new_field->sql_type == real_type() &&
- new_field->length == max_display_length());
- }
- -
- -int Field_bit::store_truncated(const char *from, uint length, CHARSET_INFO *cs,
- - bool *truncated)
- +
- +int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- @@ -9817,27 +9799,27 @@
- }
- -int Field_bit::store_truncated(double nr, bool *truncated)
- +int Field_bit::store(double nr, bool *truncated)
- {
- - return Field_bit::store_truncated((longlong) nr, FALSE, truncated);
- + return Field_bit::store((longlong) nr, FALSE, truncated);
- }
- -int Field_bit::store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- +int Field_bit::store(longlong nr, bool unsigned_val, bool *truncated)
- {
- char buf[8];
- mi_int8store(buf, nr);
- - return store_truncated(buf, 8, NULL, truncated);
- + return store(buf, 8, NULL, truncated);
- }
- -int Field_bit::store_decimal_truncated(const my_decimal *val, bool *truncated)
- +int Field_bit::store_decimal(const my_decimal *val, bool *truncated)
- {
- int err= 0;
- - longlong i= convert_decimal2longlong_truncated(val, 1, &err, truncated);
- + longlong i= convert_decimal2longlong(val, 1, &err, truncated);
- bool truncated2= false;
- - int result= test(err | store_truncated(i, TRUE, &truncated2));
- + int result= test(err | store(i, TRUE, &truncated2));
- if (truncated)
- {
- *truncated= (*truncated) || truncated2;
- @@ -10232,8 +10214,8 @@
- }
- -int Field_bit_as_char::store_truncated(const char *from, uint length,
- - CHARSET_INFO *cs, bool *truncated)
- +int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs,
- + bool *truncated)
- {
- if (truncated)
- {
- diff -ruN 216/sql/field_conv.cc 217/sql/field_conv.cc
- --- 216/sql/field_conv.cc 2012-02-15 16:28:18.668090945 +0900
- +++ 217/sql/field_conv.cc 2012-02-15 16:28:26.899086467 +0900
- @@ -298,10 +298,9 @@
- static void do_conv_blob(Copy_field *copy)
- {
- copy->from_field->val_str(©->tmp);
- - ((Field_blob *) copy->to_field)->store_truncated(copy->tmp.ptr(),
- - copy->tmp.length(),
- - copy->tmp.charset(),
- - &(copy->truncated));
- + ((Field_blob *) copy->to_field)->store(copy->tmp.ptr(), copy->tmp.length(),
- + copy->tmp.charset(),
- + &(copy->truncated));
- }
- /** Save blob in copy->tmp for GROUP BY. */
- @@ -312,10 +311,9 @@
- String res(buff,sizeof(buff),copy->tmp.charset());
- copy->from_field->val_str(&res);
- copy->tmp.copy(res);
- - ((Field_blob *) copy->to_field)->store_truncated(copy->tmp.ptr(),
- - copy->tmp.length(),
- - copy->tmp.charset(),
- - &(copy->truncated));
- + ((Field_blob *) copy->to_field)->store(copy->tmp.ptr(), copy->tmp.length(),
- + copy->tmp.charset(),
- + &(copy->truncated));
- }
- @@ -324,10 +322,8 @@
- char buff[MAX_FIELD_WIDTH];
- copy->tmp.set_quick(buff,sizeof(buff),copy->tmp.charset());
- copy->from_field->val_str(©->tmp);
- - copy->to_field->store_truncated(copy->tmp.c_ptr_quick(),
- - copy->tmp.length(),
- - copy->tmp.charset(),
- - &(copy->truncated));
- + copy->to_field->store(copy->tmp.c_ptr_quick(), copy->tmp.length(),
- + copy->tmp.charset(), &(copy->truncated));
- }
- @@ -353,33 +349,30 @@
- uint length= my_lengthsp_8bit(&my_charset_bin, copy->tmp.c_ptr_quick(),
- copy->from_field->field_length);
- - copy->to_field->store_truncated(copy->tmp.c_ptr_quick(),
- - length,
- - copy->tmp.charset(),
- - &(copy->truncated));
- + copy->to_field->store(copy->tmp.c_ptr_quick(), length, copy->tmp.charset(),
- + &(copy->truncated));
- }
- static void do_field_int(Copy_field *copy)
- {
- longlong value= copy->from_field->val_int();
- - copy->to_field->store_truncated(value,
- - test(copy->from_field->flags & UNSIGNED_FLAG),
- + copy->to_field->store(value, test(copy->from_field->flags & UNSIGNED_FLAG),
- &(copy->truncated));
- }
- static void do_field_real(Copy_field *copy)
- {
- double value=copy->from_field->val_real();
- - copy->to_field->store_truncated(value,&(copy->truncated));
- + copy->to_field->store(value,&(copy->truncated));
- }
- static void do_field_decimal(Copy_field *copy)
- {
- my_decimal value;
- - copy->to_field->store_decimal_truncated(copy->from_field->val_decimal(&value),
- - &(copy->truncated));
- + copy->to_field->store_decimal(copy->from_field->val_decimal(&value),
- + &(copy->truncated));
- }
- diff -ruN 216/sql/field.h 217/sql/field.h
- --- 216/sql/field.h 2012-02-15 16:28:18.672091429 +0900
- +++ 217/sql/field.h 2012-02-15 16:28:26.902086830 +0900
- @@ -115,27 +115,11 @@
- const char *field_name_arg);
- virtual ~Field() {}
- /* Store functions returns 1 on overflow and -1 on fatal error */
- - virtual int store(const char *to, uint length, CHARSET_INFO *cs)
- - {
- - return store_truncated(to,length,cs,0);
- - }
- - virtual int store_truncated(const char *to, uint length, CHARSET_INFO *cs,
- - bool *truncated)=0;
- - virtual int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - virtual int store_truncated(double nr, bool *truncated)=0;
- - virtual int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - virtual int store_truncated(longlong nr, bool unsigned_val, bool *truncated)=0;
- - virtual int store_decimal(const my_decimal *d)
- - {
- - return store_decimal_truncated(d, 0);
- - }
- - virtual int store_decimal_truncated(const my_decimal *d, bool *truncated)=0;
- + virtual int store(const char *to, uint length, CHARSET_INFO *cs,
- + bool *truncated= 0)=0;
- + virtual int store(double nr, bool *truncated= 0)=0;
- + virtual int store(longlong nr, bool unsigned_val, bool *truncated= 0)=0;
- + virtual int store_decimal(const my_decimal *d, bool *truncated= 0)=0;
- virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type);
- int store(const char *to, uint length, CHARSET_INFO *cs,
- enum_check_fields check_level);
- @@ -480,17 +464,12 @@
- {
- return (op_result == E_DEC_OVERFLOW);
- }
- - int warn_if_overflow(int op_result)
- - {
- - return warn_if_overflow_truncated(op_result, 0);
- - }
- - int warn_if_overflow_truncated(int op_result, bool *truncated);
- - inline void if_overflow_truncated(int op_result, bool *truncated)
- + int warn_if_overflow(int op_result, bool *truncated= 0);
- + inline void if_overflow(int op_result, bool *truncated)
- {
- - if (truncated)
- - {
- - *truncated= (op_result == E_DEC_OVERFLOW) || (op_result == E_DEC_TRUNCATED);
- - }
- + if (!truncated)
- + return;
- + *truncated= (op_result == E_DEC_OVERFLOW) || (op_result == E_DEC_TRUNCATED);
- }
- void init(TABLE *table_arg)
- {
- @@ -511,13 +490,7 @@
- virtual uint is_equal(Create_field *new_field);
- /* convert decimal to longlong with overflow check */
- longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag,
- - int *err)
- - {
- - return convert_decimal2longlong_truncated(val, unsigned_flag, err, 0);
- - }
- - longlong convert_decimal2longlong_truncated(const my_decimal *val,
- - bool unsigned_flag, int *err,
- - bool *truncated);
- + int *err, bool *truncated= 0);
- /* The max. number of characters */
- inline uint32 char_length() const
- {
- @@ -670,11 +643,7 @@
- uint decimals() const { return (uint) dec; }
- uint size_of() const { return sizeof(*this); }
- bool eq_def(Field *field);
- - int store_decimal(const my_decimal *value)
- - {
- - return store_decimal_truncated(value, 0);
- - }
- - int store_decimal_truncated(const my_decimal*, bool *truncated);
- + int store_decimal(const my_decimal*, bool *truncated= 0);
- uint row_pack_length()
- {
- return pack_length();
- @@ -689,22 +658,10 @@
- my_decimal *val_decimal(my_decimal *);
- uint is_equal(Create_field *new_field);
- int check_int(CHARSET_INFO *cs, const char *str, int length,
- - const char *int_end, int error)
- - {
- - return check_int_truncated(cs, str, length, int_end, error, 0);
- - }
- - int check_int_truncated(CHARSET_INFO *cs, const char *str, int length,
- - const char *int_end, int error, bool *truncated);
- + const char *int_end, int error, bool *truncated= 0);
- bool get_int(CHARSET_INFO *cs, const char *from, uint len, longlong *rnd,
- - ulonglong unsigned_max, longlong signed_min, longlong signed_max)
- - {
- - return get_int_truncated(cs, from,len, rnd, unsigned_max, signed_min,
- - signed_max, 0);
- - }
- - bool get_int_truncated(CHARSET_INFO *cs, const char *from, uint len,
- - longlong *rnd, ulonglong unsigned_max,
- - longlong signed_min, longlong signed_max,
- - bool *truncated);
- + ulonglong unsigned_max, longlong signed_min, longlong signed_max,
- + bool *truncated= 0);
- };
- @@ -718,27 +675,10 @@
- const char *field_name_arg, CHARSET_INFO *charset);
- Item_result result_type () const { return STRING_RESULT; }
- uint decimals() const { return NOT_FIXED_DEC; }
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated)=0;
- - int store_decimal(const my_decimal *value)
- - {
- - return store_decimal_truncated(value, 0);
- - }
- - int store_decimal_truncated(const my_decimal*, bool *truncated);
- - int store(const char *to, uint length, CHARSET_INFO *cs)
- - {
- - return store_truncated(to, length, cs, 0);
- - }
- - int store_truncated(const char* to, uint length, CHARSET_INFO *cs,
- - bool *truncated)=0;
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0)=0;
- + int store_decimal(const my_decimal *value, bool *truncated= 0);
- + int store(const char *to, uint length, CHARSET_INFO *cs, bool *truncated= 0)=0;
- uint size_of() const { return sizeof(*this); }
- CHARSET_INFO *charset(void) const { return field_charset; }
- void set_charset(CHARSET_INFO *charset_arg) { field_charset= charset_arg; }
- @@ -769,11 +709,7 @@
- field_name_arg, charset_arg)
- {}
- - int store_decimal(const my_decimal *d)
- - {
- - return store_decimal_truncated(d, 0);
- - }
- - int store_decimal_truncated(const my_decimal *d, bool *truncated);
- + int store_decimal(const my_decimal *d, bool *truncated= 0);
- uint32 max_data_length() const;
- };
- @@ -790,17 +726,9 @@
- field_name_arg, dec_arg, zero_arg, unsigned_arg),
- not_fixed(dec_arg >= NOT_FIXED_DEC)
- {}
- - int store_decimal(const my_decimal *value)
- - {
- - return store_decimal_truncated(value, 0);
- - }
- - int store_decimal_truncated(const my_decimal*, bool *truncated);
- + int store_decimal(const my_decimal *value, bool *truncated= 0);
- my_decimal *val_decimal(my_decimal *);
- - int truncate(double *nr, double max_length)
- - {
- - return truncate_truncated(nr, max_length, 0);
- - }
- - int truncate_truncated(double *nr, double max_length, bool *truncated);
- + int truncate(double *nr, double max_length, bool *truncated= 0);
- uint32 max_display_length() { return field_length; }
- uint size_of() const { return sizeof(*this); }
- virtual const uchar *unpack(uchar* to, const uchar *from,
- @@ -824,22 +752,10 @@
- enum ha_base_keytype key_type() const
- { return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; }
- int reset(void);
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char* to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- double val_real(void);
- longlong val_int(void);
- String *val_str(String*,String *);
- @@ -886,34 +802,14 @@
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
- Item_result result_type () const { return DECIMAL_RESULT; }
- int reset(void);
- - bool store_value(const my_decimal *decimal_value)
- - {
- - return store_value_truncated(decimal_value, 0);
- - }
- - bool store_value_truncated(const my_decimal *decimal_value, bool *truncated);
- + bool store_value(const my_decimal *decimal_value, bool *truncated= 0);
- void set_value_on_overflow(my_decimal *decimal_value, bool sign);
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int store_time(MYSQL_TIME *ltime, timestamp_type t_type);
- - int store_decimal(const my_decimal *value)
- - {
- - return store_decimal_truncated(value, 0);
- - }
- - int store_decimal_truncated(const my_decimal*, bool *truncated);
- + int store_decimal(const my_decimal *value, bool *truncated= 0);
- double val_real(void);
- longlong val_int(void);
- my_decimal *val_decimal(my_decimal *);
- @@ -950,22 +846,10 @@
- enum_field_types type() const { return MYSQL_TYPE_TINY;}
- enum ha_base_keytype key_type() const
- { return unsigned_flag ? HA_KEYTYPE_BINARY : HA_KEYTYPE_INT8; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { ptr[0]=0; return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1012,22 +896,10 @@
- enum_field_types type() const { return MYSQL_TYPE_SHORT;}
- enum ha_base_keytype key_type() const
- { return unsigned_flag ? HA_KEYTYPE_USHORT_INT : HA_KEYTYPE_SHORT_INT;}
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { ptr[0]=ptr[1]=0; return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1094,22 +966,10 @@
- enum_field_types type() const { return MYSQL_TYPE_INT24;}
- enum ha_base_keytype key_type() const
- { return unsigned_flag ? HA_KEYTYPE_UINT24 : HA_KEYTYPE_INT24; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char* to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1154,22 +1014,10 @@
- enum_field_types type() const { return MYSQL_TYPE_LONG;}
- enum ha_base_keytype key_type() const
- { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1216,22 +1064,10 @@
- enum_field_types type() const { return MYSQL_TYPE_LONGLONG;}
- enum ha_base_keytype key_type() const
- { return unsigned_flag ? HA_KEYTYPE_ULONGLONG : HA_KEYTYPE_LONGLONG; }
- - int store(const char* to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char* to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void)
- {
- ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
- @@ -1280,22 +1116,10 @@
- {}
- enum_field_types type() const { return MYSQL_TYPE_FLOAT;}
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_FLOAT; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { bzero(ptr,sizeof(float)); return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1333,22 +1157,10 @@
- {not_fixed= not_fixed_arg; }
- enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { bzero(ptr,sizeof(double)); return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1376,12 +1188,8 @@
- unireg_check_arg, field_name_arg, cs)
- {}
- enum_field_types type() const { return MYSQL_TYPE_NULL;}
- - int store(const char *to, uint length, CHARSET_INFO *cs)
- - {
- - return store_truncated(to, length, cs, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *cs,
- - bool *truncated)
- + int store(const char *to, uint length, CHARSET_INFO *cs,
- + bool *truncated= 0)
- {
- if (truncated)
- {
- @@ -1390,11 +1198,7 @@
- null[0]= 1;
- return 0;
- }
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated)
- + int store(double nr, bool *truncated= 0)
- {
- if (truncated)
- {
- @@ -1403,11 +1207,7 @@
- null[0]=1;
- return 0;
- }
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0)
- {
- if (truncated)
- {
- @@ -1416,11 +1216,7 @@
- null[0]= 1;
- return 0;
- }
- - int store_decimal(const my_decimal *d)
- - {
- - return store_decimal_truncated(d, 0);
- - }
- - int store_decimal_truncated(const my_decimal *d, bool *truncated)
- + int store_decimal(const my_decimal *d, bool *truncated= 0)
- {
- if (truncated)
- {
- @@ -1455,22 +1251,10 @@
- enum_field_types type() const { return MYSQL_TYPE_TIMESTAMP;}
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
- enum Item_result cmp_type () const { return INT_RESULT; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1541,22 +1325,10 @@
- unireg_check_arg, field_name_arg, 1, 1)
- {}
- enum_field_types type() const { return MYSQL_TYPE_YEAR;}
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- double val_real(void);
- longlong val_int(void);
- String *val_str(String*,String *);
- @@ -1581,22 +1353,10 @@
- enum_field_types type() const { return MYSQL_TYPE_DATE;}
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
- enum Item_result cmp_type () const { return INT_RESULT; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1639,22 +1399,10 @@
- enum_field_types real_type() const { return MYSQL_TYPE_NEWDATE; }
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
- enum Item_result cmp_type () const { return INT_RESULT; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int store_time(MYSQL_TIME *ltime, timestamp_type type);
- int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
- double val_real(void);
- @@ -1688,22 +1436,10 @@
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
- enum Item_result cmp_type () const { return INT_RESULT; }
- int store_time(MYSQL_TIME *ltime, timestamp_type type);
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
- double val_real(void);
- longlong val_int(void);
- @@ -1738,22 +1474,10 @@
- #endif
- enum Item_result cmp_type () const { return INT_RESULT; }
- uint decimals() const { return DATETIME_DEC; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- int store_time(MYSQL_TIME *ltime, timestamp_type type);
- int reset(void)
- {
- @@ -1819,24 +1543,12 @@
- (has_charset() ? ' ' : 0));
- return 0;
- }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- - int store(double nr) /* QQ: To be deleted */
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- + int store(double nr, bool *truncated= 0) /* QQ: To be deleted */
- {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated)/* QQ: To be deleted */
- - {
- - return Field_str::store_truncated(nr, truncated);
- + return Field_str::store(nr, truncated);
- }
- double val_real(void);
- longlong val_int(void);
- @@ -1920,25 +1632,13 @@
- return (uint32) field_length + (field_charset == &my_charset_bin ?
- length_bytes : 0);
- }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- - int store(double nr) /* QQ: To be deleted */
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- + int store(double nr, bool *truncated= 0) /* QQ: To be deleted */
- {
- - return store_truncated(nr, 0);
- + return Field_str::store(nr, truncated);
- }
- - int store_truncated(double nr, bool *truncated)/* QQ: To be deleted */
- - {
- - return Field_str::store_truncated(nr, truncated);
- - }
- double val_real(void);
- longlong val_int(void);
- String *val_str(String*,String *);
- @@ -2030,22 +1730,10 @@
- enum_field_types type() const { return MYSQL_TYPE_BLOB;}
- enum ha_base_keytype key_type() const
- { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- double val_real(void);
- longlong val_int(void);
- String *val_str(String*,String *);
- @@ -2199,27 +1887,11 @@
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY2; }
- enum_field_types type() const { return MYSQL_TYPE_GEOMETRY; }
- void sql_type(String &str) const;
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool* truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- - int store_decimal(const my_decimal *value)
- - {
- - return store_decimal_truncated(value, 0);
- - }
- - int store_decimal_truncated(const my_decimal*, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- + int store_decimal(const my_decimal *value, bool *truncated= 0);
- uint size_of() const { return sizeof(*this); }
- int reset(void) { return !maybe_null() || Field_blob::reset(); }
- geometry_type get_geometry_type() { return geom_type; };
- @@ -2249,22 +1921,10 @@
- enum Item_result cmp_type () const { return INT_RESULT; }
- enum Item_result cast_to_int_type () const { return INT_RESULT; }
- enum ha_base_keytype key_type() const;
- - int store(const char *to, uint length,CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(const char *to, uint length,CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- double val_real(void);
- longlong val_int(void);
- String *val_str(String*,String *);
- @@ -2304,25 +1964,13 @@
- {
- flags=(flags & ~ENUM_FLAG) | SET_FLAG;
- }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated)
- - {
- - return Field_set::store_truncated((longlong) nr, FALSE, truncated);
- - }
- - int store(longlong nr, bool unsigned_val)
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0)
- {
- - return store_truncated(nr, unsigned_val, 0);
- + return Field_set::store((longlong) nr, FALSE, truncated);
- }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- virtual bool zero_pack() const { return 1; }
- String *val_str(String*,String *);
- @@ -2368,27 +2016,11 @@
- clr_rec_bits(bit_ptr, bit_ofs, bit_len);
- return 0;
- }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated);
- - int store(longlong nr, bool unsigned_val)
- - {
- - return store_truncated(nr, unsigned_val, 0);
- - }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated);
- - int store_decimal(const my_decimal *value)
- - {
- - return store_decimal_truncated(value, 0);
- - }
- - int store_decimal_truncated(const my_decimal*, bool *truncated);
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0);
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0);
- + int store_decimal(const my_decimal *value, bool *truncated= 0);
- double val_real(void);
- longlong val_int(void);
- String *val_str(String*, String *);
- @@ -2471,27 +2103,15 @@
- enum utype unireg_check_arg, const char *field_name_arg);
- enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
- uint size_of() const { return sizeof(*this); }
- - int store(const char *to, uint length, CHARSET_INFO *charset)
- - {
- - return store_truncated(to, length, charset, 0);
- - }
- - int store_truncated(const char *to, uint length, CHARSET_INFO *charset,
- - bool *truncated);
- - int store(double nr)
- - {
- - return store_truncated(nr, 0);
- - }
- - int store_truncated(double nr, bool *truncated)
- - {
- - return Field_bit::store_truncated(nr, truncated);
- - }
- - int store(longlong nr, bool unsigned_val)
- + int store(const char *to, uint length, CHARSET_INFO *charset,
- + bool *truncated= 0);
- + int store(double nr, bool *truncated= 0)
- {
- - return store_truncated(nr, unsigned_val, 0);
- + return Field_bit::store(nr, truncated);
- }
- - int store_truncated(longlong nr, bool unsigned_val, bool *truncated)
- + int store(longlong nr, bool unsigned_val, bool *truncated= 0)
- {
- - return Field_bit::store_truncated(nr, unsigned_val, truncated);
- + return Field_bit::store(nr, unsigned_val, truncated);
- }
- void sql_type(String &str) const;
- };
Advertisement
Add Comment
Please, Sign In to add comment