summaryrefslogtreecommitdiff
path: root/src/postgres.sml
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2016-08-05 20:06:17 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2016-08-05 20:06:17 -0400
commitc921d0df325c803fed8c7742eb088cb3d030d541 (patch)
tree16d374660aa9adb92c2f08317a20d61ae995ef9a /src/postgres.sml
parenta3e471e933945dcfb54873cb20c691a193b55671 (diff)
parentbd6f549a527856db3878f1586c6666646a45d8ee (diff)
Merge branch 'upstream' into dfsg_clean20160805+dfsg
Diffstat (limited to 'src/postgres.sml')
-rw-r--r--src/postgres.sml12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/postgres.sml b/src/postgres.sml
index ddfe0ad6..404384d2 100644
--- a/src/postgres.sml
+++ b/src/postgres.sml
@@ -443,7 +443,7 @@ fun init {dbstring, prepared = ss, tables, views, sequences} =
newline,
newline,
string "if (PQresultStatus(res) != PGRES_COMMAND_OK) {",
- box [string "if (!strcmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40001\")) {",
+ box [string "if (!strcmp_nullsafe(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40001\")) {",
box [newline,
string "PQclear(res);",
newline,
@@ -451,7 +451,7 @@ fun init {dbstring, prepared = ss, tables, views, sequences} =
newline],
string "}",
newline,
- string "if (!strcmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40P01\")) {",
+ string "if (!strcmp_nullsafe(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40P01\")) {",
box [newline,
string "PQclear(res);",
newline,
@@ -629,7 +629,7 @@ fun queryCommon {loc, query, cols, doCols} =
string "if (PQresultStatus(res) != PGRES_TUPLES_OK) {",
newline,
- box [string "if (!strcmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40001\")) {",
+ box [string "if (!strcmp_nullsafe(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40001\")) {",
box [newline,
string "PQclear(res);",
newline,
@@ -637,7 +637,7 @@ fun queryCommon {loc, query, cols, doCols} =
newline],
string "}",
newline,
- string "if (!strcmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40P01\")) {",
+ string "if (!strcmp_nullsafe(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40P01\")) {",
box [newline,
string "PQclear(res);",
newline,
@@ -800,7 +800,7 @@ fun dmlCommon {loc, dml, mode} =
string "if (PQresultStatus(res) != PGRES_COMMAND_OK) {",
newline,
- box [string "if (!strcmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40001\")) {",
+ box [string "if (!strcmp_nullsafe(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40001\")) {",
box [newline,
string "PQclear(res);",
newline,
@@ -808,7 +808,7 @@ fun dmlCommon {loc, dml, mode} =
newline],
string "}",
newline,
- string "if (!strcmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40P01\")) {",
+ string "if (!strcmp_nullsafe(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40P01\")) {",
box [newline,
string "PQclear(res);",
newline,