Commit graph

65739 commits

Author SHA1 Message Date
Sergey Petrunya
da5db2e19f Backport of:
3723 oystein.grovlen@sun.com   2009-11-23
Bug#46548 (addendum)
Remove KEY::extra_length.  It is not in use.
2011-01-14 12:55:03 +03:00
Sergey Petrunya
b266e5b972 Backport testcase for: Bug#43360 - Server crash with a simple multi-table update 2011-01-14 00:47:03 +03:00
Sergey Petrunya
e43c7a2ff5 Testcase Backport: BUG#48093: 6.0 Server not processing equivalent IN clauses properly 2011-01-14 00:15:44 +03:00
Sergey Petrunya
26599d9260 Backport testcase for:
Bug #45092: join buffer contains two blob columns one of which is used in the key employed to access the joined table
2011-01-13 23:47:15 +03:00
Sergey Petrunya
d2cbb10443 Backport of (see below) + temporary measures to make SJ-Materialization work with join buffering.
Date: Mon, 01 Nov 2010 15:15:25 -0000
3272 Roy Lyseng        2010-11-01
Bug#52068: Optimizer generates invalid semijoin materialization plan

When MaterializeScan semijoin strategy was used and there were one
or more outer dependent tables before the semijoin tables, the scan
over the materialized table was not properly reset for each row of
the prefix outer tables.

Example: suppose we have a join order:

  ot1 SJ-Mat-Scan(it2 it3)  ot4

Notice that this is called a MaterializeScan, even though there is an
outer table ahead of the materialized tables. Usually a MaterializeScan
has the outer tables after the materialized table, but this is
a special (but legal) case with outer dependent tables both before and
after the materialized table.

For each qualifying row from ot1, a new scan over the materialized
table must be set up. The code failed to do that, so all scans after
the first one returned zero rows from the materialized table.
2011-01-13 19:25:31 +03:00
Sergey Petrunya
959bf3c1ee Bug #46680: Assertion failed in file item_subselect.cc, line 305 crashing on HAVING subquery
- Backport the testcase (the fix itself was included with the subquery optimizations backport)
2010-12-25 16:23:16 +03:00
Sergey Petrunya
f51a26885f Fix compile error on Windows: instead of round(X) use floor(X+0.5) 2010-12-22 02:26:35 +03:00
Sergey Petrunya
33e40f7d5b MWL#121-125 DS-MRR improvements
- Merge with 5.3-main
2010-12-21 14:40:23 +03:00
Sergey Petrunya
9d480f6af3 BUG#670417: Diverging results in maria-5.3-mwl128-dsmrr-cpk with join buffer
- Fixes for the second fix: take into account case where we don't need to save/restore the scan.
2010-12-20 14:40:12 +03:00
Sergey Petrunya
09a84dc470 BUG#670417: Diverging results in maria-5.3-mwl128-dsmrr-cpk with join buffer
Switch from "Disable identical key handling optimization when
  IndexConditionPushdown is used" approach
To 
 an approach where we save/restore index tuple and so can use index condition pushdown.
2010-12-19 13:56:12 +03:00
Sergey Petrunya
81eb82b47d Fix a compiler warning on sparc32 2010-12-17 14:58:08 +03:00
Sergey Petrunya
80cbf3a1c2 Small code cleanups 2010-12-17 13:06:21 +03:00
Sergey Petrunya
c696fb6ef3 Better comments 2010-12-16 23:43:52 +03:00
Sergey Petrunya
8dc612e6ab MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, portion 3
2010-12-16 23:37:26 +03:00
Sergey Petrunya
3e633eea66 MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, portion 2
2010-12-16 21:18:35 +03:00
Sergey Petrunya
802db7a64b - Fix compiler warning
- Better warnings
2010-12-15 10:45:08 +03:00
unknown
4f28dcbe32 Fix LP BUG#685411
Analysis:
The assert failed because st_select_lex::print() was called for subqueries
as follows:

Item_subselect::print() ->
  subselect_single_select_engine::print() -> st_select_lex::print()

It was Item_subselect::fix_fields() that set the thd by calling set_thd(),
so when this print() was called before fix_fields(), subselect_engine::thd
was NULL.

