summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.h
Commit message (Collapse)AuthorAgeFilesLines
* Removing the "thd" argument from Item::create_field_for_create_select().Alexander Barkov2016-07-011-1/+1
| | | | "thd" is available through the "table" argument, as table->in_use.
* Merge branch '10.1' into 10.2Sergei Golubchik2016-06-301-3/+3
|\
| * Merge branch '10.0' into 10.1Sergei Golubchik2016-05-041-3/+3
| |\
| | * 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
| | | |
* | | | better ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWEDSergei Golubchik2016-06-301-1/+1
| | | |
* | | | cleanup: change Item::walk() to take void* not uchar*Sergei Golubchik2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | and remove all related casts to uchar* also remove a couple of unused methods
* | | | parentheses in defaultAlexander Barkov2016-06-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adding SHOW CREATE TABLE into all DEFAULT tests, to cover need_parentheses_in_default() for all items - Fixing a few items not to print parentheses in DEFAULT: spatial function-alike predicates, IS_IPV4 and IS_IPV6 functions, COLUMN_CHECK() and COLUMN_EXISTS().
* | | | More test for MDEV-10134 Add full support for DEFAULTAlexander Barkov2016-06-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Miscelaneous functions: BENCHMARK(), SLEEP(), ROW_COUNT(), FOUND_ROWS(), GET_LOCK(), RELEASE_LOCK(), IS_USED_LOCK(), IS_FREE_LOCK(), MASTER_POS_WAIT(), MASTER_GTID_WAIT(), BINLOG_GTID_POS(), ST_GIS_DEBUG(), DECODE_HISTOGRAM(),
* | | | MDEV-9407 Illegal mix of collation when using GROUP_CONCAT in a VIEWAlexander Barkov2016-01-161-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view There were three almost identical pieces of the code: - Field *Item_func::tmp_table_field(); - Field *Item_sum::create_tmp_field(); - Field *create_tmp_field_from_item(); with a difference in very small details (hence the bugs): Only Item_func::tmp_table_field() was correct, the other two were not. Removing the two incorrect pieces of the redundant code. Joining these three functions/methods into a single virtual method Item::create_tmp_field(). Additionally, moving Item::make_string_field() and Item::tmp_table_field_from_field_type() from the public into the protected section of the class declaration, as they are now not needed outside of Item.
* | | A clean-up for MDEV-7950:Alexander Barkov2015-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Turning get_mm_tree_for_const() from a static function into a protected method in Item. - Adding a new class Item_bool_func2_with_rev, for the functions and operators that have a reverse function and can use the range optimizer for to optimize "value OP field" as "field REV_OP value". Deriving Item_bool_rowready_func2 and Item_funt_spatial_rel from the new class. - Removing Item_bool_func2::have_rev_func().
* | | MDEV-8806 Numeric CAST produce different warnings for strings literals vs ↵Alexander Barkov2015-09-251-1/+0
| | | | | | | | | | | | functions
* | | MDEV-8675 Different results of GIS functions on NULL vs NOT NULL columnsAlexander Barkov2015-09-111-1/+3
| | |
* | | MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)Sergey Vojtovich2015-08-211-52/+58
| | | | | | | | | | | | | | | | | | | | | Added mandatory thd parameter to Item (and all derivative classes) constructor. Added thd parameter to all routines that may create items. Also removed "current_thd" from Item::Item. This reduced number of pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
* | | MDEV-8610 "WHERE CONTAINS(indexed_geometry_column,1)" causes full table scanAlexander Barkov2015-08-131-0/+3
| | |