Commit graph

65873 commits

Author SHA1 Message Date
Igor Babaev
cb1e44219b Adjusted test results. 2016-08-30 11:13:25 -07:00
Igor Babaev
501fc1a9e2 Returned the test case that was removed by mistake. 2016-08-29 22:58:01 -07:00
Igor Babaev
9ac235ab7d mdev-9864: cleanup, re-factoring.
Added comments.
Added reaction for exceeding maximum number of elements in with clause.
Added a test case to check this reaction.
Added a test case where the specification of a recursive table
uses two non-recursive with tables.
2016-08-29 22:45:17 -07:00
Igor Babaev
f33c35240d Adjusted test result. 2016-08-11 14:39:26 -07:00
Igor Babaev
2f9555c40f Removed the parameter from st_select_lex_unit::exec_recursive.
Moved checking whether the limit set for the number of iterations
when executing a recursive query has been reached from
st_select_lex_unit::exec_recursive to TABLE_LIST::fill_recursive.
Changed the name of the system variable max_recursion_level for
max_recursive_iterations.
Adjusted test cases.
2016-08-10 15:51:40 -07:00
Sergei Petrunia
a2f245e49f MDEV-10372: EXPLAIN fixes for recursive CTEs, including FORMAT=JSON
- Tabular EXPLAIN now prints "RECURSIVE UNION".
- There is a basic implementation of EXPLAIN FORMAT=JSON.
- it produces "recursive_union" JSON struct
- No other details or ANALYZE support, yet.
2016-08-08 23:02:52 +03:00
Igor Babaev
e1c92a6ca9 Fixed a problem with unreferenced CTE:
explain for the query containing WITH clause
with an unreferenced CTE caused a crash.
Added a test covered this case.

Also added a test for usage CTE in different parts of union.
2016-08-05 14:12:01 -07:00
Igor Babaev
247632e67e Fixed bug mdev-10344.
The patch for bug mdev-9937 actually did not fix the problem
of name resolution for tables used in views referred in queries
with WITH clauses. This fix corrects the patch.
2016-07-29 01:10:00 -07:00
Igor Babaev
f982d1074a Fixed the following problem:
Temporary tables created for recursive CTE
were instantiated at the prepare phase. As
a result these temporary tables missed
indexes for look-ups and optimizer could not
use them.
2016-07-26 22:58:33 -07:00
Igor Babaev
8c6a9aa30f Added a proper check for acceptable mutually recursive CTE. 2016-06-30 15:13:12 -07:00
Igor Babaev
22c37c1fcf Adjusted test results. 2016-06-29 15:20:24 -07:00
Igor Babaev
096286c95f The method With_element::reset_for_exec was not called in non-debug
builds.
2016-06-07 11:06:54 -07:00
Igor Babaev
0a6e6d705b Fixed numerous problems for mutually recursive CTE.
Actually mutually recursive CTE were not functional. Now the code
for mutually recursive CTE looks like functional, but still needs
re-writing.
Added many new test cases for mutually recursive CTE.
2016-06-06 10:01:16 -07:00
Galina Shalygina
6c6c3af6aa Merge branch '10.2' into 10.2-mdev9864 2016-05-25 00:34:13 +03:00
Galina Shalygina
c7c2f8d4a0 Merge branch '10.2' of github.com:MariaDB/server into 10.2 2016-05-25 00:29:13 +03:00
Galina Shalygina
b4f1f42062 Fixed the problem of wrong identification of WITH tables defined in WITH clauses without RECURSIVE.
Added test cases to check the fix.
Fixed the problem of wrong types of recursive tables when the type of anchor part does not coincide with the
type of recursive part.
Prevented usage of marerialization and subquery cache for subqueries with recursive references.
Introduced system variables 'max_recursion_level'.
Added a test case to test usage of this variable.
2016-05-24 21:29:52 +03:00
Alexander Barkov
c80c3f6759 MDEV-10109 Disallow syntactically INSERT .. SELECT .. {ORDER BY ..| LIMIT ..} .. UNION .. 2016-05-24 18:05:38 +04:00
Alexander Barkov
ea9a393a86 MDEV-10103 Disallow syntactically UNION SELECT .. PROCEDURE ANALYSE() 2016-05-24 14:18:46 +04:00
Alexander Barkov
9a25c01f78 MDEV-10102 Disallow CREATE VIEW .. PROCEDURE ANALYSE() syntactically 2016-05-23 16:25:51 +04:00
Alexander Barkov
4c0e2960d4 MDEV-10051 Fix subselect to return a syntax error instead of "Incorrect usage of UNION and LIMIT" 2016-05-23 10:54:09 +04:00
Alexander Barkov
a999acf26e MDEV-10095 Fix derived tables to return a syntax error instead of "Illegal usage of UNION and LIMIT" 2016-05-21 16:52:12 +04:00
Oleksandr Byelkin
485ece6da9 MDEV-8429: Change binlog_checksum default to match MySQL 5.6.6+ 2016-05-20 09:46:03 +02:00
Alexander Barkov
f6a7c1c75a MDEV-10080 Derived tables allow double LIMIT clause
1. Moving the "| get_select_lex_derived select_derived_init" part of
select_derived into a separate new rule derived_query_specification.
2. Using derived_query_specification directly in select_derived_union
rather than in select_derived.
3. Moving the sequence "opt_order_clause opt_limit_clause opt_select_lock_type"
from select_derived2 to select_derived_union,
after derived_query_specification.

