Commit graph

29137 commits

Author SHA1 Message Date
Alexander Barkov
a33bb00144 MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32 2013-11-08 14:18:16 +04:00
unknown
5ce11d8b4c MariaDB made be compiled by gcc 4.8.1
There was 2 problems:
  1) coping/moving of the same type (usually casting) as sizeof() (solved in different ways depends on the cause);
  2) using 'const' in SSL_CTX::getVerifyCallback() which return object (not reference) and so copy of the object will be created and 'const' has no sens.
2013-10-29 17:50:13 +02:00
timour@askmonty.org
883af99e7d MDEV-5104 crash in Item_field::used_tables with broken order by
Analysis:
st_select_lex_unit::prepare() computes can_skip_order_by as TRUE.
As a result join->prepare() gets called with order == NULL, and
doesn't do name resolution for the inner ORDER clause. Due to this
the prepare phase doesn't detect that the query references non-exiting
function and field.
  
Later join->optimize() calls update_used_tables() for a non-resolved
Item_field, which understandably has no Field object. This call results
in a crash.

Solution:
Resolve unnecessary ORDER BY clauses to detect if they reference non-exising
objects. Then remove such clauses from the JOIN object.
2013-10-29 12:39:03 +02:00
unknown
94ad392fd8 MDEV-5143: update of a joined table with a nested subquery with a syntax error crashes mysqld with signal 11
Added check of SELECT_LEX::handle_derived() result.
2013-10-21 13:45:49 +03:00
Alexander Barkov
046fe91161 Merge 5.2 -> 5.3 2013-10-21 13:36:29 +04:00
Alexander Barkov
c63b72c968 Merge 5.1 -> 5.2 2013-10-21 13:35:43 +04:00
Alexander Barkov
11d141004a A clean-up for DEV-4890 Valgrind warnings on shutdown on a build with openSSL 2013-10-21 13:34:18 +04:00
Alexander Barkov
2b60ad3637 Merge 5.1->5.2 2013-10-16 17:58:15 +04:00
Alexander Barkov
049000101a Merge 5.1 -> 5.3 2013-10-16 17:48:31 +04:00
Alexander Barkov
de4ca539b8 MDEV-4890 Valgrind warnings on shutdown on a build with openSSL 2013-10-16 17:37:11 +04:00
unknown
3cc3bcfcc5 MDEV-5107:Left Join Yields All Nulls Instead of Appropriate Matches
MDEV-5034:Wrong result on LEFT JOIN with a SELECT SQ or a merge view, UNION in IN subquery

Make reset null_row same as it was set in evaluate_null_complemented_join_record().

The problem was that view firlds detect null_row by not-yet-reset table.
2013-10-11 15:57:19 +03:00
Igor Babaev
81623bdc35 Fixed bug mdev-5135.
The patch for bug mdev-5105 incorrectly counted conditions in nested joins.
2013-10-14 10:29:24 -07:00
Igor Babaev
78b580b779 Fixed bug mdev-5132.
Objects of the classes Item_func_isnull and Item_func_isnotnull
must have the flag sargable set to TRUE.
Set the value of the flag sargable only in constructors of the 
classes inherited from Item_int_func.
2013-10-11 23:24:57 -07:00
Igor Babaev
092a238864 Fixed a problem of the patch for mdev-5105 that caused valgrind complains. 2013-10-11 12:50:30 -07:00
Igor Babaev
7c87385e30 Fixed bug mdev-5105.
The bug caused a memory overwrite in the function update_ref_and_keys()
It happened due to a wrong value of SELECT_LEX::cond_count. This value
historically was calculated by the fix_fields method. Now the logic of
calling this method became too complicated and, as a result, this value
is calculated not always correctly.
The patch changes the way how and when  the values of SELECT_LEX::cond_count
and of SELECT_LEX::between_count are calculated. The new code does it just at
the beginning of update_ref_and_keys().
2013-10-10 10:08:26 -07:00
Igor Babaev
ec226e553a Fixed bug mdev-5078.
For aggregated fields from views/derived tables the possible adjustment
of thd->lex->in_sum_func->max_arg_level in the function Item_field::fix_fields
must be done before we leave the function.
2013-10-04 09:51:07 -07:00
Igor Babaev
00816a964f Fixed bug mdev-5028.
Apparently in a general case a short-cut for the distinct optimization
is invalid if join buffers are used to join tables after the tables whose
values are to selected.
2013-10-02 17:59:56 -07:00
unknown
ec7da1561e MDEV-5039: incorrect Item_func_regex::update_used_tables()
Other fix of maybe_null problem and revert of revno: 3608 "MDEV-3873 & MDEV-3876 & MDEV-3912 : Wrong result (extra rows) with ALL subquery from a MERGE view."
2013-09-25 15:30:13 +03:00
Alexander Barkov
5d7b97b89e MDEV-4843 Wrong data type for TIMESTAMP('2001-01-01','10:10:10') 2013-09-16 10:14:41 +04:00
Igor Babaev
996f6194c6 Fixed bug mdev-5015.
The patch for mdev-4355 had a defect: the cached values for bitmaps of
used tables were not updated when processing degenerate OR formulas.
2013-09-15 12:38:22 -07:00
Alexander Barkov
cf9cc19e91 MDEV-4724 Some temporal functions do not preserve microseconds 2013-09-13 14:43:10 +04:00
unknown
1a01e3b959 MDEV-5005: Subquery in Procedure somehow affecting temporary table
Removed unneeded set of TABLE_LIST::skip_temporary flag.
2013-09-12 17:05:29 +03:00
Sergey Petrunya
7e4845beea MDEV-5011: ERROR Plugin 'MEMORY' has ref_count=1 after shutdown for SJM queries
- Provide a special execution path for cleanup of degenerate 
  non-merged semi-join children of degenerate selects.
2013-09-12 13:53:13 +04:00
Alexander Barkov
c2b38529a9 MDEV-4863 COALESCE(time_or_datetime) returns wrong results in numeric context 2013-09-09 15:32:25 +04:00
Igor Babaev
02338228dd Fixed bug mdev-4996.
The fix for bug mdev-4971 not always correctly set the pointers to
inherited multiple equalities in objects of the Item_equal class.
2013-09-06 09:55:32 -07:00
Igor Babaev
576a2b1533 Fixed bug mdev-4971.
The function propagate_new_equalities() did not updated properly
the references to inherited multiple equalities.
2013-08-29 21:02:42 -07:00
Igor Babaev
37f18d2318 Fixed bug mdev-4962.
When a non-nullable datetime field is used under an IS NULL predicate
of the WHERE condition in a query with outer joins the remove_eq_conds
function should check whether this field belongs to an inner table
of any outer join that can be, in a general case, a nested outer join.
2013-08-29 10:56:12 -07:00
Igor Babaev
650d3266bb Fixed bug mdev-4952
When in function remove_eq_conds() a sub-formula of the processed condition
is replaced for another formula we should ensure that in the resulting
formula AND/OR levels must alternate.
2013-08-26 15:51:47 -07:00
Igor Babaev
901737c978 Fixed bug mdev-4944.
The patch to fix mdev-4418 turned out to be incorrect.
At the substitution of single row tables in make_join_statistics()
the used multiple equalities may change and references to the new multiple
equalities must be updated. The function remove_eq_conds() takes care of it and
it should be called right after the substitution of single row tables.
Calling it after the call of make_join_statistics was a mistake.
2013-08-26 12:55:58 -07:00
Igor Babaev
dbc84ff96c Fixed bug mdev-4942.
Made sure that degenerate conjunctions/disjunctions are obtained from
AND/OR conditions.
2013-08-23 22:17:02 -07:00
Alexander Barkov
c40de1df36 MDEV-4804 Date comparing false result 2013-08-22 15:20:27 +04:00
unknown
f8af4423b4 MDEV-4908: Assertion `((Item_cond *) cond)->functype() == ((Item_cond *) new_item)->functype()' fails on a query with IN and equal conditions, AND/OR, materialization+semijoin
A new AND Item should be prepared (fix_field() call) before using.
2013-08-21 17:42:09 +03:00
Igor Babaev
99992f6ec4 Fixed a bug/typo in the patch for mdev-4355, noticed after the patch
had been merged into 5.5.

Corrected the result of the output from the test case for mdev 4895.
2013-08-20 13:47:13 -07:00
unknown
5fdb531d77 Fix bug MDEV-4895 Valgrind warnings (Conditional jump or move depends on uninitialised value) in Field_datetime::get_date on GREATEST(..) IS NULL
Analysis:
The cause of the valgrind warning was an attempt to evaluate a Field that was not yet read.
The reason was that on one hand Item_func_isnotnull was marked as constant by
Item_func_isnotnull::update_used_tables, and this allowed eval_const_cond() to be called.
On the other hand Item_func_isnotnull::val_int() evaluated its argument as if it was not
constant.

Solution:
The fix make sure that Item_func_isnotnull::val_int() doesn't evaluate its argument when
it is constant and cannot be NULL, because the result is known in this case.
2013-08-20 17:08:03 +03:00
Igor Babaev
008371b627 Backported from maria-5.5 the fix in the patch for mdev-4418 that
had been discovered when merging the patch from 5.3 into 5.5.
2013-08-19 14:24:48 -07:00
Igor Babaev
25c152018d Fixed bug mdev-4418.
After single row substitutions there might appear new equalities.
They should be properly propagated to all AND/OR levels the WHERE
condition. It's done now with an additional call of remove_eq_conds().
2013-08-16 22:01:47 -07:00
Igor Babaev
752d5d022d Merge 2013-08-15 16:59:20 -07:00
Igor Babaev
fa7f677218 Fixed bug mdev-4355.
This patch almost totally revised the patch for bug mdev-4177.
The latter had too many defects. In particular, it did not
propagate multiple equalities formed when merging a degenerate
disjunct into underlying AND formula.
2013-08-15 14:16:16 -07:00
Igor Babaev
960720b10d Merge 5.2->5.3 2013-08-15 14:04:20 -07:00
Igor Babaev
7ba78277b4 Merge 5.1->5.2 2013-08-14 20:37:38 -07:00
Igor Babaev
6dd9f049ab Fixed bug mdev-4894.
This a an old legacy performance bug.
When a very selective range scan existed for the second table in a join,
and, at the same time, there was another range condition depending on the
fields of the first table, the optimizer chose a plan with
'Range checked for each record'. This plan was extremely inefficient in
comparison with the regular selective range scan.
As a matter of fact the range scan chosen for each record was the same as
that selective range scan. 

Changed the test case for bug 24776 to preserve the old output for explain.
2013-08-13 15:21:11 -07:00
Alexander Barkov
f1b4718ec8 MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')) 2013-08-12 16:47:59 +04:00
Alexander Barkov
e9db0da787 MDEV-4653 Wrong result for CONVERT_TZ(TIME('00:00:00'),'+00:00','+7:5') 2013-08-08 12:58:28 +04:00
Alexander Barkov
e6a6f653a9 MDEV-4512 Valgrind warnings in my_long10_to_str_8bit on INTERVAL and DATE_ADD with incorrect types
Fixing a typo:  bit AND (&) was erroneously used instead of logical AND (&&)
2013-08-08 11:36:03 +04:00
unknown
edcae48734 MDEV-4823: Server crashes in Item_func_not::fix_fields on creating a table with a virtual column using NOT
fix_field() call protocol was brocken (zero pointer passed as link to item which is possible only if you are sure that there can not be Items which transforms).
2013-08-01 09:25:50 +03:00
Alexey Botchkov
9b67de4797 MDEV-4478 check mysql-5.5 changes in spatial.cc.
not_enough_points() introduced to check if the spatial object is incorrect.
2013-07-22 00:55:06 +05:00
Alexander Barkov
8a732d5a5e Merge from 5.2
modified:
  mysql-test/suite/plugins/r/fulltext_plugin.result
  mysql-test/suite/plugins/t/fulltext_plugin.test
  plugin/fulltext/plugin_example.c
  sql/sql_show.cc
pending merges:
  Alexander Barkov 2013-07-09 [merge] Merge from 5.1
    Sergei Golubchik 2013-07-06 Bug #69682 - mysqld crashes after uninst...
    Sergei Golubchik 2013-05-24 MDEV-4575 MySQL client doesn't strip off...
2013-07-09 11:02:56 +04:00
Alexander Barkov
762d3cb8ed Merge from 5.1
modified:
  mysql-test/suite/plugins/r/fulltext_plugin.result
  mysql-test/suite/plugins/t/fulltext_plugin.test
  plugin/fulltext/plugin_example.c
  sql/sql_show.cc
pending merges:
  Sergei Golubchik 2013-07-06 Bug #69682 - mysqld crashes after uninstall ...
    Sergei Golubchik 2013-05-24 MDEV-4575 MySQL client doesn't strip off...
2013-07-09 10:54:47 +04:00
Sergei Golubchik
48b403cd65 Bug #69682 - mysqld crashes after uninstall of plugin with "first" status var 2013-07-06 15:28:11 +02:00
Sergei Golubchik
58fa29e0ff MDEV-4610 SQL query crashes MariaDB with derived_with_keys
MDEV-4643 MariaDB crashes consistently when trying a SELECT on VIEW with a UNION and an additional JOIN in SELECT

open derived temp tables *before* trying QUICK_SELECT for them,
handler::multi_range_read_info() needs an open table.
2013-07-05 20:45:42 +02:00