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

MCOL-641 This commit adds support for SIGNED and ZEROFILL keywords in

CREATE TABLE. ZEROFILL is dummy though.

There is a new file with column width utilities.

Array access was replaced by a variable that is calculated only once in
TupleJoiner::updateCPData.
This commit is contained in:
drrtuy
2020-02-18 11:55:51 +03:00
committed by Roman Nozdrin
parent 93170c3b31
commit 2eb5af1d24
6 changed files with 115 additions and 58 deletions

View File

@ -26,6 +26,7 @@
#define DDLPKG_DLLEXPORT
#include "ddlpkg.h"
#undef DDLPKG_DLLEXPORT
#include "../../utils/common/columnwidth.h"
namespace ddlpackage
{
@ -61,32 +62,6 @@ ostream& operator<<(ostream& os, const QualifiedName& qname)
return os;
}
/** @brief Map a DECIMAL precision to data width in bytes */
unsigned int precision_width(unsigned p)
{
switch (p)
{
case 1:
case 2:
return 1;
case 3:
case 4:
return 2;
case 5:
case 6:
case 7:
case 8:
case 9:
return 4;
default:
return 8;
}
}
ColumnType::ColumnType(int prec, int scale) :
fType(DDL_INVALID_DATATYPE),
fLength(0),
@ -94,7 +69,7 @@ ColumnType::ColumnType(int prec, int scale) :
fScale(scale),
fWithTimezone(false)
{
fLength = precision_width(fPrecision);
fLength = utils::widthByPrecision(fPrecision);
}
ColumnType::ColumnType(int type) :
@ -141,19 +116,6 @@ ColumnType::ColumnType(int type) :
break;
}
}
#if 0
ColumnType::ColumnType(int type, int length, int precision, int scale, int compressiontype, const char* autoIncrement, int64_t nextValue, bool withTimezone) :
fType(type),
fLength(length),
fPrecision(precision),
fScale(scale),
fWithTimezone(withTimezone),
fCompressiontype(compressiontype),
fAutoincrement(autoIncrement),
fNextvalue(nextValue)
{
}
#endif
ColumnConstraintDef::ColumnConstraintDef(DDL_CONSTRAINTS type) :
SchemaObject(),
fDeferrable(false),