diff options
author | bell@sanja.is.com.ua <> | 2003-06-25 23:52:15 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2003-06-25 23:52:15 +0300 |
commit | 7b77c5a2d3233290c7e307e8b78c48d28573b23e (patch) | |
tree | 445a886058facd2b39f84374786fced29406978c /sql/item_cmpfunc.h | |
parent | ac3fe4c81df253c4c736b9f238c4fcfa2ac0fd3b (diff) | |
parent | e009dce0c380d87430b03bdaef90374c1aa8e8eb (diff) | |
download | mariadb-git-7b77c5a2d3233290c7e307e8b78c48d28573b23e.tar.gz |
merged
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r-- | sql/item_cmpfunc.h | 93 |
1 files changed, 5 insertions, 88 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 8d0ccba0f37..d218d4911eb 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -111,25 +111,25 @@ class Item_bool_func2 :public Item_int_func protected: Arg_comparator cmp; String tmp_value1,tmp_value2; - CHARSET_INFO *cmp_charset; + DTCollation cmp_collation; public: Item_bool_func2(Item *a,Item *b): - Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1), cmp_charset(0) {} + Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1) + { cmp_collation.set(0,DERIVATION_NONE);} bool fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref); void fix_length_and_dec(); void set_cmp_func() { cmp.set_cmp_func(this, tmp_arg, tmp_arg+1); } - bool set_cmp_charset(CHARSET_INFO *cs1, enum coercion co1, - CHARSET_INFO *cs2, enum coercion co2); optimize_type select_optimize() const { return OPTIMIZE_OP; } virtual enum Functype rev_functype() const { return UNKNOWN_FUNC; } bool have_rev_func() const { return rev_functype() != UNKNOWN_FUNC; } void print(String *str) { Item_func::print_op(str); } bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); } - virtual bool binary() const { return test(cmp_charset->state & MY_CS_BINSORT); } + virtual bool binary() const + { return test(cmp_collation.collation->state & MY_CS_BINSORT); } static Item_bool_func2* eq_creator(Item *a, Item *b); static Item_bool_func2* ne_creator(Item *a, Item *b); @@ -262,13 +262,6 @@ class Item_func_strcmp :public Item_bool_func2 public: Item_func_strcmp(Item *a,Item *b) :Item_bool_func2(a,b) {} longlong val_int(); - void fix_length_and_dec() - { - max_length=2; - /* QQ: COERCIBILITY */ - cmp_charset= args[0]->binary() || args[1]->binary() ? - &my_charset_bin : args[0]->charset(); - } optimize_type select_optimize() const { return OPTIMIZE_NONE; } const char *func_name() const { return "strcmp"; } }; @@ -849,79 +842,3 @@ inline Item *and_conds(Item *a,Item *b) } Item *and_expressions(Item *a, Item *b, Item **org_item); - -/************************************************************** - Spatial relations -***************************************************************/ - -class Item_func_spatial_rel :public Item_bool_func2 -{ - enum Functype spatial_rel; -public: - Item_func_spatial_rel(Item *a,Item *b, enum Functype sp_rel) : - Item_bool_func2(a,b) { spatial_rel = sp_rel; } - longlong val_int(); - enum Functype functype() const - { - switch (spatial_rel) { - case SP_CONTAINS_FUNC: - return SP_WITHIN_FUNC; - case SP_WITHIN_FUNC: - return SP_CONTAINS_FUNC; - default: - return spatial_rel; - } - } - enum Functype rev_functype() const { return spatial_rel; } - const char *func_name() const - { - switch (spatial_rel) { - case SP_CONTAINS_FUNC: - return "contains"; - case SP_WITHIN_FUNC: - return "within"; - case SP_EQUALS_FUNC: - return "equals"; - case SP_DISJOINT_FUNC: - return "disjoint"; - case SP_INTERSECTS_FUNC: - return "intersects"; - case SP_TOUCHES_FUNC: - return "touches"; - case SP_CROSSES_FUNC: - return "crosses"; - case SP_OVERLAPS_FUNC: - return "overlaps"; - default: - return "sp_unknown"; - } - } -}; - - -class Item_func_isempty :public Item_bool_func -{ -public: - Item_func_isempty(Item *a) :Item_bool_func(a) {} - longlong val_int(); - optimize_type select_optimize() const { return OPTIMIZE_NONE; } - const char *func_name() const { return "isempty"; } -}; - -class Item_func_issimple :public Item_bool_func -{ -public: - Item_func_issimple(Item *a) :Item_bool_func(a) {} - longlong val_int(); - optimize_type select_optimize() const { return OPTIMIZE_NONE; } - const char *func_name() const { return "issimple"; } -}; - -class Item_func_isclosed :public Item_bool_func -{ -public: - Item_func_isclosed(Item *a) :Item_bool_func(a) {} - longlong val_int(); - optimize_type select_optimize() const { return OPTIMIZE_NONE; } - const char *func_name() const { return "isclosed"; } -}; |