Commit graph

88 commits

Author SHA1 Message Date
Sergei Golubchik
9af177042e 10.0-base merge.
Partitioning/InnoDB changes are *not* merged (they'll come from 5.6)
TokuDB does not compile (not updated to 10.0 SE API)
2013-09-21 10:14:42 +02:00
Igor Babaev
4eddb2c221 Merge 5.3->5.5.
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.
2013-08-18 19:58:51 -07:00
Igor Babaev
960720b10d Merge 5.2->5.3 2013-08-15 14:04:20 -07:00
Alexey Botchkov
9b67de4797 MDEV-4478 check mysql-5.5 changes in spatial.cc.
not_enough_points() introduced to check if the spatial object is incorrect.
2013-07-22 00:55:06 +05:00
Sergei Golubchik
b7b5f6f1ab 10.0-monty merge
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
2013-07-21 16:39:19 +02:00
Sergei Golubchik
005c7e5421 mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00
Georgi Kodinov
00ee67dece merge 2013-03-28 17:41:22 +02:00
Georgi Kodinov
e927bda69f Addendum #1 to the fix for bug #16451878 : GEOMETRY QUERY CRASHES SERVER
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.
2013-03-28 17:37:29 +02:00
Georgi Kodinov
0cbb7ddcd6 merge 5.1->5.5 2013-03-27 16:06:33 +02:00
Georgi Kodinov
e7c48834ff Bug #16451878: GEOMETRY QUERY CRASHES SERVER
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.
2013-03-27 16:03:00 +02:00
Sergei Golubchik
6599fd3e9c 5.3 merge 2013-03-27 10:03:28 +01:00
Sergei Golubchik
e308d7417b 5.2 merge 2013-03-26 19:09:47 +01:00
Alexey Botchkov
045c498691 GEOMETRYCOLLECTION EMPTY handling fixed.
The get_mbr() method shouldn't return the error, rather an invalid MBR
          in this case.
2013-03-26 21:47:06 +04:00
Michael Widenius
068c61978e Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
Alexey Botchkov
589247ae86 MDEV-4252 geometry query crashes server.
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.
2013-03-18 17:58:00 +04:00
Alexey Botchkov
511b943263 MDEV-4252 geometry query crashes server.
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).
2013-03-10 23:08:05 +04:00
Alexey Botchkov
7fb55ee807 TODO-424 geometry query crashes server.
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).
2013-03-06 01:45:25 +04:00
Murthy Narkedimilli
053d7e775c Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
unknown
3f59033536 Merge MariaDB 5.1.66 -> 5.2 -> 5.3 2012-11-09 10:11:20 +02:00
unknown
7c23d6d0c6 Merge MySQL 5.1.66 -> MariaDB 5.1.65 2012-11-06 11:52:55 +02:00
Sergei Golubchik
ee9afef271 mysql-5.5.28 2012-10-16 13:04:42 +02:00
Alexander Barkov
444a081c83 Merging from 5.5 2012-08-17 13:18:56 +04:00
Alexander Barkov
5aec4e2b3b Backporting Bug 14100466 from 5.6. 2012-08-17 13:14:04 +04:00
Sergei Golubchik
0117a92fed MDEV-419 ensure that all HAVE_XXX constants can be set by cmake
add missing checks to configure.cmake
remove dead code and unused HAVE_xxx constants from the sources
2012-07-31 19:29:07 +02:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Michael Widenius
24e452a208 Merge with 5.1 & fixes to IGNORE handling 2011-12-11 19:28:05 +02:00
Michael Widenius
6d4224a31c Merge with 5.2.
no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
2011-12-11 11:34:44 +02:00
Alexey Botchkov
fc9d34cabf bug #901655 ST_BUFFER asserts with a coplicated shape.
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.
2011-12-08 16:29:45 +04:00
Sergei Golubchik
effed09bd7 5.3->5.5 merge 2011-11-27 17:46:20 +01:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00
Alexey Botchkov
d0f2e1e551 bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed.
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.
2011-09-21 13:26:21 +05:00
Alexey Botchkov
6b64baf3b9 fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "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.
2011-09-21 12:50:03 +05:00
Alexey Botchkov
25b5019c34 bugs fixed
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.
2011-09-21 09:29:37 +05:00
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
44135d4725 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Alexey Botchkov
4f49cdf8d3 fix for bug #801243 Assertion `(0)' failed in 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.
2011-06-30 18:18:27 +05:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Alexey Botchkov
788043cd0b Precise GIS functions added. 2011-05-04 23:20:17 +05:00
Davi Arnaut
7f1eedec2d Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-14 11:12:26 -03:00
Davi Arnaut
f317d3a6fb Bug#42733: Type-punning warnings when compiling MySQL --
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.
2010-07-14 09:27:13 -03:00
Davi Arnaut
d7944b621e Bug#42733: Type-punning warnings when compiling MySQL --
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.
2010-07-14 16:39:40 -03:00
Tor Didriksen
85da8956e6 Bug #53445 Build with -Wall and fix warnings that it generates
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.
2010-05-26 16:12:23 +02:00
Mats Kindahl
23d8586dbf WL#5030: Split and remove mysql_priv.h
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
2010-03-31 16:05:33 +02:00
Staale Smedseng
2380d465f0 Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
Staale Smedseng
3b0e6e4109 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
                  
