mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Some queries do not fail with mysql_real_query(), but later, after calling mysql_store_result(). Pass them to the application. Fixes issue #1563.
This commit is contained in:
@ -377,6 +377,7 @@ begin
|
|||||||
FLastQueryDuration := GetTickCount - TimerStart;
|
FLastQueryDuration := GetTickCount - TimerStart;
|
||||||
FLastQueryNetworkDuration := 0;
|
FLastQueryNetworkDuration := 0;
|
||||||
if querystatus <> 0 then begin
|
if querystatus <> 0 then begin
|
||||||
|
// Most errors will show up here, some others slightly later, after mysql_store_result()
|
||||||
Log(lcError, GetLastError);
|
Log(lcError, GetLastError);
|
||||||
raise Exception.Create(GetLastError);
|
raise Exception.Create(GetLastError);
|
||||||
end else begin
|
end else begin
|
||||||
@ -386,6 +387,12 @@ begin
|
|||||||
TimerStart := GetTickCount;
|
TimerStart := GetTickCount;
|
||||||
Result := mysql_store_result(FHandle);
|
Result := mysql_store_result(FHandle);
|
||||||
FLastQueryNetworkDuration := GetTickCount - TimerStart;
|
FLastQueryNetworkDuration := GetTickCount - TimerStart;
|
||||||
|
if (Result = nil) and (FRowsAffected = -1) then begin
|
||||||
|
// Indicates a late error, e.g. triggered by mysql_store_result(), after selecting a stored
|
||||||
|
// function with invalid SQL body. Also SHOW TABLE STATUS on older servers.
|
||||||
|
Log(lcError, GetLastError);
|
||||||
|
raise Exception.Create(GetLastError);
|
||||||
|
end;
|
||||||
if Result <> nil then begin
|
if Result <> nil then begin
|
||||||
FRowsFound := mysql_num_rows(Result);
|
FRowsFound := mysql_num_rows(Result);
|
||||||
FRowsAffected := 0;
|
FRowsAffected := 0;
|
||||||
|
Reference in New Issue
Block a user