Commit graph

23 commits

Author SHA1 Message Date
Marko Mäkelä
d88c136b9f Merge 10.3 into 10.4 2018-10-17 19:11:42 +03:00
Igor Babaev
103b1df510 MDEV-17222 Reproducible server crash in String_list::append_str or
in Field_iterator_table::create_item

When IN predicate is converted to IN subquery we have to ensure that
any item from the select list of the subquery has some name and this name
is unique across the select list.
This was not guaranteed by the code before the patch for MDEV-17222.
If the name of an item of the select list was not set, and this happened
for binary constants, then the server crashed. If the first row in the IN
list contained the same constant in two different positions then the server
returned an error message.
This was fixed by providing all constants in the first row of the IN list
with generated names.
2018-10-14 15:29:08 -07:00
Oleksandr Byelkin
de745ecf29 MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operations 2018-07-04 19:13:55 +02:00
Alexander Barkov
f4dfc609cf MDEV-16388 Replace member Item::fixed to virtual method is_fixed() 2018-06-05 11:56:19 +04:00
Monty
30ebc3ee9e Add likely/unlikely to speed up execution
Added to:
- if (error)
- Lex
- sql_yacc.yy and sql_yacc_ora.yy
- In header files to alloc() calls
- Added thd argument to thd_net_is_killed()
2018-05-07 00:07:32 +03:00
Igor Babaev
6c5e60f1b1 MDEV-16038 Assertion `map->n_bits > 0' failed (my_bitmap.c:386: bitmap_is_clear_all)
Rows with no elements are not allowed in a table value constructor
unless it is used in an INSERT statement.
2018-04-26 16:38:56 -07:00
Galina Shalygina
9d97e6010e MDEV-14835 Server crashes in Field_iterator_table::create_item when number of
elements of BIGINT or YEAR type in the IN list reaches in_predicate_conversion_threshold

The bug appears at the prepare stage when IN-predicate with the long list
of values is converted into IN-subquery. It happens because values in the
right operand of the IN-predicate that have BIGINT or YEAR types are converted
into the Item_int_with_ref.
To fix it in the procedure Item_func_in::create_value_list_for_tvc
real_item() is taken for each value in the right operand of the IN-predicate.
2018-02-20 21:56:52 +02:00
Galina Shalygina
f1ff69cf76 Bug fix
Wrong conversion
2018-01-25 19:48:52 +02:00
Aleksey Midenkov
6e0b2c7fe0 System Versioning 1.0pre2
Merge branch '10.3' into trunk
2017-11-23 19:41:44 +03:00
Michael Widenius
87933d5261 Handle failures from malloc
Most "new" failures fixed in the following files:
- sql_select.cc
- item.cc
- item_func.cc
- opt_subselect.cc

Other things:
- Allocate udf_handler strings in mem_root
  - Required changes in sql_string.h
- Add mem_root as argument to some new [] calls
- Mark udf_handler strings as thread specific
- Removed some comment blocks with code
2017-11-17 07:30:05 +02:00
Aleksey Midenkov
7ebd12e779 SQL: VIEW of UNION [fixes #293] 2017-11-13 19:11:02 +03:00
Igor Babaev
2ba1616e5d Fixed mdev-14281 Wrong result from query with NOT IN predicate in WHERE
Conversion of NOT IN predicates into NOT IN subqueries did not work
correctly: the predicates actually were converted into IN subqueries.
As a result if the conversion was applied for the query with
a NOT IN predicate the query could return a wrong result set.
2017-11-05 11:59:19 -08:00
Marko Mäkelä
72817cafe2 Remove a type cast 2017-11-02 12:07:44 +02:00
Monty
0750b5f825 Fixed compilation failures
- Also added missing copyright notices
2017-11-02 11:06:02 +02:00
Igor Babaev
6f1b6061d8 Merge remote-tracking branch 'shagalla/10.3-mdev12172' into 10.3
As a result of this merge the code for the following tasks appears in 10.3:
- MDEV-12172 Implement tables specified by table value constructors
- MDEV-12176 Transform [NOT] IN predicate with long list of values INTO
             [NOT] IN subquery.
2017-11-01 21:42:26 -07:00
Galina Shalygina
a4ded0a9b5 Mistakes corrected.
TVC can be used in IN subquery and in PARTITION BY struct now.
Special variable to control working of optimization added.
2017-10-28 20:54:18 +02:00
Galina Shalygina
75370a58f4 New tests on errors added. Comments corrected. Some procedures corrected. 2017-09-04 22:29:58 +02:00
Galina Shalygina
6bce8e1422 Post review changes for the optimization of IN predicates into IN subqueries. 2017-09-02 23:19:20 +02:00
Galina Shalygina
e701770749 Memory allocation corrected. New tests added. 2017-09-01 19:01:06 +02:00
Galina Shalygina
a5a01dbb08 Mistakes corrected. Now all tests in opt_tvc.test file work correctly 2017-08-29 21:03:15 +02:00
Galina Shalygina
91149bbd82 Mistakes corrected, new error messages added 2017-08-29 16:58:32 +02:00
Galina Shalygina
570d2e7d0f Summarized results of two previous commits (26 July, 25 August) 2017-08-29 02:32:39 +02:00
Galina Shalygina
615da8f70b New structure Table Value Constructor added in grammar.
TVC can be used in UNION-statement, in view and in subquery.

Files where TVC is defined and its methods are stored added.
Methods exec and prepare for TVC added.
Tests for TVC added.
2017-06-29 15:36:07 +03:00