Commit graph

88278 commits

Author SHA1 Message Date
Sergei Golubchik
f90dca1a0d MDEV-6014 Merge fixed OQGRAPH into 10.0 tree 2014-05-05 17:50:07 +02:00
Sergei Golubchik
9c9aa62ddc MDEV-6095 replicate- filters for slaves with a connection name that contain an underscore are ignored
Revert revision-id: guilhem@mysql.com-20091118203617-3jfudef971r7bf2y
Implement a non-destructive fix instead.
2014-05-05 14:18:35 +02:00
Sergei Golubchik
a5beb350ae MDEV-5454 Dependencies for mariadb-connect-engine-10.0.deb don't look correct 2014-05-04 17:37:54 +02:00
Sergei Golubchik
a03997db43 MDEV-6085 ALTER TABLE looses the connection string 2014-05-01 18:27:52 +02:00
Sergei Golubchik
26618a54fa MDEV-5736 remove what remains from ONE_SHOT hack 2014-05-01 14:07:11 +02:00
Sergei Golubchik
d81b662b8c Asserting correct database name lettercase in
various places in the code.
2014-05-01 14:06:48 +02:00
Sergei Golubchik
5b6c75ca4d increase TokuDB plugins maturity to "stable". 2014-05-01 14:06:06 +02:00
Sergei Golubchik
dc23a9501a Solaris compilation failure: xtradb is linked in statically, ha_innodb.so needs
the linker script.
2014-05-01 14:05:52 +02:00
Sergei Golubchik
302e4776e0 comments 2014-05-01 14:05:44 +02:00
Sergei Golubchik
4544e60d29 MDEV-6106 Cannot create a table with 229 or greater columns in TokuDB
correct the length encoding for the extra2 frm segment. add the comment.
2014-05-01 14:04:00 +02:00
Sergey Vojtovich
b123249010 MDEV-5792 - Deadlock between SELECTs from METADATA_LOCK_INFO and another
I_S table

mdl_iterate() helper function (which is used by the plugin to iterate mdl
locks) acquired mutexes in reverse order.

Fixed by iterating MDL locks in two stages:
1. Iterate locks hash under the protection of hash mutex, store all
   lock pointers in a thread local array and increment reference counter
   for the lock.
2. Iterate local array without protection of hash mutex, handle destroyed
   locks.

