Commit graph

62 commits

Author SHA1 Message Date
Evgeny Potemkin
438b795ff7 Manual merge of the fix for bug#43668. 2009-11-24 18:26:13 +03:00
Evgeny Potemkin
726e83907c Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
MySQL manual describes values of the YEAR(2) field type as follows:
values 00 - 69 mean 2000 - 2069 years and values 70 - 99 mean 1970 - 1999
years. MIN/MAX and comparison functions was comparing them as int values
thus producing wrong result.

Now the Arg_comparator class is extended with compare_year function which
performs correct comparison of the YEAR type.
The Item_sum_hybrid class now uses Item_cache and Arg_comparator objects to
correctly calculate its value.
To allow Arg_comparator to use func_name() function for Item_func and Item_sum
objects the func_name declaration is moved to the Item_result_field class.
A helper function is_owner_equal_func is added to the Arg_comparator class.
It checks whether the Arg_comparator object owner is the <=> function or not.
A helper function setup is added to the Item_sum_hybrid class. It sets up
cache item and comparator.
2009-11-17 17:06:46 +03:00
Georgi Kodinov
9db41de042 automerge 2009-10-24 09:57:31 +03:00
Georgi Kodinov
dd02c4a12b Bug #47780: crash when comparing GIS items from subquery
If the first argument to GeomFromWKB function is a geometry
field then the function just returns its value.
However in doing so it's not preserving first argument's 
null_value flag and this causes unexpected null value to
be returned to the calling function.
      
Fixed by updating the null_value of the GeomFromWKB function
in such cases (and all other cases that return a NULL e.g.
because of not enough memory for the return buffer).
2009-10-21 11:43:45 +03:00
Martin Hansson
e33e01e516 Bug#44684: valgrind reports invalid reads in
Item_func_spatial_collection::val_str
        
When the concatenation function for geometry data collections
reads the binary data it was not rigorous in checking that there
is data available, leading to invalid reads and crashes.
Fixed by making checking stricter.
2009-06-17 16:58:33 +02:00
Alexey Botchkov
08690ef254 merging 2009-04-29 07:59:10 +05:00
Alexey Botchkov
d1968ad43f Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash
the Point() and Linestring() functions create WKB representation of an
   object instead of an real geometry object.
   That produced bugs when these were inserted into tables.

   GIS tests fixed accordingly.
            
per-file messages:
  mysql-test/r/gis-rtree.result
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
    test result
  mysql-test/r/gis.result
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
    test result
  mysql-test/t/gis-rtree.test
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
    test fixed - GeomFromWKB invocations removed
  mysql-test/t/gis.test
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
    test fixed - AsWKB invocations added
  sql/item_geofunc.cc
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
     Point() and similar functions to create a proper object
