summaryrefslogtreecommitdiff
path: root/sql/spatial.h
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-12181 ST_AsGeoJSON argument does not limit decimals.Alexey Botchkov2017-08-071-0/+1
| | | | Options handling implemented for ST_AsGeoJSON.
* MDEV-12180 ST_GeomFromGeoJSON option argument appears to have no effect.Alexey Botchkov2017-08-061-10/+12
| | | | Implement the 'option' argument for the ST_GeomFromGeoJSON.
* MDEV-11042 Implement GeoJSON functions.Alexey Botchkov2017-01-241-1/+3
| | | | Typenames made into proper character case.
* MDEV-11042 Implement GeoJSON functions.Alexey Botchkov2017-01-241-0/+35
| | | | ST_AsGeoJSON and ST_GeomFromGeoJSON functions implemented.
* General spell fixing in comments and stringsOtto Kekäläinen2016-06-081-1/+1
|
* Moving ST_RELATE() implementation out of Item_func_precise_spatial_rel,Alexander Barkov2015-06-261-1/+5
| | | | | | adding a separte class Item_func_spatial_relate for ST_RELATE(). This is a preparatory patch for: MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
* MDEV-4045 Missing OGC Spatial functions.Alexey Botchkov2014-11-281-2/+2
| | | | | | | | | | | | Missing GIS functions added: IsRing() PointOnSurface PointOnSurface Relate Distance Intersection ConvexHull Other old OpenGis standard inconsistencies fixed.
* 10.0-base merge.Sergei Golubchik2013-09-211-5/+0
|\ | | | | | | | | Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
| * Merge 5.3->5.5.Igor Babaev2013-08-181-5/+0
| |\ | | | | | | | | | | | | | | | | | | In particular: Merged the patch for bug mdev-4418 from 5.3 into 5.5. Fixed a bug in the patch that should be backported to 5.3.
| | * Merge 5.2->5.3Igor Babaev2013-08-151-5/+19
| | |\
| | | * MDEV-4478 check mysql-5.5 changes in spatial.cc.Alexey Botchkov2013-07-221-5/+19
| | | | | | | | | | | | | | | | | | | | not_enough_points() introduced to check if the spatial object is incorrect.
* | | | 10.0-monty mergeSergei Golubchik2013-07-211-2/+2
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | includes: * remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING" * introduce LOCK_share, now LOCK_ha_data is strictly for engines * rea_create_table() always creates .par file (even in "frm-only" mode) * fix a 5.6 bug, temp file leak on dummy ALTER TABLE
| * | | Temporary commit of 10.0-mergeMichael Widenius2013-03-261-2/+2
| | | |
* | | | mysql-5.5.32 mergeSergei Golubchik2013-07-161-3/+30
|\ \ \ \
| * \ \ \ mergeGeorgi Kodinov2013-03-281-4/+7
| |\ \ \ \
| | * | | | Addendum #1 to the fix for bug #16451878 : GEOMETRY QUERY CRASHES SERVERGeorgi Kodinov2013-03-281-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the get_data_size() methods for multi-point features to check properly for end of their respective data arrays. Extended the point checking function to take a 3d optional argument so cases where there's additional data in each array element (besides the point data itself) can be covered by the helper function. Fixed the 3 cases where such offset was present to use the proper checking helper function. Test cases added. Fixed review comments.
| * | | | | merge 5.1->5.5Georgi Kodinov2013-03-271-3/+26
| |\ \ \ \ \ | | |/ / / /
| | * | | | Bug #16451878: GEOMETRY QUERY CRASHES SERVERGeorgi Kodinov2013-03-271-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GIS WKB reader was checking for the presence of enough data by first multiplying the number read (where it could overflow) and only then comparing it to the number of bytes available. This can overflow and effectively turn off the check. Fixed by: 1. Introducing a new function that does division only so no overflow is possible. 2. Using the proper macros and parenthesizing them. 3. Doing an in-line division check in the only place where the boundary check is done over a data structure other than a dense points array.
| | * | | | Updated/added copyright headers.Murthy Narkedimilli2013-02-251-1/+1
| | | | | |
* | | | | | 5.3 mergeSergei Golubchik2013-03-271-1/+4
|\ \ \ \ \ \ | | |_|_|/ / | |/| | | |
| * | | | | 5.2 mergeSergei Golubchik2013-03-261-4/+5
| |\ \ \ \ \ | | | |_|_|/ | | |/| | |
| | * | | | MDEV-4252 geometry query crashes server.Alexey Botchkov2013-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additional fixes for possible overflows in length-related calculations in 'spatial' implementations. Checks added to the ::get_data_size() methods. max_n_points decreased to occupy less 2G size. An object of that size is practically inoperable anyway.
| | * | | | MDEV-4252 geometry query crashes server.Alexey Botchkov2013-03-101-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug was found by Alyssa Milburn. If the number of points of a geometry feature read from binary representation is greater than 0x10000000, then the (uint32) (num_points * 16) will cut the higher byte, which leads to various errors. Fixed by additional check if (num_points > max_n_points).
| * | | | | GEOMETRYCOLLECTION EMPTY handling fixed.Alexey Botchkov2013-03-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The get_mbr() method shouldn't return the error, rather an invalid MBR in this case.
| * | | | | Merge MariaDB 5.1.66 -> 5.2 -> 5.3unknown2012-11-091-0/+8
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge MySQL 5.1.66 -> MariaDB 5.1.65unknown2012-11-061-0/+8
| | |\ \ \ \ | | | | |/ / | | | |/| |
* | | | | | TODO-424 geometry query crashes server.Alexey Botchkov2013-03-061-4/+5
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug was found by Alyssa Milburn. If the number of points of a geometry feature read from binary representation is greater than 0x10000000, then the (uint32) (num_points * 16) will cut the higher byte, which leads to various errors. Fixed by additional check if (num_points > max_n_points).
* | | | | mysql-5.5.28Sergei Golubchik2012-10-161-0/+8
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Merging from 5.5Alexander Barkov2012-08-171-0/+8
| |\ \ \ \ | | | |_|/ | | |/| |
| | * | | Backporting Bug 14100466 from 5.6.Alexander Barkov2012-08-171-0/+8
| | | | |
* | | | | MDEV-419 ensure that all HAVE_XXX constants can be set by cmakeSergei Golubchik2012-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | add missing checks to configure.cmake remove dead code and unused HAVE_xxx constants from the sources
* | | | | 5.3 mergeSergei Golubchik2012-01-131-1/+9
|\ \ \ \ \ | | |_|/ / | |/| | |
| * | | | Merge with 5.1 & fixes to IGNORE handlingMichael Widenius2011-12-111-3/+5
| |\ \ \ \
| | * \ \ \ Merge with 5.2.Michael Widenius2011-12-111-3/+5
| | |\ \ \ \ | | | | |_|/ | | | |/| | | | | | | | no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
| | | * | | Initail merge with MySQL 5.1 (XtraDB still needs to be merged)Michael Widenius2011-11-211-2/+4
| | | |\ \ \ | | | | | |/ | | | | |/| | | | | | | Fixed up copyright messages.
| * | | | | bug #901655 ST_BUFFER asserts with a coplicated shape.Alexey Botchkov2011-12-081-0/+7
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coinciding nodes can appear as a result of DOUBLE inaccuracy. We should test that before we start the loop. Also the spatial relations can be calculated faster if we check MBR relations first. And we do have the shape's MBR-s now. per-file comments: sql/gcalc_slicescan.cc set_extent() method added. bug #901655 ST_BUFFER asserts with a coplicated shape. sql/gcalc_slicescan.h set_extent() method declared. bug #901655 ST_BUFFER asserts with a coplicated shape. sql/gcalc_tools.cc bug #901655 ST_BUFFER asserts with a coplicated shape. checks for equal nodes added. sql/item_geofunc.cc bug #901655 ST_BUFFER asserts with a coplicated shape. MBR for the shapes calculated, and MBR checks added before we start the heavy calculations. sql/spatial.h bug #901655 ST_BUFFER asserts with a coplicated shape. MBR::buffer() method implemented.
* | | | | 5.3->5.5 mergeSergei Golubchik2011-11-271-18/+32
|\ \ \ \ \ | |/ / / / | | | | / | |_|_|/ |/| | |
| * | | bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed.Alexey Botchkov2011-09-211-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | per-file comments: mysql-test/r/gis.result bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. test result updated. mysql-test/t/gis.test bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. test case added. sql/item_geofunc.cc bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. geom_length() call fixed. sql/spatial.cc bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. Geometry_collection::geom_length implemented. sql/spatial.h bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. Geometry_collection::geom_length declaration added.
| * | | fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of ↵Alexey Botchkov2011-09-211-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "GEOMETRYCOLLECTION EMPTY" per-file comments: mysql-test/r/gis.result fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" test result updated. mysql-test/t/gis.test fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" test case added. sql/gstream.cc fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" lookup_next_word() implemented. sql/gstream.h fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" lookup_next_word() added. sql/spatial.cc fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" name changed for the empty geometry. sql/spatial.h fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" declarations modified.
| * | | bugs fixedAlexey Botchkov2011-09-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 855253 Compiler error: gcalc_slicescan.cc:2036: error: suggest parentheses around comparison in operand of .|. in maria-5.3-gis 850775 ST_AREA does not work on GEOMETRYCOLLECTIONs in maria-5.3-gis per-file comments: mysql-test/r/gis.result test result updated. mysql-test/t/gis.test test case added for 850775. sql/gcalc_slicescan.cc compiler error fixed. sql/spatial.cc ST_AREA implementation for GEOMETRY_COLLECTION, POINT and LINESTRING. sql/spatial.h area() declarations added.
| * | | fix for bug #801243 Assertion `(0)' failed in ↵Alexey Botchkov2011-06-301-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gis_geometry_collection::init_from_opresult on ST_UNION If the result contains a polygon with a hole, consequitive shapes weren't calculated properly, as the hole appeared as shape in the result, but actually it's a single shape with the surrounding polygon. It's more natural to use the size of the result as a border instead of the number of resulting shapes. per-file comments: mysql-test/r/gis-precise.result fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION test result updated. mysql-test/t/gis-precise.test fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION test case added. sql/spatial.cc fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION check the data lenght instead of number of shapes. sql/spatial.h fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION check the data lenght instead of number of shapes.
| * | | Precise GIS functions added.Alexey Botchkov2011-05-041-6/+36
| |/ /
* | | Updated/added copyright headersKent Boortz2011-06-301-2/+2
|\ \ \ | | |/ | |/|
| * | Updated/added copyright headersKent Boortz2011-06-301-2/+4
| |\ \ | | |/ | |/|
| | * Updated/added copyright headersKent Boortz2011-06-301-2/+3
| | |
| * | Bug#42733: Type-punning warnings when compiling MySQL --Davi Arnaut2010-07-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strict aliasing violations. Post-merge fix: include my_compiler.h before my_attribute.h as the latter will undef __attribute__ if the compiler is not GCC. Based on the compiler version, in my_compiler.h we know for sure whether the aligned attribute is supported. Furthermore, undefining attribute might cause bugs if some system header uses it. include/my_compiler.h: Drop aligned attribute support from Sun Studio C++ compiler as its not clear exactly which version of it supports the attribute.
* | | Merge of mysql-5.1-bugteam into mysql-trunk-merge.Davi Arnaut2010-07-141-7/+9
|\ \ \ | |/ /
| * | Bug#42733: Type-punning warnings when compiling MySQL --Davi Arnaut2010-07-141-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
* | | Bug #53445 Build with -Wall and fix warnings that it generatesTor Didriksen2010-05-261-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add -Wall to gcc/g++ Fix most warnings reported in dbg and opt mode. cmd-line-utils/libedit/filecomplete.c: Remove unused auto variables. configure.cmake: Add -Wall to gcc. extra/comp_err.c: Cast to correct type. extra/perror.c: Fix segfault (but warnings about deprecated features remain) extra/yassl/taocrypt/include/runtime.hpp: Comparing two literals was reported as undefined behaviour. include/my_global.h: Add a template for aligning character buffers. mysys/lf_alloc-pin.c: Initialize pointer. sql/mysqld.cc: Use UNINIT_VAR rather than LINT_INIT. sql/partition_info.cc: Use UNINIT_VAR rather than LINT_INIT. sql/rpl_handler.cc: Use char[] rather than unsigned long[] array for placement buffer. sql/spatial.cc: Use char[] rather than unsigned void*[] array for placement buffer. sql/spatial.h: Use char[] rather than unsigned void*[] array for placement buffer. sql/sql_partition.cc: Initialize auto variable. sql/sql_table.cc: Initialize auto variables. Add parens around assignment within if() sql/sys_vars.cc: Use UNINIT_VAR. storage/innobase/os/os0file.c: Init first slot in auto variable. storage/myisam/mi_create.c: Use UNINIT_VAR rather than LINT_INIT. storage/myisam/mi_open.c: Remove (wrong) casting. storage/myisam/mi_page.c: Remove (wrong) casting. storage/myisam/mi_search.c: Cast to uchar* rather than char*. strings/ctype-ucs2.c: Use UNINIT_VAR rather than LINT_INIT. Add (uchar*) casting.
* | | WL#5030: Split and remove mysql_priv.hMats Kindahl2010-03-311-0/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | This patch: - Moves all definitions from the mysql_priv.h file into header files for the component where the variable is defined - Creates header files if the component lacks one - Eliminates all include directives from mysql_priv.h - Eliminates all circular include cycles - Rename time.cc to sql_time.cc - Rename mysql_priv.h to sql_priv.h