Index: openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/01-database-procs.tcl,v diff -u -r1.1.2.40 -r1.1.2.41 --- openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 23 Aug 2022 11:10:22 -0000 1.1.2.40 +++ openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 29 Aug 2022 09:06:15 -0000 1.1.2.41 @@ -2129,9 +2129,16 @@ # If there is no next row, this is the last row return 1 } + upvar 1 __db_multirow__local_columns columns upvar 1 $column column_value - # Otherwise, it's the last row in the group if the next row has a different value than this row - return [expr {$column_value ne [dict get $next_row $column] }] + set pos [lsearch $columns $column] + if {$pos == -1} { + error "column '$column' not found in columns list '$columns'" + } + # Otherwise, it's the last row in the group if the next row has a + # different value than this row + set next_value [lindex $next_row $pos] + return [expr {$next_value eq $column_value}] }