1
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
1
/* Copyright (C) 2000-2006 MySQL AB
3
3
This program is free software; you can redistribute it and/or modify
4
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; either version 2 of the License, or
6
(at your option) any later version.
5
the Free Software Foundation; version 2 of the License.
8
7
This program is distributed in the hope that it will be useful,
9
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
727
726
class Field_double :public Field_real {
729
729
Field_double(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
730
730
uchar null_bit_arg,
731
731
enum utype unireg_check_arg, const char *field_name_arg,
733
733
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
734
734
:Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
735
735
unireg_check_arg, field_name_arg, table_arg,
736
dec_arg, zero_arg, unsigned_arg)
736
dec_arg, zero_arg, unsigned_arg),
737
not_fixed(dec_arg >= NOT_FIXED_DEC)
738
739
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
739
740
struct st_table *table_arg, uint8 dec_arg)
740
:Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
741
NONE, field_name_arg, table_arg, dec_arg, 0, 0)
741
:Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
742
NONE, field_name_arg, table_arg, dec_arg, 0, 0),
743
not_fixed(dec_arg >= NOT_FIXED_DEC)
745
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
746
struct st_table *table_arg, uint8 dec_arg, my_bool not_fixed_srg)
747
:Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
748
NONE, field_name_arg, table_arg, dec_arg, 0, 0),
749
not_fixed(not_fixed_srg)
743
751
enum_field_types type() const { return FIELD_TYPE_DOUBLE;}
744
752
enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
1035
1044
bool zero_pack() const { return 0; }
1036
1045
int reset(void)
1038
charset()->cset->fill(charset(),ptr,field_length,' ');
1047
charset()->cset->fill(charset(),ptr,field_length,
1048
(has_charset() ? ' ' : 0));
1041
1051
int store(const char *to,uint length,CHARSET_INFO *charset);
1242
1252
uint max_packed_col_length(uint max_length);
1243
1253
void free() { value.free(); }
1244
1254
inline void clear_temporary() { bzero((char*) &value,sizeof(value)); }
1245
friend void field_conv(Field *to,Field *from);
1255
friend int field_conv(Field *to,Field *from);
1246
1256
uint size_of() const { return sizeof(*this); }
1247
1257
bool has_charset(void) const
1248
1258
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
1299
1309
flags|=ENUM_FLAG;
1311
Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
1301
1312
enum_field_types type() const { return FIELD_TYPE_STRING; }
1302
1313
enum Item_result cmp_type () const { return INT_RESULT; }
1303
1314
enum Item_result cast_to_int_type () const { return INT_RESULT; }