Changeset: 9788179ac336 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/9788179ac336 Modified Files: sql/backends/monet5/sql_statistics.c Branch: analyze-fix Log Message:
Simplify a little diffs (65 lines): diff --git a/sql/backends/monet5/sql_statistics.c b/sql/backends/monet5/sql_statistics.c --- a/sql/backends/monet5/sql_statistics.c +++ b/sql/backends/monet5/sql_statistics.c @@ -327,41 +327,35 @@ sql_statistics(Client cntxt, MalBlkPtr m } BATiter bi = bat_iterator(fb); - if (fb->tminpos != BUN_NONE || fb->tmaxpos != BUN_NONE) { - if (fb->tminpos != BUN_NONE) { - if (tostr(&min, &minlen, BUNtail(bi, fb->tminpos), false) < 0) { - bat_iterator_end(&bi); - BBPunfix(fb->batCacheid); - msg = createException(SQL, "sql.statistics", SQLSTATE(HY013) MAL_MALLOC_FAIL); - goto bailout; - } - nmin = min; - } else { - nmin = (char *) str_nil; - } - if (BUNappend(minval, nmin, false) != GDK_SUCCEED) { + if (fb->tminpos != BUN_NONE) { + if (tostr(&min, &minlen, BUNtail(bi, fb->tminpos), false) < 0) { bat_iterator_end(&bi); BBPunfix(fb->batCacheid); + msg = createException(SQL, "sql.statistics", SQLSTATE(HY013) MAL_MALLOC_FAIL); goto bailout; } + nmin = min; + } else { + nmin = (char *) str_nil; + } + if (BUNappend(minval, nmin, false) != GDK_SUCCEED) { + bat_iterator_end(&bi); + BBPunfix(fb->batCacheid); + goto bailout; + } - if (fb->tmaxpos != BUN_NONE) { - if (tostr(&max, &maxlen, BUNtail(bi, fb->tmaxpos), false) < 0) { - bat_iterator_end(&bi); - BBPunfix(fb->batCacheid); - msg = createException(SQL, "sql.statistics", SQLSTATE(HY013) MAL_MALLOC_FAIL); - goto bailout; - } - nmax = max; - } else { - nmax = (char *) str_nil; - } - if (BUNappend(maxval, nmax, false) != GDK_SUCCEED) { + if (fb->tmaxpos != BUN_NONE) { + if (tostr(&max, &maxlen, BUNtail(bi, fb->tmaxpos), false) < 0) { bat_iterator_end(&bi); BBPunfix(fb->batCacheid); + msg = createException(SQL, "sql.statistics", SQLSTATE(HY013) MAL_MALLOC_FAIL); goto bailout; } - } else if (BUNappend(minval, str_nil, false) != GDK_SUCCEED || BUNappend(maxval, str_nil, false) != GDK_SUCCEED) { + nmax = max; + } else { + nmax = (char *) str_nil; + } + if (BUNappend(maxval, nmax, false) != GDK_SUCCEED) { bat_iterator_end(&bi); BBPunfix(fb->batCacheid); goto bailout; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list