summaryrefslogtreecommitdiff
path: root/mysql-test/t/gis.test
Commit message (Collapse)AuthorAgeFilesLines
* Create 'main' test directory and move 't' and 'r' thereMichael Widenius2018-03-291-2992/+0
|
* (Part#2) MDEV-13049 Querying INFORMATION_SCHEMA becomes slow in MariaDB 10.1Alexander Barkov2017-10-311-0/+1
| | | | | | | This is a 10.3 specific part of MDEV-13049. It disables automatic sorting for "SELECT .. FROM INFORMATION_SCHEMA.{SCHEMATA|TABLES}" and adjusts the affected tests accordingly.
* MDEV-13967 Parameter data type control for Item_long_funcAlexander Barkov2017-10-011-0/+109
| | | | | | - Implementing stricter data type control for Item_long_func descendants - Cleanup: renaming Type_handler::can_return_str_ascii() to can_return_text() (a better name).
* MDEV-13966 Parameter data type control for Item_temporal_funcAlexander Barkov2017-09-301-0/+41
|
* MDEV-13965 Parameter data type control for Item_longlong_funcAlexander Barkov2017-09-291-0/+42
|
* MDEV-13964 Parameter data type control for Item_real_funcAlexander Barkov2017-09-291-0/+105
|
* Merge branch '10.2' into bb-10.2-extSergei Golubchik2017-08-251-5/+5
|\
| * Merge branch '10.1' into 10.2Sergei Golubchik2017-08-171-5/+5
| |\
| | * Merge branch '10.0' into 10.1Sergei Golubchik2017-08-081-5/+5
| | |\
| | | * MDEV-12915 ST_Centroid does not return the same result than MySQL.Alexey Botchkov2017-08-011-5/+5
| | | | | | | | | | | | | | | | Test fixed for IA64.
* | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-071-0/+15
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Sergei Golubchik2017-07-051-0/+15
| |\ \ \ | | |/ /
| | * | Merge remote-tracking branch '10.0' into 10.1Vicențiu Ciorbaru2017-06-211-0/+15
| | |\ \ | | | |/
| | | * MDEV-10306 Wrong results with combination of CONCAT, SUBSTR and CONVERT in ↵Alexander Barkov2017-06-191-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subquery The bug happens because of a combination of unfortunate circumstances: 1. Arguments args[0] and args[2] of Item_func_concat point recursively (through Item_direct_view_ref's) to the same Item_func_conv_charset. Both args[0]->args[0]->ref[0] and args[2]->args[0]->ref[0] refer to this Item_func_conv_charset. 2. When Item_func_concat::args[0]->val_str() is called, Item_func_conv_charset::val_str() writes its result to Item_func_conc_charset::tmp_value. 3. Then, for optimization purposes (to avoid copying), Item_func_substr::val_str() initializes Item_func_substr::tmp_value to point to the buffer fragment owned by Item_func_conv_charset::tmp_value Item_func_substr::tmp_value is returned as a result of Item_func_concat::args[0]->val_str(). 4. Due to optimization to avoid memory reallocs, Item_func_concat::val_str() remembers the result of args[0]->val_str() in "res" and further uses "res" to collect the return value. 5. When Item_func_concat::args[2]->val_str() is called, Item_func_conv_charset::tmp_value gets overwritten (see #1), which effectively overwrites args[0]'s Item_func_substr::tmp_value (see #3), which effectively overwrites "res" (see #4). This patch does the following: a. Changes Item_func_conv_charset::val_str(String *str) to use tmp_value and str the other way around. After this change tmp_value is used to store a temporary result, while str is used to return the value. The fixes the second problem (without SUBSTR): SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT CONVERT(t USING latin1) t2 FROM t1) sub; As Item_func_concat::val_str() supplies two different buffers when calling args[0]->val_str() and args[2]->val_str(), in the new reduction the result created during args[0]->val_str() does not get overwritten by args[2]->val_str(). b. Fixing the same problem in val_str() for similar classes Item_func_to_base64 Item_func_from_base64 Item_func_weight_string Item_func_hex Item_func_unhex Item_func_quote Item_func_compress Item_func_uncompress Item_func_des_encrypt Item_func_des_decrypt Item_func_conv_charset Item_func_reverse Item_func_soundex Item_func_aes_encrypt Item_func_aes_decrypt Item_func_buffer c. Fixing Item_func::val_str_from_val_str_ascii() the same way. Now Item_str_ascii_func::ascii_buff is used for temporary value, while the parameter passed to val_str() is used to return the result. This fixes the same problem when conversion (from ASCII to e.g. UCS2) takes place. See the ctype_ucs.test for example queries that returned wrong results before the fix. d. Some Item_func descendand classes had temporary String buffers (tmp_value and tmp_str), but did not really use them. Removing these temporary buffers from: Item_func_decode_histogram Item_func_format Item_func_binlog_gtid_pos Item_func_spatial_collection: e. Removing Item_func_buffer::tmp_value, because it's not used any more. f. Renaming Item_func_[un]compress::buffer to "tmp_value", for consistency with other classes. Note, this patch does not fix the following classes (although they have a similar problem): Item_str_conv Item_func_make_set Item_char_typecast They have a complex implementations and simple swapping between "tmp_value" and "str" won't work. These classes will be fixed separately.
* | | | MDEV-12803 Improve function parameter data type controlAlexander Barkov2017-05-291-4/+340
| | | |
* | | | Merge tag 'mariadb-10.2.6' into bb-10.2-extAlexander Barkov2017-05-261-1/+14
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Sergei Golubchik2017-05-091-1/+14
| |\ \ \ | | |/ / | | | | | | | | | | | | Revert commit db0917f68f, because the fix for MDEV-12696 is coming from 5.5 and 10.1 in this merge.
| | * | Merge branch '10.0' 10.1Sergei Golubchik2017-04-281-1/+14
| | |\ \ | | | |/
| | | * MDEV-12495 Conditional jump depends on uninitialised value for: SELECT NULL ↵Alexander Barkov2017-04-221-0/+13
| | | | | | | | | | | | | | | | UNION geom_expression
* | | | MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data ↵Alexander Barkov2017-05-201-0/+19
| | | | | | | | | | | | | | | | type for INT functions
* | | | MDEV-12798 Item_param does not preserve exact field type in EXECUTE ↵Alexander Barkov2017-05-151-0/+13
| | | | | | | | | | | | | | | | IMMEDIATE 'CREATE TABLE AS SELECT ?' USING POINT(1,1)
* | | | MDEV-12560, MDEV-12665 - geometry type not preserved in hybrid functions and ↵Alexander Barkov2017-05-051-2/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UNION This is a join patch fixing these two bugs: MDEV-12560 Wrong data type for SELECT NULL UNION SELECT Point(1,1) MDEV-12665 Hybrid functions do not preserve geometry type
* | | | MDEV-12506 Split Item_func_min_max::fix_length_and_dec() into methods in ↵Alexander Barkov2017-04-221-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type_handler + MDEV-12497 + MDEV-12504 This patch does the following: 1. Adds a new method Type_handler_hybrid_field_type::aggregate_for_min_max() - For non-traditional data types it uses type_handler_data->m_type_aggregator_for_result.find_handler() This allows pluggable data types to define in the future their own behavior of the result data type detection for LEAST/GREATEST. Also, this disallows expressions of the GEOMETRY data type (and its variants such as POINT) to be mixed in with numeric and temporal data types in LEAST/GREATEST. - For traditional data types it reproduces the old behavior of the result data type detection (but not attributes, see below). 2. Adds a new virtual method Type_handler::Item_func_min_max_fix_attributes() and reuses as much as possible the code that calculates data type attributes for CASE-alike functions (e.g. CASE..THEN, COALESCE, IF). As the old code responsible for attributes calculation in the old implementation of Item_func_min_max::fix_length_and_dec() was not fully correct, this automatically fixes the following bugs: - MDEV-12497 Wrong data type for LEAST(latin1_expr, utf8_expr) The old fix_length_and_dec() calculated max_length before character set aggregation. Now max_length is calculated after, in Item_func::count_string_length() called from Item_func::aggregate_attributes_string() called from Type_handler_string_result::Item_hybrid_func_fix_attributes() called from Type_handler::Item_func_min_max_fix_attributes() called from Item_func_min_max::fix_length_and_dec(). - MDEV-12504 Wrong data type for LEAST(date_expr,time_expr) The old fix_length_and_dec() simply used the maximum of max_length among all arguments to set its own max_length and did not take into account that a mixture of DATE and TIME becomes DATETIME. Now this is correctly handled by: Type_handler_datetime_common::Item_hybrid_func_fix_attributes() called from Type_handler::Item_func_min_max_fix_attributes() called from Item_func_min_max::fix_length_and_dec(). 3. Removes the old implementation of Item_func_min_max::fix_length_and_dec() and replaces it to calls of the new methods. 4. Cleanup: moves the code related to unsigned_flag processing from Type_handler_hybrid_field_type::aggregate_for_result() to Type_handler_int_result::Item_hybrid_func_fix_attributes(). This is done: - to avoid code duplication in Type_handler_hybrid_field_type::aggregate_for_min_max() - to get rid of one more call for field_type(), which is unfriendly to the conceipt of pluggable data types.
* | | | MDEV-12514 Split Item_temporal_func::fix_length_and_dec() + MDEV-12515Alexander Barkov2017-04-191-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements MDEV-12514 according to the task descriptions. It automatically fixes: MDEV-12515 Wrong value when storing DATE_ADD() and ADDTIME() to a numeric field Additionally: a. Moves Item_func::set_attributes_temporal() to Type_str_attributes::fix_attributes_temporal(), which is a more proper place and name for it. b. Continues replacing calls for: set_handler_by_field_type(MYSQL_TYPE_XXX) to corresponding: set_handler(&type_handler_xxx) which is faster. Note, we should eventually get rid of almost all set_handler_by_field_type(). c. Makes type_handler_string, type_handler_time2, type_handler_newdate, type_handler_datetime2 public. (all built-in handlers will become public eventually) d. Removing Item_temporal_func::sql_mode, as it was not used.
* | | | MDEV-12238 Add ↵Alexander Barkov2017-04-131-0/+75
| | | | | | | | | | | | | | | | Type_handler::Item_func_{plus|minus|mul|div|mod}_fix_length_and_dec()
* | | | MDEV-12303 Add Type_handler::Item_xxx_fix_length_and_dec() for CAST classesAlexander Barkov2017-04-041-0/+63
| | | |
* | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-03-311-2/+2
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Sergei Golubchik2017-03-301-2/+2
| |\ \ \ | | |/ /
| | * | MDEV-11943 I_S.TABLES inconsistencies with tables with unknown storage engineSergei Golubchik2017-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make SELECT <columns> FROM I_S.TABLES behave identically independently from whether <columns> require opening the table in engine or <columns> can be filled with only opening the frm. In particular, fill_schema_table_from_frm() should not silently skip frms with unknown engine, but should fill the I_S.TABLES row with NULLs just like fill_schema_table_by_open() does.
* | | | MDEV-12239 Add Type_handler::Item_sum_{sum|avg|variance}_fix_length_and_dec()Alexander Barkov2017-03-191-0/+38
| | | |
* | | | MDEV-10141: Add support for INTERSECT (and common parts for EXCEPT)Oleksandr Byelkin2017-03-141-1/+1
| | | | | | | | | | | | | | | | MDEV-10140: Add support for EXCEPT
* | | | MDEV-12199 Split Item_func_{abs|neg|int_val}::fix_length_and_dec() into ↵Alexander Barkov2017-03-101-0/+35
| | | | | | | | | | | | | | | | methods in Type_handler
* | | | MDEV-12001 Split Item_func_round::fix_length_and_dec to virtual methods in ↵Alexander Barkov2017-02-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type_handler This patch makes the following changes (according to the task description): - Adds Type_handler::Item_func_round_fix_length_and_dec(). - Splits the code from Item_func_round::fix_length_and_dec() into new Item_func_round methods fix_arg_int(), fix_arg_decimal(), fix_arg_double(). - Calls the new Item_func_round methods from the relevant implementations of Type_handler_xxx::Item_func_round_fix_length_and_dec(). - Adds a new error message ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION - Makes ROUND() return the new error for GEOMETRY Additionally: - Inherits Item_func_round directly from Item_func_numhybrid as it uses nothing from Item_func_num1. - Fixes "MDEV-12000 ROUND(expr,const_expr_returning_NULL) creates DOUBLE(0,0)". Now if args[1] returns NULL, the data type is set to DOUBLE with NOT_FIXED_DEC decimals instead of 0 decimals.
* | | | MDEV-11692 Comparison data type aggregation for pluggable data typesAlexander Barkov2017-02-011-0/+69
| | | |
* | | | Fixing minor problems in the patch for MDEV-11478 (shortint vs smallint)Alexander Barkov2016-12-301-1/+5
| | | | | | | | | | | | | | | | | | | | - Fixing Type_handler_short::name() to return "smallint" instead of "shortint". - Fixing test markers "End of 10.2 tests" and "End of 10.3 test"
* | | | MDEV-11478 Result data type aggregation for pluggable data typesAlexander Barkov2016-12-291-0/+79
|/ / /
* | | bugfix: Item_func_spatial_collection::print()Sergei Golubchik2016-12-121-0/+8
| | |
* | | parentheses in defaultAlexander Barkov2016-06-301-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | - 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 tests for MDEV-7563 Support CHECK constraint:Alexander Barkov2016-06-301-0/+125
| | | | | | | | | | | | GIS functions
* | | Adding more tests for "MDEV-7563 Support CHECK constraint":Alexander Barkov2016-06-301-0/+32
|/ / | | | | | | | | | | - real functions - temporal functions - hybrid functions
* | MDEV-8675 Different results of GIS functions on NULL vs NOT NULL columnsAlexander Barkov2015-09-111-0/+7
| |
* | MDEV-7528 GIS: Functions return NULL instead of specified -1 for NULL arguments.Alexey Botchkov2015-06-231-0/+7
| | | | | | | | The behaviour required by the standard seems too weird to expect.
* | Merge tag 'mariadb-10.0.19' into 10.1Sergei Golubchik2015-06-011-4/+8
|\ \ | |/
| * Merge branch '5.5' into 10.0Sergei Golubchik2015-05-041-1/+10
| |\
| | * MDEV-7779 View definition changes upon creation.Alexey Botchkov2015-04-281-1/+10
| | | | | | | | | | | | | | | Fixed by using POINT instead of ST_POINT in the item. Later need to fix that with proper ST_POINT implementation
* | | MDEV-7661 Unexpected result for: CAST(0xHHHH AS CHAR CHARACTER SET xxx)Alexander Barkov2015-03-181-0/+1
| | | | | | | | | | | | for incorrect byte sequences
* | | MDEV-7529 GIS: ST_Relate returns unexpected results for POINT relations.Alexey Botchkov2015-03-151-0/+9
| | | | | | | | | | | | | | | | | | | | | Problem was that we considered the point itself as the 'border' object. Instead of that the 'border' of a POINT is an empty set, and the point is the 'interior'. Another error fixed by the way - not all operations of the resulting function were properly allocated.
* | | MDEV-7514 GIS: PointOnSurface returns NULL instead of the point.Alexey Botchkov2015-03-151-0/+5
| | | | | | | | | | | | Need to take into account cases of a polygon shaped as a very thin line.
* | | MDEV-7510 GIS: IsRing returns false for a primitive triangle.Alexey Botchkov2015-03-131-0/+6
| | | | | | | | | | | | | | | The problem is in the IsSimple function. If the first and the last points of a curve coincide it's and exception and the line is still 'simple'.
* | | MDEV-7334 valgrind warning "unitialized bytes" in 10.1.Alexey Botchkov2015-03-121-1/+20
| | | | | | | | | | | | The 'srid' field's copying was missing in the copying Create_field::Create_field() constructor.