﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
786	Error in _SQLite_Exec	tayoufabrice@…	Jpm	"	_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 
"	Bug	closed	3.3.1.0	Standard UDFs	3.3.0.0	None	Fixed	SQLite	
