Commit graph

5963 commits

Author SHA1 Message Date
igor@rurik.mysql.com
faa48bf1a0 Added a test case for bug #18359.
This was another manifestation of the problems fixed in the
patch for bug 16674.
Wrong calculation of length of the search prefix in the pattern
string led here to a wrong result set for a query in 4.1. 
The bug could be demonstrated for any multi-byte character set.
2006-06-22 20:39:46 -07:00
igor@rurik.mysql.com
8940231491 Fixed bug #20076.
Server crashed in some cases when a query required a MIN/MAX
agrregation for a 'ucs2' field. 
In these cases  the aggregation caused calls of the function
update_tmptable_sum_func that indirectly invoked 
the method Item_sum_hybrid::min_max_update_str_field() 
containing a call to strip_sp for a ucs2 character set.
The latter led directly to the crash as it used my_isspace
undefined for the ucs2 character set.
Actually the call of strip_sp is not needed at all in this
situation and has been removed by the fix.
2006-06-22 15:50:15 -07:00
igor@rurik.mysql.com
e307b5b297 Modified the test case for bug 16674 to have the same
execution plans in 4.1 and 5.0.
2006-06-21 22:39:48 -07:00
igor@rurik.mysql.com
cfd2c2a569 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-4.1-opt
2006-06-21 16:29:58 -07:00
evgen@moonbone.local
6439337bb1 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-06-22 00:29:47 +04:00
evgen@moonbone.local
8d4a910a1f Fixed bug #14896.
This bug in Field_string::cmp resulted in a wrong comparison 
with keys in partial indexes over multi-byte character fields.
Given field a is declared as a varchar(16) collate utf8_unicode_ci
INDEX(a(4)) gives us an example of such an index.
  
Wrong key comparisons could lead to wrong result sets if 
the selected query execution plan used a range scan by 
a partial index over a utf8 character field.
This also caused wrong results in many other cases.
2006-06-22 00:29:04 +04:00
svoj@may.pils.ru
fedbbf4865 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/BUG20357/mysql-4.1
2006-06-21 19:41:08 +05:00
tomas@poseidon.ndb.mysql.com
5f46cb7e1a added missing MYSQLTEST_VARDIR declaration 2006-06-21 16:41:07 +02:00
svoj@may.pils.ru
e560564cfa Merge april:devel/BitKeeper/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/BUG20357/mysql-4.1
2006-06-21 17:51:16 +05:00
svoj@may.pils.ru
8b98be2844 BUG#20357 - Got error 124 from storage engine using MIN and MAX
functions in queries

Using MAX()/MIN() on table with disabled indexes (by ALTER TABLE)
results in error 124 (wrong index) from storage engine.

The problem was that optimizer use disabled index to optimize
MAX()/MIN(). Normally it must skip disabled index and perform
table scan.

This patch skips disabled indexes for min/max optimization.
2006-06-21 17:30:59 +05:00
igor@rurik.mysql.com
5e8d011c3a Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-4.1-opt
2006-06-20 22:15:30 -07:00
igor@rurik.mysql.com
2893d11c5e Fixed bug #16674.
The length of the prefix of the pattern string in the LIKE predicate that 
determined the index range to be scanned was calculated incorrectly for
multi-byte character sets. 
As a result of this in 4. 1 the the scanned range was wider then necessary
if the prefix contained not only one-byte characters.  
In 5.0 additionally it caused missing some rows from the result set.
2006-06-20 19:57:21 -07:00
evgen@moonbone.local
52d86dff85 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-06-20 23:49:33 +04:00
evgen@moonbone.local
ae6970e6bc select.result:
Added test case for bug#18759 Incorrect string to numeric conversion.  
select.test:
  Added test case for bug#18759 Incorrect string to numeric conversion.
item_cmpfunc.cc:
  Cleanup after fix for bug#18360 removal
2006-06-20 23:05:55 +04:00
ramil@mysql.com
d1fcc620d8 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-4.1
2006-06-20 09:35:25 +05:00
evgen@moonbone.local
217faf569e Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-06-20 02:04:36 +04:00
evgen@moonbone.local
609e0dbd99 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-06-20 01:56:33 +04:00
evgen@moonbone.local
279c310b66 item_cmpfunc.cc, func_in.result, func_in.test:
Reverted fix for bug#18360
2006-06-20 00:50:09 +04:00
gkodinov@mysql.com
6777928eec Merge mysql.com:/home/kgeorge/mysql/4.1/teamclean
into  mysql.com:/home/kgeorge/mysql/4.1/B9676
2006-06-19 13:25:28 +03:00
gkodinov@mysql.com
c5ed7a87f4 * Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
tables
Currently in INSERT ... SELECT ... LIMIT ... the compiler uses a 
temporary table to store the results of SELECT ... LIMIT .. and then
uses that table as a source for INSERT. The problem is that in some cases
it actually skips the LIMIT clause in doing that and materializes the 
whole SELECT result set regardless of the LIMIT.
This fix is limiting the process of filling up the temp table with only 
that much rows that will be actually used by propagating the LIMIT value.
2006-06-19 13:22:42 +03:00
svoj@may.pils.ru
737e166403 Merge april:devel/BitKeeper/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/BUG18036/mysql-4.1
2006-06-19 14:13:44 +05:00
svoj@may.pils.ru
37cdb0fbf3 BUG#18036 - update of table joined to self reports table as crashed
Certain updates of table joined to self results in unexpected
behavior.

The problem was that record cache was mistakenly enabled for
self-joined table updates. Normally record cache must be disabled
for such updates.

