Skip to content

Commit 9ece517

Browse files
authored
Merge pull request #79 from sy-c/master
v2.4.2
2 parents 7f43384 + bd0d4cf commit 9ece517

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,6 @@ This file describes the main feature changes for each InfoLogger released versio
114114

115115
## v2.4.1 - 26/10/2021
116116
- Added a cleanup/retry in case of corrupted cache of infoLoggerD, to allow immediate restart. The corrupted files are saved and available for later debugging.
117+
118+
## v2.4.2 - 11/01/2022
119+
- Do not count number of messages for large tables (>5M rows) in Archive Select menu. Would otherwise be very long.

src/infoBrowser.tcl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,17 @@ proc select_level {} {
528528
# archive commands
529529
#############################
530530

531+
proc getTableCount { tableName } {
532+
set maxtablesize 5000000
533+
534+
set nl 0
535+
set nl [mysqlquery "select count(*) from $tableName LIMIT ROWS EXAMINED $maxtablesize"]
536+
if {$nl==""} {
537+
set nl "over $maxtablesize"
538+
}
539+
return $nl
540+
}
541+
531542
proc select_archive {} {
532543
if {[winfo exists .logselect]} {return}
533544

@@ -544,10 +555,8 @@ proc select_archive {} {
544555
scrollbar .logselect.scrolly -orient vertical -command ".logselect.listbox yview" -width 10
545556

546557
global defaultlogfile
547-
548-
set nl 0
549-
set nl [mysqlquery "select count(*) from $defaultlogfile"]
550-
558+
set nl [getTableCount $defaultlogfile]
559+
551560
.logselect.listbox insert end "Latest logs (${nl} messages)"
552561
global lpath
553562
set lpath {}
@@ -560,7 +569,7 @@ proc select_archive {} {
560569
set s [split $n "_"]
561570
if {[llength $s] != 9} {continue}
562571
set d "[lindex $s 4]/[lindex $s 3]/[lindex $s 2] [lindex $s 6]:[lindex $s 7]:[lindex $s 8]"
563-
set nl [mysqlquery "select count(*) from $f"]
572+
set nl [getTableCount $f]
564573
.logselect.listbox insert end "$d (${nl} messages)"
565574
lappend lpath $f
566575
}

0 commit comments

Comments
 (0)