diff --git a/components/zeosdbo/src/dbc/ZDbcMySqlResultSet.pas b/components/zeosdbo/src/dbc/ZDbcMySqlResultSet.pas index 28eaa039..015ed59e 100644 --- a/components/zeosdbo/src/dbc/ZDbcMySqlResultSet.pas +++ b/components/zeosdbo/src/dbc/ZDbcMySqlResultSet.pas @@ -236,15 +236,6 @@ begin else LastRowNo := 0; end; - {*** - @note ansgarbecker: - Store FOUND_ROWS() in variable so we can use that in HeidiSQL's data tab - } - if pos( 'SQL_CALC_FOUND_ROWS', FSQL ) > 0 then - begin - Statement.GetConnection.CreateStatement.Execute('SET @found_rows = FOUND_ROWS()'); - end; - if not Assigned(FQueryHandle) then raise EZSQLException.Create(SCanNotRetrieveResultSetData); diff --git a/source/childwin.pas b/source/childwin.pas index 6aa059be..3a6cc5c3 100644 --- a/source/childwin.pas +++ b/source/childwin.pas @@ -1296,8 +1296,6 @@ begin // Try to calc the rowcount regardless of a given LIMIT // Only needed if the user specified a WHERE-clause Filter := GetFilter; - if (mysql_version >= 40000) and (Filter <> '') then - select_base := select_base + ' SQL_CALC_FOUND_ROWS'; // Selected columns if DisplayedColumnsList.Count = 0 then begin FSelectedTableColumns.First; @@ -1427,29 +1425,7 @@ begin lblDataTop.Caption := lblDataTop.Caption + ' [View]'; end; - {*** - @note: FOUND_ROWS() gives us a correct number, but this number - belongs in most cases to a different query than the previous SELECT, - because Zeos does some automagically - SHOW TABLES LIKE '' and - SHOW COLUMNS LIKE '%' - between the above SELECT and a following "SELECT FOUND_ROWS()". - This problem has been introduced with the fix of - a faulty caching-mechanism in Zeos (rev 312). - and those queries seem to reset the FOUND_ROWS() since MySQL 5.0 - The workaround is to store FOUND_ROWS() immediately after query-execution - in a variable, which we are selecting here. - @see TZMySQLResultSet:Create - @see TZMySQLResultSet:Open - } - if Filter <> '' then begin - if mysql_version >= 40000 then - rows_matching := StrToInt64Def(GetVar('SELECT @found_rows'), 0) - else - rows_matching := DataGrid.RootNodeCount; - end - else - rows_matching := rows_total; + rows_matching := DataGrid.RootNodeCount; if( rows_matching <> rows_total ) and (Filter <> '') then