diff options
author | ramil/ram@ramil.myoffice.izhnet.ru <> | 2007-03-05 17:12:37 +0400 |
---|---|---|
committer | ramil/ram@ramil.myoffice.izhnet.ru <> | 2007-03-05 17:12:37 +0400 |
commit | ca66f604f40ddab4cc9c012b3d2355e146e5d888 (patch) | |
tree | 4e122dc2fcc68efa8a2682f9282622f6e00664a8 /sql/item_geofunc.h | |
parent | 2d819535c7fb34a6a3064770e7d21a31fd4af78b (diff) | |
parent | f165316cfcaf52875d56fdf99404c1cf483cb05d (diff) | |
download | mariadb-git-ca66f604f40ddab4cc9c012b3d2355e146e5d888.tar.gz |
Merge mysql.com:/home/ram/work/b26038/b26038.5.0
into mysql.com:/home/ram/work/b26038/b26038.5.1
Diffstat (limited to 'sql/item_geofunc.h')
-rw-r--r-- | sql/item_geofunc.h | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index 5361a02aa83..068caa447ef 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -34,6 +34,7 @@ public: enum_field_types field_type() const { return MYSQL_TYPE_GEOMETRY; } Field *tmp_table_field(TABLE *t_arg); virtual int get_geometry_type() const; + bool is_null() { (void) val_int(); return null_value; } }; class Item_func_geometry_from_text: public Item_geometry_func @@ -81,6 +82,7 @@ public: void fix_length_and_dec() { max_length=20; // "GeometryCollection" is the most long + maybe_null= 1; }; }; @@ -225,6 +227,8 @@ public: } } void print(String *str) { Item_func::print(str); } + void fix_length_and_dec() { maybe_null= 1; } + bool is_null() { (void) val_int(); return null_value; } }; class Item_func_isempty: public Item_bool_func @@ -234,6 +238,7 @@ public: longlong val_int(); optimize_type select_optimize() const { return OPTIMIZE_NONE; } const char *func_name() const { return "isempty"; } + void fix_length_and_dec() { maybe_null= 1; } }; class Item_func_issimple: public Item_bool_func @@ -243,6 +248,7 @@ public: longlong val_int(); optimize_type select_optimize() const { return OPTIMIZE_NONE; } const char *func_name() const { return "issimple"; } + void fix_length_and_dec() { maybe_null= 1; } }; class Item_func_isclosed: public Item_bool_func @@ -252,6 +258,7 @@ public: longlong val_int(); optimize_type select_optimize() const { return OPTIMIZE_NONE; } const char *func_name() const { return "isclosed"; } + void fix_length_and_dec() { maybe_null= 1; } }; class Item_func_dimension: public Item_int_func @@ -261,7 +268,7 @@ public: Item_func_dimension(Item *a): Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "dimension"; } - void fix_length_and_dec() { max_length=10; } + void fix_length_and_dec() { max_length= 10; maybe_null= 1; } }; class Item_func_x: public Item_real_func @@ -271,6 +278,11 @@ public: Item_func_x(Item *a): Item_real_func(a) {} double val_real(); const char *func_name() const { return "x"; } + void fix_length_and_dec() + { + Item_real_func::fix_length_and_dec(); + maybe_null= 1; + } }; @@ -281,6 +293,11 @@ public: Item_func_y(Item *a): Item_real_func(a) {} double val_real(); const char *func_name() const { return "y"; } + void fix_length_and_dec() + { + Item_real_func::fix_length_and_dec(); + maybe_null= 1; + } }; @@ -291,7 +308,7 @@ public: Item_func_numgeometries(Item *a): Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "numgeometries"; } - void fix_length_and_dec() { max_length=10; } + void fix_length_and_dec() { max_length= 10; maybe_null= 1; } }; @@ -302,7 +319,7 @@ public: Item_func_numinteriorring(Item *a): Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "numinteriorrings"; } - void fix_length_and_dec() { max_length=10; } + void fix_length_and_dec() { max_length= 10; maybe_null= 1; } }; @@ -313,7 +330,7 @@ public: Item_func_numpoints(Item *a): Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "numpoints"; } - void fix_length_and_dec() { max_length=10; } + void fix_length_and_dec() { max_length= 10; maybe_null= 1; } }; @@ -324,6 +341,11 @@ public: Item_func_area(Item *a): Item_real_func(a) {} double val_real(); const char *func_name() const { return "area"; } + void fix_length_and_dec() + { + Item_real_func::fix_length_and_dec(); + maybe_null= 1; + } }; @@ -334,6 +356,11 @@ public: Item_func_glength(Item *a): Item_real_func(a) {} double val_real(); const char *func_name() const { return "glength"; } + void fix_length_and_dec() + { + Item_real_func::fix_length_and_dec(); + maybe_null= 1; + } }; @@ -344,7 +371,7 @@ public: Item_func_srid(Item *a): Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "srid"; } - void fix_length_and_dec() { max_length= 10; } + void fix_length_and_dec() { max_length= 10; maybe_null= 1; } }; #define GEOM_NEW(thd, obj_constructor) new (thd->mem_root) obj_constructor |