From: Adam Chlipala Date: Fri, 15 Apr 2005 17:04:42 +0000 (+0000) Subject: Add proper handling of null column values X-Git-Url: https://git.hcoop.net/hcoop/smlsql.git/commitdiff_plain/8c0e760706fe94c8e1f0db30895075b27d059cee?ds=sidebyside Add proper handling of null column values --- diff --git a/libpq/pg.sml b/libpq/pg.sml index de1a9e8..1b99da2 100644 --- a/libpq/pg.sml +++ b/libpq/pg.sml @@ -104,7 +104,11 @@ struct let fun build (~1, acc) = acc | build (j, acc) = - build (j-1, makeValue (F_PQgetvalue.f' (roRes, i, j)) :: acc) + build (j-1, + if F_PQgetisnull.f' (roRes, i, j) <> 0 then + NONE :: acc + else + makeValue (F_PQgetvalue.f' (roRes, i, j)) :: acc) in builder (i+1, f (build (nf-1, []), acc)) end