1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +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; return rc;
} }
#if MYSQL_VERSION_ID < 110400
// For TIMESTAMP, if no constraint is given, default to NOT NULL // For TIMESTAMP, if no constraint is given, default to NOT NULL
if (createTable->fTableDef->fColumns[i]->fType->fType == ddlpackage::DDL_TIMESTAMP && if (createTable->fTableDef->fColumns[i]->fType->fType == ddlpackage::DDL_TIMESTAMP &&
createTable->fTableDef->fColumns[i]->fConstraints.empty()) createTable->fTableDef->fColumns[i]->fConstraints.empty())
{ {
createTable->fTableDef->fColumns[i]->fConstraints.push_back(new ColumnConstraintDef(DDL_NOT_NULL)); createTable->fTableDef->fColumns[i]->fConstraints.push_back(new ColumnConstraintDef(DDL_NOT_NULL));
} }
#endif
if (createTable->fTableDef->fColumns[i]->fDefaultValue) 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. // for the first column of the index if any.
// Statistics is stored in GWI context. // Statistics is stored in GWI context.
// Mock for ES 10.6 // Mock for ES 10.6
#if MYSQL_VERSION_ID >= 110401 #if MYSQL_VERSION_ID >= 120401
void extractColumnStatistics(Item_field* ifp, gp_walk_info& gwi) void extractColumnStatistics(Item_field* ifp, gp_walk_info& gwi)
{ {
for (uint j = 0; j < ifp->field->table->s->keys; j++) 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 # MCOL-5480 LDI loads values incorrectly for MEDIUMINT, TIME and TIMESTAMP
# when cpimport is used for batch insert # when cpimport is used for batch insert
# #
--source ../include/disable_11.4.inc
--source ../include/have_columnstore.inc --source ../include/have_columnstore.inc
--source ../include/detect_maxscale.inc --source ../include/detect_maxscale.inc