MySQL Forums
Forum List  »  Newbie

Re: mysqldump - View created even though commented (/*!50001 CREATE...)
Posted by: Barry Galbraith
Date: August 17, 2011 08:55PM

>/*!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.

See the refman for comment syntax
http://dev.mysql.com/doc/refman/5.5/en/comments.html

I take from your fragment, that VIEW support began at V5.0.1, and the DEFINER clause of VIEW is supported from V5.0.13

Good luck,
Barry.



Edited 1 time(s). Last edit at 08/17/2011 09:11PM by Barry Galbraith.

Options: ReplyQuote


Subject
Written By
Posted
Re: mysqldump - View created even though commented (/*!50001 CREATE...)
August 17, 2011 08:55PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.