Commit graph

35 commits

Author SHA1 Message Date
Oleksandr Byelkin
3d27f6d7f4 Merge branch '10.3' into 10.4 2023-04-21 09:10:58 +02:00
Alexander Barkov
895673dae5 MDEV-30151 parse error 1=2 not between/in
This patch fixes the problem by adding a new rule booleat_test.
This makes the grammar clearer and less conflicting.

Additionally, fixing %prec in this grammar branch:

-        | boolean_test IS NULL_SYM %prec PREC_BELOW_NOT
+        | boolean_test IS NULL_SYM %prec IS

to have consistently "%prec IS" in all grammar branches starting
with "boolean_test IS ...".
It's not clear why these three rules needed different %prec before the fix:

- boolean_test IS TRUE
- boolean_test IS UNKNOWN
- boolean_test IS NULL
2023-01-26 10:58:12 +04:00
Alexander Barkov
b1043ea0ed Revert "MDEV-30151 parse error 1=2 not between/in"
This reverts commit eba099184e.

A different patch with less shift-reduce conflicts is coming.
2023-01-26 10:57:01 +04:00
Marko Mäkelä
fb0808c450 Merge 10.3 into 10.4 2023-01-03 16:10:02 +02:00
Sergei Golubchik
eba099184e MDEV-30151 parse error 1=2 not between/in
the parser couldn't parse `1=2 not between 3 and 5`
after `2` it expected only NOT2_SYM, but not NOT_SYM
(visible from the sql_yacc.output file), which resulted in
Syntax error ... near 'not between 3 and 4'

The parser was confused by a rather low NOT_SYM precedence and
%prec BETWEEN_SYM didn't resolve this confusion.

As a fix, let's remove any %precedence from NOT_SYM and
specify %prec explicitly in the only place where it matters for NOT_SYM.

In other places, such as for NOT BETWEEN, NOT_SYM won't have a
precedence, so bison won't be confused about it.
2023-01-02 00:04:03 +01:00
Lena Startseva
184e65954b MDEV-27691: make working view-protocol
Update tests for version 10.4
2022-09-23 19:47:30 +07:00
Lena Startseva
78dcf71e88 Merge branch 'bb-10.3-all-builders' into bb-10.4-all-builders 2022-09-23 19:47:13 +07:00
Lena Startseva
72ba96a48e MDEV-27691: make working view-protocol
Tests with checking metadata or that cannot be run with
the view-protocol are excluded from --view-protocol.
For tests that do not allow the use of an additional connection,
the util connection is disabled with "--disable_service_connection".
Also cases with bugs for --view-protocol are disabled.
2022-09-23 17:36:20 +07:00
Sergei Golubchik
a70a1cf3f4 Merge branch '10.3' into 10.4 2022-05-08 23:03:08 +02:00
Oleksandr Byelkin
9614fde1aa Merge branch '10.2' into 10.3 2022-05-03 10:59:54 +02:00
Marko Mäkelä
4da2273876 Merge 10.3 into 10.4 2021-11-29 10:59:22 +02:00
Marko Mäkelä
289721de9a Merge 10.2 into 10.3 2021-11-29 10:33:06 +02:00
Marko Mäkelä
3467f63764 Merge 10.3 into 10.4 2021-01-25 11:02:07 +02:00
Dmitry Shulga
f130adbf35 MDEV-23666: Assertion `m_cpp_buf <= ptr && ptr <= m_cpp_buf + m_buf_length' failed in Lex_input_stream::body_utf8_append
On parsing statements for which a starting backtick (`) delimiter doesn't have
a corresponding ending backtick, a current pointer to a position inside a
pre-processed buffer could go beyond the end of the buffer.

This bug report caused by the commit d496765903
  "MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds".

In order to fix the issue both pointers m_ptr and m_cpp_ptr must be
rolled back to previous position in raw input and pre-processed input streams
correspondingly in case end of query reached during parsing.
2021-01-14 14:31:20 +07:00
Marko Mäkelä
7b2bb67113 Merge 10.3 into 10.4 2020-10-29 13:38:38 +02:00
Marko Mäkelä
a8de8f261d Merge 10.2 into 10.3 2020-10-28 10:01:50 +02:00
Oleksandr Byelkin
0f080dd60a MDEV-23094: Multiple calls to a Stored Procedure from another Stored Procedure crashes server
Added system-SELECT to IF/WHILE/REPET/FOR for correct subqueries connecting.

