zoukankan      html  css  js  c++  java
  • mysql varchar

    当插入的字符数超过varchar(n)限制的长度时,字符会被截断,不会出错,但会有警告

    mysql> create table aa(name varchar(12));
    Query OK, 0 rows affected (0.06 sec)

    mysql> insert into aa value('qwertyuiopasdf');
    Query OK, 1 row affected, 1 warning (0.03 sec)

    mysql> show warnings;
    +---------+------+-------------------------------------------+
    | Level | Code | Message |
    +---------+------+-------------------------------------------+
    | Warning | 1265 | Data truncated for column 'name' at row 1 |
    +---------+------+-------------------------------------------+
    1 row in set (0.00 sec)

    mysql> select * from aa;
    +--------------+
    | name |
    +--------------+
    | qwertyuiopas |
    +--------------+



  • 相关阅读:
    51nod——T1267 4个数和为0
    cf220B莫队
    cf220b
    poj1436水平可见线
    poj2528贴海报,,
    poj3468
    hdu1698
    ural1989 单点更新+字符串hash
    cf Queries on a String
    hdu4605
  • 原文地址:https://www.cnblogs.com/iLoveMyD/p/2420998.html
Copyright © 2011-2022 走看看