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

fix(ddl): MCOL-5974 TIMESTAMP columns are not IS NOT NULL by default in MCS (#3670)

The old behavior was to assign TIMESTAMP columns an IS NOT NULL
constraint if list of constraints was empty. Apparently, this particular
invariant was changed in 11.4 and bugfixes' mcol-5480.test started to
fail.

This patch fixes behavioral difference and reenables mcol-5480 test in
11.4.
This commit is contained in:
Sergey Zefirov
2025-07-27 22:06:40 +03:00
committed by GitHub
parent a92bd2d142
commit 3418e68b78
3 changed files with 3 additions and 2 deletions

View File

@@ -867,12 +867,14 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& /*ta
return rc;
}
#if MYSQL_VERSION_ID < 110400
// For TIMESTAMP, if no constraint is given, default to NOT NULL
if (createTable->fTableDef->fColumns[i]->fType->fType == ddlpackage::DDL_TIMESTAMP &&
createTable->fTableDef->fColumns[i]->fConstraints.empty())
{
createTable->fTableDef->fColumns[i]->fConstraints.push_back(new ColumnConstraintDef(DDL_NOT_NULL));
}
#endif
if (createTable->fTableDef->fColumns[i]->fDefaultValue)
{