Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL parser: "ALTER TABLE ADD/DROP/REORGANIZE PARTITION" error #329

Closed
DynamicLoader opened this issue Feb 14, 2021 · 5 comments · Fixed by #381
Closed

SQL parser: "ALTER TABLE ADD/DROP/REORGANIZE PARTITION" error #329

DynamicLoader opened this issue Feb 14, 2021 · 5 comments · Fixed by #381
Assignees
Labels
Milestone

Comments

@DynamicLoader
Copy link

Describe the bug

According to MySQL Reference Manual - 13.1.8.1 ALTER TABLE Partition Operations,we can use

ALTER TABLE t1 ADD PARTITION (PARTITION p3 VALUES LESS THAN (2002));
ALTER TABLE t1 DROP PARTITION p0, p1;

and so on to change partition.
But when I copy these statements to the SQL console (including the console in the bottom and SQL on the top),it reminds me:

1.This option conflicts with "ADD". (near "PARTITION" at position 19)
2.Missing comma before start of a new alter operation. (near "PARTITION" at position 30)

But when I go these statements,it worked(I have create table like the example in the MySQL document).

It seems that the SQL parser in phpMyAdmin doesn't parse these statements properly.

To Reproduce

Steps to reproduce the behavior:

  1. Create a table in a database like what are in MySQL Document (link is above)
CREATE TABLE t1 (
    id INT,
    year_col INT
)
PARTITION BY RANGE (year_col) (
    PARTITION p0 VALUES LESS THAN (1991),
    PARTITION p1 VALUES LESS THAN (1995),
    PARTITION p2 VALUES LESS THAN (1999)
);
  1. Input these statements in console:
ALTER TABLE t1 ADD PARTITION (PARTITION p3 VALUES LESS THAN (2002));
ALTER TABLE t1 DROP PARTITION p0, p1;
  1. You will find it underlined some words (like "partition").
  2. Press Ctrl+Enter to excute,and you will find it queried ok.

Expected behavior

phpMyAdmin parse the ALTER TABLE Partition Operations in MySQL Document properly.

Screenshots

ScreenShot1

Server configuration

  • Operating system: Ubuntu Server 20.04
  • Web server: Nginx 1.18.0
  • Database version: Mariadb 10.3.25
  • PHP version: 7.4.3
  • phpMyAdmin version: 5.0.4

Client configuration

  • Browser: Chrome 81
  • Operating system: Windows 7

Thanks.

@williamdes williamdes transferred this issue from phpmyadmin/phpmyadmin Feb 14, 2021
@williamdes williamdes added the bug label Feb 14, 2021
@williamdes williamdes added this to the 4.7.3 milestone Feb 14, 2021
@williamdes
Copy link
Member

Hi @Lucy2003
I moved this one here, thank you for the detailed report

@williamdes williamdes modified the milestones: 4.7.3, 4.7.4 Dec 11, 2021
@DynamicLoader
Copy link
Author

One year has passed and no any updates to the milestone 4.7.4 issues.Should I colse this?

@williamdes
Copy link
Member

williamdes commented Apr 4, 2022

One year has passed and no any updates to the milestone 4.7.4 issues.Should I colse this?

Hi
I am sorry this is still not fixed
We welcome contributions to this library
@iifawzi if you are interested by this one when you have time let us know :)

PS: do not close this issue please

@iifawzi
Copy link
Contributor

iifawzi commented Apr 4, 2022

Added to my to-do list. I will make sure to fix this asap.

@DynamicLoader
Copy link
Author

It is so kind of you.Thank you.

@williamdes williamdes linked a pull request Jul 22, 2022 that will close this issue
@williamdes williamdes self-assigned this Jul 22, 2022
@williamdes williamdes modified the milestones: 4.7.4, 5.6.0 Jul 22, 2022
williamdes added a commit that referenced this issue Jul 22, 2022
Pull-request: #381

Signed-off-by: William Desportes <williamdes@wdes.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants