Bug #102883 select for update union all syntax error
Submitted: 9 Mar 12:40 Modified: 9 Mar 13:38
Reporter: andy zhang Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: select for update

[9 Mar 12:40] andy zhang
Description:
There is SQL incompatibility issue of 8.0 v.s. 5.7. Here is the sample:

create table t1(c1 int);
create table t2(c1 int);

Following sql is supported by 5.7 while a syntax error is reported on 8.0.

select * from t1 for update union all select * from t2 for update;

From our reference manual of 8.0, there is no claim to that. So, is it as expected or 8.0 parser has a bug?

How to repeat:
create table t1(c1 int);
create table t2(c1 int);

select * from t1 for update union all select * from t2 for update;
[9 Mar 13:38] MySQL Verification Team
Hello andy zhang,

Thank you for the report and test case.
Imho this is duplicate of Bug #99561, please see Bug #99561. 

regards,
Umesh