Update of /cvsroot/htoolkit/HSQL/SQLite/Database/HSQL
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7000/SQLite/Database/HSQL
Modified Files:
SQLite.hsc
Log Message:
Another way to handle null values in HSQL. Not tested yet.
Index: SQLite.hsc
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/SQLite/Database/HSQL/SQLite.hsc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SQLite.hsc 9 Jun 2005 12:16:34 -0000 1.2
--- SQLite.hsc 12 Dec 2005 15:21:56 -0000 1.3
***************
*** 145,158 ****
modifyMVar tupleIndex (\index -> return (index+1,index < countTuples))
! getColValue pResult refIndex columns rows colNumber (name,sqlType,nullable) f = do
index <- readMVar refIndex
when (index > rows) (throwDyn SqlNoData)
pStr <- peekElemOff pResult (columns*index+colNumber)
if pStr == nullPtr
! then return Nothing
! else do
! strLen <- strlen pStr
! mb_value <- f sqlType pStr (fromIntegral strLen)
! case mb_value of
! Just v -> return (Just v)
! Nothing -> throwDyn (SqlBadTypeCast name sqlType)
--- 145,154 ----
modifyMVar tupleIndex (\index -> return (index+1,index < countTuples))
! getColValue pResult refIndex columns rows colNumber fieldDef f = do
index <- readMVar refIndex
when (index > rows) (throwDyn SqlNoData)
pStr <- peekElemOff pResult (columns*index+colNumber)
if pStr == nullPtr
! then f fieldDef pStr 0
! else do strLen <- strlen pStr
! f fieldDef pStr (fromIntegral strLen)
|