Effectively, the parser now does not go through the sequence
"opt_order_clause opt_limit_clause ... opt_union_order_or_limit" any more.

This fixes the problem with double LIMIT clause and removes 2 shift/reduce
conflicts.
2016-05-20 09:21:07 +04:00
Galina Shalygina
0f7fe2a743 Changes in test files 2016-05-19 23:17:19 +03:00
Galina Shalygina
46a2e41398 Fixed many problems in the code of With_element::check_unrestricted_recursive().
Added the check whether there are set functions in the specifications of recursive CTE.
Added the check whether there are recursive references in subqueries.
Introduced boolean system variable 'standards_compliant_cte'. By default it's set to 'on'.
When it's set to 'off' non-standard compliant CTE can be executed.
2016-05-19 22:07:53 +03:00
Alexander Barkov
7e66a24dfb MDEV-10079 sql_yacc.yy: Remove non-parenthesized SELECT from table_ref 2016-05-17 13:41:39 +04:00
Igor Babaev
4a8d377171 Fixed bug mdev-10058.
This was a bug in the parser. As a result it could accept queries
with invalid derived tables if they used With clauses.
2016-05-16 20:19:04 -07:00
Galina Shalygina
3b47632bfc Fixed a bug that caused crashes for SHOW CREATE VIEW <view> when <view> was recursive. Added a test case to check the fix. 2016-05-14 23:33:50 +03:00
Galina Shalygina
d9b332bd20 Made prepared statement, explain and views working with recursuve CTE. 2016-05-12 23:23:12 +03:00
Galina Shalygina
d0e973a3b0 Fixed merge problems to allow mysql-test suite 'main' to pass 2016-05-10 22:32:02 +03:00
Alexander Barkov
612267301f MDEV-10036 sql_yacc.yy: Split select_part2 to disallow syntactically bad constructs with INTO, PROCEDURE, UNION
MDEV-10037 UNION with LIMIT ROWS EXAMINED does not require parentheses
2016-05-10 11:48:01 +04:00
Galina Shalygina
be1d06c8a5 Merge branch '10.2' into 10.2-mdev9864 2016-05-08 23:04:41 +03:00
Galina Shalygina
93845e1718 Initial commit for mdev-9864 containing only test files 2016-05-08 21:19:51 +03:00
Alexander Barkov
c0a59b46be MDEV-10030 sql_yacc.yy: Split table_expression and remove PROCEDURE from create_select, select_paren_derived, select_derived2, query_specification
This change refactors the "table_expression" rule in sql_yacc.yy.

