summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorram@mysql.r18.ru <>2003-03-18 15:30:32 +0400
committerram@mysql.r18.ru <>2003-03-18 15:30:32 +0400
commit031ac2a7b2ba8eb881fc24d0429922cd8c42e9b9 (patch)
tree0e83c851e37727716fb38186353324ae67952771 /sql/item_cmpfunc.cc
parent34681a80360955a1aa0718e77fac94ae62b85fc8 (diff)
downloadmariadb-git-031ac2a7b2ba8eb881fc24d0429922cd8c42e9b9.tar.gz
SRID support.
GeomertyFromWKB() function. SRID() function. ::store() methods for Field_geom. Code cleanup.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc35
1 files changed, 19 insertions, 16 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 998b38513a9..1ae16827e0b 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2200,17 +2200,19 @@ longlong Item_cond_xor::val_int()
longlong Item_func_spatial_rel::val_int()
{
- String *res1=args[0]->val_str(&tmp_value1);
- String *res2=args[1]->val_str(&tmp_value2);
+ String *res1= args[0]->val_str(&tmp_value1);
+ String *res2= args[1]->val_str(&tmp_value2);
Geometry g1, g2;
- MBR mbr1,mbr2;
-
- if ((null_value=(args[0]->null_value ||
- args[1]->null_value ||
- g1.create_from_wkb(res1->ptr(),res1->length()) ||
- g2.create_from_wkb(res2->ptr(),res2->length()) ||
- g1.get_mbr(&mbr1) ||
- g2.get_mbr(&mbr2))))
+ MBR mbr1, mbr2;
+
+ if ((null_value= (args[0]->null_value ||
+ args[1]->null_value ||
+ g1.create_from_wkb(res1->ptr() + SRID_SIZE,
+ res1->length() - SRID_SIZE) ||
+ g2.create_from_wkb(res2->ptr() + SRID_SIZE,
+ res2->length() - SRID_SIZE) ||
+ g1.get_mbr(&mbr1) ||
+ g2.get_mbr(&mbr2))))
return 0;
switch (spatial_rel)
@@ -2260,15 +2262,16 @@ longlong Item_func_issimple::val_int()
longlong Item_func_isclosed::val_int()
{
String tmp;
- String *wkb=args[0]->val_str(&tmp);
+ String *swkb= args[0]->val_str(&tmp);
Geometry geom;
int isclosed;
- null_value= (!wkb ||
- args[0]->null_value ||
- geom.create_from_wkb(wkb->ptr(),wkb->length()) ||
- !GEOM_METHOD_PRESENT(geom,is_closed) ||
- geom.is_closed(&isclosed));
+ null_value= (!swkb ||
+ args[0]->null_value ||
+ geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE) ||
+ !GEOM_METHOD_PRESENT(geom,is_closed) ||
+ geom.is_closed(&isclosed));
return (longlong) isclosed;
}