Fixed wrong condition in code that determines whether to use
record cache for self-joined table updates.

Only MyISAM tables were affected.
2006-06-19 14:05:14 +05:00
ramil@mysql.com
49797c23b3 Fix for bug #20496: func_time.test failure 2006-06-19 13:03:29 +05:00
evgen@moonbone.local
7f24667598 Manually merged 2006-06-17 02:11:12 +04:00
evgen@moonbone.local
d22c082b87 Merge moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
into moonbone.local:/work/16377-4.1-after
2006-06-15 16:41:26 +04:00
evgen@moonbone.local
2877b5ef64 item_cmpfunc.h, cast.result:
Post fix for bug#16377
2006-06-15 16:39:18 +04:00
evgen@moonbone.local
b669852866 Merge moonbone.local:/work/15351-bug-4.1-mysql
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-15 14:57:53 +04:00
ramil@mysql.com
26fa98a2cb Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b15558
2006-06-15 11:15:56 +05:00
tomas@poseidon.ndb.mysql.com
220345d3c8 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-06-14 20:18:01 +02:00
tomas@poseidon.ndb.mysql.com
2fcf737feb Bug #19493 NDB does not ignore duplicate keys when using LOAD DATA LOCAL
- make sure to disable bulk insert when check for duplicate key is needed
2006-06-14 20:16:32 +02:00
evgen@moonbone.local
111dc92786 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-13 22:53:30 +04:00
evgen@moonbone.local
d4942a2635 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/work/16377-bug-4.1-opt-mysql
2006-06-13 19:10:27 +04:00
evgen@moonbone.local
67de8c46a5 Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.

All date/time functions has the STRING result type thus their results are
compared as strings. The string date representation allows a user to skip 
some of leading zeros. This can lead to wrong comparison result if a date/time 
function result is compared to such a string constant.

The idea behind this bug fix is to compare results of date/time functions
and data/time constants as ints, because that date/time representation is 
more exact. To achieve this the agg_cmp_type() is changed to take in the
account that a date/time field or an date/time item should be compared 
as ints.

This bug fix is partially back ported from 5.0.

The agg_cmp_type() function now accepts THD as one of parameters. 
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.

From the Item_func_between::fix_length_and_dec() function removed the part
which was converting date/time constants to int if possible. Now this is 
done by the agg_cmp_type() function.

The new function result_as_longlong() is added to the Item class. 
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.

Correct val_int() methods are implemented for classes Item_date_typecast, 
Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these
classes are derived from Item_str_func and Item_str_func::val_int() converts
its string value to int without regard to the date/time type of these items.

Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant. This is done
to get a correct result of comparisons like date_time_function() = string_constant.
2006-06-13 19:09:24 +04:00
mskold@mysql.com
47bb569979 Added order by 2006-06-12 15:35:47 +02:00
mskold@mysql.com
049c3e3f69 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/marty/MySQL/mysql-4.1
2006-06-12 15:35:46 +02:00
evgen@moonbone.local
147961bc59 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-12 15:56:21 +04:00
evgen@moonbone.local
e831704a33 Merge moonbone.local:/work/16716-bug-4.1-mysql
into moonbone.local:/work/16716-bug-4.1-opt-mysql
2006-06-12 15:50:59 +04:00
mskold@mysql.com
b89f17912c Added lock test on index scan 2006-06-12 09:28:27 +02:00
kent@mysql.com
3744b46a1d Merge bk-internal:/home/bk/mysql-4.1
into  mysql.com:/data0/mysqldev/my/mysql-4.1
2006-06-09 22:42:34 +02:00
joerg@trift2.mysql.com
44c0053a44 Merge trift2.mysql.com:/M41/bug20303-4.1
into trift2.mysql.com:/M41/mysql-4.1
2006-06-09 14:37:24 +02:00
joerg@mysql.com
a26c9c31a1 mysql-test/mysql-test-run.pl : Output the usage error if one is given. (Found when fixing bug#20303) 2006-06-08 19:55:22 +02:00
mskold@mysql.com
597e1444aa Fix for Bug #18184 SELECT ... FOR UPDATE does not work..: implemented ha_ndblcuster::unlock_row() and explicitly lock all rows that are not being unlocked 2006-06-08 16:12:38 +02:00
joerg@mysql.com
5091df1333 mysql-test/mysql-test-run.pl : A fix for bug#20303 "mysql-test-run.pl: Does not recognize -- argument" 2006-06-08 14:52:33 +02:00
ramil@mysql.com
fe01874613 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b6880
2006-06-07 14:40:33 +05:00
ramil@mysql.com
0bdae38efb Fix for bug #6880: LAST_INSERT_ID() within a statement 2006-06-07 14:01:10 +05:00
ramil@mysql.com
19e312af08 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16546
2006-06-06 09:10:28 +05:00
igor@rurik.mysql.com
d02f254eaa Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-4.1-opt
2006-06-02 14:16:22 -07:00
igor@rurik.mysql.com
37e049db01 Fixed bug #18206.
The bug report revealed two problems related to min/max optimization:
1. If the length of a constant key used in a SARGable condition for
for the MIN/MAX fields is greater than the length of the field an 
unwanted warning on key truncation is issued;
2. If MIN/MAX optimization is applied to a partial index, like INDEX(b(4))
than can lead to returning a wrong result set.
2006-06-02 14:14:57 -07: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
mskold@mysql.com
39b50ce0d2 Bug #18864 TRUNCATE TABLE doesn't reset AUTO_INCREMENT value on ndb table 2006-06-02 07:26:45 +02:00