]> granicus.if.org Git - postgresql/commitdiff
bug fix for large objects (free)
authorByron Nikolaidis <byronn@insightdist.com>
Mon, 25 Oct 1999 01:11:44 +0000 (01:11 +0000)
committerByron Nikolaidis <byronn@insightdist.com>
Mon, 25 Oct 1999 01:11:44 +0000 (01:11 +0000)
src/interfaces/odbc/bind.c
src/interfaces/odbc/statement.c

index 285fabd75abeeb11109487374acd7c0456f9b005..67811f3926546fbed6728a4ee2732faf2cd3ad14 100644 (file)
@@ -124,7 +124,8 @@ static char *func="SQLBindParameter";
        }
 
        if (stmt->parameters[ipar].EXEC_buffer) {
-               free(stmt->parameters[ipar].EXEC_buffer);
+               if (stmt->parameters[ipar].SQLType != SQL_LONGVARBINARY)
+                       free(stmt->parameters[ipar].EXEC_buffer);
                stmt->parameters[ipar].EXEC_buffer = NULL;
        }
 
index c11a0ab21691865f004de0328fe178e0c1174c40..5aa540ec27719c718592da83f35893e31800a9a5 100644 (file)
@@ -327,7 +327,8 @@ int i;
                        }
 
                        if (self->parameters[i].EXEC_buffer) {
-                               free(self->parameters[i].EXEC_buffer);
+                               if (self->parameters[i].SQLType != SQL_LONGVARBINARY)
+                                       free(self->parameters[i].EXEC_buffer);
                                self->parameters[i].EXEC_buffer = NULL;
                        }
                }
@@ -875,7 +876,7 @@ QueryInfo qi;
                        */
                }
                else {
-                       self->errornumber = STMT_BAD_ERROR;
+                       self->errornumber = STMT_EXEC_ERROR;
                        self->errormsg = "Error while executing the query";
                }