aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2008-03-02 00:37:19 -0500
committerBrian Cully <bjc@kublai.com>2008-03-02 00:37:19 -0500
commit3499d3f54e7ae753cc42769dcc945a4ba1aa23a5 (patch)
tree313c7aee475fb8168750252f768a9a953073b2fa /src
parente55779c5188c795a9005d7dd88cfdeaac16ae369 (diff)
downloadmysqlerl-3499d3f54e7ae753cc42769dcc945a4ba1aa23a5.tar.gz
mysqlerl-3499d3f54e7ae753cc42769dcc945a4ba1aa23a5.zip
Use integers for sizes. Add a couple more types.
Diffstat (limited to 'src')
-rw-r--r--src/mysqlerl.erl12
1 files 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, []).