Commit graph

101 commits

Author SHA1 Message Date
sergefp@pylon.mylan
0a68b63735 Merge mysql.com:/home/psergey/bk-trees/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.1-merge2
2007-03-31 03:12:33 +04:00
sergefp@mysql.com
dd7e39f441 BUG#26624, pushbuild fixes: Merge to 5.0 2007-03-31 00:48:31 +04:00
sergefp@mysql.com
dcb2551347 BUG#26624: high mem usage (crash) in range optimizer
Pushbuild fixes: 
 - Make MAX_SEL_ARGS smaller (even 16K records_in_range() calls is 
   more than it makes sense to do in typical cases)
 - Don't call sel_arg->test_use_count() if we've already allocated 
   more than MAX_SEL_ARGs elements. The test will succeed but will take
   too much time for the test suite (and not provide much value).
2007-03-31 00:29:18 +04:00
sergefp@pylon.mylan
87d98bec74 Merge mysql.com:/home/psergey/mysql-5.0-merge
into  mysql.com:/home/psergey/mysql-5.1-merge
2007-03-29 12:24:23 +04:00
sergefp@mysql.com
399bc9861e Merge of BUG#26624 and BUG#26625 2007-03-29 10:35:28 +04:00
sergefp@mysql.com
a8d439728f BUG#26624: high mem usage (crash) in range optimizer
- Added PARAM::alloced_sel_args where we count the # of SEL_ARGs
  created by SEL_ARG tree cloning operations.
- Made the range analyzer to shortcut and not do any more cloning 
  if we've already created MAX_SEL_ARGS SEL_ARG objects in cloning.
- Added comments about space complexity of SEL_ARG-graph 
  representation.
2007-03-28 20:16:01 +04:00
cmiller@zippy.cornsilk.net
85896c0af5 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
2007-01-31 16:23:10 -05:00
gluh@eagle.(none)
7b291e36cf Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-01-24 19:54:40 +04:00
gkodinov/kgeorge@macbook.gmz
17a0207ece Merge macbook.gmz:/Users/kgeorge/mysql/work/mysql-5.0-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/merge-5.1-opt
2007-01-23 12:34:50 +02:00
gluh@mysql.com/eagle.(none)
e34b0056f2 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-01-23 14:08:58 +04:00
ramil/ram@myoffice.izhnet.ru
a2303ea3fe Merge mysql.com:/usr/home/ram/work/bug22533/my50-bug22533
into  mysql.com:/usr/home/ram/work/bug22533/my51-bug22533
2007-01-18 11:13:13 +04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
e8968822dc Merge mysql.com:/usr/home/ram/work/bug22533/my41-bug22533
into  mysql.com:/usr/home/ram/work/bug22533/my50-bug22533
2007-01-18 09:39:47 +04:00
igor@olga.mysql.com
0a47b962de Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2007-01-15 10:14:09 -08:00
igor@olga.mysql.com
34eea49eb7 Fixed bug #24776: an assertion abort in handler::ha_index_init
for queries using 'range checked for each record'.
The problem was fixed in 5.0 by the patch for bug 12291.
This patch down-ported the corresponding code from 5.0 into 
QUICK_SELECT::init() and added a new test case.
2007-01-13 10:49:26 -08:00
ramil/ram@mysql.com/myoffice.izhnet.ru
0b5696b82b Fix for bug #22533: Traditional: Too-long bit value not rejected.
Problem: storing >=8 byte hexadecimal values we don't check data.
Fix: check if the data fits the {u}longlong range.
2006-12-06 16:32:12 +04:00
ramil/ram@myoffice.izhnet.ru
800d80542f Merge mysql.com:/usr/home/ram/work/bug20732/my50-bug20732
into  mysql.com:/usr/home/ram/work/bug20732/my51-bug20732
2006-10-23 10:32:39 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
f6ea36c3a5 Merge mysql.com:/usr/home/ram/work/bug20732/my41-bug20732
into  mysql.com:/usr/home/ram/work/bug20732/my50-bug20732
2006-10-19 16:15:30 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
0027b6e4b7 Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
We miss some records sometimes using RANGE method if we have
partial key segments.
Example:
  Create table t1(a char(2), key(a(1)));
  insert into t1 values ('a'), ('xx');
  select a from t1 where a > 'x';
We call index_read() passing 'x' key and HA_READ_AFTER_KEY flag
in the handler::read_range_first() wich is wrong because we have
a partial key segment for the field and might miss records like 'xx'.

Fix: don't use open segments in such a case.
2006-10-19 12:52:37 +05:00
sergefp@pylon.mylan
fb077c0efd Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/home/psergey/mysql-5.1-bug22393
2006-09-19 21:14:37 +04:00
sergefp@mysql.com
13901802bc BUG#22393: Very wrong E(#rows(ref(const)) for key with skewed distribution
- Check if we have E(#rows) for 'range' access on the smaller interval 
  on the same index. If yes, adjust the estimate.
2006-09-18 14:49:54 +04:00
tsmith@maint2.mysql.com
6a31ec2cad Merge maint2.mysql.com:/data/localhome/tsmith/bk/mrg50/50
into  maint2.mysql.com:/data/localhome/tsmith/bk/mrg50/51
2006-09-13 09:03:52 +02:00
igor@rurik.mysql.com
c0389e7b0c Fixed bug #16249: different results for a range with an without index
when a range condition use an invalid DATETIME constant.
Now we do not use invalid DATETIME constants to form end keys for
range intervals: range analysis just ignores predicates with such
constants.
2006-08-31 07:27:34 -07:00
evgen@moonbone.local
8cf9781717 Merge moonbone.local:/work/tmp_merge-5.0-mysql
into  moonbone.local:/work/tmp_merge-5.1-opt-mysql
2006-08-29 18:58:50 +04:00
igor@rurik.mysql.com
067d6fdfca Fixed bug #18165.
Made [NOT]BETWEEN predicates SARGable in respect to the second and 
the third arguments.
2006-08-16 09:37:19 -07:00
sergefp@mysql.com
1230f3ad38 BUG#21282: Incorrect query results for "t.key NOT IN (<big const list>)
In fix for BUG#15872, a condition of type "t.key NOT IN (c1, .... cN)"
where N>1000, was incorrectly converted to
  (-inf < X < c_min) OR (c_max < X)
Now this conversion is removed, we dont produce any range lists for such
conditions.
2006-08-15 21:08:22 +04:00
sergefp@pylon.mylan
2834bc1eae Merge mysql.com:/home/psergey/tmp_merge-2
into  mysql.com:/home/psergey/mysql-5.1-merge-2
2006-07-14 19:10:54 +04:00
sergefp@mysql.com
775ec4fb85 Post-merge fix 2006-07-01 09:28:41 +04:00
sergefp@mysql.com
784b3118a5 Merge mysql.com:/home/psergey/mysql-4.1-bug16168-push
into  mysql.com:/home/psergey/mysql-5.0-bug16168-merge
2006-07-01 01:25:59 +04:00
sergefp@mysql.com
611e20d8e1 BUG#16168: Wrong results from range optimizer, "Use_count: Wrong count for key ..." warnings:
- Added comments.
 - Make SEL_ARG::clone() set SEL_ARG::elements in the created copy.
2006-06-30 09:05:12 +04:00
mats@mysql.com
321d9d842f Bug#19066 (DELETE FROM inconsistency for NDB):
Under row-based replication, DELETE FROM will now always be
replicated as individual row deletions, while TRUNCATE TABLE will
always be replicated as a statement.
2006-06-01 11:53:27 +02:00
bar@mysql.com
bf1a3bc030 select.result, mysqldump-max.result:
after merge fix.
range.result:
  fixing result accordingly
  ,
cast.result:
  after merge fix
range.test:
  Avoid SELECT'ing of BINARY column not to output 0x00 bytes.
2005-10-13 21:28:44 +05:00
monty@mysql.com
f5fdf3e87a Reviewing new pushed code
- CHAR() now returns binary string as default
- CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
- Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  (Some old systems returns ETIME and it's safer to test for both values
   than to try to write a wrapper for each old system)
- Fixed new introduced bug in NOT BETWEEN X and X
- Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
- Use octet2hex() for all conversion of string to hex
- Simplify and optimize code
2005-10-12 00:58:22 +03:00
sergefp@mysql.com
71d8990f8e Fix for BUG#13455: Make "ref" optimizer able to make this inference:
"t.key BETWEEN c1 AND c2" and c1 = c2 -> can access table t using "t.key = c1".
2005-09-30 01:34:19 +04:00
sergefp@mysql.com
7aca974fc8 Fix for BUG#13317: Make range optimizer able to produce ranges for "view.field IN (c1,c2)"
and "view.field BETWEEN c1 AND c2"
2005-09-21 21:36:15 +04:00
monty@mishka.mysql.fi
f348f62cc3 Added option --valgrind-mysqltest to mysql-test-run
Added flag to Field::store(longlong) to specify if value is unsigned.
This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0)
Fixed warning from valgrind in CREATE ... SELECT
Fixed double free of mysql.options if reconnect failed
2005-09-14 01:41:44 +03:00
monty@mysql.com
15d48525af Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0
2005-07-28 17:09:54 +03:00
monty@mysql.com
3c12d0ae54 Added end marker for tests to make future merges easier 2005-07-28 03:22:47 +03:00
igor@rurik.mysql.com
6ea960c8d6 opt_range.cc:
Fixed bug #11853.
  Corrected the code of the range optimization for
  NOT IN and NOT BETWEEN.
range.test, range.result:
  Fixed bug #11853.
2005-07-16 08:19:20 -07:00
igor@rurik.mysql.com
451faae3c9 range.result, range.test:
Added a test case for bug #10031.
opt_range.cc:
  Fixed bug #10031: range condition was not used with
  views. Range analyzer did not take into account that
  view columns were always referred through Item_ref.
2005-06-28 07:27:00 -07:00
timour@mysql.com
b3acc7fe39 Fix for BUG#11185.
The source of the problem is in Field_longlong::cmp. If 'this' is
  an unsigned number, the method casts both the current value, and
  the constant that we compare with to an unsigned number. As a
  result if the constant we compare with is a negative number, it
  wraps to some unsigned number, and the comparison is incorrect.
  
  When the optimizer chooses the "range" access method, this problem
  causes handler::read_range_next to reject the current key when the
  upper bound key is a negative number because handler::compare_key
  incorrectly considers the positive and negative keys to be equal.
  
  The current patch does not correct the source of the problem in
  Field_longlong::cmp because it is not easy to propagate sign
  information about the constant at query execution time. Instead
  the patch changes the range optimizer so that it never compares
  unsiged fields with negative constants. As an added benefit,
  queries that do such comparisons will execute faster because
  the range optimizer replaces conditions like:
  (a) (unsigned_int [< | <=] negative_constant) == FALSE
  (b) (unsigned_int [> | >=] negative_constant) == TRUE
  with the corresponding constants.
  In some cases this may even result in constant time execution.
2005-06-23 12:08:56 +03:00
timour@mysql.com
294498e203 Fix for BUG#11185.
The source of the problem is in Field_longlong::cmp. If 'this' is
an unsigned number, the method casts both the current value, and
the constant that we compare with to an unsigned number. As a
result if the constant we compare with is a negative number, it
wraps to some unsigned number, and the comparison is incorrect.

When the optimizer chooses the "range" access method, this problem
causes handler::read_range_next to reject the current key when the
upper bound key is a negative number because handler::compare_key
incorrectly considers the positive and negative keys to be equal.

The current patch does not correct the source of the problem in
Field_longlong::cmp because it is not easy to propagate sign
information about the constant at query execution time. Instead
the patch changes the range optimizer so that it never compares
unsiged fields with negative constants. As an added benefit,
queries that do such comparisons will execute faster because
the range optimizer replaces conditions like:
(a) (unsigned_int [< | <=] negative_constant) == FALSE
(b) (unsigned_int [> | >=] negative_constant) == TRUE
with the corresponding constants.
In some cases this may even result in constant time execution.
2005-06-23 10:56:44 +03:00
igor@rurik.mysql.com
fdb6c661a3 range.result, range.test:
Added test cases for optimization request #10561.
opt_range.cc, sql_select.cc:
  Fixed bug #10561: an optimization request to allow
  range analysis for NOT IN and NOT BETWEEN.
2005-05-21 06:11:44 -07:00
jimw@mysql.com
3f6aad900c Resolve merge from 4.1 2005-05-18 11:06:34 -07:00
serg@serg.mylan
48377eb7c4 test fixes 2005-05-18 10:57:07 +02:00
msvensson@neptunus.(none)
f3890e9440 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-05-10 10:49:50 +02:00
sergefp@mysql.com
b580a12d47 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug10095
2005-05-10 00:43:18 +02:00
sergefp@mysql.com
d1e9d9b981 Fix for BUG#10070: Make the test not to produce warnings if InnoDB is not available 2005-05-10 00:40:41 +02:00
dlenev@mysql.com
e7f29e1904 Manual merge of fix for bug #9913 into 5.0 tree. 2005-05-09 16:21:57 +04:00
lenz@mysql.com
1b198a78b2 - fix the range test to pass when InnoDB is note enabled (e.g. in the "-classic" build) 2005-05-09 00:47:47 +02:00
sergefp@mysql.com
ba3795f1d4 Post-merge fixes 2005-04-17 02:10:43 +04:00