zoukankan      html  css  js  c++  java
  • mysql的decimal(10,0) not null问题

    今天排查一个bug发现开发环境老是报错 order_num 字段insert的时候不能为空,但是发现测试环境没有这个问题。

    后来发现测试环境有一个数据库docker安装的mysql 版本是5.7  而开发环境是5.7.24  怀疑是这个问题引起的。

    后来测试了一下果然,在5.7中执行如下语句只会warning并且把order_num写入0  但是5.7.24会直接报错

    create table t_instance_struct_2
    (
    struct_id varchar(36) not null,
    task_code varchar(30),
    order_num decimal(10,0) not null,
    primary key (struct_id)
    );

    insert into t_instance_struct_2 values ('1','aa',null),('2','aa2',null);

  • 相关阅读:
    三范式
    作用域
    函数传参
    js数据类型
    纯css小图标
    js生成div
    js模拟微信聊天窗口
    js图片切换
    js this指向
    常用实体字符
  • 原文地址:https://www.cnblogs.com/xiaohanlin/p/10840693.html
Copyright © 2011-2022 走看看