Opened 15 years ago

Closed 15 years ago

#786 closed Bug (Fixed)

Error in _SQLite_Exec

Reported by: tayoufabrice@… Owned by: Jpm
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: SQLite Cc:


_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

$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

If $avRval[0] <> $SQLITE_OK Then

SQLite_ReportError($hDB, "_SQLite_Exec", $sSQL)

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 15 years ago by TicketCleanup

  • Severity changed from Blocking to None

Automatic ticket cleanup.

comment:2 Changed 15 years ago by Jpm

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

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

comment:3 Changed 15 years ago by Jpm

  • Milestone set to
  • Owner changed from Gary to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed in version:

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.

Add Comment

Modify Ticket

as closed The owner will remain Jpm.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.