From: Ben Pfaff Date: Fri, 17 Feb 2023 00:17:42 +0000 (-0800) Subject: AGGREGATE: Fix crash with temporary transformations. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0b9ef120f69daabda403a823296b0ed352964e9;p=pspp AGGREGATE: Fix crash with temporary transformations. Thanks to Frans Houweling for reporting this bug at https://lists.gnu.org/archive/html/bug-gnu-pspp/2023-01/msg00004.html --- diff --git a/src/language/commands/aggregate.c b/src/language/commands/aggregate.c index fac71b139e..24b22722a7 100644 --- a/src/language/commands/aggregate.c +++ b/src/language/commands/aggregate.c @@ -278,7 +278,7 @@ cmd_aggregate (struct lexer *lexer, struct dataset *ds) { /* The active dataset will be replaced by the aggregated data, so TEMPORARY is moot. */ - proc_cancel_temporary_transformations (ds); + proc_make_temporary_transformations_permanent (ds); proc_discard_output (ds); output = autopaging_writer_create (dict_get_proto (agr.dict)); } diff --git a/tests/language/commands/aggregate.at b/tests/language/commands/aggregate.at index a76870289b..ac3ad929aa 100644 --- a/tests/language/commands/aggregate.at +++ b/tests/language/commands/aggregate.at @@ -511,3 +511,21 @@ aggregate.sps:16: error: AGGREGATE: Number of source variables (1) does not matc | ^~~~~~~~~" ]) AT_CLEANUP + +AT_SETUP([AGGREGATE - temporary transformations]) +AT_DATA([aggregate.sps], [dnl +DATA LIST FREE /quakes (F2.0). +BEGIN DATA +1 2 3 4 5 6 7 8 9 10 +END DATA. +TEMPORARY. +SELECT IF quakes GT 5. +AGGREGATE OUTFILE = * /nrecs=NU. +LIST. +]) +AT_CHECK([pspp -O format=csv aggregate.sps], [0], [dnl +Table: Data List +nrecs +5 +]) +AT_CLEANUP