1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-02-11 12:24:40 +00:00
parent 509f005be7
commit 7c808317dc
1367 changed files with 394342 additions and 413129 deletions

View File

@@ -17,10 +17,10 @@
MA 02110-1301, USA. */
/***********************************************************************
* $Id: predicateoperator.h 9667 2013-07-08 16:37:10Z bpaul $
*
*
***********************************************************************/
* $Id: predicateoperator.h 9667 2013-07-08 16:37:10Z bpaul $
*
*
***********************************************************************/
/** @file */
#ifndef PREDICATEOPERATOR_H
@@ -43,7 +43,7 @@
#include "returnedcolumn.h"
#include "dataconvert.h"
#include "collation.h" // CHARSET_INFO
#include "collation.h" // CHARSET_INFO
namespace messageqcpp
{
@@ -52,145 +52,129 @@ class ByteStream;
namespace execplan
{
class PredicateOperator : public Operator
{
public:
PredicateOperator();
PredicateOperator(const std::string& operatorName);
PredicateOperator(const PredicateOperator& rhs);
virtual ~PredicateOperator();
public:
PredicateOperator();
PredicateOperator(const std::string& operatorName);
PredicateOperator(const PredicateOperator& rhs);
virtual ~PredicateOperator();
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual PredicateOperator* clone() const
{
return new PredicateOperator(*this);
}
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const;
virtual void unserialize(messageqcpp::ByteStream&);
/** return a copy of this pointer
*
* deep copy of this pointer and return the copy
*/
inline virtual PredicateOperator* clone() const
{
return new PredicateOperator (*this);
}
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const;
/**
* The serialization interface
*/
virtual void serialize(messageqcpp::ByteStream&) const;
virtual void unserialize(messageqcpp::ByteStream&);
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
bool operator==(const PredicateOperator& t) const;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
virtual bool operator==(const TreeNode* t) const;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/
bool operator==(const PredicateOperator& t) const;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
bool operator!=(const PredicateOperator& t) const;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
virtual bool operator!=(const TreeNode* t) const;
const CHARSET_INFO* getCharset() const
{
return cs;
}
/***********************************************************
* F&E framework *
***********************************************************/
using Operator::getBoolVal;
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop);
void setOpType(Type& l, Type& r);
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
*
* Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/
bool operator!=(const PredicateOperator& t) const;
private:
inline bool numericCompare(const IDB_Decimal& op1, const IDB_Decimal& op2);
template <typename result_t>
inline bool numericCompare(const result_t op1, const result_t op2);
inline bool strTrimCompare(const std::string& op1, const std::string& op2);
const CHARSET_INFO* getCharset() const
{
return cs;
}
/***********************************************************
* F&E framework *
***********************************************************/
using Operator::getBoolVal;
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop);
void setOpType(Type& l, Type& r);
private:
inline bool numericCompare(const IDB_Decimal& op1, const IDB_Decimal& op2);
template <typename result_t>
inline bool numericCompare(const result_t op1, const result_t op2);
inline bool strTrimCompare(const std::string& op1, const std::string& op2);
const CHARSET_INFO* cs;
const CHARSET_INFO* cs;
};
inline bool PredicateOperator::numericCompare(const IDB_Decimal& op1, const IDB_Decimal& op2)
{
switch (fOp)
switch (fOp)
{
case OP_EQ: return op1 == op2;
case OP_NE: return op1 != op2;
case OP_GT: return op1 > op2;
case OP_GE: return op1 >= op2;
case OP_LT: return op1 < op2;
case OP_LE: return op1 <= op2;
default:
{
case OP_EQ:
return op1 == op2;
case OP_NE:
return op1 != op2;
case OP_GT:
return op1 > op2;
case OP_GE:
return op1 >= op2;
case OP_LT:
return op1 < op2;
case OP_LE:
return op1 <= op2;
default:
{
std::ostringstream oss;
oss << "invalid predicate operation: " << fOp;
throw logging::InvalidOperationExcept(oss.str());
}
std::ostringstream oss;
oss << "invalid predicate operation: " << fOp;
throw logging::InvalidOperationExcept(oss.str());
}
}
}
template <typename result_t>
inline bool PredicateOperator::numericCompare(const result_t op1, const result_t op2)
{
switch (fOp)
switch (fOp)
{
case OP_EQ: return op1 == op2;
case OP_NE: return op1 != op2;
case OP_GT: return op1 > op2;
case OP_GE: return op1 >= op2;
case OP_LT: return op1 < op2;
case OP_LE: return op1 <= op2;
default:
{
case OP_EQ:
return op1 == op2;
case OP_NE:
return op1 != op2;
case OP_GT:
return op1 > op2;
case OP_GE:
return op1 >= op2;
case OP_LT:
return op1 < op2;
case OP_LE:
return op1 <= op2;
default:
{
std::ostringstream oss;
oss << "invalid predicate operation: " << fOp;
throw logging::InvalidOperationExcept(oss.str());
}
std::ostringstream oss;
oss << "invalid predicate operation: " << fOp;
throw logging::InvalidOperationExcept(oss.str());
}
}
}
std::ostream& operator<<(std::ostream& os, const PredicateOperator& rhs);
}
#endif //PREDICATEOPERATOR_H
} // namespace execplan
#endif // PREDICATEOPERATOR_H