It somewhat echoes hack in MDL_map_partition::move_from_hash_to_lock_mutex.
2014-04-23 11:34:06 +04:00
Sergey Petrunya
504068b093 MDEV-6209: Assertion `join->best_read < double(1.79769313486231570815e+308L ...
- Use floating-point division in selectivity calculations.
2014-05-05 13:24:54 +03:00
Igor Babaev
d130cef416 Fixed the problem of mdev-6198: statistics.test fails in valgrind.
The problem appeared when a loose scan used a key prefix whose
last component called uint3korr in the implementation of the key_cmp
virtual function.
2014-05-02 15:47:50 -07:00
Sergey Petrunya
32392c05b7 MDEV-6185: Buildbot valgrind failure: Conditional jump or move in table_cond_selectivity 2014-04-29 18:33:17 +04:00
Sergey Petrunya
54265c5f50 MDEV-5980: EITS: if condition is used for REF access, its selectivity is still in filtered%
- Testcase. The bug is fixed by commit for MDEV-6003
2014-04-25 19:12:06 +04:00
Sergey Petrunya
2acd81af73 MDEV-6003: EITS: ref access, keypart2=const vs keypart2=expr - inconsistent filtered% value
- Fix table_cond_selectivity() to work correctly for ref access 
  and "keypart2=const" case.
2014-04-25 19:04:54 +04:00
Sergey Petrunya
182f7d76ee Revert these two changes (wrong push) :
MDEV-5980: EITS: if condition is used for REF access, its selectivity is still in filtered%
MDEV-5985: EITS: selectivity estimates look illogical for join and non-key equalities
MDEV-6003: EITS: ref access, keypart2=const vs keypart2=expr - inconsistent filtered% value
- Made a number of fixes in table_cond_selectivity() so that it returns
  correct selectivity estimates.
- Added comments in related code.
Better comments
2014-04-28 21:49:39 +04:00
Sergey Petrunya
46d1b84597 Better comments 2014-04-25 11:47:51 +04:00
Sergey Petrunya
deb26989e9 MDEV-5980: EITS: if condition is used for REF access, its selectivity is still in filtered%
MDEV-5985: EITS: selectivity estimates look illogical for join and non-key equalities
MDEV-6003: EITS: ref access, keypart2=const vs keypart2=expr - inconsistent filtered% value
- Made a number of fixes in table_cond_selectivity() so that it returns
  correct selectivity estimates.
- Added comments in related code.
2014-04-21 15:37:55 +04:00
Elena Stepanova
872a01b6b1 MDEV-6178 mysql_upgrade breaks databases with long user names
Added a test, the problem itself was fixed in MDEV-6068
2014-04-28 02:38:03 +04:00
Alexander Barkov
fbfa004327 MDEV-6170 Incorrect ordering with utf8_bin and utf8mb4_bin collations 2014-04-25 17:10:25 +04:00
unknown
64923bb653 MDEV-6156: Parallel replication incorrectly caches charset between worker threads
The previous patch for this bug was unfortunately completely wrong.

The purpose of cached_charset is to remember which character set we
have installed currently in the THD, so that in the common case where
charset does not change between queries, we do not need to update it
in the THD. Thus, it is important that the cached_charset field is
tightly coupled to the THD for which it handles caching.

Thus the right place to put cached_charset seems to be in the THD.
This patch introduces a field THD:system_thread_info where such info
in general can be placed without further inflating the THD with unused
data for other threads (THD is already far too big as it is). It then
moves the cached_charset into this slot for the SQL driver thread and
for the parallel replication worker threads.

The THD::rpl_filter field is also moved inside system_thread_info, to
keep the size of THD unchanged. Moving further fields in to reduce the
size of THD is a separate task, filed as MDEV-6164.
2014-04-25 12:58:31 +02:00
Alexander Barkov
d3d3a4b834 MDEV-4511 Assertion `scale <= precision' fails on GROUP BY TIMEDIFF with incorrect types 2014-04-24 16:59:01 +04:00
unknown
aefddfe3ff Fix sporadic test failures in rpl_mariadb_slave_capability.test.
The problem is the async binlog checkpointing; this could on rare
occasions occur too late, causing SHOW BINLOG EVENTS to show the
wrong events and cause .result file difference.
2014-04-24 09:41:31 +02:00
Alexander Barkov
4c56dfe95b MDEV-5851 MySQL WL#5303 Romansh locale for DAYNAME, MONTHNAME, DATE_FORMAT 2014-04-24 10:30:13 +04:00
unknown
010971a761 MDEV-6156: Parallel replication incorrectly caches charset between worker threads
Replication caches the character sets used in a query, to be able to quickly
reuse them for the next query in the common case of them not having changed.

In parallel replication, this caching needs to be per-worker-thread. The
code was not modified to handle this correctly, so the caching in one worker
could cause another worker to run a query using the wrong character set,
causing replication corruption.
2014-04-23 16:06:06 +02:00
Alexander Barkov
f9e5f237f0 MDEV-6027 RLIKE: "." no longer matching new line
Added a new system variable:
default_regex_flags='DOTALL,DUPNAMES,EXTENDED,EXTRA,MULTILINE,UNGREEDY'
2014-04-23 10:57:25 +04:00
Igor Babaev
bcf16fa612 Merge. 2014-04-22 14:43:13 -07:00
Igor Babaev
3e0f63c18f Fixed the problem of mdev-5947.
Back-ported from the mysql 5.6 code line the patch with
the following comment:

  Fix for Bug#11757108 CHANGE IN EXECUTION PLAN FOR COUNT_DISTINCT_GROUP_ON_KEY
                       CAUSES PEFORMANCE REGRESSION

  The cause for the performance regression is that the access strategy for the
  GROUP BY query is changed form using "index scan" in mysql-5.1 to use "loose
  index scan" in mysql-5.5. The index used for group by is unique and thus each
  "loose scan" group will only contain one record. Since loose scan needs to
  re-position on each "loose scan" group this query will do a re-position for
  each index entry. Compared to just reading the next index entry as a normal
  index scan does, the use of loose scan for this query becomes more expensive.

  The cause for selecting to use loose scan for this query is that in the current
  code when the size of the "loose scan" group is one, the formula for
  calculating the cost estimates becomes almost identical to the cost of using
  normal index scan. Differences in use of integer versus floating point arithmetic
  can cause one or the other access strategy to be selected.

  The main issue with the formula for estimating the cost of using loose scan is
  that it does not take into account that it is more costly to do a re-position
  for each "loose scan" group compared to just reading the next index entry.
  Both index scan and loose scan estimates the cpu cost as:

    "number of entries needed too read/scan" * ROW_EVALUATE_COST

  The results from testing with the query in this bug indicates that the real
  cost for doing re-position four to eight times higher than just reading the
  next index entry. Thus, the cpu cost estimate for loose scan should be increased.
  To account for the extra work to re-position in the index we increase the
  cost for loose index scan to include the cost of navigating the index.
  This is modelled as a function of the height of the b-tree:

    navigation cost= ceil(log(records in table)/log(indexes per block))
                   * ROWID_COMPARE_COST;

  This will avoid loose index scan being used for indexes where the "loose scan"
  group contains very few index entries.
2014-04-22 14:39:57 -07:00
Alexander Barkov
ed93e55bac MDEV-5975 Prepared statements with DATE literals do not honor NO_ZERO_IN_DATE 2014-04-22 11:23:35 +04:00
Sergei Golubchik
046ae9f5c6 10.0-connect merge 2014-04-21 20:45:38 +02:00
Alexander Barkov
6075c82467 Merge 10.0 -> 10.0-connect 2014-04-21 14:57:10 +04:00
Olivier Bertrand
187e41697b - Implement "remote" index (similar to FEDERATED ones) for MYSQL tables.
Not yet done for ODBC tables.
modified:
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/plgdbsem.h
  storage/connect/reldef.h
  storage/connect/tabdos.h
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
  storage/connect/xindex.cpp
  storage/connect/xtable.h

- Return error in "info" on Cardinality error.
modified:
  storage/connect/ha_connect.cc
2014-04-19 17:02:53 +02:00
Sergey Petrunya
7216afbc78 MDEV-5963: InnoDB: Assertion failure in file row0sel.cc line 2503 ...
- Backport the fix for MySQL Bug#13947868
- Add our testcase (they don't publish theirs)
2014-04-18 14:07:54 +04:00
Igor Babaev
12eb6d88f7 Fixed the problem of mdev-5970:
back-ported the patch for bug #13256831 from mysql-5.6 code line.

  Here's the comment this patch was provided with:

  Fixed bug#13256831 - ERROR 1032 (HY000): CAN'T FIND RECORD.

  This bug only occurs if a user tries to update a base table using
  an updatable view and this view was created as a join for which
  the clause 'WITH CHECK OPTION' was specified.

  The reason for the bug was that when such an update was
  executed, row positions were not properly handled for tables
  that were not updated but had constraints that had to be
  checked due to the 'WITH CHECK OPTION' clause.

  The reason for the bug was that when such update is executed
  then for tables specified in the view definition and
  also listed in the 'WITH CHECK OPTION' clause the positioning to
  row being updated is not performed.
2014-04-17 12:53:53 -07:00
Sergey Vojtovich
bd44c086b3 MDEV-6059 - Result files with no corresponding test files
Removed unused result files.
2014-04-16 09:49:30 +04:00
Sergey Vojtovich
15b443b095 MDEV-6088 - Merge spider 3.2 2014-04-15 11:29:57 +04:00
Olivier Bertrand
213ecbbb4f - In info, the file length sometimes could not be caculated because the
catalog data path had not been set. This was added into ha_connect::info.
modified:
  storage/connect/ha_connect.cc

- All the functions querying table options could return information from the wrong
  table when several CONNECT tables were used in the same query (for instance joined
  together) This was because they belonged to the catalog class that is shared between
  all tables in the same query. They have been moved from the catalog class to the
  TABDEF/RELDEF class that is attached to each table. This was a major potential bug.
modified:
  storage/connect/catalog.h
  storage/connect/filamvct.cpp
  storage/connect/filamzip.cpp
  storage/connect/mycat.cc
  storage/connect/mycat.h
  storage/connect/reldef.cpp
  storage/connect/reldef.h
  storage/connect/tabdos.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabmul.cpp
  storage/connect/tabmysql.cpp
  storage/connect/taboccur.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabpivot.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabtbl.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabvct.cpp
  storage/connect/tabwmi.cpp
  storage/connect/tabxcl.cpp
  storage/connect/tabxml.cpp
  storage/connect/xindex.cpp

- Prepare indexing of MYSQL/ODBC tables (as does FEDERATED) (Not implemented yet)
modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/mycat.h

- Typo
modified:
  storage/connect/plgdbutl.cpp
2014-04-14 14:26:48 +02:00
Sergey Petrunya
244d4b532a MDEV-6081: ORDER BY+ref(const): selectivity is very incorrect (MySQL Bug#14338686)
Add a testcase and backport this fix:

Bug#14338686: MYSQL IS GENERATING DIFFERENT AND SLOWER
              (IN NEWER VERSIONS) EXECUTION PLAN
PROBLEM:
While checking for an index to sort for the order by clause
in this query
"SELECT datestamp FROM contractStatusHistory WHERE
contract_id = contracts.id ORDER BY datestamp asc limit 1;"

we do not calculate the number of rows to be examined correctly.
As a result we choose index 'idx_contractStatusHistory_datestamp'
defined on the 'datestamp' field, rather than choosing index
'contract_id'. And hence the lower performance.

ANALYSIS:
While checking if an index is present to give the records in
sorted order(datestamp), we consider the selectivity of the
'ref_key'(contract_id here) using 'table->quick_condition_rows'.
'ref_key' here can be an index from 'REF_ACCESS' or from 'RANGE'.

As this is a 'REF_ACCESS', 'table->quick_condition_rows' is not
set to the actual value which is 2. Instead is set to the number
of tuples present in the table indicating that every row that
is selected would be satisfying the condition present in the query.

Hence, the selectivity becomes 1 even when we choose the index
on the order by column instead of the join_condition.

But, in reality as only 2 rows satisy the condition, we need to
examine half of the entire data set to get one tuple when we
choose index on the order by column.
Had we chosen the 'REF_ACCESS' we would have examined only 2 tuples.
Hence the delay in executing the query specified.
  
FIX:
While calculating the selectivity of the ref_key:
For REF_ACCESS consider quick_rows[ref_key] if range 
optimizer has an estimate for this key. Else consider 
'rec_per_key' statistic.
For RANGE ACCESS consider 'table->quick_condition_rows'.
2014-04-12 01:01:32 +04:00
andrew
8bc1fa7344 MDEV-3037 - make build work on Windows 64 2014-04-11 21:09:18 +09:30
andrew
b03e2393b9 MDEV-5996 - regression test result 2014-04-11 21:07:49 +09:30
andrew
3cb82b6261 Merged maria trunk 2014-04-10 22:14:56 +09:30
Alexander Barkov
5fffa449ed Fixing compilation problem on AIX. 2014-04-10 15:26:05 +04:00
unknown
39afdcddd1 MDEV-5401: Wrong result (missing row) on a 2nd execution of PS with exists_to_in=on, MERGE view or a SELECT SQ
The problem was that the view substitute its fields (on prepare) with reverting the change after execution. After prepare on optimization exists2in convertion substituted arguments of '=' with constsnt '1', but then one of the arguments of '=' was reverted to the view field reference.This lead to incorrect WHERE condition on the second execution.

To fix the problem we replace whole '=' with '1' permannently.
2014-04-10 12:14:18 +03:00
unknown
584c2d0ae9 MDEV-6040: MariaDB hangs if terminated quickly after start
We need to use mysql_cond_broadcast() rather than _signal for
COND_thread_count, as there can be multiple waiters.

Thanks to Pavel Ivanov for reporting both the problem and the
solution.
2014-04-10 09:38:57 +02:00
unknown
2480b60bb7 MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication
The code did not correctly handle the update of position for Rotate events in the
binlog/relaylog when using parallel replication.
2014-04-09 14:42:46 +02:00
Olivier Bertrand
be1ee90b44 - Add the "skipcol" option to Pivot tables.
modified:
  storage/connect/ha_connect.cc
  storage/connect/tabpivot.cpp
  storage/connect/tabpivot.h
2014-04-08 18:18:02 +02:00
Olivier Bertrand
16893bc076 - Add index read previous capacity.
modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/xindex.cpp

- Optimize retrieving numeric values in scan_record. Was previously
  translating numeric values to character representation back and forth.
modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/xml.result

- Modify Pivot table creation to avoid reading the entire source table
  when making columns from Discovery. MDEV-6024
modified:
  storage/connect/tabpivot.cpp
2014-04-08 11:15:08 +02:00
andrew
97954225ae MDEV-5996 - fix odd behaviour of some combinations of table and database names 2014-04-07 22:16:02 +09:30
Sergey Petrunya
2bbca99018 MDEV-6041: ORDER BY+subqueries: subquery_table.key=outer_table.col is not recongized as binding
- Make JOIN::const_key_parts include keyparts for which 
  the WHERE clause has an equality in form 
  "t.key_part=reference_outside_this_select"
- This allows to avoid filesort'ing in some cases (and also 
  avoid a difficult choice between using filesort or using an index)
2014-04-07 13:49:48 +04:00