![](https://secure.gravatar.com/avatar/8fa4efb81153950d325fbc3930a3d4fd.jpg?s=120&d=mm&r=g)
Hi Sergei!
On Sat, Sep 4, 2021 at 3:34 PM Sergei Golubchik
Hi, Aleksey!
On Aug 26, Sergei Golubchik wrote:
ALTER ... MOVE TABLE table_name TO PARTITION (...) ALTER ... MOVE PARTITION ... TO TABLE table_name
There is no MOVE symbol and we should not add a new one because of the same compatibility reason: it will not be possible to create table "move" (as well as to work with existing one I suspect).
So, yes, I totally agree that it's best to avoid adding new keywords to the grammar.
That's why we found MIGRATE as a good candidate And the reasons to have some special keyword, not just "ADD PARTITION ... FROM ..." are:
If it's my suggested synax from above, but with MIGRATE, it becomes
ALTER TABLE ... MIGRATE TABLE tbl_name TO PARTITION (partition definition) ALTER TABLE ... MIGRATE PARTITION part_name TO TABLE tbl_name
so very symmetrical.
"MIGRATE" is still a bit awkward here, because "migrate" is historically an intransitive verb, it isn't normally used like that.
I went over all keywords in lex.h again and I think this one works quite well:
ALTER TABLE ... CONVERT TABLE tbl_name TO PARTITION (partition definition) ALTER TABLE ... CONVERT PARTITION part_name TO TABLE tbl_name
I also think it conveys the meaning better.
Yes, CONVERT looks more natural. Updated the code.
Regards, Sergei VP of MariaDB Server Engineering and security@mariadb.org
-- All the best, Aleksey Midenkov @midenok