summaryrefslogtreecommitdiff
path: root/mysql-test/r/select.result
Commit message (Collapse)AuthorAgeFilesLines
* Mergeunknown2006-01-131-0/+11
|\ | | | | | | | | | | | | | | | | sql/sql_select.cc: Auto merged mysql-test/r/select.result: SCCS merged mysql-test/t/select.test: SCCS merged
| * Fixed bug #15347: Wrong result of subselect when records cache and setunknown2006-01-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions are involved. When subselect is a join with set functions and no record have been found in it, end_send_group() sets null_row for all tables in order aggregate functions to calculate their values correctly. Normally this null_row flag is cleared for each table in sub_select(), but flush_cached_records() doesn't do so. Due to this all fields from the table processed by flush_cached_records() are always evaluated as nulls and whole select produces wrong result. flush_cached_records() now clears null_row flag at the very beginning. mysql-test/t/select.test: Added test case for bug #15347: Wrong result of subselect when records cache and set functions are involved mysql-test/r/select.result: Added test case for bug #15347: Wrong result of subselect when records cache and set functions are involved sql/sql_select.cc: Fixed bug #15347: Wrong result of subselect when records cache and set functions are involved flush_cached_records() now clears null_row flag at the very beginning.
* | Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0unknown2006-01-131-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into moonbone.local:/work/15538-bug-5.0-mysql mysql-test/r/select.result: Auto merged mysql-test/t/select.test: Auto merged sql/sql_yacc.yy: Auto merged
| * | Fixed bug #15538: unchecked table absence caused server crash.unknown2006-01-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Absence of table in left part of LEFT/RIGHT join wasn't checked before name resolution which resulted in NULL dereferencing and server crash. Modified rules: "table_ref LEFT opt_outer JOIN_SYM table_ref" and "table_ref RIGHT opt_outer JOIN_SYM table_ref" NULL check is moved before push_new_name_resolution_context() sql/sql_yacc.yy: Fixed bug #15538: unchecked table absence caused server crash. Modified rules: "table_ref LEFT opt_outer JOIN_SYM table_ref" and "table_ref RIGHT opt_outer JOIN_SYM table_ref" NULL check is moved before push_new_name_resolution_context() mysql-test/r/select.result: Added test case for bug #15538: unchecked table absence caused server crash. mysql-test/t/select.test: Added test case for bug #15538: unchecked table absence caused server crash.
* | | Mergeunknown2006-01-131-0/+13
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged mysql-test/r/select.result: SCCS merged mysql-test/t/select.test: SCCS merged
| * | Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrongunknown2006-01-111-0/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select result Item equal objects are employed only at the optimize phase. Usually they are not supposed to be evaluated. Yet in some cases we call the method val_int() for them. Here we have to take care of restricting the predicate such an object represents f1=f2= ...=fn to the projection of known fields fi1=...=fik. Added a check for field's table being const in Item_equal::val_int(). If the field's table is not const val_int() just skips that field when evaluating Item_equal. mysql-test/t/select.test: Added test case for bug #15633: Evaluation of Item_equal for non-const table caused wrong select result mysql-test/r/select.result: Added test case for bug #15633: Evaluation of Item_equal for non-const table caused wrong select result mysql-test/r/func_group.result: Corrected test result for bug #12882 after fix for bug#15633 sql/item_cmpfunc.h: Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong select result Added comment about fields from non-const tables in class description. sql/item_cmpfunc.cc: Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong select result Added check for field's table being const in Item_equal::val_int().
* | Fix bug #15268 Unchecked null value caused server crashunknown2005-12-091-0/+8
|/ | | | | | | | | | | | | | | | | cmp_item_sort_string::cmp() wasn't checking values_res variable for null. Later called function was dereferenced it and crashed server. Added null check to cmp_item_sort_string::cmp(). sql/item_cmpfunc.h: Fix bug#15268 Unchecked null value caused server crash Added null check to cmp_item_sort_string::cmp(). mysql-test/t/select.test: Test case for bug#15268 Unchecked null value caused server crash mysql-test/r/select.result: Test case for bug#15268 Unchecked null value caused server crash
* Fixed bug #15106.unknown2005-11-251-0/+46
| | | | | | | | | | A typo bug caused loss of a predicate of the form field=const in some cases. mysql-test/r/select.result: Added a test case for bug #15106. mysql-test/t/select.test: Added a test case for bug #15106.
* Post-merge fixes.unknown2005-11-251-0/+8
|
* Fix for BUG#14662: view column in ORDER BY considered ambiguous if SELECT ↵unknown2005-11-111-0/+42
| | | | | | | | | | | | | | | | | | contains the same column as an aliased and as a non-aliased column. The problem was that Item_direct_view_ref::eq() was first comparing view columns by name, and in this case the name of one of them is different since it is aliased. mysql-test/r/select.result: Added test for BUG#14662. mysql-test/t/select.test: Added test for BUG#14662. sql/item.cc: Changed the way view column refenreces are compared. Two view columns are equal if they resolve to the same result field of a view.
* Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-11-031-0/+40
|\ | | | | | | | | | | | | | | | | | | | | | | into moonbone.local:/work/14093-bug-5.0-mysql mysql-test/r/select.result: Auto merged mysql-test/t/select.test: Auto merged sql/item.h: Auto merged
| * Fix bug #14093 Query takes a lot of time when date format is not validunknown2005-11-031-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Invalid date like 2000-02-32 wasn't converted to int, which lead to not using index and comparison with field as astring, which results in slow query execution. convert_constatn_item() and get_mm_leaf() now forces MODE_INVALID_DATES to allow such conversion. sql/item.h: Fix bug #14093 Query takes a lot of time when date format is not valid To Item_int_with_ref added method real_item() which returns ref. sql/item_cmpfunc.cc: Fix bug #14093 Query takes a lot of time when date format is not valid convert_constant_item() now allows conversion of invalid dates like 2000-01-32 to int to make it possible to use index when comparing fields with such dates. sql/opt_range.cc: Fix bug #14093 Query takes a lot of time when date format is not valid get_mm_leaf() modified so it allows index usage for comparing fields with invalid dates like 2000-01-32. mysql-test/r/select.result: Test case for bug#14093 Query takes a lot of time when date format is not valid mysql-test/t/select.test: Test case for bug#14093 Query takes a lot of time when date format is not valid
* | Merge 4.1 - 5.0unknown2005-10-281-306/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/insert_select.result: Merge from 4.1 to 5.0. mysql-test/r/select.result: Merge from 4.1 to 5.0. mysql-test/t/insert_select.test: Merge from 4.1 to 5.0. mysys/my_handler.c: Merge from 4.1 to 5.0. sql/item.cc: Merge from 4.1 to 5.0. sql/item_timefunc.cc: Imported bug fix from 4.1 to 5.0. (Bug#14016) sql/item_timefunc.h: Imported bug fix from 4.1 to 5.0. (Bug#14016)
* | Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1unknown2005-10-271-0/+306
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp heap/_check.c: Auto merged heap/hp_create.c: Auto merged include/config-netware.h: Auto merged include/my_base.h: Auto merged include/my_handler.h: Auto merged include/myisam.h: Auto merged innobase/include/Makefile.am: Auto merged myisam/mi_check.c: Auto merged myisam/mi_delete.c: Auto merged myisam/mi_rnext_same.c: Auto merged myisam/mi_search.c: Auto merged myisam/mi_write.c: Auto merged myisam/myisamdef.h: Auto merged myisam/sort.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/date_formats.result: Auto merged mysql-test/r/update.result: Auto merged mysql-test/t/date_formats.test: Auto merged mysql-test/t/select.test: Auto merged mysql-test/t/update.test: Auto merged mysys/my_getopt.c: Auto merged mysys/my_handler.c: Auto merged scripts/make_binary_distribution.sh: Auto merged sql/ha_myisam.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/records.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_select.cc: Auto merged sql/structs.h: Auto merged strings/conf_to_src.c: Auto merged strings/ctype-win1250ch.c: Auto merged Makefile.am: Merged from 4.1 myisam/myisamchk.c: Merged from 4.1 mysql-test/mysql-test-run.pl: Merged from 4.1 mysql-test/r/insert_select.result: Merged from 4.1 mysql-test/r/myisam.result: Merged from 4.1 mysql-test/r/select.result: Merged from 4.1 mysql-test/t/insert_select.test: Merged from 4.1 mysql-test/t/myisam.test: Merged from 4.1 netware/mysql_test_run.c: Merged from 4.1 sql/item.cc: Merged from 4.1 sql/mysqld.cc: Merged from 4.1 sql/sql_update.cc: Merged from 4.1 tests/mysql_client_test.c: Merged from 4.1
| * select.result:unknown2005-10-271-8/+8
| | | | | | | | | | | | | | | | After merge fix mysql-test/r/select.result: After merge fix
| * Manually mergedunknown2005-10-271-0/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/config-netware.h: Auto merged sql/sql_select.cc: Auto merged mysql-test/r/select.result: Manually merged fix for bug#13855 mysql-test/t/select.test: Manuall merged fix for bug#13855
| | * Fix bug #13855 select distinct with group by caused server crashunknown2005-10-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DISTINCT wasn't optimized away and caused creation of tmp table in wrong case. This result in integer overrun and running out of memory. Fix backported from 4.1. Now if optimizer founds that in result be only 1 row it removes distinct. sql/sql_select.cc: Fix bug #13855 select distinct with group by caused server crash mysql-test/r/select.result: Test case for bug#13855 select distinct with group by caused server crash mysql-test/t/select.test: Test case for bug#13855 select distinct with group by caused server crash
* | | Merge mysql.com:/home/timka/mysql/src/5.0-virginunknown2005-10-251-0/+12
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/timka/mysql/src/5.0-bug-13832 mysql-test/r/select.result: Auto merged mysql-test/t/select.test: Auto merged sql/sql_yacc.yy: Auto merged
| * | | Fix for BUG#13832 - Unknown column t1.a in 'on clause'.unknown2005-10-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cause for the bug is that the priorities of all rules/terminals that process the FROM clause are not fully specified, and the parser generator produces a parser that doesn't always parse the FROM clause so that JOINs are left-associative. As a result the final join tree produced by the parser is incorrect, which is the cause for subsequent name resolution to fail. mysql-test/r/select.result: Test for BUG#13832. mysql-test/t/select.test: Test for BUG#13832. sql/sql_yacc.yy: Fix for BUG#13832 - Unknown column t1.a in 'on clause'. List all join-related operators as having lower priority than the join operands to make the parser process join- related productions from left to right.
* | | | fix for bug #12595 (ESCAPE must be exactly 1 character long)unknown2005-10-211-0/+57
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ESCAPE has length of 1 if specified and sql_mode is NO_BACKSLASH_ESCAPES or has length of 0 or 1 in every other situation. (approved patch applied on a up-to-date tree re-commit) mysql-test/r/select.result: results of test for bug 12595 mysql-test/t/select.test: test for bug #12595 (ESCAPE must be exactly one character long) sql/item_cmpfunc.cc: if ESCAPE was in the statement check whether its length is different than 1. In NO_BACKSLASH_ESCAPES mode only length of 1 is allowed, otherwise the length could be 0 or 1 character (code point in the sense of Unicode). sql/item_cmpfunc.h: pass variable from the parsing stage - whether ESCAPE clause was found in the statement sql/sql_help.cc: pass FALSE for escape_used_in_parsing because we want the default mode of no error checking - our internal code. sql/sql_lex.cc: initialized variable used to transfer information during parsing up in the stack when reducing in the grammar sql/sql_lex.h: new variable used for transfering information when reducing in the grammar. sql/sql_yacc.yy: initialize Lex->escape_used and then use it when reducing. This is needed as fix for bug #12595 to distinguish between situation where ESCAPE was found and when not because internally we may pass a string an empty string and there is no other way to find out whether this is correct or not in case of NO_BACKSLASH_ESCAPES mode, which allows only length of 1 if ESCAPE is part of the SQL statement.
* | | Move handling of suffix_length from strnxfrm_bin() to filesort to ensure ↵unknown2005-10-141-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | proper sorting of all kind of binary objects field::sort_key() now adds length last for varbinary/blob VARBINARY/BLOB is now sorted by filesort so that shorter strings comes before longer ones Fixed issues in test cases from last merge mysql-test/r/select.result: Change column name in test to get GROUP BY to use the alias mysql-test/r/type_blob.result: Test BLOB and VARCHAR sorting mysql-test/t/select.test: Change column name in test to get GROUP BY to use the alias Drop used tables at start of test Don't use table names 'a', 'b' or 'c' mysql-test/t/type_blob.test: Test BLOB and VARCHAR sorting sql/field.cc: Store length last in VARBINARY() and BLOB() columns to get shorter strings sorted before longer onces sql/field.h: Added method 'sort_length()' to allow one to have length bytes last for VARBINARY/BLOB to get these to sort properly sql/filesort.cc: Use 'sort_length()' instead of 'pack_length()' to get length of field. Store suffix_length last for varbinary (blob) objects. The above ensures that BLOB/VARBINARY are correctly sorted (shorter strings before longer ones) sql/sql_class.h: Added sort suffix length (to get varbinary/blob to sort correctly) sql/sql_select.cc: Use sort_length() instead of pack_lengths() strings/ctype-bin.c: Don't let strnxfrm_bin store length last Better to do it in MySQL field object to ensure it's done properly for all cases
* | | Merge mysql.com:/home/my/mysql-4.1unknown2005-10-131-18/+55
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/my/mysql-5.0 mysql-test/t/select.test: Auto merged sql/item.cc: Auto merged sql/slave.cc: Auto merged sql/sql_select.cc: Auto merged vio/vio.c: Auto merged mysql-test/r/select.result: Merge and change table names a,b,c to t1,t2.t3
| * | mergingunknown2005-10-131-55/+0
| | |
| * | mergingunknown2005-10-131-0/+100
| |\ \ | | |/ | | | | | | | | | sql/sql_select.cc: Auto merged
| | * Fix for bug #3874 (Group by field is not considered)unknown2005-10-131-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/select.result: test result fixed mysql-test/t/select.test: test case added sql/sql_select.cc: do the same for nullable
* | | Merged from 4.1.unknown2005-10-131-20/+20
| | |
* | | Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-tmpunknown2005-10-131-0/+10
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0 configure.in: Auto merged include/config-win.h: Auto merged include/m_string.h: Auto merged include/my_pthread.h: Auto merged myisam/mi_search.c: Auto merged mysql-test/r/cast.result: Auto merged mysql-test/t/cast.test: Auto merged mysql-test/t/select.test: Auto merged mysys/my_pthread.c: Auto merged mysys/thr_alarm.c: Auto merged netware/pack_isam.def: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-tis620.c: Auto merged strings/xml.c: Auto merged vio/vio.c: Auto merged vio/viosocket.c: Auto merged mysql-test/r/select.result: Merged from 4.1. netware/BUILD/mwenv: Merged from 4.1. scripts/make_binary_distribution.sh: Merged from 4.1. sql/mysqld.cc: Merged from 4.1. sql/sql_show.cc: Merged from 4.1. strings/my_strtoll10.c: Merged from 4.1.
| * | Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1unknown2005-10-131-0/+10
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into moonbone.local:/work/13535-bug-4.1-mysql mysql-test/r/select.result: Auto merged mysql-test/t/select.test: Auto merged
| * \ \ Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1unknown2005-10-131-0/+10
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into moonbone.local:/work/13535-bug-4.1-mysql mysql-test/r/select.result: Auto merged mysql-test/t/select.test: Auto merged
| | * | | Fix bug#13535 Incorrect result from SELECT statement after SHOW TABLE STATUSunknown2005-10-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After SHOW TABLE STATUS last_insert_id wasn't cleaned, and next select erroneously rewrites WHERE condition and returs a row; 5.0 isn't affected because of different SHOW TABLE STATUS handling. last_insert_id cleanup added to mysqld_extend_show_tables(). sql/sql_show.cc: Fix bug #13535 Incorrect result from SELECT statement after SHOW TABLE STATUS Added last_insert_id cleanup after SHOW TABLE STATUS command. mysql-test/t/select.test: Test case for bug #13535 Incorrect result from SELECT statement after SHOW TABLE STATUS mysql-test/r/select.result: Test case for bug #13535 Incorrect result from SELECT statement after SHOW TABLE STATUS
* | | | | Manual merge of bug fix #7672unknown2005-10-131-0/+10
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | sql/sql_lex.h: Auto merged
| * | | | Manual mergedunknown2005-10-131-0/+10
| |\ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | sql/item.cc: Auto merged
| | * | | Manual merge, fix for bug #7672unknown2005-10-121-0/+10
| | |\ \ \ | | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/select.result: Manual merge mysql-test/t/select.test: Manual merge sql/item.cc: Manual merge sql/sql_lex.cc: Manual merge sql/sql_lex.h: Manual merge sql/sql_select.cc: Manual merge
| | | * | Fix bug#7672 Unknown column error in order clauseunknown2005-10-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When fixing Item_func_plus in ORDER BY clause field c is searched in all opened tables, but because c is an alias it wasn't found there. This patch adds a flag to select_lex which allows Item_field::fix_fields() to look up in select's item_list to find aliased fields. sql/item.cc: Fix bug#7672 Unknown column error in order clause When fixing fields in ORDER BY clause allow Item_field::fix_fields() to look up items in select's item list to find aliased fields. sql/sql_lex.cc: Fix bug#7672 Unknown column error in order clause sql/sql_lex.h: Fix bug#7672 Unknown column error in order clause Added flag to select_lex allowing Item_field::fix_fields to look up items in select's item list. sql/sql_select.cc: Fix bug#7672 Unknown column error in order clause mysql-test/t/select.test: Test case for bug#7672 Unknown column error in order clause mysql-test/r/select.result: Test case for bug#7672 Unknown column error in order clause
| * | | | Review of new code since last pullunknown2005-10-071-0/+7
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use %lx instead of %p as %p is not portable - Don't replace ROW item with Item_null myisam/mi_rkey.c: Use %lx instead of %p as %p is not portable myisam/mi_search.c: Use %lx instead of %p as %p is not portable mysql-test/r/select.result: More test for ROW comparison mysql-test/t/select.test: More test for ROW comparison sql/item.cc: We can't replace a ROW item with Item_null because: - Arg_comparator is still using the orignal row items and it's not good to have args[0] different from what is actually compared - If we are using the <=> comparator, NULL can still be compared as true - We would break things if we would ever use resolve_const_item() for operators like >, < etc.
* | | | After merge fixesunknown2005-10-101-0/+7
| | | |
* | | | Fix for BUG#13597 - columns in ON condition not resolved if references a ↵unknown2005-09-301-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table in a nested right join. The problem was in that when finding the last table reference in a nested join tree, the procedure doing the iteration over the right-most branches of a join tree was testing for RIGHT JOINs the table reference that represents the join, and not the second operand of the JOIN. Currently the information whether a join is LEFT/RIGHT is stored not on the join object itself, but on one of its operands. mysql-test/r/select.result: Added test for BUG#13597 mysql-test/t/select.test: Added test for BUG#13597 sql/table.cc: - test whether a table reference is a right join by testing the rigth join operand (first in the list of operands), and not the table reference that represents the join itself. - clearer comments
* | | | select.result, item.cc:unknown2005-09-281-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After merge fix for bug#13356 sql/item.cc: After merge fix for bug#13356 mysql-test/r/select.result: After merge fix for bug#13356
* | | | Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1unknown2005-09-281-0/+9
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.0 BitKeeper/deleted/.del-disabled.def: Delete: mysql-test/t/disabled.def libmysqld/lib_sql.cc: Auto merged mysql-test/t/innodb.test: Auto merged sql/ha_innodb.cc: Auto merged mysql-test/r/innodb.result: Manual merge from 4.1 to 5.0 mysql-test/r/select.result: Manual merge from 4.1 to 5.0 mysql-test/t/select.test: Manual merge from 4.1 to 5.0 sql/item.cc: Manual merge from 4.1 to 5.0
| * | | Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items.unknown2005-09-281-0/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resolve_const_item() assumed to be not called for Item_row items. For ensuring that DBUG_ASSERT(0) was set there. This patch adds section for Item_row items. If it can it recursively calls resolve_const_item() for each item the Item_row contains. If any of the contained items is null then whole Item_row substitued by Item_null. Otherwise it just returns. sql/item.cc: Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items. Added section to resolve_const_item() for Item_row items. If it can it recursively calls resolve_const_item() for each item the Item_row contains. If any of the contained items is null then Item_row is substituted by Item_null. Otherwise it just returns. Comment moved closer to function it belongs to. mysql-test/t/select.test: Test case for bug#13356 resolve_const_item() wasn't able to handle Item_row items. mysql-test/r/select.result: Test case for bug#13356 resolve_const_item() wasn't able to handle Item_row items.
* | | Fix for BUG#13127.unknown2005-09-201-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was in the way table references are pre-filtered when resolving a qualified field. When resolving qualified table references we search recursively in the operands of the join. If there is natural/using join with a merge view, the first call to find_field_in_table_ref makes a recursive call to itself with the view as the new table reference to search for the column. However the view has both nested_join and join_columns != NULL so it skipped the test whether the view name matches the field qualifier. As a result the field was found in the view since the view already has a field with the same name. Thus the field was incorrectly resolved as the view field. mysql-test/r/select.result: Test for BUG#13127. mysql-test/t/select.test: Test for BUG#13127. sql/sql_base.cc: The patch contains two independent changes: - When searching for qualified fields, include merge views and information schema tables used with SHOW (both using TABLE_LIST::field_translation to represent result fields) in the test that compares the qualifying table with the name of the table reference being searched. This change fixes the bug. - Do not search the materialized list of columns of a NATURAL/USING join if 'table_list' is a stored table or merge view. Instead search directly in the table or view as if it is not under a natural join. This is a performance improvement since if 'table_list' is a stored table, then the search can utilize the name hash for table names.
* | | Fix bug #12291 Table wasn't reinited for index scan after sequential scanunknown2005-09-161-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizer did choose "Range checked for each record" for one of the tables. For first few loops over that table it choose sequential access, on later stage it choose to use index. Because table was previously initialized for sequential access, it skips intitialization for index access, and when server tries to retrieve data error occurs. QUICK_RANGE_SELECT::init() changes so if file already initialized for sequential access, it calls ha_rnd_end() and initializes file for index access. sql/opt_range.cc: Fix bug #12291 Table wasn't reinited for index scan after sequential scan mysql-test/t/select.test: Test case for bug #12291 Table wasn't reinited for index scan after sequential scan mysql-test/r/select.result: Test case for bug #12291 Table wasn't reinited for index scan after sequential scan
* | | BUG#12943 - post-merge fixunknown2005-09-121-0/+1
| | | | | | | | | | | | | | | | | | | | | mysql-test/r/select.result: post-merge fix mysql-test/t/select.test: post-merge fix
* | | Merge mysql.com:/home/timka/mysql/src/5.0-virginunknown2005-09-121-0/+20
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/timka/mysql/src/5.0-bug-12943 sql/sql_parse.cc: Auto merged mysql-test/r/select.result: merge BUG#12943 mysql-test/t/select.test: merge BUG#12943
| * | | Fix for BUG#12943.unknown2005-09-101-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that in the first production in rule 'join_table', that processes simple cross joins, the parser was processing the second join operand before the first one due to unspecified priorities of JOINs. As a result in the case of cross joins the parser constructed a tree with incorrect nesting: the expression "t1 join t2 join t3 on some_cond" was interpreted as "t1 join (t2 join t3 on some_cond)" instead of "(t1 join t2) join t3 on some_cond". Because of this incorrect nesting the method make_join_on_context picked an incorrect table as the first table of the name resolution context. The solution assignes correct priorities to the related production. mysql-test/r/select.result: Added test for BUG#12943. mysql-test/t/select.test: Added test for BUG#12943. sql/sql_parse.cc: Fixed typo. sql/sql_yacc.yy: Provide explicit priorities of the JOIN operator and the 'table_ref' rule, to enforce left-associativity of [INNER | CROSS] JOIN.
* | | | Fix for BUG#13067 "JOIN ... USING is case sensitive".unknown2005-09-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/select.result: Test for BUG#13067 mysql-test/t/select.test: Test for BUG#13067 sql/sql_base.cc: Correctly compare field names with respect to case sensitivity.
* | | | Fix for BUG#12977.unknown2005-09-081-0/+15
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/select.result: Test for BUG#12977. mysql-test/t/select.test: Test for BUG#12977. sql/sql_base.cc: - Compare table qualifier of qualified fields only with tables that are not natural joins or their operands. - For qualified fields perform recursive search in all operands of natural joins that are nested joins. - Symmetrically detect ambiguous columns for both operands of NATURAL/USING joins.
* | | fix for bug #12841unknown2005-08-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Server crash on DO IFNULL(NULL,NULL) (fixes also "SELECT CAST(IFNULL(NULL,NULL) as DECIMAL)" unreported crash) (new revampled fix with suggestions from Igor) mysql-test/r/select.result: result of test for bug 12841 mysql-test/t/select.test: test for bug #12841 (Server crash on DO IFNULL(NULL,NULL) sql/item_func.cc: don't use the return value of ::str_op() without checking it whether checking it for NULL. (fixes bug #12841 as well as another not reported bug, but existing one - test case added). All other places where ::str_op() is used are safe.
* | | Test for BUG#6495.unknown2005-08-231-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug itself is fixed by WL#2486. mysql-test/r/select.result: Test for BUG#6495. mysql-test/t/select.test: Test for BUG#6495.
* | | Test for BUG#4889 - inconsistent resilts of more than 2-way natural joinunknown2005-08-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | due to incorrect transformation to JOIN ... ON. The bug itself is fixed by WL#2486. mysql-test/r/select.result: Test for BUG#4889. mysql-test/t/select.test: Test for BUG#4889.