Commit graph

225 commits

Author SHA1 Message Date
evgen@moonbone.local
59b204fe08 select.result:
After merge fix
2006-06-17 02:52:14 +04:00
evgen@moonbone.local
28cf3c3e64 Manually merged 2006-06-17 00:58:36 +04:00
gkodinov@mysql.com
476d728a8d Bug #18895: BIT values cause joins to fail
The Field::eq() considered instances of Field_bit that differ only in 
bit_ptr/bit_ofs equal. This caused equality conditions optimization 
(build_equal_items_for_cond()) to make bad field substitutions that result
in wrong predicates. 
Field_bit requires an overloaded eq() function that checks the bit_ptr/bit_ofs
in addition to Field::eq().
2006-06-14 15:57:23 +03:00
gkodinov@mysql.com
20c057cef3 Removed duplicate tests from select.test 2006-06-02 18:02:22 +03:00
gkodinov@mysql.com
3dad611cbc bad merge fixed for b4981. 2006-06-02 17:22:21 +03:00
gkodinov@mysql.com
abd7344676 Merge mysql.com:/home/kgeorge/mysql/4.1/B4981
into  mysql.com:/home/kgeorge/mysql/5.0/B4981
2006-06-02 15:35:40 +03:00
gkodinov@mysql.com
b519877c90 Bug #4981: 4.x and 5.x produce non-optimal execution path,
3.23 regression test failure

The member SEL_ARG::min_flag was not initialized, 
due to which the condition for no GEOM_FLAG in function 
key_or did not choose "Range checked for each record" as 
the correct access method.
2006-06-02 12:04:03 +03:00
igor@rurik.mysql.com
d350bd9050 Post-merge fixes 2006-05-31 22:55:45 -07:00
igor@rurik.mysql.com
2fca3df452 Manual merge 2006-05-31 18:12:13 -07:00
igor@rurik.mysql.com
6051e0f959 Fixed bug #17873: confusing error message when IGNORE/USE/FORCE INDEX
refers to a column name.
2006-05-30 00:08:58 -07:00
igor@rurik.mysql.com
377b3e0306 Fixed bug #17873: confusing error message when IGNORE/USE/FORCE INDEX
refers to a column name.
Added a new error message ER_INDEX_DOES_NOT_EXIST.
2006-05-27 23:57:33 -07:00
igor@rurik.mysql.com
d1417ad55a Added a test case for bug #18940:in 5.0 the optimizer chose
a worse execution plan than in 4.1 for some queries.
It happened due the fact that at some conditions the 
optimizer always preferred range or full index scan access
methods to lookup access methods even when the latter were much
cheaper. 
The problem was not observed in 4.1 for the reported query
because the WHERE condition was not of a form that could
cause the problem.
Equality propagation introduced on 5.0 added an extra 
predicate and changed the WHERE condition. The new condition
provoked the optimizer to make a bad choice.

