[MDEV-18982] Partition pruning with column list causes syntax error in 10.4 Created: 2019-03-20  Updated: 2019-04-05  Resolved: 2019-04-05

Status: Closed
Project: MariaDB Server
Component/s: Parser, Partitioning
Affects Version/s: 10.4
Fix Version/s: 10.4.4

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: regression

Issue Links:
Duplicate
is duplicated by MDEV-17827 INSERT .. PARTITION (partition_list) ... Closed

 Description   

--source include/have_partition.inc
create table t (a int) partition by hash(a);
insert into t partition (p0) (a) values (1);
select * from t;
drop table t;

10.4 09b2d37a

insert into t partition (p0) (a) values (1);
bug.t2                                   [ fail ]
        Test ended at 2019-03-20 19:44:18
 
CURRENT_TEST: bug.t2
mysqltest: At line 3: query 'insert into t partition (p0) (a) values (1)' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'a) values (1)' at line 1

In 10.3 it works all right.

Same for insert .. select instead of insert .. values:

--source include/have_partition.inc
create table t (a int) partition by hash(a);
insert into t partition (p0) (a) select 1;
select * from t;
drop table t;

mysqltest: At line 3: query 'insert into t partition (p0) (a) select 1' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'a) select 1' at line 1



 Comments   
Comment by Alexander Barkov [ 2019-03-21 ]

The syntax error happens because of the parser refactoring which added the LEFT_PAREN_ALT pseudo-token in addition to normal '('.
igor, can you please take over this bug?
Thanks.

Comment by Igor Babaev [ 2019-04-05 ]

A fix for this bug was pushed into 10.4

Generated at Thu Feb 08 08:48:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.