Skip to content

Commit c81ca6a

Browse files
committed
Made Postgresql.null an empty string physically unequal to any other empty string
1 parent b1c80dc commit c81ca6a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/postgresql.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ let ftype_of_string = function
238238

239239
external init : unit -> unit = "PQocaml_init"
240240

241-
let null = ""
241+
let null = String.make 0 '\000'
242242

243243
let () =
244244
Callback.register_exception "Postgresql.Oid" (Oid invalid_oid);

src/postgresql.mli

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ val invalid_oid : oid
212212

213213
val null : string
214214
(** [null] can be used as an element of the optional argument [parameters]
215-
passed to the [exec] or [send_query] method to indicate a NULL value. *)
215+
passed to the [exec] or [send_query] method to indicate a NULL value. It is
216+
an empty string, but not physically equal to [""]. *)
216217

217218
(** Class type of query results.
218219

0 commit comments

Comments
 (0)