Added control of system/usual selects for correct error detection.
2020-08-31 14:40:34 +02:00
Marko Mäkelä
eae968f62d Merge 10.3 into 10.4 2020-08-10 21:08:46 +03:00
Alexander Barkov
d496765903 MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
Lex_input_stream::scan_ident_delimited() could go beyond the end
of the input when a starting backtick (`) delimiter did not have a
corresponding ending backtick.

Fix: catch the case when yyGet() returns 0, which means
either eof-of-query or straight 0x00 byte inside backticks,
and make the parser fail on syntax error, displaying the left
backtick as the syntax error place.

In case of filename in a script like this:

SET CHARACTER_SET_CLIENT=17; -- 17 is 'filename'
SELECT doc.`Children`.0 FROM t1;

the ending backtick was not recognized as such because my_charlen() returns 0 for
a straight backtick (backticks must normally be encoded as @0060 in filename).

The same fix works for 'filename': the execution skips the backtick
and reaches the end of the query, then yyGet() returns 0.
This fix is OK for now. But eventually 'filename' should either be disallowed
as a parser character set, or fixed to handle encoded punctuation properly.
2020-08-04 09:49:44 +04:00
Oleksandr Byelkin
c6eb21cd87 MDEV-21998: Server crashes in st_select_lex::add_table_to_list upon mix of KILL and sequences
Continue support the hack of current select equal builtin select if
selects stack is empty even after subselects.
2020-07-28 08:23:57 +02:00
Oleksandr Byelkin
ddb8309e8c MDEV-21997 Server crashes in LEX::create_item_ident_sp upon use of unknown identifier
If there is no current_select and variable is not found among SP variables it can be only an error.
2020-07-22 15:03:22 +02:00
Marko Mäkelä
9936cfd531 Merge 10.3 into 10.4 2020-07-15 10:17:15 +03:00
Marko Mäkelä
8a0944080c Merge 10.2 into 10.3 2020-07-14 22:59:19 +03:00
Oleksandr Byelkin
a17a327f11 MDEV-21684: mysqld crash with signal 11 when renaming table+max_statement_time
Main select should be pushed first in case of SET STATEMENT.
2020-02-26 13:58:08 +01:00
Oleksandr Byelkin
c1eaa385ff MDEV-21616: Server crash when using "SET STATEMENT max_statement_time=0 FOR desc xxx" lead to collapse
Main select should be pushed first.
2020-02-05 13:37:12 +01:00
Igor Babaev
b44171428a MDEV-19956 Queries with subqueries containing UNION are not parsed
Shift-Reduce conflicts prevented parsing some queries with subqueries that
used set operations when the subqueries occurred in expressions or in IN
predicands.
The grammar rules for query expression were transformed in order to avoid
these conflicts. New grammar rules employ an idea taken from MySQL 8.0.
2019-09-23 09:57:37 -07:00
Oleksandr Byelkin
bccd9d0e3a MDEV-20108: [ERROR] mysqld got signal 11 in st_select_lex::add_table_to_list
Use the same select as for usual table list.
2019-07-24 13:20:36 +02:00
Oleksandr Byelkin
1921df6697 MDEV-19540: 10.4 allow lock options with SELECT in brackets which previous version do not
Check locking options and brackets combinations.
2019-05-21 16:10:03 +02:00
Marko Mäkelä
dde2ca4aa1 Merge 10.3 into 10.4 2018-11-19 20:22:33 +02:00
Alexander Barkov
c29c39a7dc MDEV-17693 Shift/reduce conflicts for NAMES,ROLE,PASSWORD in the option_value_no_option_type grammar 2018-11-13 09:54:21 +04:00
Marko Mäkelä
c761b43451 Merge 10.3 into 10.4 2018-11-08 10:19:55 +02:00
Oleksandr Byelkin
54b2e1c1be MDEV-16697: Fix difference between 32bit/windows and 64bit systems in allowed select nest level 2018-11-07 09:43:12 +01:00
Oleksandr Byelkin
de745ecf29 MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operations 2018-07-04 19:13:55 +02:00
Alexander Barkov
10d44db5d4 MDEV-16202 Latest changes made erroneously some keywords reserved in sql_mode=ORACLE 2018-05-17 16:01:20 +04:00
Michael Widenius
a7abddeffa Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +03:00
Renamed from mysql-test/t/parser.test (Browse further)