Fix a compilation error with vc10.
authorHiroshi Inoue <[email protected]>
Sat, 7 Nov 2020 12:43:41 +0000 (21:43 +0900)
committerHiroshi Inoue <[email protected]>
Sat, 7 Nov 2020 12:43:41 +0000 (21:43 +0900)
statement.c

index 07e4ff888875e2ec5e3f6ee75e8d054b51f76606..24dee4c97f3d9bd3c5aa06c32b3cd737a2a2144f 100644 (file)
@@ -1292,8 +1292,6 @@ static PG_ErrorInfo *
 SC_create_errorinfo(const StatementClass *self, PG_ErrorInfo *pgerror_fail_safe)
 {
    QResultClass *res = SC_get_Curres(self);
-   if (!res)
-       res = SC_get_Parsed(self);
    ConnectionClass *conn = SC_get_conn(self);
    Int4    errornum;
    size_t      pos;
@@ -1303,6 +1301,8 @@ SC_create_errorinfo(const StatementClass *self, PG_ErrorInfo *pgerror_fail_safe)
    char        *ermsg = NULL, *sqlstate = NULL;
    PG_ErrorInfo    *pgerror;
 
+   if (!res)
+       res = SC_get_Parsed(self);
    if (self->pgerror)
        return self->pgerror;
    errornum = self->__error_number;