lua-resty-mysql icon indicating copy to clipboard operation
lua-resty-mysql copied to clipboard

incorrect type for mysql int/bigint field

Open epiphyllum opened this issue 7 years ago • 2 comments

db:query("select * from t_batch where id = 1")

i get a row: where: id, orgid become a string

drop table if exists `t_batch`;
create table `t_batch` (
  `id` bigint not null auto_increment,
  `orgid` bigint not null comment '机构id',
  `mid` bigint not null comment '商户id',
  `batchno` bigint not null comment '批次号',
  `amt` decimal(11,2) null comment '批次汇总金额',
  `status` smallint not null default 0 comment '0: 未处理  1:处理完毕',
  `deadline` timestamp not null comment '在什么时间之前处理',
  `memo` varchar(256) null comment '处理备注',
  `tsc` timestamp not null default current_timestamp comment '记录创建时间',
  `tsu` timestamp null default current_timestamp on update current_timestamp comment '记录最后修改时间',
  primary key (`id`),
    unique key key_1 (mid, batchno)

epiphyllum avatar Mar 15 '19 05:03 epiphyllum

but for smallint , when i get a row. the variable is not string.

epiphyllum avatar Mar 15 '19 05:03 epiphyllum

Any fix planned? Issue still persists

tvlc avatar Feb 21 '22 22:02 tvlc