diff --git a/ma_odbc.h b/ma_odbc.h index 8f9f2f63..0420f8f5 100644 --- a/ma_odbc.h +++ b/ma_odbc.h @@ -311,7 +311,6 @@ struct st_ma_odbc_stmt MADB_DescRecord *PutDataRec; MADB_Stmt *DaeStmt; char *StmtString; - char *NativeSql; MADB_Stmt *PositionedCursor; my_bool PositionedCommand; enum MADB_StmtState State; diff --git a/ma_statement.c b/ma_statement.c index 92fe3253..e7d504e2 100644 --- a/ma_statement.c +++ b/ma_statement.c @@ -221,7 +221,6 @@ SQLRETURN MADB_StmtFree(MADB_Stmt *Stmt, SQLUSMALLINT Option) MADB_FREE(Stmt->result); MADB_FREE(Stmt->Cursor.Name); MADB_FREE(Stmt->StmtString); - MADB_FREE(Stmt->NativeSql); MADB_FREE(Stmt->CatalogName); MADB_FREE(Stmt->TableName); ResetMetadata(&Stmt->metadata, NULL); @@ -334,7 +333,6 @@ SQLRETURN MADB_StmtExecDirect(MADB_Stmt *Stmt, char *StatementText, SQLINTEGER T else { MADB_FREE(Stmt->StmtString); - MADB_FREE(Stmt->NativeSql); return ret; } } @@ -426,9 +424,12 @@ void MADB_StmtReset(MADB_Stmt *Stmt) Stmt->Ird->Header.Count= 0; case MADB_SS_EMULATED: + /* We can have the case, then query did not succeed, and in case of direct execution we wouldn't + have ane state set, but some of stuff still needs to be cleaned. Perhaps we could introduce a state + for such case, smth like DIREXEC_PREPARED. Would be more proper, but yet overkill */ + default: Stmt->PositionedCommand= 0; Stmt->QueryType= MADB_QUERY_NO_RESULT; - MADB_FREE(Stmt->NativeSql); MADB_FREE(Stmt->StmtString); Stmt->State= MADB_SS_INITED; MADB_CLEAR_ERROR(&Stmt->Error);