Commit graph

76 commits

Author SHA1 Message Date
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
ab72ecc5fd Fixed test result for BUG#11185. 2005-06-24 09:56:58 +03: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
monty@mishka.local
2d25da2a4b concurrent-insert can now be set to 2 for concurrent inserts when there is holes in the data file
myisam_max_extra_sort_file_size is depricated
Ensure that myisam_data_pointer_size is honoured when creating new MyISAM files
Changed default value of myisam_data_pointer_size from 4 to 6 to get rid of 'table-is-full' errors
2005-05-13 12:08:08 +03:00
sergefp@mysql.com
c2959178ca Fix for BUG#10037
* Add 0.01 to cost of 'range'+'using index' scan to avoid optimizer choice races with 
  'index' scan.
2005-04-21 01:55:33 +04:00
sergefp@mysql.com
ba3795f1d4 Post-merge fixes 2005-04-17 02:10:43 +04:00
sergefp@mysql.com
2ef1963c91 Fix for BUG#9348: when computing union of two intervals set lower bound to
minimum of lower bounds of two joined intervals.
2005-04-17 02:05:09 +04:00
monty@mishka.local
de1b1fe54d Added more rows to test to get predictable results 2005-04-16 10:53:30 +03:00
msvensson@neptunus.(none)
7387030e67 BUG#8924 'Explain' shows different strategy
- If number of records in table is 4, the calculated cost for using "index" and "range" become so close so that any rounding errors becomes visible.
 - Added one more record to the tables for heap test and expoect "range" to be selected
 - Decrease number of records in t1 for range and expect "index" to be choosen.
2005-04-12 12:04:43 +02:00
serg@serg.mylan
f862ba4788 post-merge 2004-11-22 22:57:05 +01:00
serg@serg.mylan
ee933cd198 merged 2004-11-22 21:33:15 +01:00
serg@serg.mylan
41c33c29a3 Bug #6748 heap_rfirst() doesn't work (and never did!)
range for BETWEEN typo fixed
2004-11-22 14:53:18 +01:00
monty@mysql.com
071001950e Merge with 4.1 to get in latest bug fixes 2004-11-04 15:06:24 +02:00
bar@mysql.com
45451568bf opt_range.cc, range.result, range.test:
Bug #6045: Binary Comparison regression in MySQL 4.1
  Binary searches didn't use a case insensitive index, now they do.
2004-11-03 15:22:33 +04:00
monty@mysql.com
47bbf768d4 Fixes after merge with 4.1
FOUND is not a reserved keyword anymore
Added Item_field::set_no_const_sub() to be able to mark fields that can't be substituted
Added 'simple_select' method to be able to quickly determinate if a select_result is a normal SELECT
Note that the 5.0 tree is not yet up to date: Sanja will have to fix multi-update-locks for this merge to be complete
2004-11-03 12:39:38 +02:00
igor@rurik.mysql.com
f0bc019c86 Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2004-10-20 13:17:06 -07:00
serg@serg.mylan
bbfb5f244a the test moved from range.test to innodb.test - it should not be run when innodb is disabled 2004-10-20 12:56:49 +02:00
igor@rurik.mysql.com
a03e5ad8e4 Merge for post-merge fixes for Item_equal patch. 2004-10-19 16:07:10 -07:00
igor@rurik.mysql.com
4c8e391718 table.h, sql_select.h:
Added the code processing on expressions for applying
  multiple equalities.
sql_select.cc:
  Post-merge fixes for Item_equal patch.
  Added the code processing on expressions for applying
  multiple equalities.
Many files:
  Post-merge fixes for Item_equal patch.
item_cmpfunc.cc:
  Post-merge fixes for Item_equal patch.
  Fixed a problem when an equality field=const cannot be applied to
  the predicate P(field,c) for constant propagation as a conversion
  of field is needed.
item.h, item.cc:
  Fixed a problem when an equality field=const cannot be applied to
  the predicate P(field,c) for constant propagation as a conversion
  of field is needed.
