Skip to content

Commit

Permalink
Correctly delegate BitColumnExpression::eval(*double out, bool& missing)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
TomHodson committed Oct 23, 2024
1 parent e29a620 commit 0e9a5ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/eckit/sql/expression/BitColumnExpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::reference_wrapper<const SQLTable>>&,
expression::Expressions&) override;
Expand Down

0 comments on commit 0e9a5ff

Please sign in to comment.