summaryrefslogtreecommitdiff
path: root/sql/field.cc
Commit message (Collapse)AuthorAgeFilesLines
* merge with mysql-5.5.30 minus few incorrect or not applicable changesetsSergei Golubchik2013-02-281-4/+4
|\
| * Merge from 5.1Chaithra Gopalareddy2012-12-241-4/+4
| |\
| | * Bug#11757005: UNION CONVERTS UNSIGNED MEDIUMINT AND BIGINTChaithra Gopalareddy2012-12-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TO SIGNED Problem: When we are joining types (of fields) in case of a union, we usually upgrade the datatypes to the largest present in the query. In case of mediumint, it is not happening. Analysis: When joined with types LONG and LONGLONG, mediumint should get upgraded to LONG and LONGLONG respectively. W.r.t the given query, constant '1' will be created as a LONGLONG internally and SIGNED flag is enabled. As a result, while combining types for the field, LONGLONG along with MEDIUMINT gets converted to LONG first. LONG with MEDIUMINT(of the third select) gets converted to MEDIUMINT. SIGNED FLAG would be that of the first field's. As a result, the final result would be SIGNED MEDIUMINT. Fix: While joining types, MEDIUMINT with LONGLONG and MEDIUMINT with LONG is converted to LONGLONG and LONG respectively. Also, made some changes for FLOAT and DOUBLE. sql/field.cc: Changed merge types for MEDIUMINT.
* | | MDEV-3819 missing constraints for spatial column types.Alexey Botchkov2013-02-211-1/+15
| | | | | | | | | | | | | | | | | | Checks added to return and error when inappropriate geometry type is stored in a field.
* | | 5.3 mergeSergei Golubchik2013-01-281-0/+15
|\ \ \
| * | | MDEV-3875 Wrong result (missing row) on a DISTINCT query with the same ↵Sergei Golubchik2013-01-261-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | subquery in the SELECT list and GROUP BY fix remove_dup_with_hash_index() and remove_dup_with_compare() to take NULLs into account
* | | | Added new status variables:Michael Widenius2012-09-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature_dynamic_columns,feature_fulltext,feature_gis,feature_locale,feature_subquery,feature_timezone,feature_trigger,feature_xml Opened_views, Executed_triggers, Executed_events Added new process status 'updating status' as part of 'freeing items' mysql-test/r/features.result: Test of feature_xxx status variables mysql-test/r/mysqld--help.result: Removed duplicated 'language' variable. mysql-test/r/view.result: Test of opened_views mysql-test/suite/rpl/t/rpl_start_stop_slave.test: Write more information on failure mysql-test/t/features.test: Test of feature_xxx status variables mysql-test/t/view.test: Test of opened_views sql/event_scheduler.cc: Increment executed_events status variable sql/field.cc: Increment status variable sql/item_func.cc: Increment status variable sql/item_strfunc.cc: Increment status variable sql/item_subselect.cc: Increment status variable sql/item_xmlfunc.cc: Increment status variable sql/mysqld.cc: Add new status variables to 'show status' sql/mysqld.h: Added executed_events sql/sql_base.cc: Increment status variable sql/sql_class.h: Add new status variables sql/sql_parse.cc: Added new process status 'updating status' as part of 'freeing items' sql/sql_trigger.cc: Increment status variable sql/sys_vars.cc: Increment status variable sql/tztime.cc: Increment status variable
* | | | 5.3 mergeSergei Golubchik2012-08-311-1/+1
|\ \ \ \ | |/ / /
| * | | MDEV-454 Addition of a time interval reduces the resulting valueSergei Golubchik2012-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Field_newdate::get_date should refuse to return a date with zeros when TIME_NO_ZERO_IN_DATE is set, not when TIME_FUZZY_DATE is unset 2. Item_func_to_days and Item_date_add_interval can only work with valid dates, no zeros allowed.
| * | | 5.2 merge.Sergei Golubchik2012-08-221-0/+11
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | two tests still fail: main.innodb_icp and main.range_vs_index_merge_innodb call records_in_range() with both range ends being open (which triggers an assert)
| | * \ \ 5.1 mergeSergei Golubchik2012-08-221-0/+11
| | |\ \ \ | | | | | | | | | | | | | | | | | | increase xtradb verson from 13.0 to 13.01
| | | * \ \ merge with MySQL 5.1.65Sergei Golubchik2012-08-221-0/+11
| | | |\ \ \ | | | | | |/ | | | | |/|
* | | | | | merge with MySQL 5.5.27Sergei Golubchik2012-08-091-0/+11
|\ \ \ \ \ \ | | |_|_|_|/ | |/| | | | | | | | | | manually checked every change, reverted incorrect or stupid changes.
| * | | | | auto-mergeGleb Shchepa2012-06-291-1/+1
| |\ \ \ \ \ | | | |_|_|/ | | |/| | |
| | * | | | minor update to make MSVS happyGleb Shchepa2012-06-291-1/+1
| | | | | |
| * | | | | manual merge (WL6219)Gleb Shchepa2012-06-291-0/+11
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | sql/sql_yacc.yy: manual merge (backport of WL6219)
| | * | | | Backport of the deprecation warning from WL#6219: "Deprecate and remove ↵Gleb Shchepa2012-06-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | YEAR(2) type" Print the warning(note): YEAR(x) is deprecated and will be removed in a future release. Please use YEAR(4) instead on "CREATE TABLE ... YEAR(x)" or "ALTER TABLE MODIFY ... YEAR(x)", where x != 4
* | | | | | mysql-5.5 mergeSergei Golubchik2012-06-141-2/+2
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 5.5.24 back into main 5.5.Joerg Bruehe2012-05-071-2/+14
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a weave merge, but without any conflicts. In 14 source files, the copyright year needed to be updated to 2012.
* | \ \ \ \ \ cSergei Golubchik2012-05-211-1/+13
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| * | | | | | Bug#13871079 RQG_MYISAM_DML_ALTER_VALGRIND FAILS ON VALGRIND PN PB2Tor Didriksen2012-04-121-1/+13
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The class Copy_field contains a String tmp, which may allocate memory on the heap. That means that all instances of Copy_field must be properly destroyed. Alas they are not. Solution: don't use Copy_field::tmp for copying from_field => tmp => to_field in do_field_string() sql/field.cc: In Field_set::val_str return empty string (of appropriate character set) for an empty set. sql/field.h: New private member in Field_enum: empty_set_string. sql/field_conv.cc: In do_field_string, use an auto variable for copying from_field => tmp => to_field rather than copy->tmp.
* | | | | | mysql 5.5.23 mergeSergei Golubchik2012-04-101-2/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Bug#13832953 MY_STRNXFRM_UNICODE: ASSERTION `SRC' FAILED. | ↵Alexander Barkov2012-03-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MY_STRNXFRM_UNICODE/MAKE_SORTKEY Problem: Field_set::val_str in case of an empty SET value returned a String with str_length==0 and Ptr==0, which is not expected by some pieces of the code. Fix: Returning an empty string with str_length==0 and Ptr=="", like Field_enum does.
* | | | | | Merge 5.3->5.5Igor Babaev2012-03-171-14/+60
|\ \ \ \ \ \ | | |_|/ / / | |/| | | |
| * | | | | Fixed bug lp:917689 "Archive table corruption crashing MariaDB signal 11"Michael Widenius2012-03-131-13/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added 'from_end' as extra parameter to Field::unpack() to detect wrong from data. Change ha_archive::unpack_row() to detect wrong field lengths. Replication code changed to detect wrong field information in events. mysql-test/r/archive.result: dded test case for lp:917689 sql/field.cc: Added 'from_end' as extra parameter to Field::unpack() to detect wrong from data. Removed not used 'unpack_key' functions. sql/field.h: Added 'from_end' as extra parameter to Field::unpack() to detect wrong from data. Removed not used 'unpack_key' functions. Removed some not needed unpack() functions. sql/filesort.cc: Added buffer end parameter to unpack_addon_fields() sql/log_event.h: Added end of buffer argument to unpack_row() sql/log_event_old.cc: Added end of buffer argument to unpack_row() sql/log_event_old.h: Added end of buffer argument to unpack_row() sql/records.cc: Added buffer end parameter to unpack_addon_fields() sql/rpl_record.cc: Added end of buffer argument to unpack_row() Added detection of wrong field information in events sql/rpl_record.h: Added end of buffer argument to unpack_row() sql/rpl_record_old.cc: Added end of buffer argument to unpack_row() Added detection of wrong field information in events sql/rpl_record_old.h: Added end of buffer argument to unpack_row() sql/table.h: Added buffer end parameter to unpack() storage/archive/ha_archive.cc: Change ha_archive::unpack_row() to detect wrong field lengths. This fixes lp:917689
* | | | | | mysql-5.5 mergeSergei Golubchik2012-01-161-1/+2
|\ \ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Backport from trunk of:Tor Didriksen2011-08-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#12532830 - SIGFPE OR ASSERTION (PRECISION <= ((9 * 9) - 8*2)) && (DEC <= 30)
* | | | | | 5.3 mergeSergei Golubchik2012-01-131-1/+1
|\ \ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Merge with 5.2.Michael Widenius2011-12-111-11/+13
| |\ \ \ \ \ | | | |_|/ / | | |/| | | | | | | | | no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
| | * | | | Merge with MariaDB 5.1Michael Widenius2011-11-241-10/+12
| | |\ \ \ \ | | | | |_|/ | | | |/| |
| | | * | | Initail merge with MySQL 5.1 (XtraDB still needs to be merged)Michael Widenius2011-11-211-10/+12
| | | |\ \ \ | | | | | |/ | | | | |/| | | | | | | Fixed up copyright messages.
| | | | * | Updated/added copyright headersKent Boortz2011-07-031-9/+11
| | | | |\ \
| | | | * \ \ Updated/added copyright headersKent Boortz2011-06-301-2/+3
| | | | |\ \ \
| | | | | * | | Updated/added copyright headersKent Boortz2011-06-301-1/+1
| | | | | | | |
| | | | | * | | automergeGeorgi Kodinov2011-01-071-1/+1
| | | | | |\ \ \
| | | | | * | | | backport: Bug #55568 from 5.1-security to 5.0-securityGleb Shchepa2010-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > revision-id: alexey.kopytov@sun.com-20100824103548-ikm79qlfrvggyj9h > parent: sunny.bains@oracle.com-20100816001222-xqc447tr6jwh8c53 > committer: Alexey Kopytov <Alexey.Kopytov@Sun.com> > branch nick: 5.1-security > timestamp: Tue 2010-08-24 14:35:48 +0400 > message: > Bug #55568: user variable assignments crash server when used > within query > > The server could crash after materializing a derived table > which requires a temporary table for grouping. > > When destroying the temporary table used to execute a query for > a derived table, JOIN::destroy() did not clean up Item_fields > pointing to fields in the temporary table. This led to > dereferencing a dangling pointer when printing out the items > tree later in the outer SELECT. > > The solution is an addendum to the patch for bug37362: in > addition to cleaning up items in tmp_all_fields3, do the same > for items in tmp_all_fields1, since now we have an example > where this is necessary. sql/field.cc: Make sure field->table_name is not set to NULL in Field::make_field() to avoid assertion failure in Item_field::make_field() after cleaning up items (the assertion fired in udf.test when running the test suite with the patch applied). sql/sql_select.cc: In addition to cleaning up items in tmp_all_fields3, do the same for items in tmp_all_fields1. Introduce a new helper function to avoid code duplication. sql/sql_select.h: Introduce a new helper function to avoid code duplication in JOIN::destroy().
* | | | | | | | | 5.3->5.5 mergeSergei Golubchik2011-11-271-1/+1
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / /
| * | | | | | | | bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in ↵Alexey Botchkov2011-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | maria-5.3-gis. We didn't implement an empty geometry. And returning NULL instead of it is not quite correct. So here is the implementation of the empty value as GEOMETRYCOLLECTION(). per-file comments: mysql-test/r/gis-precise.result bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. test result updated. mysql-test/r/gis.result bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. test result updated. mysql-test/t/gis-precise.test bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. test case added. mysql-test/t/gis.test bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. test case added. sql/field.cc bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. store GEOMETRYCOLLECTION() properly. sql/gcalc_tools.cc bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. create the GEOMETRYCOLLECTION() for the empty result. sql/gstream.h bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. next_symbol() added. sql/spatial.cc bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. code modified to handle 0 geometries in the GEOMETRYCOLLECTION properly.
* | | | | | | | | mergeSergei Golubchik2011-11-031-9/+9
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | compilation warnings on WindowsSergei Golubchik2011-11-021-9/+9
| | | | | | | | | |
* | | | | | | | | | mysql-5.5.18 mergeSergei Golubchik2011-11-031-2/+5
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | / | | |_|_|_|_|_|_|/ | |/| | | | | | |
| * | | | | | | | Updated/added copyright headersKent Boortz2011-07-041-2/+4
| | | | | | | | |
* | | | | | | | | merge with 5.3Sergei Golubchik2011-10-191-1627/+1128
|\ \ \ \ \ \ \ \ \ | | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
| * | | | | | | | Merge of mwl #106 into 5.3. Igor Babaev2011-06-151-0/+24
| |\ \ \ \ \ \ \ \
| | * \ \ \ \ \ \ \ Merged the code of mwl 106 into the latest 5.3 with mwl 90 pushed.Igor Babaev2011-06-041-0/+24
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved all conflicts and failures.
| | | * \ \ \ \ \ \ \ MergeIgor Babaev2011-05-201-0/+24
| | | |\ \ \ \ \ \ \ \
| | | | * \ \ \ \ \ \ \ Merged the code of MWL#106 into 5.3Igor Babaev2011-05-161-0/+24
| | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved all conflicts, bad merges and fixed a few minor bugs in the code. Commented out the queries from multi_update, view, subselect_sj, func_str, derived_view, view_grant that failed either with crashes in ps-protocol or with wrong results. The failures are clear indications of some bugs in the code and these bugs are to be fixed.
| | | | | * \ \ \ \ \ \ \ Merge of the mwl106 tree into the latest 5.3 tree.Igor Babaev2010-09-231-0/+24
| | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved conflicts. Adjusted some test results
| | | | | | * | | | | | | | MWL#106: Backport optimizations for derived tables and views.Igor Babaev2010-05-261-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main consolidated patch.
| * | | | | | | | | | | | | various fixes for buildbot failuresSergei Golubchik2011-06-101-13/+4
| | | | | | | | | | | | | |