mysql 不能定义用户变量名_MySQL用户定义变量的存储限制

User-Defined Variables以下,MySQL手册文件:

User variables can be assigned a value from a limited set of data types: integer, decimal, floating-point, binary or nonbinary string, or NULL value. Assignment of decimal and real values does not preserve the precision or scale of the value. A value of a type other than one of the permissible types is converted to a permissible type. For example, a value having a temporal or spatial data type is converted to a binary string.

If a user variable is assigned a nonbinary (character) string value, it has the same character set and collation as the string. The coercibility of user variables is implicit. (This is the same coercibility as for table column values.)

但是手册没有说明:

>支持的整数(例如4字节INT或8字节BIGINT)的大小,无论它们是有符号还是无符号,以及是否应用ZEROFILL(如果是,使用什么显示宽度);

This sqlfiddle似乎建议MySQL 5.5.25将使用BIGINT,根据作业签名,不会应用任何ZEROFILL.

>在固定和浮点值中使用的精度和尺度,因为这不是从赋值中保留的;和

>字符串的最大长度(字符和/或字节).

sqlfiddle受限于220个字节的max_allowed_pa​​cket(我不能改变):我猜想支持232字节(4GiB)的LONGTEXT.

可以安全依赖什么限制,特别是在不同的服务器版本和配置上?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值