提交 20588139 编写于 作者: 自凡

add param default value

上级 ea10d4b4
......@@ -107,12 +107,12 @@ public:
virtual void setValuesOfEnumSet(std::vector<const char*>& v);
virtual void setValuesOfEnumSet(const char** v, size_t size);
virtual void setGenerated(bool Generated);
virtual void setHiddenRowKey();
virtual void setGenerated(bool generated = true);
virtual void setHiddenRowKey(bool hiddenRowKey = true);
virtual bool isHiddenRowKey();
virtual void setPartitioned();
virtual void setPartitioned(bool partitioned = true);
virtual bool isPartitioned();
virtual void setDependent();
virtual void setDependent(bool dependent = true);
virtual bool isDependent();
public:
......
......@@ -406,34 +406,45 @@ void IColMeta::setFlag(unsigned char flag)
{
m_col->m_colMetaHeader->m_flag = flag;
}
void IColMeta::setGenerated(bool Generated)
void IColMeta::setGenerated(bool generated)
{
if (Generated) {
if (generated) {
m_col->m_colMetaHeader->m_flag |= COL_FLAG_GENERATED;
} else {
// 0xffff - COL_FLAG_GENERATED to binary 0b11111110
m_col->m_colMetaHeader->m_flag &= (0xffff - COL_FLAG_GENERATED);
m_col->m_colMetaHeader->m_flag &= ~COL_FLAG_GENERATED;
}
}
void IColMeta::setHiddenRowKey()
void IColMeta::setHiddenRowKey(bool hiddenRowKey)
{
m_col->m_colMetaHeader->m_flag |= COL_FLAG_HIDDEN_ROWKEY;
if (hiddenRowKey) {
m_col->m_colMetaHeader->m_flag |= COL_FLAG_HIDDEN_ROWKEY;
} else {
m_col->m_colMetaHeader->m_flag &= ~COL_FLAG_HIDDEN_ROWKEY;
}
}
bool IColMeta::isHiddenRowKey()
{
return m_col->m_colMetaHeader->m_flag & COL_FLAG_HIDDEN_ROWKEY;
}
void IColMeta::setPartitioned()
void IColMeta::setPartitioned(bool partitioned)
{
m_col->m_colMetaHeader->m_flag |= COL_FLAG_PARTITIONED;
if (partitioned) {
m_col->m_colMetaHeader->m_flag |= COL_FLAG_PARTITIONED;
} else{
m_col->m_colMetaHeader->m_flag &= ~COL_FLAG_PARTITIONED;
}
}
bool IColMeta::isPartitioned()
{
return m_col->m_colMetaHeader->m_flag & COL_FLAG_PARTITIONED;
}
void IColMeta::setDependent()
void IColMeta::setDependent(bool dependent)
{
m_col->m_colMetaHeader->m_flag |= COL_FLAG_DEPENDENT;
if (dependent) {
m_col->m_colMetaHeader->m_flag |= COL_FLAG_DEPENDENT;
} else {
m_col->m_colMetaHeader->m_flag &= ~COL_FLAG_DEPENDENT;
}
}
bool IColMeta::isDependent()
{
......
......@@ -41,9 +41,12 @@ IColMeta* createColMeta(const char* name, int type, int length)
colMeta->setEncoding(ENC);
colMeta->setGenerated(false);
colMeta->setGenerated(true);
colMeta->setHiddenRowKey();
colMeta->setPartitioned();
colMeta->setDependent();
colMeta->setHiddenRowKey(false);
colMeta->setHiddenRowKey(true);
colMeta->setPartitioned(false);
colMeta->setPartitioned(true);
colMeta->setDependent(false);
colMeta->setDependent(true);
colMeta->setOriginType("varchar");
colMeta->setPrecision(5);
colMeta->setScale(3);
......
......@@ -38,9 +38,12 @@ IColMeta* createColMeta(const char* name, int type, int length)
colMeta->setEncoding(ENC);
colMeta->setGenerated(false);
colMeta->setGenerated(true);
colMeta->setHiddenRowKey();
colMeta->setPartitioned();
colMeta->setDependent();
colMeta->setHiddenRowKey(false);
colMeta->setHiddenRowKey(true);
colMeta->setPartitioned(false);
colMeta->setPartitioned(true);
colMeta->setDependent(false);
colMeta->setDependent(true);
colMeta->setOriginType("varchar");
colMeta->setPrecision(5);
colMeta->setScale(4);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册