summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2003-08-27 19:11:54 -0400
committerunknown <vva@eagle.mysql.r18.ru>2003-08-27 19:11:54 -0400
commita73058a77c0fe693ea825ab5f9b896fd7eb1bc2c (patch)
treee6c2943f6ddf76f861bea6ce8b9febe07a60bc95 /sql/field.h
parent6496a0dd14dd15be215cfca5172bad1935302c24 (diff)
downloadmariadb-git-a73058a77c0fe693ea825ab5f9b896fd7eb1bc2c.tar.gz
fixed bug #910 (right type of ifnull function)
mysql-test/r/create.result: added test for bug #910 (right type of ifnull function) mysql-test/t/create.test: added test for bug #910 (right type of ifnull function) sql/field.h: added new constructors of Field_decimal, Field_tiny, Field_short, Field_float, Field_null, Field_year for using in Item::tmp_table_field_from_field_type sql/item.cc: added Item::tmp_table_field_from_field_type sql/item.h: added Item::tmp_table_field_from_field_type
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h
index 79c45a99a43..a69178b4c92 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -305,6 +305,11 @@ public:
unireg_check_arg, field_name_arg, table_arg,
dec_arg, zero_arg,unsigned_arg)
{}
+ Field_decimal(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
+ struct st_table *table_arg,bool unsigned_arg)
+ :Field_num((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
+ NONE, field_name_arg, table_arg,0,0,unsigned_arg)
+ {}
enum_field_types type() const { return FIELD_TYPE_DECIMAL;}
enum ha_base_keytype key_type() const
{ return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; }
@@ -334,6 +339,11 @@ public:
unireg_check_arg, field_name_arg, table_arg,
0, zero_arg,unsigned_arg)
{}
+ Field_tiny(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
+ struct st_table *table_arg,bool unsigned_arg)
+ :Field_num((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
+ NONE, field_name_arg, table_arg,0,0,unsigned_arg)
+ {}
enum Item_result result_type () const { return INT_RESULT; }
enum_field_types type() const { return FIELD_TYPE_TINY;}
enum ha_base_keytype key_type() const
@@ -364,6 +374,11 @@ public:
unireg_check_arg, field_name_arg, table_arg,
0, zero_arg,unsigned_arg)
{}
+ Field_short(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
+ struct st_table *table_arg,bool unsigned_arg)
+ :Field_num((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
+ NONE, field_name_arg, table_arg,0,0,unsigned_arg)
+ {}
enum Item_result result_type () const { return INT_RESULT; }
enum_field_types type() const { return FIELD_TYPE_SHORT;}
enum ha_base_keytype key_type() const
@@ -497,6 +512,11 @@ public:
unireg_check_arg, field_name_arg, table_arg,
dec_arg, zero_arg,unsigned_arg)
{}
+ Field_float(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
+ struct st_table *table_arg, uint8 dec_arg)
+ :Field_num((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
+ NONE, field_name_arg, table_arg,dec_arg,0,0)
+ {}
enum_field_types type() const { return FIELD_TYPE_FLOAT;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_FLOAT; }
int store(const char *to,uint length,CHARSET_INFO *charset);
@@ -558,6 +578,11 @@ public:
:Field_str(ptr_arg, len_arg, null, 1,
unireg_check_arg, field_name_arg, table_arg, cs)
{}
+ Field_null(uint32 len_arg, const char *field_name_arg,
+ struct st_table *table_arg, CHARSET_INFO *cs)
+ :Field_str((char*) 0, len_arg, null, 1,
+ NONE, field_name_arg, table_arg, cs)
+ {}
enum_field_types type() const { return FIELD_TYPE_NULL;}
int store(const char *to, uint length, CHARSET_INFO *cs) { null[0]=1; return 0; }
int store(double nr) { null[0]=1; return 0; }
@@ -627,6 +652,10 @@ public:
:Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, table_arg, 1, 1)
{}
+ Field_year(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
+ struct st_table *table_arg)
+ :Field_tiny(len_arg,maybe_null_arg,field_name_arg,table_arg,1)
+ {}
enum_field_types type() const { return FIELD_TYPE_YEAR;}
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr);