Commit graph

65263 commits

Author SHA1 Message Date
Igor Babaev
73898792da Fixed LP bug #664594 and other bugs leading to invalid execution
plans or wrong results due to the fact that JOIN_CACHE functions
ignored the possibility of interleaving materialized semijoin 
tables with tables whose records were stored in join buffers.
This fixes would become mostly unnecessary if the new code of
mwl 90 was merged into 5.3 right now.
Yet the fix the code of optimize_wo_join_buffering was needed
in any case.
2010-11-03 12:26:18 -07:00
Igor Babaev
84218365c0 Post-merge fix. 2010-11-02 16:50:32 -07:00
Igor Babaev
517fc164cd Merge 2010-11-02 16:30:42 -07:00
Igor Babaev
2dc2098e59 Merge 2010-11-02 16:08:02 -07:00
Igor Babaev
1f70c2a67c Removed empty lines. 2010-11-02 16:04:39 -07:00
Igor Babaev
66191ef070 Merge 2010-11-02 10:12:21 -07:00
Igor Babaev
432c9b20e9 Fixed LP bug #669420.
This bug in the MRR code for Maria engine caused wrong results when
MRR was used to scan ranges for each record.

Added test cases for bugs 669420 and 669423 (as a duplicate of 669420).
2010-11-02 10:07:46 -07:00
Sergei Golubchik
c186b79b19 merge 2010-11-02 10:48:55 +01:00
Sergei Golubchik
9a73249161 fix windows embedded 2010-11-02 10:47:36 +01:00
Sergei Golubchik
74711a4615 merge w/ 5.2 2010-11-02 10:12:29 +01:00
Michael Widenius
c4a5cf111b Fixed wrong queue_replace(), which caused timeout failure in pbxt.flush_read_lock_kill
Fixed compiler warnings.

include/queues.h:
  Added prototype for queue_replace()
mysys/queues.c:
  Fixed wrong queue_replace()
mysys/thr_alarm.c:
  Added DBUG_PRINT
sql/item_subselect.cc:
  Check return value of ha_rnd_init().
  (Fixes compiler warnings)
sql/sql_class.cc:
  Fixed wrong test
sql/sql_show.cc:
  Removed not used variable.
2010-11-02 11:03:33 +02:00
Igor Babaev
df32342102 Fixed LP bug #668290.
Prohibited to use hash join algorithm BNLH if join attributes
need non-binary collations. It has to be done because BNLH does
not support join for such attributes yet.
Later this limitations will be lifted.

Changed default collations for the schemes of some test cases
to preserve the old execution plans.
2010-10-30 15:14:36 -07:00
Sergei Golubchik
5789f96c62 fix LIKE in a vcol function, broken by a fix for mysql bug#54568.
don't set view_prepare_mode when opening a base table
(either in SHOW CREATE or in I_S.TABLES)
2010-10-30 19:54:38 +02:00
Igor Babaev
0b72fd88a1 Merge. 2010-10-30 06:07:45 -07:00
Igor Babaev
d48a8b6034 Fixed bug #665049.
The bug could cause wrong results for queries over Maria tables when
index condition pushdown was used.
2010-10-29 18:59:39 -07:00
Sergei Golubchik
310584a849 merge w/ 5.1 2010-10-29 23:18:02 +02:00
Sergei Golubchik
716f784375 sane implementation of Key_% status variables. 2010-10-29 20:29:43 +02:00
unknown
c6b19ea001 mysqltest: Fix reversed error check, causing truncated output when testcase fails.
Also fix missing zero termination in DBUG_PRINT, causing garbage output
in --debug output.
2010-10-29 09:56:45 +02:00
Igor Babaev
05092b7323 Post-merge adjustment of the results for the innodb_plugin test suite. 2010-10-28 13:51:50 -07:00
Sergei Golubchik
8e7ebfbce8 5.2 merge 2010-10-28 19:04:23 +02:00
Igor Babaev
4292c59089 Merge 2010-10-27 16:37:33 -07:00
Igor Babaev
8d8170f1a4 Changed properties changed: +x to -x 2010-10-27 16:35:00 -07:00
Igor Babaev
4f75a8254a Merge 5.3-mwl128 -> 5.3 2010-10-27 16:31:22 -07:00
unknown
3bdede3c67 Fixed LP bug #613009
The set of Ordered keys of a rowid merge engine is dense. Thus when
we decide not to create a key for a column that has only NULLs, this
column shouldn't be counted.

Notice that the caller has already precomputed the correct total
number of keys that should be created.
2010-10-27 16:28:19 +03:00
unknown
3b11e4f834 Fixed LP bug #609121
Post-review fix - avoid re-evaluation of the having clause
when it evaluates to true.
2010-10-27 12:35:15 +03:00
unknown
4cb9a326cf Fix test failure (timeout) in --valgrind tests in Buildbot.
The main.ps_ddl test does SELECT * FROM mysql.general_log; that can be really
expensive with --valgrind if previous test cases put lots of data in the
general log since last server restart. Fix by truncating the log at test start.
2010-10-27 10:41:45 +02:00
unknown
a09e5f504a Type of the variables fixed.
sql/sql_expression_cache.cc:
  Type of the variable fixed.
sql/sql_expression_cache.h:
  Type of the variable fixed.
2010-10-27 06:03:59 +03:00
unknown
b4d5f30a86 Fixed LP bug #601156
The cause for this bug is that MariaDB 5.3 still processes derived tables
(subqueries in the FROM clause) by fully executing them during the parse
phase. This will be remedied by MWL#106 once merged into the main 5.3.

The assert statement is triggered when MATERIALIZATION is ON for EXPLAIN
EXTENDED for derived tables with an IN subquery as follows:
- mysql_parse calls JOIN::exec for the derived table as if it is regular
  execution (not explain).
- When materialization is ON, this call goes all the way to
  subselect_hash_sj_engine::exec, which creates a partial match engine
  because of NULL presence.
- In order to proceed with normal execution, the hash_sj engine substitutes
  itself with the created partial match engine.
- After the parse phase it turns out that this execution was part of
  EXPLAIN EXTENDED, which in turn calls
  Item_cond::print -> ... -> Item_subselect::print,
  which calls engine->print().
  Since subselect_hash_sj_engine::exec substituted the current
  Item_subselect engine with a  partial match engine, eventually we call
  its ::print() method. However the partial match engines are designed only
  for execution, hence there is no implementation of this print() method.

The fix temporarily removes the assert, until this code is merged with
MWL#106.
2010-10-26 14:55:42 +03:00
Sergei Golubchik
7c24e8d54d fixes for windows 2010-10-26 07:37:44 +02:00
unknown
db4738a18a Fixed LP bug #609121
The bug was a result of missing logic to handle the case
when there are 'expensive' predicates that are not evaluated
during constant table optimization. Such is the case for
the IN predicate, which is considered expensive if it is
computed via materialization. In general this bug can be
triggered with any expensive predicate instead of IN.

When FALSE constant predicates are not evaluated during constant
optimization, the execution path changes so that instead of
setting JOIN::zero_result_cause after make_join_select, and
exiting JOIN::exec via the call to return_zero_rows(), execution
ends in JOIN::exec in the branch:
if (join->tables == join->const_tables)
{
  ...
  else if (join->send_row_on_empty_set())
     ...
     rc= join->result->send_data(*columns_list);
}
Unlike return_zero_rows(), this branch didn't evaluate the
having clause of the query.

The patch adds a call to evaluate the HAVING clause of a query even
when all tables are constant, because even for an empty result set
some aggregate functions may produce a NULL value.
2010-10-25 23:48:43 +03:00
Sergei Golubchik
04a4b43346 merge with 5.1 2010-10-25 15:21:16 +02:00
Sergei Golubchik
37a78d6868 forgotten option handled 2010-10-25 09:04:40 +02:00
Igor Babaev
0c53cd1ec9 Fixed LP bug #664508.
When join buffers are employed no index scan for the first
table with grouping columns can be used.



