akmrakib / erlang-mysql-driver

Automatically exported from code.google.com/p/erlang-mysql-driver
Other
0 stars 0 forks source link

patch for TINYINT support #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

The attached patch ads support for TINYINT column types

Enjoy!

Jason

Index: mysql_conn.erl
===================================================================
--- mysql_conn.erl  (revision 31)
+++ mysql_conn.erl  (working copy)
@@ -847,6 +847,7 @@
 get_field_datatype(12) ->  'DATETIME';
 get_field_datatype(13) ->  'YEAR';
 get_field_datatype(14) ->  'NEWDATE';
+get_field_datatype(16) ->  'TINYINT';
 get_field_datatype(246) -> 'NEWDECIMAL';
 get_field_datatype(247) -> 'ENUM';
 get_field_datatype(248) -> 'SET';
@@ -892,6 +893,9 @@
            Res
        end,
        Num;
+   T when T == 'TINYINT' ->
+       <<Res:8>> = Val,
+       Res;
    _Other ->
        Val
     end.

Original issue reported on code.google.com by jla...@gmail.com on 12 Jul 2007 at 8:36