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)
{

View File

@@ -6292,7 +6292,7 @@ int processLimitAndOffset(SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP& csep
// for the first column of the index if any.
// Statistics is stored in GWI context.
// Mock for ES 10.6
#if MYSQL_VERSION_ID >= 110401
#if MYSQL_VERSION_ID >= 120401
void extractColumnStatistics(Item_field* ifp, gp_walk_info& gwi)
{
for (uint j = 0; j < ifp->field->table->s->keys; j++)

View File

@@ -2,7 +2,6 @@
# MCOL-5480 LDI loads values incorrectly for MEDIUMINT, TIME and TIMESTAMP
# when cpimport is used for batch insert
#
--source ../include/disable_11.4.inc
--source ../include/have_columnstore.inc
--source ../include/detect_maxscale.inc