1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-5215 Fix overflow of UNION operation involving DECIMAL datatypes.

When a UNION operation involving DECIMAL datatypes with scale and digits
before the decimal exceeds the currently supported maximum precision
of 38, we throw an error to the user:
"MCS-2060: Union operation exceeds maximum DECIMAL precision of 38".

This is until MCOL-5417 is implemented where ColumnStore will have
full parity with MariaDB server in terms of maximum supported DECIMAL
precision and scale of 65 and 38 digits respectively.
This commit is contained in:
Gagan Goel
2023-02-17 05:22:34 -05:00
parent 8cdcae0d2f
commit 86dcf92d56
10 changed files with 123 additions and 70 deletions

View File

@ -6393,12 +6393,13 @@ boost::any CalpontSystemCatalog::ColType::convertColumnData(const std::string& d
}
CalpontSystemCatalog::ColType CalpontSystemCatalog::ColType::convertUnionColType(
vector<CalpontSystemCatalog::ColType>& types)
vector<CalpontSystemCatalog::ColType>& types,
unsigned int& rc)
{
idbassert(types.size());
CalpontSystemCatalog::ColType unionedType = types[0];
for (uint64_t i = 1; i < types.size(); i++)
dataconvert::DataConvert::joinColTypeForUnion(unionedType, types[i]);
dataconvert::DataConvert::joinColTypeForUnion(unionedType, types[i], rc);
return unionedType;
}

View File

@ -306,7 +306,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
return !(*this == t);
}
static ColType convertUnionColType(std::vector<ColType>&);
static ColType convertUnionColType(std::vector<ColType>&, unsigned int&);
};
/** the structure of a table infomation