From 0e9a5ff0c060da503662b4263d2e232f8fdeb755 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 23 Oct 2024 12:22:46 +0100 Subject: [PATCH] Correctly delegate BitColumnExpression::eval(*double out, bool& missing) In the old code calling `e.eval(&value_[0], missing_);` when e was a bitfield would actually call ColumnExpression::eval(*double out, bool& missing) and it wouldn't delegate to BitColumnExpression::eval(bool& missing) This change overrides BitColumnExpression::eval(*double out, bool& missing) to SQLExpression:eval(*double out, bool& missing) which correctly delegates to BitColumnExpression::eval(bool& missing) --- src/eckit/sql/expression/BitColumnExpression.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/eckit/sql/expression/BitColumnExpression.h b/src/eckit/sql/expression/BitColumnExpression.h index 27b428108..9434a6c61 100644 --- a/src/eckit/sql/expression/BitColumnExpression.h +++ b/src/eckit/sql/expression/BitColumnExpression.h @@ -45,7 +45,12 @@ class BitColumnExpression : public ColumnExpression { // -- Overridden methods void prepare(SQLSelect& sql) override; void updateType(SQLSelect& sql) override; - using ColumnExpression::eval; + + // Use SQLExpression's eval rather than ColumnExpression's + void eval(double* out, bool& missing) const override { + SQLExpression::eval(out, missing); + } + double eval(bool& missing) const override; virtual void expandStars(const std::vector>&, expression::Expressions&) override;