2004-10-19 14:12:55 -07:00
serg@serg.mylan
5fd2c489fb compatibility fix
test results corrected
2004-10-18 15:32:06 +02:00
igor@rurik.mysql.com
71f6ab7a09 Merge for Item_equal. 2004-10-09 10:34:13 -07:00
monty@mysql.com
f2829d0386 After merge fixes of merge with 4.1 that included the new arena code.
Fixed (together with Guilhem) bugs in mysqlbinlog regarding --offset
Prefix addresses with 0x for easier comparisons of debug logs
Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
This fix changed some 'index' queries to 'range' queries in the test suite
Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
This fix removed of a lot of 'Using where' notes in the test suite.
Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
Give NOTE instead of WARNING for safe field-type conversions
2004-09-09 06:59:26 +03:00
monty@mysql.com
31122efde7 Merge with 4.1
(Includes merge of arena code in 4.1 and 5.0)
2004-09-06 15:14:10 +03:00
sergefp@mysql.com
fdb51f67a2 Fix for bug#4488: sign-aware equality check 2004-08-17 02:59:24 +04:00
sergefp@mysql.com
4ddeee9d2f Fix for BUG#4488: first portion: sign aware '<' and '>' comparisons. 2004-08-11 23:08:20 +04:00
monty@mysql.com
1e31199995 Merge with 4.1.3-beta 2004-07-07 11:29:39 +03:00
serg@serg.mylan
450e5b0119 after merge fixed 2004-06-26 14:21:32 +02:00
monty@mysql.com
b1d08ba2b4 Merge with 4.0 to get the latest bug patches to 4.1 2004-06-25 20:13:05 +03:00
sergefp@mysql.com
f874071a26 Range optimizer fix:
If cost(full_scan_on_shortest_covering_index) < cost(best_range_scan) <  cost(full_table_scan)
  use full_scan_on_shortest_covering_index
(before this fix best_range_scan was used)
2004-06-22 04:47:28 +04:00
serg@sergbook.mysql.com
6adefe41a4 Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-4.0
2004-06-21 19:44:20 +03:00
serg@sergbook.mysql.com
e2a3ca8637 use ref not range for ... WHERE key IN (val) 2004-06-21 19:42:00 +03:00
monty@mysql.com
b11d258835 Merge with 4.0.21 2004-06-18 04:38:58 +03:00
monty@mysql.com
fd6858dccd Fixed unlikely bug in the range optimzer when using many IN() queries on different key parts. (Bug #4157) 2004-06-18 02:31:11 +03:00
marko@hundin.mysql.fi
df5336a3cc Introduce keys in child tables corresponding to FOREIGN KEYs
Remove redundant keys in CREATE TABLE and ALTER TABLE
2004-04-21 13:15:43 +03:00
bar@bar.intranet.mysql.r18.ru
3aea3e92ce 1. New data types, from the user point of view:
BINARY(N) and VARBIBARY(N)
2. More 4.0 compatibility and more BINARY keyword consistency:
2a. CREATE TABLE a (a CHAR(N) BINARY) 
    is now synonym for
    CREATE TABLE a (a CHAR(N) COLLATE xxxx_bin)
2b. SELECT BINARY x
    is still synonin for
    SELECT x COLLATE xxxxx_bin.
2004-03-26 16:11:46 +04:00
monty@mysql.com
f43093ec0e After merge fixes
Added more DBUG statements
Ensure that we are comparing end space with BINARY strings
Use 'any_db' instead of '' to mean any database. (For HANDLER command)
Only strip ' ' when comparing CHAR, not other space-like characters (like \t)
2004-02-16 10:03:25 +02:00
monty@mysql.com
fb8f27f017 Always use libtool with "--preserve-dup-deps"
Always use all LOAD DATA options in replication.
Fixed problem in mysqlbinlog where LOAD DATA options could be overwritten.
2004-02-13 16:05:09 +02:00
monty@mysql.com
ce14578909 Merge with 4.0.18 2004-02-11 00:06:46 +01:00
monty@mysql.com
f7e65a7620 Fixed problem with range optimization over overlapping ranges (#2448) 2004-02-04 09:51:13 +01:00
serg@serg.mylan
faa8252b10 test moved to an appropriate file 2004-01-21 23:39:35 +01:00
serg@serg.mylan
8caf856afe an obvious bug in _mi_key_cmp fixed (BUG#2295 - range on blobs) 2004-01-15 16:31:27 +01:00
igor@rurik.mysql.com
c236568ac9 Auto Merge 2003-12-23 02:24:12 -08:00
antony@ltantony.rdg.cyberkinetica.homeunix.net
fcf96dbb18 WorkLog#1323
Deprecate the use of TYPE=... Preferred syntax is ENGINE=
2003-12-10 04:31:42 +00:00
igor@rurik.mysql.com
580b878562 The output of explain command for some queries has changed
after introducing Item_equal.
2003-12-02 16:41:53 -08:00
monty@mysql.com
5914033478 merge with 4.0 to get fix for range bug 2003-11-28 15:55:43 +02:00
monty@mysql.com
4f42a47408 Fixed range optimzier bug (Bug #1828) 2003-11-28 15:45:34 +02:00
monty@narttu.mysql.fi
f763d4c31d Removed some warnings reported by valgrind
After merge fixes.
Now code compiles, but there is still some valgrind warnings that needs to be fixed
2003-11-04 14:09:03 +02:00