summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
Commit message (Collapse)AuthorAgeFilesLines
* Bug#23417: Too strict checks against GROUP BY in the ONLY_FULL_GROUP_BY mode.evgen@moonbone.local2007-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Currently in the ONLY_FULL_GROUP_BY mode no hidden fields are allowed in the select list. To ensure this each expression in the select list is checked to be a constant, an aggregate function or to occur in the GROUP BY list. The last two requirements are wrong and doesn't allow valid expressions like "MAX(b) - MIN(b)" or "a + 1" in a query with grouping by a. The correct check implemented by the patch will ensure that: any field reference in the [sub]expressions of the select list is under an aggregate function or is mentioned as member of the group list or is an outer reference or is part of the select list element that coincide with a grouping element. The Item_field objects now can contain the position of the select list expression which they belong to. The position is saved during the field's Item_field::fix_fields() call. The non_agg_fields list for non-aggregated fields is added to the SELECT_LEX class. The SELECT_LEX::cur_pos_in_select_list now contains the position in the select list of the expression being currently fixed.
* Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | Changed header to GPL version 2 only
* Merge bk-internal.mysql.com:/home/bk/mysql-5.0cmiller@zippy.cornsilk.net2006-11-021-2/+13
|\ | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
| * Bug#17039 Cursor with procedure crashes clientmsvensson@neptunus.(none)2006-09-071-2/+13
| | | | | | | | - Change 'get_unit_column_type" to return the field list for the procedure
* | Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2stewart@willster.(none)2006-10-161-1/+6
|\ \ | |/ |/| | | into willster.(none):/home/stewart/Documents/MySQL/5.0/bug19914-mk2-merge
| * BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tablesstewart@willster.(none)2006-09-281-1/+6
| | | | | | | | | | | | | | | | | | post-review fixes as indicated by Serg. manual testing of error cases done in 5.0 due to support for DBUG_EXECUTE_IF to insert errors. Unable to write test case for mysql-test until 5.1 due to support for setting debug options at runtime.
* | Post merge fixesigor@rurik.mysql.com2006-04-211-1/+1
| |
* | Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0igor@rurik.mysql.com2006-04-211-1/+1
|\ \ | |/ | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
| * Fixed bug #18767.igor@rurik.mysql.com2006-04-201-1/+1
| | | | | | | | | | | | | | The bug caused wrong result sets for union constructs of the form (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2. For such queries order lists were concatenated and limit clause was completely neglected.
| * Review of new pushed codemonty@mysql.com2005-08-091-2/+4
| | | | | | | | | | | | - Fixed some error condtion when handling dates with 'T' - Added extra test for bug #11867 (Wrong result with "... WHERE ROW( a, b ) IN ( SELECT DISTINCT a, b WHERE ...)" to show it's not yet fixed - Safety fixes and cleanups
* | A fix and a test case for Bug#12736 "Server crash during a select".konstantin@mysql.com2005-10-131-0/+14
| | | | | | | | | | | | The bug was in JOIN::join_free which was wrongly determining that all joins have been already executed and therefore all used tables can be closed.
* | A fix and a test case for Bug#6513 "Test Suite: Values inserted by using konstantin@mysql.com2005-09-221-70/+106
| | | | | | | | | | | | | | | | | | | | cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server Crash while fetching from table with 5 million records." A fix for a possible memory leak when fetching into an SP cursor in a long loop. The patch uses a common implementation of cursors in the binary protocol and in stored procedures and implements materialized cursors. For implementation details, see comments in sql_cursor.cc
* | Rename:konstantin@mysql.com2005-09-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - current_arena to stmt_arena: the thread may have more than one 'current' arenas: one for runtime data, and one for the parsed tree of a statement. Only one of them is active at any moment. - set_item_arena -> set_query_arena, because Item_arena was renamed to Query_arena a while ago - set_n_backup_item_arena -> set_n_backup_active_arena; the active arena is the arena thd->mem_root and thd->free_list are currently pointing at. - restore_backup_item_arena -> restore_active_arena (with the same rationale) - change_arena_if_needed -> activate_stmt_arena_if_needed; this method sets thd->stmt_arena active if it's not done yet.
* | Fixes during review of new pushed codemonty@mysql.com2005-08-121-2/+3
| | | | | | | | Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
* | Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0sergefp@mysql.com2005-08-071-6/+13
|\ \ | | | | | | | | | into mysql.com:/home/psergey/mysql-5.0-bug11869-part3
| * \ Manual mergesergefp@mysql.com2005-08-071-3/+2
| |\ \ | | |/
| | * BUG#11869: part2: post-review fixes:sergefp@mysql.com2005-08-071-3/+2
| | | | | | | | | | | | | | | In init_prepare_fake_select_lex() don't empty ftfunc_list. UNION's ORDER BY clause may contain MATCH(...), for which fix_index() should be called.
| * | BUG#11869:part 2: post-review fixes: merging into 5.0sergefp@mysql.com2005-08-071-3/+3
| | | | | | | | | | | | | | | We're out of bits in st_select_lex->options so make TMP_TABLE_FORCE_MYISAM == OPTION_FOUND_COMMENT (the latter is not used by create_tmp_table).
| * | Manual mergesergefp@mysql.com2005-08-071-4/+12
| |\ \ | | |/
| | * BUG#11869 (cont'd, eliminating "table type doesn't support FULLTEXT" error):sergefp@mysql.com2005-08-061-4/+12
| | | | | | | | | | | | | | | | | | When creating temporary table for UNION, pass TMP_TABLE_FORCE_MYISAM flag to create_tmp_table if we will be using fulltext function(s) when reading from the temp. table.
* | | Fix bug #11335 View redefines TinyInt(1) column definitionevgen@moonbone.local2005-07-301-1/+7
|/ / | | | | | | | | | | | | | | | | Item_type_holder doesn't store information about length and exact type of original item which results in redefining length to max_length and geometry type to longtext. Changed the way derived tables except unions are built. Now they are created from original field list instead of list of Item_type_holder.
* | Merge jwinstead@production.mysql.com:my/mysql-5.0-11045jimw@mysql.com2005-07-061-1/+3
|\ \ | | | | | | | | | into mysql.com:/home/jimw/my/mysql-5.0-clean
| * | Clean up warnings and build problems on Windows. (Bug #11045)jimw@mysql.com2005-06-181-1/+3
| | |
* | | manual mergemonty@mysql.com2005-07-041-2/+2
|\ \ \
| * | | Fixes during review of new codemonty@mysql.com2005-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Mostly indentation fixes - Added missing test - Ensure that Item_func_case() checks for stack overruns - Use real_item() instead of (Item_ref*) item - Fixed wrong error handling
* | | | Name resolution context added (BUG#6443)bell@sanja.is.com.ua2005-07-011-0/+9
| | | |
* | | | fixed SP parameter executionbell@sanja.is.com.ua2005-06-291-0/+1
|/ / /
* | | - don't call JOIN::join_free(1) twice for every join in JOIN::cleanup().konstantin@mysql.com2005-06-241-21/+29
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The reason it happened was that both, JOIN::cleanup() and JOIN::join_free(), went over all nested joins and called cleanup/join_free for them. For that: - split recursive and non-recursive parts of JOIN::cleanup() and JOIN::join_free() - rename JOIN::cleanup to JOIN::destroy, as it actually destroys its argument - move the recursive part of JOIN::cleanup to st_select_lex::cleanup - move the non-recursive part of JOIN::join_free to the introduced method JOIN::cleanup().
* | renamed:serg@serg.mylan2005-06-151-2/+2
| | | | | | | | | | | | Item_buff -> Cached_item Item_arena -> Query_arena TEST_ASSERT -> YYERROR_UNLESS
* | Patch two (the final one) for Bug#7306 "the server side preparedStatementkonstantin@mysql.com2005-06-071-1/+1
| | | | | | | | | | | | | | error for LIMIT placeholder". The patch adds grammar support for LIMIT ?, ? and changes the type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*, so that it can point to Item_param.
* | Give Item_arena::is_stmt_prepare a more descriptive name (it marks konstantin@mysql.com2005-06-031-1/+1
| | | | | | | | the code that is active for SP as well in 5.0)
* | One more post-review fix.konstantin@mysql.com2005-05-301-3/+2
| |
* | Preparatory (and the most problematic) patch for Bug#7306konstantin@mysql.com2005-05-301-28/+8
| | | | | | | | | | | | | | "the server side preparedStatement error for LIMIT placeholder", which moves all uses of LIMIT clause from PREPARE to OPTIMIZE and later steps. After-review fixes.
* | merge 4.1->5.0bell@sanja.is.com.ua2005-03-311-6/+6
|\ \ | |/
| * Mergebell@sanja.is.com.ua2005-03-301-6/+6
| |\
| | * fixed union types merging and table related metadata (BUG#8824)bell@sanja.is.com.ua2005-03-231-6/+6
| | |
* | | Mergepekka@mysql.com2005-03-281-1/+1
|\ \ \ | |/ /
| * | client/mysqltest.cserg@serg.mylan2005-03-231-1/+1
| |/ | | | | | | | | | | corrected number of fields for --enable_metadata sql/sql_union.cc fixed a apparent typo in assert
* | manual mergeramil@mysql.com2005-03-031-21/+12
|\ \ | |/
| * a fix for --ps-protocol (bug #6089: FOUND_ROWS returns wrong values when no ↵ramil@mysql.com2005-03-021-19/+11
| | | | | | | | table/view is used)
* | Remove compiler warnings and remove not used variablesmonty@mysql.com2005-02-251-1/+1
| | | | | | | | (Found during build process)
* | Show all generated warnings in SHOW ERRORmonty@mysql.com2005-02-241-15/+8
| | | | | | | | Previously we only stored the first given error (the error sent to the client)
* | Merge changesjimw@mysql.com2005-02-041-2/+12
|\ \ | |/
| * A fix: bug#6931: Date Type column problem when using UNION-Tablegluh@gluh.mysql.r18.ru2005-02-041-2/+12
| | | | | | | | bug#7833: Wrong datatype of aggregate column is returned
* | after merge fixesSinisa@sinisa.nasamreza.org2005-01-181-4/+7
|\ \ | |/
| * fixing wrong value for "examined rows" when UNION's are used.Sinisa@sinisa.nasamreza.org2005-01-181-4/+7
| |
* | First stage of table definition cachemonty@mysql.com2005-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | Split TABLE to TABLE and TABLE_SHARE (TABLE_SHARE is still allocated as part of table, will be fixed soon) Created Field::make_field() and made Field_num::make_field() to call this Added 'TABLE_SHARE->db' that points to database name; Changed all usage of table_cache_key as database name to use this instead Changed field->table_name to point to pointer to alias. This allows us to change alias for a table by just updating one pointer. Renamed TABLE_SHARE->real_name to table_name Renamed TABLE->table_name to alias Renamed TABLE_LIST->real_name to table_name
* | Merge with 4.1 tree to get fix for INSERT IGNORE ... ON DUPLICATE KEYmonty@mysql.com2005-01-031-2/+2
|\ \ | |/
| * Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flagmonty@mysql.com2004-12-311-2/+2
| | | | | | | | This allows use to use INSERT IGNORE ... ON DUPLICATE ...
* | Better handling of ensuring that setup_tables() are not called twicemonty@mysql.com2005-01-031-2/+10
| | | | | | | | | | | | This fixed a bug in prepared statements when used with outher joins Fixed a bug in SUM(DISTINCT) when used with prepared statements. Some safety fixes in test scripts to ensure that previous test failures shouldn't affect other tests