Commit graph

211 commits

Author SHA1 Message Date
unknown
231f4964ad Added test case for Bug#18712: Truncation problem. The test
is only to make sure that this will not be fixed, as it is
intended behaviour. Documentation will be improved accordingly.
2006-05-04 17:05:21 +03:00
unknown
f0bfea2bb0 Added a test case for bug #16504.
Results changed after the bug fix.
2006-03-31 23:12:05 -08:00
unknown
5ef6e903a4 Fixed bug #16504.
Multiple equalities were not adjusted after reading constant tables.
It resulted in neglecting good index based methods that could be
used to access of other tables.


mysql-test/r/having.result:
  Adjusted a test case results after fix for bug #16504.
mysql-test/r/select.result:
  Added a test case for bug #16504.
mysql-test/r/subselect.result:
  Adjusted a test case results after fix for bug #16504.
mysql-test/r/varbinary.result:
  Adjusted a test case results after fix for bug #16504.
mysql-test/t/select.test:
  Added a test case for bug #16504.
sql/item.cc:
  Fixed bug #16504.
  An Item_equal object may contain only a constant member.
  It may happen after reading constant tables.
sql/item_cmpfunc.cc:
  Fixed bug #16504.
  Added method Item_equal::check_const that check appearance of new 
  constant items in a multiple equality.
sql/item_cmpfunc.h:
  Fixed bug #16504.
  Added method Item_equal::check_const that check appearance of new 
  constant items in a multiple equality.
sql/sql_select.cc:
  Fixed bug #16504.
  Adjusted multiple equalities after reading constant tables.
  Fixed a few typo in comments.
2006-03-31 21:26:17 -08:00
unknown
7eb0f577d8 Merge
sql/sql_select.cc:
  Auto merged
mysql-test/r/select.result:
  SCCS merged
mysql-test/t/select.test:
  SCCS merged
2006-01-13 16:27:38 +03:00
unknown
4e91470d29 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
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
2006-01-13 14:30:20 +03:00
unknown
a8a4a22974 Merge
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
2006-01-13 12:13:50 +03:00
unknown
4e2e0c6d53 Fixed bug #15538: unchecked table absence caused server crash.
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.
2006-01-11 23:39:09 +03:00
unknown
ddcc6d7bd4 Fixed bug #15347: Wrong result of subselect when records cache and set
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.
2006-01-11 23:16:21 +03:00
unknown
593bed0d92 Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong
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().
2006-01-11 22:49:43 +03:00
unknown
cb06e0c125 Fix bug #15268 Unchecked null value caused server crash
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
2005-12-09 23:01:52 +03:00
unknown
fd4fcd2f7f Fixed bug #15106.
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.
2005-11-25 18:51:44 -08:00
unknown
2e79201c72 Post-merge fixes. 2005-11-25 18:53:55 +03:00
unknown
9a0da055fd Fix for BUG#14662: view column in ORDER BY considered ambiguous if SELECT 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.
2005-11-11 11:40:35 +02:00
unknown
dd490fd2d5 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
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
2005-11-03 13:55:08 +03:00
unknown
bb841518b9 Fix bug #14093 Query takes a lot of time when date format is not valid
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
2005-11-03 13:53:49 +03:00
unknown
1b574f5bdf Merge 4.1 - 5.0
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)
2005-10-28 02:36:19 +03:00
unknown
7911c50718 Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
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
2005-10-27 23:43:20 +03:00
unknown
fb94ffdaf5 select.result:
After merge fix


mysql-test/r/select.result:
  After merge fix
2005-10-27 18:36:11 +04:00
unknown
111b40e156 Manually merged
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
2005-10-27 17:44:28 +04:00
unknown
215602cbe3 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
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
2005-10-25 09:01:47 +03:00
unknown
3efd251ae3 Fix for BUG#13832 - Unknown column t1.a in 'on clause'.
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.
2005-10-25 09:00:57 +03:00
unknown
ccc051cd40 fix for bug #12595 (ESCAPE must be exactly 1 character long)
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.
2005-10-21 04:01:52 +03:00
unknown
0390de8672 Fix bug #13855 select distinct with group by caused server crash
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
2005-10-14 01:22:24 +04:00
unknown
b896d3343b Move handling of suffix_length from strnxfrm_bin() to filesort to ensure 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
2005-10-14 00:04:52 +03:00
unknown
08d4591881 Merge mysql.com:/home/my/mysql-4.1
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
2005-10-13 20:18:37 +03:00
unknown
2a25659b47 Merged from 4.1. 2005-10-13 19:34:15 +03:00
unknown
1e14067736 Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-tmp
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.
2005-10-13 18:23:53 +03:00
unknown
3d332ea76f merging 2005-10-13 19:51:07 +05:00
unknown
2a0183b54d merging
sql/sql_select.cc:
  Auto merged
2005-10-13 19:31:09 +05:00
unknown
2e887f794a Fix for bug #3874 (Group by field is not considered)
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
2005-10-13 19:23:52 +05:00
unknown
8b6ba46c2c Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/13535-bug-4.1-mysql


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2005-10-13 17:17:32 +04:00
unknown
785b7dbccf Manual merge of bug fix #7672
sql/sql_lex.h:
  Auto merged
2005-10-13 16:00:26 +04:00
unknown
d68f16e215 Manual merged
sql/item.cc:
  Auto merged
2005-10-13 01:14:58 +04:00
unknown
228d5c42fa Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/13535-bug-4.1-mysql


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2005-10-13 00:16:33 +04:00
unknown
b455f7c575 Manual merge, fix for bug #7672
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
2005-10-12 03:32:14 +04:00
unknown
17a7fbd59c After merge fixes 2005-10-10 19:38:58 +02:00
unknown
f3f84ed8a0 Fix bug#7672 Unknown column error in order clause
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
2005-10-09 23:05:44 +04:00
unknown
3dcf205664 Review of new code since last pull
- 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.
2005-10-07 03:12:15 +03:00
unknown
78e8833f39 Fix bug#13535 Incorrect result from SELECT statement after SHOW TABLE STATUS
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
2005-10-03 23:22:46 +04:00
unknown
68a91293eb Fix for BUG#13597 - columns in ON condition not resolved if references a 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
2005-09-30 10:39:17 +03:00
unknown
0fda286a41 select.result, item.cc:
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
2005-09-28 21:30:10 +04:00
unknown
95754006eb Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
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
2005-09-28 15:32:05 +02:00
unknown
a17b3dcbe3 Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items.
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.
2005-09-28 00:58:12 +04:00
unknown
5f81fbb323 Fix for BUG#13127.
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.
2005-09-20 14:00:39 +03:00
unknown
28028b5f07 Fix bug #12291 Table wasn't reinited for index scan after sequential scan
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
2005-09-16 01:19:43 +04:00
unknown
3462573fa8 BUG#12943 - post-merge fix
mysql-test/r/select.result:
  post-merge fix
mysql-test/t/select.test:
  post-merge fix
2005-09-12 19:18:17 +03:00
unknown
e08e620c3e Merge mysql.com:/home/timka/mysql/src/5.0-virgin
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
2005-09-12 19:05:55 +03:00
unknown
25fb012dcf Fix for BUG#13067 "JOIN ... USING is case sensitive".
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.
2005-09-12 08:28:53 +03:00
unknown
0dec682f39 Fix for BUG#12943.
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.
2005-09-10 15:01:54 +03:00
unknown
9adffe2926 Fix for BUG#12977.
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.
2005-09-08 11:29:52 +03:00