From 3499d3f54e7ae753cc42769dcc945a4ba1aa23a5 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sun, 2 Mar 2008 00:37:19 -0500 Subject: Use integers for sizes. Add a couple more types. --- src/mysqlerl.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mysqlerl.erl b/src/mysqlerl.erl index 3099675..213dbc4 100644 --- a/src/mysqlerl.erl +++ b/src/mysqlerl.erl @@ -209,13 +209,19 @@ convert_type("int") -> sql_integer; convert_type("int(" ++ Rest) -> Size = find_data_size(Rest), - {sql_numeric, Size}; + {sql_numeric, list_to_integer(Size)}; +convert_type("decimal(" ++ Rest) -> + Size = find_data_size(Rest), + {sql_decimal, list_to_integer(Size)}; +convert_type("float(" ++ Rest) -> + Size = find_data_size(Rest), + {sql_float, list_to_float(Size)}; convert_type("char(" ++ Rest) -> Size = find_data_size(Rest), - {sql_char, Size}; + {sql_char, list_to_integer(Size)}; convert_type("varchar(" ++ Rest) -> Size = find_data_size(Rest), - {sql_varchar, Size}. + {sql_varchar, list_to_integer(Size)}. find_data_size(Str) -> find_data_size(Str, []). -- cgit v1.2.3