2009-04-28 14:47:26 +05:00
serg@janus.mylan
d9ca7b670e Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-12-20 22:11:37 +01:00
cmiller@zippy.cornsilk.net
c940d64a69 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
2007-12-14 10:52:10 -05:00
holyfoot/hf@hfmain.(none)
e400b54447 Merge mysql.com:/home/hf/work/31158/my50-31158
into  mysql.com:/home/hf/work/31158/my51-31158
2007-11-17 17:12:18 +04:00
holyfoot/hf@hfmain.(none)
7588fa52b6 Merge mysql.com:/home/hf/work/31158/my41-31158
into  mysql.com:/home/hf/work/31158/my50-31158
2007-11-17 16:48:57 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
7d111abf0e Bug #31158 Spatial, Union, LONGBLOB vs BLOB bug (crops data)
max_length parameter for BLOB-returning functions must be big enough
for any possible content. Otherwise the field created for a table
will be too small.
2007-11-13 10:51:47 +04:00
holyfoot/hf@hfmain.(none)
44325614ec Merge mysql.com:/home/hf/work/31155/my50-31155
into  mysql.com:/home/hf/work/31155/my51-31155
2007-10-12 15:33:26 +05:00
cmiller@zippy.cornsilk.net
91b5c11922 Doxygenization of comments. 2007-10-11 13:29:09 -04:00
holyfoot/hf@mysql.com/hfmain.(none)
16db036d82 Bug #31155 gis types in union'd select cause crash.
We use get_geometry_type() call to decide the exact type
of a geometry field to be created (POINT, POLYGON etc)
Though this function was only implemented for few items.
In the bug's case we need to call this function for the
Item_sum instance, where it was not implemented, what is
the reason of the crash.
Fixed by implementing virtual Item::get_geometry_type(),
so it can be called for any Item.
2007-10-04 12:01:28 +05:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
fe801fcf5d Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/ram/work/b26038/b26038.5.0
2007-03-05 18:22:35 +04:00
ramil/ram@ramil.myoffice.izhnet.ru
ca66f604f4 Merge mysql.com:/home/ram/work/b26038/b26038.5.0
into  mysql.com:/home/ram/work/b26038/b26038.5.1
2007-03-05 17:12:37 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
f165316cfc after merge fix (bug #26038)
Item_func_geometry_from_text::val_str() should set null_value
in case of wrong data.
2007-03-02 15:09:44 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
08431e7865 Merge mysql.com:/home/ram/work/b26038/b26038.4.1
into  mysql.com:/home/ram/work/b26038/b26038.5.0
2007-02-28 12:13:46 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
049251624a Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL
Having maybe_null flag unset for geometry/spatial functions leads to
wrong Item_func_isnull::val_int()'s results.
Fix: set maybe_null flag and add is_null() methods.
2007-02-21 14:45:19 +04:00
monty@narttu.mysql.fi
8a80e36ac3 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
Merge of 'remove compiler warnings when using -Wshadow'
2007-01-27 03:46:45 +02:00
monty@mysql.com/narttu.mysql.fi
a04157fbb3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-01-22 14:04:40 +02:00
kent@kent-amd64.(none)
58763e383e Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-31 01:32:21 +01:00
kent@mysql.com/kent-amd64.(none)
6523aca729 my_strtoll10-x86.s:
Corrected spelling in copyright text
Makefile.am:
  Don't update the files from BitKeeper
Many files:
  Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
  Adjusted year(s) in copyright header 
Many files:
  Added GPL copyright text
Removed files:
  Docs/Support/colspec-fix.pl
  Docs/Support/docbook-fixup.pl
  Docs/Support/docbook-prefix.pl
  Docs/Support/docbook-split
  Docs/Support/make-docbook
  Docs/Support/make-makefile
  Docs/Support/test-make-manual
  Docs/Support/test-make-manual-de
  Docs/Support/xwf
2006-12-31 01:02:27 +01:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
monty@mysql.com/narttu.mysql.fi
88dd873de0 Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments

Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c

I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
2006-12-15 00:51:37 +02:00
holyfoot/hf@mysql.com/deer.(none)
cf76884b38 Fix for the failing gis.test 2006-08-18 22:29:35 +05:00
rburnett@production.mysql.com
284fa931bb A couple of adjustments to the merge to fix the broken build
instance.cc:
  Removed wrongly placed closing brace
item_geofunc.cc:
  needed to pass in a TABLE_SHARE* instead of a TABLE*
2006-08-17 22:24:35 +02:00
holyfoot@deer.(none)
4b48b35680 bug #14807 (GeomFromText() should return MYSQL_TYPE_GEOMETRY)
we didn't have code creating GEOMETRY-type fields from Items (expression results)
So i added this code
2006-07-04 12:56:53 +05:00
jani@ua141d10.elisa.omakaista.fi
44aea416f9 Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp
2005-10-31 11:54:36 +02:00
hf@deer.(none)
12068b45e8 Fix for bug #12839 (Endian support is absurd) 2005-09-21 14:35:01 +05:00
monty@mysql.com
775f17667b Merge with 4.1 2005-06-07 00:31:53 +03:00
serg@serg.mylan
6a5349028c a compiler must see '#pragma implementation' *before*
'#pragma interface' (that comes with the #include'd header file)
2005-06-05 19:38:52 +02:00
monty@mysql.com
29fd1f2fd9 Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable
2005-06-03 23:46:03 +03:00
kent@mysql.com
f0fcc54b0c Merge 2005-06-02 04:45:09 +02:00
kent@mysql.com
bd48eed988 tztime.cc:
Set #pragma implementation" earlier
Many files:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
2005-06-02 02:43:32 +02:00
msvensson@neptunus.(none)
697cfe7f07 Merge from 4.1 2005-05-26 21:01:55 +02:00
msvensson@neptunus.(none)
83d430353e Add ifdefs to control when "#pragma implementation" should be used
Added some more ifdefs for "#pragma interface"
2005-05-26 12:09:14 +02:00
hf@deer.(none)
054463f975 Fix for #6553 and #8776 (no errors on bad spatial data) 2005-04-29 20:23:02 +05:00
monty@mishka.local
4f4bbfc279 Merge with 4.1 2004-12-22 13:54:39 +02:00
dlenev@brandersnatch.localdomain
4b0882e0a6 Fix for bug #6765 "Implicit access to time zone description
tables requires privileges for them if some table or column level grants
present" (with after-review fixes).

We should set SELECT_ACL for implicitly opened tables in 
my_tz_check_n_skip_implicit_tables() to be able to bypass privilege
checking in check_grant(). Also we should exclude those tables from
privilege checking in multi-update.
2004-12-09 13:31:46 +03:00
konstantin@mysql.com
e5f4c7a0bd Rename: Item::val -> Item::val_real(). 2004-11-11 21:39:35 +03:00
hf@deer.(none)
497fe7f71e Fix for bug #6117 (Centroid() crashes server)
I learned that one shouldn't use String::set in val_str() methods...
2004-10-22 20:32:02 +05:00
hf@deer.(none)
d8c626eb53 Additional fix for bug #5136 (Geometry object is corrupted when queried)
CREATE TABLE t1 SELECT POINT(1,2); fixed
2004-09-22 22:36:53 +05:00
hf@deer.(none)
b40ca99668 Fix for bug #5136(Geometry object corrupted after the query) 2004-09-07 16:44:25 +05:00
hf@deer.(none)
cbff743b2d Final patch for WL#1600(warn if max_allowed_packet used) 2004-07-21 21:27:45 +05:00
hf@deer.(none)
5bff13bc72 Merging 2004-07-21 19:10:37 +05:00
paul@ice.snake.net
8ead38a5dc item_geofunc.cc:
Minor comment tweaks.
2004-07-02 16:22:46 -05:00
hf@deer.(none)
eb67909bf4 WL#1600 (Warn if result is truncatet due to max_allowed_packet) 2004-06-29 19:55:13 +05:00