From c6edd51552f49c850d3adc85cbd8d30cba5e00ad Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 10 Apr 2014 21:59:39 +0300 Subject: [PATCH] Print a better error message in regression tests on an invalid handle. Has no effect at the moment, but I've seen it happen during development of new regression tests, when I've passed an invalid handle to print_diag by accident. --- test/src/common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/src/common.c b/test/src/common.c index 595bc42..2423ad0 100644 --- a/test/src/common.c +++ b/test/src/common.c @@ -17,8 +17,9 @@ print_diag(char *msg, SQLSMALLINT htype, SQLHANDLE handle) ret = SQLGetDiagRec(htype, handle, 1, sqlstate, &nativeerror, message, 256, &textlen); - - if (ret != SQL_ERROR) + if (ret == SQL_INVALID_HANDLE) + printf("Invalid handle\n"); + else if (ret != SQL_ERROR) printf("%s=%s\n", (CHAR *)sqlstate, (CHAR *)message); } -- 2.39.5