@@ -163,7 +163,6 @@ class Results
163163 private bool $ editable = false ;
164164 private bool $ printView = false ;
165165 private bool $ isCount = false ;
166- private bool $ isGroup = false ;
167166 private bool $ isExport = false ;
168167 private bool $ isFunction = false ;
169168 private bool $ isAnalyse = false ;
@@ -317,7 +316,6 @@ private function setDefaultTransformations(): void
317316 * any appended "LIMIT" clause programmatically
318317 * @param FieldMetadata[] $fieldsMeta meta information about fields
319318 * @param bool $isCount statement is SELECT COUNT
320- * @param bool $isGroup statement has GROUP BY
321319 * @param bool $isExport statement contains INTO OUTFILE
322320 * @param bool $isFunction statement contains a function like SUM()
323321 * @param bool $isAnalyse statement contains PROCEDURE ANALYSE
@@ -336,7 +334,6 @@ public function setProperties(
336334 int |string $ unlimNumRows ,
337335 array $ fieldsMeta ,
338336 bool $ isCount ,
339- bool $ isGroup ,
340337 bool $ isExport ,
341338 bool $ isFunction ,
342339 bool $ isAnalyse ,
@@ -352,7 +349,6 @@ public function setProperties(
352349 $ this ->unlimNumRows = $ unlimNumRows ;
353350 $ this ->fieldsMeta = $ fieldsMeta ;
354351 $ this ->isCount = $ isCount ;
355- $ this ->isGroup = $ isGroup ;
356352 $ this ->isExport = $ isExport ;
357353 $ this ->isFunction = $ isFunction ;
358354 $ this ->isAnalyse = $ isAnalyse ;
@@ -379,7 +375,6 @@ private function setDisplayPartsForPrintView(DisplayParts $displayParts): Displa
379375 'hasBookmarkForm ' => false ,
380376 'hasTextButton ' => false ,
381377 'hasPrintLink ' => false ,
382- 'hasQueryStats ' => true ,
383378 ]);
384379 }
385380
@@ -409,7 +404,6 @@ private function setDisplayPartsForShow(DisplayParts $displayParts): DisplayPart
409404 'hasBookmarkForm ' => true ,
410405 'hasTextButton ' => true ,
411406 'hasPrintLink ' => true ,
412- 'hasQueryStats ' => false ,
413407 ]);
414408 }
415409
@@ -429,7 +423,6 @@ private function setDisplayPartsForNonData(DisplayParts $displayParts): DisplayP
429423 'hasBookmarkForm ' => true ,
430424 'hasTextButton ' => $ this ->isMaintenance ,
431425 'hasPrintLink ' => true ,
432- 'hasQueryStats ' => false ,
433426 ]);
434427 }
435428
@@ -502,7 +495,7 @@ private function setDisplayPartsAndTotal(DisplayParts $displayParts): array
502495 // 2. Updates the display parts
503496 if ($ this ->printView ) {
504497 $ displayParts = $ this ->setDisplayPartsForPrintView ($ displayParts );
505- } elseif ($ this ->isAnalyse || $ this ->isMaintenance || $ this ->isExplain ) {
498+ } elseif ($ this ->isCount || $ this -> isAnalyse || $ this ->isMaintenance || $ this ->isExplain ) {
506499 $ displayParts = $ this ->setDisplayPartsForNonData ($ displayParts );
507500 } elseif ($ this ->isShow ) {
508501 $ displayParts = $ this ->setDisplayPartsForShow ($ displayParts );
@@ -523,8 +516,8 @@ private function setDisplayPartsAndTotal(DisplayParts $displayParts): array
523516
524517 // if for COUNT query, number of rows returned more than 1
525518 // (may be being used GROUP BY)
526- if ($ this ->isCount && ! $ this ->isGroup ) {
527- $ displayParts = $ displayParts ->with (['hasNavigationBar ' => false , 'hasSortLink ' => false ]);
519+ if ($ this ->isCount && $ this ->numRows > 1 ) {
520+ $ displayParts = $ displayParts ->with (['hasNavigationBar ' => true , 'hasSortLink ' => true ]);
528521 }
529522
530523 // 4. If navigation bar or sorting fields names URLs should be
@@ -3089,7 +3082,7 @@ public function getTable(
30893082 // 1.2 Defines offsets for the next and previous pages
30903083 $ posNext = 0 ;
30913084 $ posPrev = 0 ;
3092- if ($ displayParts ->hasNavigationBar || $ displayParts -> hasQueryStats ) {
3085+ if ($ displayParts ->hasNavigationBar ) {
30933086 [$ posNext , $ posPrev ] = $ this ->getOffsets ();
30943087 }
30953088
@@ -3122,7 +3115,7 @@ public function getTable(
31223115
31233116 // 2.1 Prepares a messages with position information
31243117 $ sqlQueryMessage = '' ;
3125- if ($ displayParts ->hasQueryStats && $ total > 0 ) {
3118+ if ($ displayParts ->hasNavigationBar ) {
31263119 $ message = $ this ->setMessageInformation (
31273120 $ sortedColumnMessage ,
31283121 $ statementInfo ,
0 commit comments