转储中的 MySQL 标志 [英] MySQL flags in dumps

查看:52
本文介绍了转储中的 MySQL 标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在查看 mySQL Dump 时,我遇到了一些事情并且想知道它们是什么.

我明白了:

/*!50001 DROP TABLE IF EXISTS `xxx` */;

标志 50001 是什么,有没有列出它们的含义?

解决方案

它在 MySQL 的论坛/邮件列表中讨论 此处.

<块引用>

/*!50001 DROP TABLE `category_count_view`*/;

这是 MySQL 的一个特性".任何其他 RDBMS 都会将此视为评论.

但是,MySQL 查看 50001 并将其检查为 MySQL 版本.这是版本 5.00.01,或现实世界中的 5.0.1,但为子版本和版本大于9.

如果 MySQL 低于 5.0.1,MySQL 会将该行视为注释,并且如果 MySQL 大于或等于 5.0.1,将处理该行.

这是一种使 SQL 脚本兼容不同版本的方法MySQL,并允许包含新功能.

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?

解决方案

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.

这篇关于转储中的 MySQL 标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