diff options
author | unknown <ram@mysql.r18.ru> | 2003-03-18 15:30:32 +0400 |
---|---|---|
committer | unknown <ram@mysql.r18.ru> | 2003-03-18 15:30:32 +0400 |
commit | 3ccd93c704556d9496b643e580dca8a9fcd2f4d4 (patch) | |
tree | 0e83c851e37727716fb38186353324ae67952771 /sql/item_cmpfunc.cc | |
parent | 1c1f407dd33951d44b4e2eaa30d4025998514e47 (diff) | |
download | mariadb-git-3ccd93c704556d9496b643e580dca8a9fcd2f4d4.tar.gz |
SRID support.
GeomertyFromWKB() function.
SRID() function.
::store() methods for Field_geom.
Code cleanup.
myisam/sp_key.c:
SRID support.
mysql-test/r/gis.result:
We should use GeometryFromWKB().
mysql-test/t/gis.test:
We should use GeometryFromWKB().
sql/field.cc:
SRID support.
::store() methods for Field_geom.
Code cleanup.
sql/field.h:
SRID support.
::store() methods for Field_geom.
Code cleanup.
sql/item_cmpfunc.cc:
SRID support.
Code cleanup.
sql/item_create.cc:
Code cleanup.
sql/item_create.h:
Code cleanup.
sql/item_func.cc:
SRID support.
Code cleanup.
sql/item_func.h:
SRID support.
sql/item_strfunc.cc:
SRID support.
GeometryFromWKB() function.
Code cleanup.
sql/item_strfunc.h:
SRID support.
GeometryFromWKB() function.
Code cleanup.
sql/lex.h:
GeometryFromWKB() function.
SRID() function.
sql/spatial.cc:
Code cleanup.
sql/spatial.h:
Code cleanup.
sql/sql_yacc.yy:
Fix for xxxFromText() functions.
GeometryFromWKB() function.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 35 |
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; } |