1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

fixup! MCOL-2051: CS uses 'NULL' literal as NULL when UPDATEs varchar field

Fixed to retain compatibility with CentOS 6 (no C++11 support).
Moved initialization to the ColumnAssignment constructor.
This commit is contained in:
Sergey Sedov
2019-05-02 09:58:57 +03:00
committed by sianur
parent 83aad0c7b1
commit 12d9e2ec95
3 changed files with 12 additions and 13 deletions

View File

@ -566,17 +566,11 @@ assignment_commalist:
assignment: assignment:
column COMPARISON scalar_exp column COMPARISON scalar_exp
{ {
$$ = new ColumnAssignment(); $$ = new ColumnAssignment($1, $2, $3);
$$->fColumn = $1;
$$->fOperator = $2;
$$->fScalarExpression = $3;
} }
| column COMPARISON NULLX | column COMPARISON NULLX
{ {
$$ = new ColumnAssignment(); $$ = new ColumnAssignment($1, $2, $3);
$$->fColumn = $1;
$$->fOperator = $2;
$$->fScalarExpression = $3;
} }
; ;

View File

@ -397,6 +397,14 @@ public:
class ColumnAssignment class ColumnAssignment
{ {
public: public:
explicit ColumnAssignment(
std::string const& column,
std::string const& op = "=",
std::string const& expr = "") :
fColumn(column), fOperator(op), fScalarExpression(expr),
fFromCol(false), fFuncScale(0), fIsNull(false)
{};
/** @brief dump to stdout /** @brief dump to stdout
*/ */
std::ostream& put(std::ostream &os) const; std::ostream& put(std::ostream &os) const;
@ -411,7 +419,7 @@ public:
std::string fScalarExpression; std::string fScalarExpression;
bool fFromCol; bool fFromCol;
uint32_t fFuncScale; uint32_t fFuncScale;
bool fIsNull = false; bool fIsNull;
}; };
/** @brief Stores a value list or a query specification /** @brief Stores a value list or a query specification

View File

@ -928,10 +928,7 @@ uint32_t doUpdateDelete(THD *thd)
else else
schemaName = string(item->db_name); schemaName = string(item->db_name);
columnAssignmentPtr = new ColumnAssignment(); columnAssignmentPtr = new ColumnAssignment(item->name, "=", "");
columnAssignmentPtr->fColumn = string(item->name);
columnAssignmentPtr->fOperator = "=";
columnAssignmentPtr->fFuncScale = 0;
Item *value= value_it++; Item *value= value_it++;
if (value->type() == Item::STRING_ITEM) if (value->type() == Item::STRING_ITEM)
{ {