Solution:
The patch makes all constructors of all subselect_engine classes to take
a THD parameter. The default subselect_single_select_engine engine is created
early during parse time, in the Item_subselect::init call, so we pass the
correct THD object already at this point.
2010-12-14 14:08:05 +02:00
Sergey Petrunya
eafc4bef33 MWL#121-125 DS-MRR improvements
- Address review feedback: change return type of RANGE_SEQ_IF::next()
2010-12-13 20:01:32 +03:00
Sergey Petrunya
58b646001a Merge DS-MRR/CPK improvements into 5.3-main 2010-12-13 13:42:40 +03:00
Igor Babaev
419d524ff9 Fixed compiler warnings. 2010-12-11 12:50:39 -08:00
Igor Babaev
7f52af655a Merge. 2010-12-10 23:23:34 -08:00
Sergey Petrunya
14ca046833 Fix crashes on sparc-32 bit: use memcpy when we need to access non-aligned
pointers.
2010-12-10 20:18:12 +03:00
Sergey Petrunya
a86599e1e4 BUG#671340: Diverging results in with mrr_sort_keys=ON|OFF and join_cache_level=5
- Make Mrr_ordered_index_reader() save the rowid across scan interruptions

Also
- Fix compiler warning for setup_buffer_sizes()
- Add commented key_copy/key_restore for better handling of a similar issue
  with index record being destroyed by scan interruption (which causes 
  incorrect evaluation of pushed index condition later on).
2010-12-09 00:47:33 +03:00
Michael Widenius
eb70e64cea Fixed test results for windows builds
Fixed compiler warning

mysql-test/r/named_pipe.result:
  Fixed test results for windows builds
mysql-test/r/shm.result:
  Fixed test results for windows builds
sql/item_cmpfunc.cc:
  Fixed compiler warning about uninitialized "first"
2010-12-08 16:16:32 +02:00
Vladislav Vaintroub
2de9a7742a merge LP Bug#686184 2010-12-07 00:15:27 +01:00
Vladislav Vaintroub
077d96c2a7 merge LP Bug#686184 2010-12-07 00:14:16 +01:00
Vladislav Vaintroub
3fb8bc165e Fix myisam_crash_before_flush_keys on Windows
Problem : mtr reports test failure because it sees
[ERROR] mysqld got exception 0x80000003 ;
in the .err file

The exception comes from DBUG_EXECUTE_IF (.. abort())

Fix:  use DBUG_ABORT instead of abort() - it does not throw 
any exceptions.
2010-12-07 00:10:09 +01:00
Vladislav Vaintroub
60722bca7b Fix LP Bug#686184 - merge_debug test fails.
The reason for failure is that DBUG_EXECUTE_IF in mi_open()
only worked for Unix-formatted file names, due to strstr(name, "/crashed")

The fix change strstr() above to strstr(name, "crashed"), to it can work with 
Windows file names as well.
2010-12-06 22:34:50 +01:00
Sergey Petrunya
c67b895410 Post-merge fixes: fix compile failure in buildbot 2010-12-06 20:44:17 +03:00
Vladislav Vaintroub
82113c39b2 merge 2010-12-06 13:40:52 +01:00
Vladislav Vaintroub
bfcc62c748 merge 2010-12-06 13:16:49 +01:00
Vladislav Vaintroub
6ad448115b merge 2010-12-06 13:01:23 +01:00
Vladislav Vaintroub
0eae06c430 Bug#473914: mysql_client_test fail with in debug compilaton on windows x64
Reason: inconsistent compilation, federatedx is compiled without SAFEMALLOC
flag, while anything else is compiled with SAFEMALLOC.

As a consequence, my_hash_init used inside federatedx initialization does not
provide correct caller info parameters (file, line) , so they are initialized with 
whatever is on stack. When info about allocated memory is output in
COM_DEBUG command, the server crashes trying to output string starting at
0xcccccccccccccccc.

The fix is to remove SAFEMALLOC  preprocessor flags 
from every CMakeLists.txt, except the top-level one.

Also, SAFEMALLOC is not defined by default now, instead
there is WITH_DEBUG_FULL CMake option which adds 
-DSAFEMALLOC to C and C++ flags in debug compilation. 
This option is off by  default, because 
1) Debug C runtime already has heap debugging builtin with 
 overwrite and leak detection
