summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '5.5' into 10.0Sergei Golubchik2016-04-261-3/+3
|\
| * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-04-201-3/+3
| |\
| | * Bug#21682356: STOP INJECTING DATA ITEMS IN AN ERROR MESSAGEKnut Anders Hatlen2016-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GENERATED BY THE EXP() FUNCTION When generating the error message for numeric overflow, pass a flag to Item::print() that prevents it from expanding constant expressions and parameters to the values they evaluate to. For consistency, also pass the flag to Item::print() when Item_func_spatial_collection::fix_length_and_dec() generates an error message. It doesn't make any difference at the moment, since constant expressions haven't been evaluated yet when this function is called.
| | * Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-191-1/+1
| | |
| | * weave merge from mysql-5.1 to mysql-5.5Georgi Kodinov2011-02-081-1/+1
| | |\ | | | | | | | | | | | | Resolved an innodb conflict thanks to vasil.
| | | * Updating header copyright/README in source for 2011Karen Langford2011-01-251-1/+1
| | | |
| | * | merging.Alexey Botchkov2011-01-121-0/+1
| | |\ \ | | | |/
| | | * Bug #57321 crashes and valgrind errors from spatial types Alexey Botchkov2011-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Item_func_spatial_collection::fix_length_and_dec didn't call parent's method, so the maybe_null was set to '0' after it. But in this case the result was just NULL, that caused wrong behaviour. per-file comments: mysql-test/r/gis.result Bug #57321 crashes and valgrind errors from spatial types test result updated. mysql-test/t/gis.test Bug #57321 crashes and valgrind errors from spatial types test case added. sql/item_geofunc.h Bug #57321 crashes and valgrind errors from spatial types Item_func_geometry::fix_length_and_dec() called in Item_func_spatial_collection::fix_length_and_dec().
| | * | Automerge.Ramil Kalimullin2010-09-091-4/+6
| | |\ \ | | | |/
| | | * Fix for bug#56679: gis.test: valgrind errorRamil Kalimullin2010-09-091-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Item_func_spatial_collection::fix_length_and_dec() changed to use argument's print() method to print the ER_ILLEGAL_VALUE_FOR_TYPE error.
| | * | merge 5.1-security => 5.5-securityKristofer Pettersson2010-09-081-0/+13
| | |\ \ | | | |/
| | | * Bug#55531 crash with conversions of geometry types / stringsKristofer Pettersson2010-09-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convertion from a floating point number to a string caused a crash. During rare circumstances a String object could crash when it was requested to allocate new memory. A crash could occcur in Field_double::val_str() because of a pointer referencing memory inside a String object which was of unknown size. And finally, the geometric collection should not accept arguments which are non geometric.
| | * | WL#2649 Number-to-string conversionsAlexander Barkov2010-02-111-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added: include/ctype_numconv.inc mysql-test/include/ctype_numconv.inc mysql-test/r/ctype_binary.result mysql-test/t/ctype_binary.test Adding tests modified: mysql-test/r/bigint.result mysql-test/r/case.result mysql-test/r/create.result mysql-test/r/ctype_cp1251.result mysql-test/r/ctype_latin1.result mysql-test/r/ctype_ucs.result mysql-test/r/func_gconcat.result mysql-test/r/func_str.result mysql-test/r/metadata.result mysql-test/r/ps_1general.result mysql-test/r/ps_2myisam.result mysql-test/r/ps_3innodb.result mysql-test/r/ps_4heap.result mysql-test/r/ps_5merge.result mysql-test/r/show_check.result mysql-test/r/type_datetime.result mysql-test/r/type_ranges.result mysql-test/r/union.result mysql-test/suite/ndb/r/ps_7ndb.result mysql-test/t/ctype_cp1251.test mysql-test/t/ctype_latin1.test mysql-test/t/ctype_ucs.test mysql-test/t/func_str.test Fixing tests @ sql/field.cc - Return str result using my_charset_numeric. - Using real multi-byte aware str_to_XXX functions to handle tricky charset values propely (e.g. UCS2) @ sql/field.h - Changing derivation of non-string field types to DERIVATION_NUMERIC. - Changing binary() for numeric/datetime fields to always return TRUE even if charset is not my_charset_bin. We need this to keep ha_base_keytype() return HA_KEYTYPE_BINARY. - Adding BINARY_FLAG into some fields, because it's not being set automatically anymore with "my_charset_bin to my_charset_numeric" change. - Changing derivation for numeric/datetime datatypes to a weaker value, to make "SELECT concat('string', field)" use character set of the string literal for the result of the function. @ sql/item.cc - Implementing generic val_str_ascii(). - Using max_char_length() instead of direct read of max_length to make "tricky" charsets like UCS2 work. NOTE: in the future we'll possibly remove all direct reads of max_length - Fixing Item_num::safe_charset_converter(). Previously it alligned binary string to character string (for example by adding leading 0x00 when doing binary->UCS2 conversion). Now it just converts from my_charset_numbner to "tocs". - Using val_str_ascii() in Item::get_time() to make UCS2 arguments work. - Other misc changes @ sql/item.h - Changing MY_COLL_CMP_CONV and MY_COLL_ALLOW_CONV to bit operations instead of hard-coded bit masks. - Addding new method DTCollation.set_numeric(). - Adding new methods to Item. - Adding helper functions to make code look nicer: agg_item_charsets_for_string_result() agg_item_charsets_for_comparison() - Changing charset for Item_num-derived items from my_charset_bin to my_charset_numeric (which is an alias for latin1). @ sql/item_cmpfunc.cc - Using new helper functions - Other misc changes @ sql/item_cmpfunc.h - Fixing strcmp() to return max_length=2. Previously it returned 1, which was wrong, because it did not fit '-1'. @ sql/item_func.cc - Using new helper functions - Other minor changes @ sql/item_func.h - Removing unused functions - Adding helper functions agg_arg_charsets_for_string_result() agg_arg_charsets_for_comparison() - Adding set_numeric() into constructors of numeric items. - Using fix_length_and_charset() and fix_char_length() instead of direct write to max_length. @ sql/item_geofunc.cc - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when character_set_connection=ucs2). @ sql/item_geofunc.h - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when @@character_set_connection=ucs2). @ sql/item_strfunc.cc - Implementing Item_str_func::val_str(). - Renaming val_str to val_str_ascii for some items, to make them work with UCS2 properly. - Using new helper functions - All single-argument functions that expect string result now call this method: agg_arg_charsets_for_string_result(collation, args, 1); This enables character set conversion to @@character_set_connection in case of pure numeric input. @ sql/item_strfunc.h - Introducing Item_str_ascii_func - for functions which return pure ASCII data, for performance purposes, as well as for the cases when the old implementation of val_str() was heavily 8-bit oriented and implementing a UCS2-aware version is tricky. @ sql/item_sum.cc - Using new helper functions. @ sql/item_timefunc.cc - Using my_charset_numeric instead of my_charset_bin. - Using fix_char_length(), fix_length_and_charset() and fix_length_and_charset_datetime() instead of direct write to max_length. - Using tricky-charset aware function str_to_time_with_warn() @ sql/item_timefunc.h - Using new helper functions for charset and length initialization. - Changing base class for Item_func_get_format() to make it return UCS2 properly (when character_set_connection=ucs2). @ sql/item_xmlfunc.cc - Using new helper function @ sql/my_decimal.cc - Adding a new DECIMAL to CHAR converter with real multibyte support (e.g. UCS2) @ sql/mysql_priv.h - Introducing a new derivation level for numeric/datetime data types. - Adding macros for my_charset_numeric and MY_REPERTOIRE_NUMERIC. - Adding prototypes for str_set_decimal() - Adding prototypes for character-set aware str_to_xxx() functions. @ sql/protocol.cc - Changing charsetnr to "binary" client-side metadata for numeric/datetime data types. @ sql/time.cc - Adding to_ascii() helper function, to convert a string in any character set to ascii representation. In the future can be extended to understand digits written in various non-Latin word scripts. - Adding real multy-byte character set aware versions for str_to_XXXX, to make these these type of queries work correct: INSERT INTO t1 SET datetime_column=ucs2_expression; @ strings/ctype-ucs2.c - endptr was not calculated correctly. INSERTing of UCS2 values into numeric columns returned warnings about truncated wrong data.
| | * | WL#5016: Fix header file include guardsMats Kindahl2009-09-231-0/+4
| | |/ | | | | | | | | | Adding header include file guards to files that are missing such.
| | * Fix for Bug#30217: Views: changes in metadata behaviouranozdrin/alik@quad.2008-02-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | between 5.0 and 5.1. The problem was that in the patch for Bug#11986 it was decided to store original query in UTF8 encoding for the INFORMATION_SCHEMA. This approach however turned out to be quite difficult to implement properly. The main problem is to preserve the same IS-output after dump/restore. So, the fix is to rollback to the previous functionality, but also to fix it to support multi-character-set-queries properly. The idea is to generate INFORMATION_SCHEMA-query from the item-tree after parsing view declaration. The IS-query should: - be completely in UTF8; - not contain character set introducers. For more information, see WL4052.
| | * Merge mysql.com:/home/hf/work/31155/my50-31155holyfoot/hf@hfmain.(none)2007-10-121-4/+3
| | |\ | | | | | | | | | | | | into mysql.com:/home/hf/work/31155/my51-31155
| | | * Bug #31155 gis types in union'd select cause crash.holyfoot/hf@mysql.com/hfmain.(none)2007-10-041-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Merge mysql.com:/home/ram/work/b26038/b26038.5.0ramil/ram@ramil.myoffice.izhnet.ru2007-03-051-5/+32
| | |\ \ | | | |/ | | | | | | | | into mysql.com:/home/ram/work/b26038/b26038.5.1
| | | * Merge mysql.com:/home/ram/work/b26038/b26038.4.1ramil/ram@mysql.com/ramil.myoffice.izhnet.ru2007-02-281-5/+32
| | | |\ | | | | | | | | | | | | | | | into mysql.com:/home/ram/work/b26038/b26038.5.0
| | | | * Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor ↵ramil/ram@mysql.com/ramil.myoffice.izhnet.ru2007-02-211-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | Merge mysql.com:/home/kent/bk/main/mysql-5.0kent@kent-amd64.(none)2006-12-231-2/+1
| | |\ \ \ | | | |/ / | | | | | | | | | | into mysql.com:/home/kent/bk/main/mysql-5.1
| | | * | Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | | | | | | | | | | | | | Changed header to GPL version 2 only
| | * | | Bug#21114 (Foreign key creation fails to table with name format)malff/marcsql@weblab.(none)2006-11-021-2/+2
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Due to the complexity of this change, everything is documented in WL#3565 This patch is the third iteration, it takes into account the comments received to date.
| | * | bug #14807 (GeomFromText() should return MYSQL_TYPE_GEOMETRY)holyfoot@deer.(none)2006-07-041-0/+5
| | | | | | | | | | | | | | | | | | | | we didn't have code creating GEOMETRY-type fields from Items (expression results) So i added this code
| | * | mergingholyfoot@mysql.com2006-06-261-0/+2
| | |\ \ | | | |/
| | | * bug #10166 (Signed byte values cause data to be padded)holyfoot@deer.(none)2006-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The AsBinary function returns VARCHAR data type with binary collation. It can cause problem for clients that treat that kind of data as different from BLOB type. So now AsBinary returns BLOB.
| | * | Merge neptunus.(none):/home/msvensson/mysql/bug10241msvensson@neptunus.(none)2005-05-091-1/+1
| | |\ \ | | | |/ | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.0
| | | * BUG#10241 cygwin port: invalid pragma interface directivesmsvensson@neptunus.(none)2005-05-041-1/+1
| | | | | | | | | | | | | | | | - Introduce ifdefs so we can control when to use #pragma interface on cygwin
| | * | Rename: Item::val -> Item::val_real().konstantin@mysql.com2004-11-111-4/+4
| | |/
| | * Additional fix for bug #5136 (Geometry object is corrupted when queried)hf@deer.(none)2004-09-221-30/+32
| | | | | | | | | | | | CREATE TABLE t1 SELECT POINT(1,2); fixed
| | * Optimized GIS functionsmonty@mashka.mysql.fi2004-03-041-2/+0
| | |
| | * SCRUM:hf@deer.(none)2004-01-151-0/+11
| | | | | | | | | | | | | | | WL#1163 (Making spatial code optional) Pack of changes to do in sql/ code.
| | * fixed printability of gis functionsbell@sanja.is.com.ua2003-11-061-1/+2
| | | | | | | | | | | | | | | code covarage for srid, GeomFromText with 2 parameters code covarage foe print() method of gis functions
| | * fixed printability of Items (all items except subselects)bell@laptop.sanja.is.com.ua2003-10-121-0/+3
| | | | | | | | | | | | (SCRUM) (WL#1274)
| | * fixed a crash on COMPRESS() and other zlib-dependent functions when compiled ↵serg@serg.mylan2003-08-211-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | w/o zlib moved them all from different places to item_strfunc.{h,cc} checksum table command Com_xxx status variables updated
| | * Renamed xxx_as_text() and xxx__from_text().ram@mysql.r18.ru2003-06-201-2/+2
| | |
| | * Moved spatial functions to the sql/item_geofunc.cc file.ram@mysql.r18.ru2003-05-301-0/+360
| |
* | Merge branch '5.5' into 10.0Sergei Golubchik2015-05-041-2/+2
|\ \ | |/
| * MDEV-7779 View definition changes upon creation.Alexey Botchkov2015-04-281-1/+1
| | | | | | | | | | Fixed by using POINT instead of ST_POINT in the item. Later need to fix that with proper ST_POINT implementation
* | MDEV-6073 Merge gis test cases form 5.6.Alexey Botchkov2014-07-011-0/+12
|/ | | | | | | Tests were merged. As the implementation is different, the 'internal debugging' part was not merged, only a stub for it created.
* merge 5.3 -> 5.5unknown2013-09-251-15/+15
|\
| * MDEV-5039: incorrect Item_func_regex::update_used_tables()unknown2013-09-251-15/+15
| | | | | | | | | | Other fix of maybe_null problem and revert of revno: 3608 "MDEV-3873 & MDEV-3876 & MDEV-3912 : Wrong result (extra rows) with ALL subquery from a MERGE view."
* | mysql-5.5.32 mergeSergei Golubchik2013-07-161-2/+2
|\ \
| * | Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-191-1/+1
| | |
* | | 5.3 mergeSergei Golubchik2013-01-151-15/+15
|\ \ \ | | |/ | |/|
| * | MDEV-3873 & MDEV-3876 & MDEV-3912 : Wrong result (extra rows) with ALL subqueryunknown2012-12-281-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from a MERGE view. The problem was in the lost ability to be null for the table of a left join if it is a view/derived table. It hapenned because setup_table_map(), was called earlier then we merged the view or derived. Fixed by propagating new maybe_null flag during Item::update_used_tables(). Change in join_outer.test and join_outer_jcl6.test appeared because IS NULL reported no used tables (i.e. constant) for argument which could not be NULL and new maybe_null flag was propagated for IS NULL argument (Item_field) because table the Item_field belonged to changed its maybe_null status.
* | | 5.3->5.5 mergeSergei Golubchik2011-11-271-64/+161
|\ \ \ | |/ / | | / | |/ |/|
| * Fix for bug #809849 spatial operations must be KILL-able.Alexey Botchkov2011-11-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checks for thd->killed state added to the long loops in geometry calculations. per-file comments: sql/gcalc_slicescan.cc Fix for bug #809849 spatial operations must be KILL-able. checks for TERMINATED_STATE added. sql/gcalc_slicescan.h Fix for bug #809849 spatial operations must be KILL-able. defines added to include checks for termination in the library. sql/gcalc_tools.cc Fix for bug #809849 spatial operations must be KILL-able. checks for TERMINATED_STATE added. sql/gcalc_tools.h Fix for bug #809849 spatial operations must be KILL-able. TERMINATED_STATE pointers added. sql/item_geofunc.cc Fix for bug #809849 spatial operations must be KILL-able. sql/item_geofunc.h Fix for bug #809849 spatial operations must be KILL-able.
| * merging.Alexey Botchkov2011-11-121-0/+1
| |\
| * | Copyright notices fixed.Alexey Botchkov2011-10-061-1/+2
| | |