The problem was fixed by the patch for bug 17379.
2006-05-11 19:47:00 -07:00
sergefp@mysql.com
2956dbe84f BUG#17379 Wrong reuse of E(#rows(range)) as E(#rows(ref(const))):
Re-work best_access_path() and find_best() to reuse E(#rows(range access)) as
E(#rows(ref[_or_null](const) access) only when it is appropriate.
[This is the final cumulative patch]
2006-05-10 17:40:20 +04:00
jani@ua141d10.elisa.omakaista.fi
3e1e98876a 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
igor@rurik.mysql.com
d1bfeb7520 Added a test case for bug #16504.
Results changed after the bug fix.
2006-03-31 23:12:05 -08:00
igor@rurik.mysql.com
af2d79a771 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.
2006-03-31 21:26:17 -08:00
evgen@moonbone.local
cea01c7387 Merge 2006-01-13 16:27:38 +03:00
evgen@moonbone.local
02570c20bf Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/15538-bug-5.0-mysql
2006-01-13 14:30:20 +03:00
evgen@moonbone.local
8dbedc9ffd Merge 2006-01-13 12:13:50 +03:00
evgen@moonbone.local
41ef34356c 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()
2006-01-11 23:39:09 +03:00
evgen@moonbone.local
3e23d458f9 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.
2006-01-11 23:16:21 +03:00
evgen@moonbone.local
605f62fce8 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.
2006-01-11 22:49:43 +03:00
evgen@moonbone.local
2790489cd6 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().
2005-12-09 23:01:52 +03:00
igor@rurik.mysql.com
881e6e681c Fixed bug #15106.
A typo bug caused loss of a predicate of the form field=const in some cases.
2005-11-25 18:51:44 -08:00
konstantin@mysql.com
463175c4e8 Post-merge fixes. 2005-11-25 18:53:55 +03:00
evgen@moonbone.local
a4a3215a44 Fix bug #14482 Wrongly applied optimization in resolve_const_item() caused
crash

resolve_const_item() substitutes item which will evaluate to constant with
equvalent constant item, basing on the item's result type. In this case
subselect was resolved as constant, and resolve_const_item() was substituting
it's result's Item_caches to Item_null. Later Item_cache's function was called
for Item_null object, which caused server crash.

resolve_const_item() now substitutes constants for items with 
result_type == ROW_RESULT only for Item_rows.
2005-11-24 19:16:51 +03:00
timour@mysql.com
225e94fb75 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.
2005-11-11 11:40:35 +02:00
evgen@moonbone.local
55790f74bb Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/14093-bug-5.0-mysql
2005-11-03 13:55:08 +03:00
evgen@moonbone.local
30fdafea76 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.
2005-11-03 13:53:49 +03:00
jani@ua141d10.elisa.omakaista.fi
af50eff0d2 Merge 4.1 - 5.0 2005-10-28 02:36:19 +03:00
jani@ua141d10.elisa.omakaista.fi
cbe21a8eb6 Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp
2005-10-27 23:43:20 +03:00
evgen@moonbone.local
ec009d6963 select.result:
After merge fix
2005-10-27 18:36:11 +04:00
evgen@moonbone.local
71b731e92e Manually merged 2005-10-27 17:44:28 +04:00
timour@mysql.com
d24027fa79 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-bug-13832
2005-10-25 09:01:47 +03:00
timour@mysql.com
f5354eba90 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.
2005-10-25 09:00:57 +03:00
andrey@lmy004.
991b6f1440 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)
2005-10-21 04:01:52 +03:00
evgen@moonbone.local
aff8dbe130 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.
2005-10-14 01:22:24 +04:00
monty@mysql.com
3da5f1c223 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
2005-10-14 00:04:52 +03:00
monty@mysql.com
6f5baa1eba Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0
2005-10-13 20:18:37 +03:00
jani@ua141d10.elisa.omakaista.fi
3ef920a7c7 Merged from 4.1. 2005-10-13 19:34:15 +03:00
jani@ua141d10.elisa.omakaista.fi
2dd1e4f94e Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-tmp
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
2005-10-13 18:23:53 +03:00
hf@deer.(none)
27d8bc5b1f merging 2005-10-13 19:51:07 +05:00
hf@deer.(none)
62ffbea5e4 merging 2005-10-13 19:31:09 +05:00
hf@deer.(none)
c933505d2d Fix for bug #3874 (Group by field is not considered) 2005-10-13 19:23:52 +05:00
evgen@moonbone.local
818c37ac68 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/13535-bug-4.1-mysql
2005-10-13 17:17:32 +04:00
evgen@moonbone.local
4d2a58f848 Manual merge of bug fix #7672 2005-10-13 16:00:26 +04:00
evgen@moonbone.local
fb0074a6ad Manual merged 2005-10-13 01:14:58 +04:00
evgen@moonbone.local
902b06ecb1 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/13535-bug-4.1-mysql
2005-10-13 00:16:33 +04:00
evgen@moonbone.local
c16410d3a1 Manual merge, fix for bug #7672 2005-10-12 03:32:14 +04:00
lars@mysql.com
af951aa662 After merge fixes 2005-10-10 19:38:58 +02:00