MySQL Variables sql_auto_is_null 数据库 参数变量解释及正确配置使用
  iDU31ygkXmx7 2023年11月20日 23 0

本站中文解释

sql_auto_is_null 是MySQL中的一个用于开启或关闭空值检测的参数。当参数值为1时,空值检测被开启,当为0时,空值检测被关闭。此参数的设定值是全局的,可以控制SQL语句中对空值的检测是否被系统执行,设定值可在MySQL的配置文件中做出变更,修改例子如下:

sql_auto_is_null=0

这将会关闭空值检测,也就是消除对NULL值的检测动作,同时设置需要重启MySQL服务来使设定生效,例如:

sudo service mysql restart

官方英文解释

sql_auto_is_null

System Variable sql_auto_is_null
Scope Global, Session
Dynamic Yes
Type Boolean
Default Value OFF

If this variable is enabled, then after a statement that
successfully inserts an automatically generated
AUTO_INCREMENT value, you can find that
value by issuing a statement of the following form:

SELECT * FROM tbl_name WHERE auto_col IS NULL

If the statement returns a row, the value returned is the same
as if you invoked the
LAST_INSERT_ID() function. For
details, including the return value after a multiple-row
insert, see Section 12.16, “Information Functions”. If no
AUTO_INCREMENT value was successfully
inserted, the SELECT statement
returns no row.

The behavior of retrieving an
AUTO_INCREMENT value by using an
IS NULL comparison is used by
some ODBC programs, such as Access. See
Obtaining Auto-Increment Values.
This behavior can be disabled by setting
sql_auto_is_null to
OFF.

The default value of
sql_auto_is_null is
OFF.

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月20日 0

暂无评论

iDU31ygkXmx7
最新推荐 更多

2024-05-17