2)safemalloc considerably slows down the tests.


Note also  that 
- SAFEMALLOC is gone  in MySQL5.5
- On Windows, heap related overflows can also be found using free pageheap utility
(that is also part of application verifier). This is even more efficient if there are no other layers 
on top of Windows heap allocator, e.g  it is most efficient with release version.
2010-12-06 12:52:06 +01:00
Michael Widenius
ca94028a36 Fixed test case to be repeatable (after discussion with Igor) 2010-12-06 11:25:04 +02:00
Michael Widenius
42746a44a2 Merge with 5.1-release 2010-12-06 11:24:12 +02:00
Michael Widenius
b7b25dc666 Merge with 5.1-release.
- Fixed problem with oqgraph and 'make dist'

Note that after this merge we have a problem show in join_outer where we examine too many rows in one specific case (related to BUG#57024).
This will be fixed when mwl#128 is merged into 5.3.
2010-12-06 10:25:44 +02:00
Michael Widenius
b3c72b9a02 Removed compiler warning 2010-12-05 19:46:39 +02:00
Michael Widenius
6061a11d36 merge with 5.1-release 2010-12-05 15:10:12 +02:00
Michael Widenius
a585745d4f Fixes to not trigger end-consistency testing of pagecache.
- Moved end_pagecache() to after maria_close()
- Flush page cache before closing files (in maria_pack)
Fixed test suite failure for PBXT

mysql-test/suite/pbxt/r/select.result:
  We mask out the 'rows' column because it may differ from run to run
mysql-test/suite/pbxt/t/select.test:
  We mask out the 'rows' column because it may differ from run to run
storage/maria/maria_chk.c:
  Moved end_pagecache() to after maria_close() to not trigger end-consistency testing of pagecache.
storage/maria/maria_pack.c:
  Moved end_pagecache() to after maria_close() to not trigger end-consistency testing of pagecache.
  flush page cache before closing files.
2010-12-05 14:25:01 +02:00
unknown
657e83cf4d The assert removed because it do not take into account case when previous and this buffers used for first time but previous buffer was not sent to disk yet (i.e. previous buffer was never sent to disk yet). 2010-12-05 01:12:10 +02:00
Michael Widenius
bafceea14f Automatic merge 2010-12-04 23:18:46 +02:00
Michael Widenius
dfefc15db4 Automatic merge with 5.1-release 2010-12-04 23:00:22 +02:00
unknown
6120fbace4 Aria unit tests fixed to have correct pagecache shutdown.
The Aria multithread test unlocked.

storage/maria/unittest/ma_pagecache_consist.c:
  Fixed pagecache shutdown.
storage/maria/unittest/ma_pagecache_rwconsist.c:
  Fixed pagecache shutdown.
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  The Aria multithread test unlocked.
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  Fixed pagecache shutdown.
2010-12-04 18:31:11 +02:00
Michael Widenius
a924325656 Merge with 5.1 2010-12-04 16:32:42 +02:00
Michael Widenius
26eb30d07f automatic merge with 5.1-release 2010-12-04 13:17:22 +02:00
Michael Widenius
6a5570789e Removed assert as gcc on gentoo couldn't compile it without a warning :(
(Not critical, we will just catch the error later)
2010-12-04 13:15:16 +02:00
Michael Widenius
9baab6f5e3 Fixed (wrong) compiler warning 2010-12-04 12:54:35 +02:00
Michael Widenius
6426564753 Fixed compiler warnings but calling field->store(longlong, unsigned_flag) with proper arguments. 2010-12-04 12:35:41 +02:00
Michael Widenius
7fc6086192 Automatic merge with 5.1-release 2010-12-04 12:27:51 +02:00
Michael Widenius
8938ed57a4 Fixed compiler warning
Added missing inc_counter_for_resize_op(pagecache).
(caused maria.maria-preload.test to fail)

storage/maria/ma_loghandler.c:
  Fixed compiler warning
storage/maria/ma_pagecache.c:
  Added missing inc_counter_for_resize_op(pagecache).
  (caused maria.maria-preload.test to fail)
2010-12-04 12:21:24 +02:00