← Back to team overview

maria-developers team mailing list archive

Re: 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

 

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.

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx


Follow ups

References