Modify

Opened 17 years ago

Closed 17 years ago

#786 closed Bug (Fixed)

Error in _SQLite_Exec

Reported by: tayoufabrice@… Owned by: J-Paul Mesnage
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 by TicketCleanup, 17 years ago

Severity: BlockingNone

Automatic ticket cleanup.

comment:2 by J-Paul Mesnage, 17 years ago

can I have a small repro script to check the fix?
Thanks

PS that the standard way to document a bug ...

comment:3 by J-Paul Mesnage, 17 years ago

Milestone: 3.3.1.0
Owner: changed from Gary to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed in version: 3.3.1.0

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.