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

drop partition + add partition 语法校验通过,执行失败 #628

Open
KaiNiao opened this issue Dec 13, 2023 · 2 comments
Open

drop partition + add partition 语法校验通过,执行失败 #628

KaiNiao opened this issue Dec 13, 2023 · 2 comments

Comments

@KaiNiao
Copy link

KaiNiao commented Dec 13, 2023

描述
一条SQL中先新增分区,后删除分区,语法校验通过,但是执行失败

重现
SQL:
alter table t_partition_drop add partition (partition p9 VALUES LESS THAN (10)), drop partition p3,p6;

语法校验结果:
[{'id': 1, 'stage': 'CHECKED', 'errlevel': 0, 'stagestatus': 'Audit Completed', 'errormessage': '', 'sql': 'USE cctest', 'affected_rows': 0, 'sequence': '0_0_00000000', 'backup_dbname': '', 'execute_time': '0', 'sqlsha1': '', 'backup_time': '0', 'actual_affected_rows': ''}, {'id': 2, 'stage': 'CHECKED', 'errlevel': 0, 'stagestatus': 'Audit Completed', 'errormessage': '', 'sql': 'alter table t_partition_drop add partition (partition p9 VALUES LESS THAN (10)), drop partition p3,p6', 'affected_rows': 0, 'sequence': '0_0_00000001', 'backup_dbname': '', 'execute_time': '0', 'sqlsha1': '', 'backup_time': '0', 'actual_affected_rows': ''}]

执行日志:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' drop partition p3,p6' at line 1

环境

  • 数据库: mysql
  • 版本: 5.7.24
  • inception
  • 版本:v1.3.0
@KaiNiao
Copy link
Author

KaiNiao commented Dec 13, 2023

原始表结构

CREATE TABLE t_partition_drop (
id int(11) NOT NULL,
p int(11) NOT NULL DEFAULT '0',
a int(11) DEFAULT '0',
PRIMARY KEY (id,p),
KEY idx_a (a)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
/*!50500 PARTITION BY RANGE COLUMNS(p)
(PARTITION p3 VALUES LESS THAN (4) ENGINE = InnoDB,
PARTITION p6 VALUES LESS THAN (7) ENGINE = InnoDB) */

@hanchuanchuan
Copy link
Owner

hanchuanchuan commented Dec 17, 2023

已发布v1.3.0-86,请升级后重试.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants