1246
class Field_date :public Field_str {
1248
Field_date(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
1249
enum utype unireg_check_arg, const char *field_name_arg,
1251
:Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg,
1252
unireg_check_arg, field_name_arg, cs)
1254
Field_date(bool maybe_null_arg, const char *field_name_arg,
1256
:Field_str((uchar*) 0,10, maybe_null_arg ? (uchar*) "": 0,0,
1257
NONE, field_name_arg, cs) {}
1258
enum_field_types type() const { return MYSQL_TYPE_DATE;}
1259
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
1260
enum Item_result cmp_type () const { return INT_RESULT; }
1261
int store(const char *to,uint length,CHARSET_INFO *charset);
1262
int store(double nr);
1263
int store(longlong nr, bool unsigned_val);
1264
int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
1265
double val_real(void);
1266
longlong val_int(void);
1267
String *val_str(String*,String *);
1268
bool get_time(MYSQL_TIME *ltime);
1269
bool send_binary(Protocol *protocol);
1270
int cmp(const uchar *,const uchar *);
1271
void sort_string(uchar *buff,uint length);
1272
uint32 pack_length() const { return 4; }
1273
void sql_type(String &str) const;
1274
bool can_be_compared_as_longlong() const { return TRUE; }
1275
bool zero_pack() const { return 1; }
1279
1246
class Field_newdate :public Field_str {
1281
1248
Field_newdate(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
1288
1255
CHARSET_INFO *cs)
1289
1256
:Field_str((uchar*) 0,10, maybe_null_arg ? (uchar*) "": 0,0,
1290
1257
NONE, field_name_arg, cs) {}
1291
enum_field_types type() const { return MYSQL_TYPE_DATE;}
1258
enum_field_types type() const { return MYSQL_TYPE_NEWDATE;}
1292
1259
enum_field_types real_type() const { return MYSQL_TYPE_NEWDATE; }
1293
1260
enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
1294
1261
enum Item_result cmp_type () const { return INT_RESULT; }