Update of /cvsroot/htoolkit/HSQL/SQLite3/Database/HSQL
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7000/SQLite3/Database/HSQL
Modified Files:
SQLite3.hsc
Log Message:
Another way to handle null values in HSQL. Not tested yet.
Index: SQLite3.hsc
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/SQLite3/Database/HSQL/SQLite3.hsc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SQLite3.hsc 16 Jun 2005 19:27:09 -0000 1.1
--- SQLite3.hsc 12 Dec 2005 15:21:56 -0000 1.2
***************
*** 146,159 ****
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)
--- 146,155 ----
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)
|