mysql-test/r/join_cache.result:
  Added a test case for bug #664508.
  Sorted results for some other test cases.
mysql-test/t/join_cache.test:
  Added a test case for bug #664508.
  Sorted results for some other test cases.
2010-10-24 14:22:01 -07:00
Sergei Golubchik
62d31f675d bugfix: engine defined table options were not showing up in INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS 2010-10-24 20:47:01 +02:00
Igor Babaev
de69dbae0c Fixed LP bug #663818.
After the patch for bug 663840 had been applied the test case for
bug 663818 triggered the assert introduced by this patch.
It happened because the the patch turned out to be incomplete:
the space needed for a key entry must be taken into account
for the record written into the buffer, and, for the next record
as well, when figuring out whether the record being written is
the last for the buffer or not.
2010-10-22 15:30:47 -07:00
Igor Babaev
ca862231f7 Fixed LP bug #663840.
When adding a new record into the join buffer that is employed by
BNLH join algorithm the writing procedure JOIN_CACHE::write_record_data 
checks whether there is enough space for the record in the buffer.
When doing this it must take into account a possible new key entry
added to the buffer. It might happen, as it has been demonstrated by
the bug test case, that there is enough remaining space in the buffer
for the record, but not for the additional key entry for this record.
In this case the key entry overwrites the end of the record that might
cause a crash or wrong results.
Fixed by taking into account a possible addition of new key entry when
estimating the remaining free space in the buffer.
2010-10-22 10:53:29 -07:00
Sergei Golubchik
1d8ad7e54c workaround for MySQL BUG#57491 2010-10-22 10:32:54 +02:00
Sergei Golubchik
2e02037288 Show the number of warm keycache blocks in SHOW STATUS 2010-10-20 21:42:17 +02:00
unknown
010733cb13 Make the skip-on-windows check as the first one, as the master-slave include fails on windows. 2010-10-26 16:58:52 +02:00
Sergei Golubchik
60c15066db better fix for MySQL bugs
BUG#26447 prefer a clustered key for an index scan, as secondary index is always slower
  ... which was fixed to cause
BUG#35850 queries take 50% longer
  ... and was reverted

and

BUG#39653 prefer a secondary index for an index scan, as clustered key is always slower
  ... which was fixed to cause
BUG#55656 mysqldump takes six days instead of half an hour
  ... and was amended with a special case workaround


sql/opt_range.cc:
  move get_index_only_read_time() into the handler class
sql/sql_select.cc:
  use cost not an index length when choosing a cheaper index
2010-10-20 12:58:43 +02:00
Sergei Golubchik
b56086cbbb build mysqld.exe with federatedx not federated 2010-10-20 09:17:17 +02:00
Sergei Golubchik
36fe044174 updated test results 2010-10-20 08:40:46 +02:00
Sergei Golubchik
da0603b690 fixed a bad merge 2010-10-19 18:11:30 +02:00
unknown
462d14d42b Merge XtraDB from Percona-server-5.1.51-12 into MariaDB. 2010-10-19 17:03:26 +02:00
Sergei Golubchik
745cc74c33 5.1.51 merge 2010-10-19 15:58:35 +02:00
unknown
c6ccd3f346 Merge XtraDB from Percona-server-5.1.51-12 into MariaDB. 2010-10-19 14:16:15 +02:00
unknown
4f907dc75b Updated with changes from lp:percona-server/release-5.1.51-12 as of October 19, 2010 2010-10-19 12:27:31 +02:00
Igor Babaev
ac58b4b7e0 Merge 2010-10-18 13:56:48 -07:00
Igor Babaev
ed511daf3c Merge 2010-10-18 13:48:44 -07:00
Igor Babaev
25f5debdc7 MWL#128: Added into EXPLAIN output info about types of the used join buffers and
about the employed join algorithms.
Refactored constructors of the JOIN_CACHE* classes.
2010-10-18 13:33:05 -07:00