This bug will be resolved in more than one patch to limit the
size of changesets. This is the second patch, fixing more
of the warnings.
2009-06-17 15:54:01 +02:00
Staale Smedseng
a103509788 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
            
This bug will be resolved in more than one patch to limit the
size of changesets. This is the second patch, fixing more
of the warnings.
2009-06-10 16:04:07 +02:00
Ignacio Galarza
5b7347bda3 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-13 11:41:47 -05:00
Davi Arnaut
3ce026ec2f Fix warnings and bug spotted by gcc-4.3.
Related to operator precedence and associativity.
Make the expressions as explicit as possible.

sql/field.h:
  Silence gcc-4.3 warning: be more explicit.
sql/item.cc:
  Silence gcc-4.3 warning: be more explicit.
sql/item_sum.cc:
  Silence gcc-4.3 warning: be more explicit.
sql/log_event.cc:
  Silence gcc-4.3 warning: be more explicit.
sql/spatial.h:
  Silence gcc-4.3 warning: be more explicit.
sql/sql_lex.cc:
  Silence gcc-4.3 warning: be more explicit.
sql/table.h:
  Silence gcc-4.3 warning: be more explicit.
storage/federated/ha_federated.cc:
  Fix operator precedence bug.
storage/heap/ha_heap.cc:
  Silence gcc-4.3 warning: be more explicit.
2008-12-16 10:12:22 -02:00
unknown
f48f4f1efb Merge siva.hindu.god:/home/tsmith/m/bk/maint/bmisc/50
into  siva.hindu.god:/home/tsmith/m/bk/maint/bmisc/51


mysql-test/include/gis_generic.inc:
  Auto merged
mysql-test/r/archive_gis.result:
  Auto merged
BitKeeper/deleted/.del-bdb_gis.result:
  Auto merged
mysql-test/r/ndb_gis.result:
  Auto merged
sql/spatial.h:
  Auto merged
mysql-test/r/gis.result:
  Manual merge
mysql-test/r/innodb_gis.result:
  Manual merge
mysql-test/t/gis.test:
  Manual merge
2007-03-23 17:48:03 -06:00
unknown
eee28a267d Bug #24563: MBROverlaps does not seem to function propertly.
Fix is to rewrite the MBR::overlaps() function, to compute the dimension of both
arguments, and the dimension of the intersection; test that all three dimensions are the
same (e.g., all are Polygons).

Add tests for all MBR* functions for various combinations of shapes, lines and points.


mysql-test/include/gis_generic.inc:
  Add tests & checks for bug #24563 and bug #24588 - some GIS functions missing in
  5.1; many GIS functions not tested; Overlaps() function was incorrect when MBR shifted
  only along one axis; Overlaps() needs to take dimension of shape into account.
mysql-test/r/archive_gis.result:
  Update test results.
mysql-test/r/bdb_gis.result:
  Update test results.
mysql-test/r/gis.result:
  Update test results.
mysql-test/r/innodb_gis.result:
  Update test results.
mysql-test/r/ndb_gis.result:
  Update test results.
mysql-test/t/gis.test:
  Add tests & checks for bug #24563 and bug #24588 - some GIS functions missing in
  5.1; many GIS functions not tested; Overlaps() function was incorrect when MBR shifted
  only along one axis; Overlaps() needs to take dimension of shape into account.
sql/spatial.h:
  Add MBR::dimension() (map MBR to integral dimension: point -> 0, line -> 1,
  polygon -> 2, invalid -> -1)
  
  Fix MBR::overlaps() to handle MBRs which are shifted on one dimension only, and to
  take MBR dimension into account.  Also, test both within() and contains() predicates (so
  that overlaps(a, b) == overlaps(b, a)).
2007-03-23 16:28:07 -06:00