MySQL flags in dumps -


By looking at a MySQL dump, I've come to some and I know what they are.

I see:

  / * 50001 drop table if existing `xxx` * / /;  

What's the flag 50001, is there a list of what they mean?

This is discussed on MySQL forum / mailing lists.

  / *! 50001 drop table 'category_field_view' * /;  

This is MySQL's "feature", no other RDBMS will treat it as a comment.

But, looks at MySQL 50001 and checks it as a MySQL version. This version is 5.00.01, or 5.0.1 in the real world, but leaves the space for the sub-version and releases to be more than 9.

MySQL will treat the line as a comment if MySQL is below 5.0.1, and if MySQL is equal to 5.0.1 or greater than 5.0.1, then this line will be processed.

This is a way in which a SQL script is compatible with different versions of MySQL, and allows to include new features.


Comments