Queries with subselects and derived tables, as well as "CREATE TABLE ... SELECT"
now return syntax error instead of "Incorrect usage of PROCEDURE and ...".
2016-05-06 11:42:48 +04:00
Sergey Vojtovich
7905ea8904 MDEV-6720 - enable connection log in mysqltest by default
This is an addition to original patch. Removed meaningless
"echo SET SESSION AUTOCOMMIT=0" (transaction is started explicitely on
master anyway).
2016-05-05 11:20:37 +04:00
Monty
5a7374d71b Fixed test cases that broke because we now print changing of connections
- Don't log connection creation in galera_connect.inc
2016-05-01 19:10:13 +03:00
Daniel Black
aed1485b99 MDEV-9758: correct test case 2016-04-29 18:41:00 +02:00
Daniel Black
51a66299f3 CHECKSUM TABLE to calculate in multiple column chunks
Checksum implementations contain optimizations for calculating
checksums of larger blocks of memory.

This optimization calls my_checksum on a larger block of memory
rather than calling on multiple adjacent memory as its going though
the table columns for each table row.
2016-04-29 18:41:00 +02:00
Vladislav Vaintroub
8b94aec11a Fix connect2 test, simulated errors do not work with thread cache 2016-04-28 22:25:11 +02:00
Monty
9c846373f0 Merge commit 'd5822a3ad0657040114cdc185c6387b9eb3a12b2' into 10.2 2016-04-28 16:59:33 +03:00
Monty
d5822a3ad0 Fixed some galera tests 2016-04-28 16:30:34 +03:00
Monty
48f02af761 MDEV-9602 crash in st_key::actual_rec_per_key when group by constant
Problem was that cost_group_min_max() could not handle if group by was optimized away.
2016-04-28 13:39:55 +03:00
Alexey Botchkov
47e0717806 MDEV-9792 Backport MDEV-8713 to 10.1. 2016-04-27 11:08:46 +04:00
Igor Babaev
3b6a64c247 Fixed bug mdev-9937.
When the specification of a WITH table referred to a view
that used a based table with the same name as the WITH table
the server went into an infinite loop because it erroneously
resolved the reference to the base table as the reference to
the WITH table.

With tables used in a view cannot be searched for beyond the
scope the view.
2016-04-20 10:55:53 -07:00
Sergei Petrunia
4b8e54bb98 MDEV-7885, MDEV-8857: Add testcases
The issues themselves were fixed as part of MDEV-8646
2016-04-17 13:25:05 -07:00
Sergei Petrunia
957809b190 MDEV-9922: Assertion `!join->only_const_tables() && fsort' failed
When join output is just one row, we still need to compute window
function values for it. We could skip invoking filesort for it,
but it doesn't seem to be worth it to do such optimization.
2016-04-16 20:41:06 +03:00
Sergei Petrunia
a81e711a06 MDEV-9925: Wrong result with aggregate function as a window function
Make Frame_range_current_row_bottom to take into account partition bounds.

Other partition bounds that could potentially hit the end of partition are
Frame_range_n_bottom, Frame_n_rows_following, Frame_unbounded_following,
and they all had end-of-partition protection.

To simplify the code, factored out end-of-partition checks into
class Partition_read_cursor.
2016-04-15 20:40:01 +03:00
Sergei Petrunia
d29e1472fb Make test result deterministic. 2016-04-15 17:48:40 +03:00
Igor Babaev
bc6df8d6e0 Merge branch 'bb-10.2-mdev9543' of github.com:MariaDB/server into bb-10.2-mdev9543 2016-04-14 01:08:54 -07:00
Igor Babaev
5ff4b21e02 Fixed bug mdev-9897.
This bug revealed a serious problem: if the same partition list
was used in two window specifications then the temporary table created
to calculate window functions contained fields for two identical
partitions. This problem was fixed as well.
2016-04-14 00:47:28 -07:00