Opened 16 years ago
Closed 16 years ago
#786 closed Bug (Fixed)
Error in _SQLite_Exec
Reported by: | tayoufabrice@… | Owned by: | Jpm |
---|---|---|---|
Milestone: | 3.3.1.0 | Component: | Standard UDFs |
Version: | 3.3.0.0 | Severity: | None |
Keywords: | SQLite | Cc: |
Description
_SQLite_Exec set allway @error to 0
see the Line 3 from the end "If $avRval[5] <> 0 Then DllCall($g_hDll_SQLite, "none:cdecl", "sqlite3_free", "ptr", $avRval[5])"
this line overwrite the @error set at the line 5 from the end
Func _SQLite_Exec($hDB, $sSQL, $sCallBack = "")
If $g_hDll_SQLite = 0 Then Return SetError(1, 0, $SQLITE_MISUSE)
If Not SQLite_hChk($hDB, $SQLITE_DBHANDLE) = $SQLITE_OK Then Return SetError(2, 0, $SQLITE_MISUSE)
Local $avRval, $aResult, $iRows, $iColumns, $iRval
If $sCallBack <> "" Then
$aResult = "SQLITE_CALLBACK:" & $sCallBack
$iRval = _SQLite_GetTable2d($hDB, $sSQL, $aResult, $iRows, $iColumns)
If @error Then Return SetError(3, 0, $iRval)
Return $iRval
EndIf
$avRval = DllCall($g_hDll_SQLite, "int:cdecl", "sqlite3_exec", _
"ptr", $hDB, _ ; An open database
"str", $sSQL, _ ; SQL to be executed
"ptr", 0, _ ; Callback function
"ptr", 0, _ ; 1st argument to callback function
"long*", 0); Error msg written here
If @error > 0 Then
Return SetError(1, 0, $SQLITE_MISUSE) ; DllCall Error
EndIf
If $avRval[0] <> $SQLITE_OK Then
SQLite_ReportError($hDB, "_SQLite_Exec", $sSQL)
SetError(-1)
EndIf
If $avRval[5] <> 0 Then DllCall($g_hDll_SQLite, "none:cdecl", "sqlite3_free", "ptr", $avRval[5])
Return $avRval[0]
EndFunc ;==>_SQLite_Exec
after _SQLite_Exec, @error==0
Attachments (0)
Change History (3)
comment:1 Changed 16 years ago by TicketCleanup
- Severity changed from Blocking to None
comment:2 Changed 16 years ago by Jpm
can I have a small repro script to check the fix?
Thanks
PS that the standard way to document a bug ...
comment:3 Changed 16 years ago by Jpm
- Milestone set to 3.3.1.0
- Owner changed from Gary to Jpm
- Resolution set to Fixed
- Status changed from new to closed
Fixed in version: 3.3.1.0
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Automatic ticket cleanup.