Add proper handling of null column values origin
authorAdam Chlipala <adamc@hcoop.net>
Fri, 15 Apr 2005 17:04:42 +0000 (17:04 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Fri, 15 Apr 2005 17:04:42 +0000 (17:04 +0000)
libpq/pg.sml

index de1a9e8..1b99da2 100644 (file)
@@ -104,7 +104,11 @@ struct
                            let
                                fun build (~1, acc) = acc
                                  | build (j, acc) =
                            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
                            in
                                builder (i+1, f (build (nf-1, []), acc))
                            end