From: <br...@us...> - 2006-03-11 20:32:04
|
Update of /cvsroot/htoolkit/HSQL/HSQL/Database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2890/HSQL/Database Modified Files: HSQL.hsc Log Message: The current CVS version cannot convert fields of type SqlText to Haskell Int values. This fixes this problem by calling the default version of fromSqlCStringLen if the field type is such that the value cannot be converted directly. Converting from SqlText to Int is essential for the sqlite drivers, as they return all fields as SqlText. Index: HSQL.hsc =================================================================== RCS file: /cvsroot/htoolkit/HSQL/HSQL/Database/HSQL.hsc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** HSQL.hsc 9 Jan 2006 14:49:23 -0000 1.16 --- HSQL.hsc 11 Mar 2006 20:32:00 -0000 1.17 *************** *** 240,244 **** sqlType==SqlSmallInt|| sqlType==SqlBigInt = c_atoi cstr ! | otherwise = throwDyn (SqlBadTypeCast name sqlType) fromSqlValue SqlInteger s = Just (read s) --- 240,245 ---- sqlType==SqlSmallInt|| sqlType==SqlBigInt = c_atoi cstr ! fromSqlCStringLen field cstr cstrLen ! = defaultFromSqlCStringLen field cstr cstrLen fromSqlValue SqlInteger s = Just (read s) *************** *** 266,270 **** c_strtoll cstr nullPtr 10 #endif ! | otherwise = throwDyn (SqlBadTypeCast name sqlType) fromSqlValue SqlInteger s = Just (read s) --- 267,272 ---- c_strtoll cstr nullPtr 10 #endif ! fromSqlCStringLen field cstr cstrLen ! = defaultFromSqlCStringLen field cstr cstrLen fromSqlValue SqlInteger s = Just (read s) |