From f65bb2d418dc100dc4ec2582980ca44db9a23682 Mon Sep 17 00:00:00 2001 From: Cris Ward Date: Tue, 18 Jul 2017 17:44:25 +0100 Subject: [PATCH] added medium int as int32 fixes #33 --- spec/db_spec.cr | 1 + src/mysql/types.cr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/db_spec.cr b/spec/db_spec.cr index ae072d5..526effa 100644 --- a/spec/db_spec.cr +++ b/spec/db_spec.cr @@ -24,6 +24,7 @@ DB::DriverSpecs(MySql::Any).run do sample_value false, "bool", "false", type_safe_value: false sample_value 5_i8, "tinyint(1)", "5", type_safe_value: false sample_value 54_i16, "smallint(2)", "54", type_safe_value: false + sample_value 123, "mediumint(2)", "123", type_safe_value: false sample_value 1, "int", "1", type_safe_value: false sample_value 1_i64, "bigint", "1" sample_value "hello", "varchar(25)", "'hello'" diff --git a/src/mysql/types.cr b/src/mysql/types.cr index 3261a05..fbf2052 100644 --- a/src/mysql/types.cr +++ b/src/mysql/types.cr @@ -158,7 +158,7 @@ abstract struct MySql::Type end end decl_type LongLong, 0x08u8, ::Int64 - decl_type Int24, 0x09u8 + decl_type Int24, 0x09u8, ::Int32 def self.datetime_read(packet) pkt = packet.read_byte!