Looking at a mySQL Dump, I have come across something and like to know what they are.
I see:
/*!50001 DROP TABLE IF EXISTS `xxx` */;
What is the flag 50001, is there a list of what they mean?
Mysqldump is a command-line utility that is used to generate the logical backup of the MySQL database. It produces the SQL Statements that can be used to recreate the database objects and data. The command can also be used to generate the output in the XML, delimited text, or CSV format.
To dump large tables, you could combine the following two flags, --single-transaction and --quick .
4 mysqldump — A Database Backup Program. The mysqldump client utility performs logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It dumps one or more MySQL databases for backup or transfer to another SQL server.
It is discussed on the MySQL's forums/mailing lists here.
/*!50001 DROP TABLE `category_count_view`*/;
This is a "feature" of MySQL. Any other RDBMS will treat this as a comment.
But, MySQL looks at 50001 and checks that as a MySQL version. This is Version 5.00.01, or 5.0.1 in the real world, but leaves room for the the sub-version and release to be greater than 9.
MySQL will treat the line as a comment if MySQL is below 5.0.1, and will process the line if MySQL is greater than or equal to 5.0.1.
It's a way making a SQL script compatible with different versions of MySQL, and allows new features to be included.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With