1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-298 Fix saturated date/datetime handling

Saturated DML updates would be set to NULL as were saturated cpimport
values. This sets them to the zero date/datetime value.
This commit is contained in:
Andrew Hutchings
2016-09-14 19:58:11 +01:00
parent 820ad233cb
commit d551b7d6e0
4 changed files with 14 additions and 63 deletions

View File

@ -1100,16 +1100,8 @@ boost::any
} }
else else
{ {
if ( isUpdate) //@Bug 5222 set to null for ot of range value value = 0;
{ pushWarning = true;
uint32_t d = joblist::DATENULL;
value = d;
pushWarning = true;
}
else
{
throw QueryDataExcept("Invalid date", formatErr);
}
} }
} }
break; break;
@ -1123,14 +1115,8 @@ boost::any
} }
else else
{ {
if ( isUpdate) //@Bug 5222 set to null for ot of range value value = 0;
{ pushWarning = true;
uint64_t d = joblist::DATETIMENULL;
value = d;
pushWarning = true;
}
else
throw QueryDataExcept("Invalid datetime", formatErr);
} }
} }
break; break;

View File

@ -965,19 +965,8 @@ void BulkLoadBuffer::convert(char *field, int fieldLength,
bufStats.maxBufferVal = llDate; bufStats.maxBufferVal = llDate;
} }
else { else {
if(!column.fNotNull) llDate = 0;
{ bufStats.satCount++;
// @bug 3375: reset invalid date/time to NULL,
// and track as a saturated value.
llDate = joblist::DATETIMENULL;
bufStats.satCount++;
}
else
{
//Bug5383 - 4.0@1400-01-01 00:00:00 Below it is 0000-01-01 00:00:00
llDate = 0x578104000000000; //394082834458869760
bufStats.satCount++;
}
} }
pVal = &llDate; pVal = &llDate;
@ -1262,23 +1251,8 @@ void BulkLoadBuffer::convert(char *field, int fieldLength,
bufStats.maxBufferVal = iDate; bufStats.maxBufferVal = iDate;
} }
else { else {
iDate = 0;
bufStats.satCount++;
if (!column.fNotNull)
{
// @bug 3375: reset invalid date to NULL,
// and track as a saturated value.
iDate = joblist::DATENULL;
bufStats.satCount++;
}
else
{
// Bug5383 - 1400-01-01
// iDate = 0x5781068; // for versions below 4.0 it is 0x1068
// MariaDB bug 740
iDate = 0x578107E;
bufStats.satCount++;
}
} }
pVal = &iDate; pVal = &iDate;

View File

@ -924,24 +924,15 @@ void TableInfo::reportTotals(double elapsedTime)
fColumns[i].column.colName << "; Number of "; fColumns[i].column.colName << "; Number of ";
if (fColumns[i].column.dataType == CalpontSystemCatalog::DATE) if (fColumns[i].column.dataType == CalpontSystemCatalog::DATE)
{ {
//bug5383 ossSatCnt <<
if(!fColumns[i].column.fNotNull) "invalid dates replaced with zero value : ";
ossSatCnt <<
"invalid dates replaced with null: ";
else
ossSatCnt <<
"invalid dates replaced with minimum value : ";
} }
else if (fColumns[i].column.dataType == else if (fColumns[i].column.dataType ==
CalpontSystemCatalog::DATETIME) CalpontSystemCatalog::DATETIME)
{ {
//bug5383 //bug5383
if(!fColumns[i].column.fNotNull) ossSatCnt <<
ossSatCnt << "invalid date/times replaced with zero value : ";
"invalid date/times replaced with null: ";
else
ossSatCnt <<
"invalid date/times replaced with minimum value : ";
} }
else if (fColumns[i].column.dataType == CalpontSystemCatalog::CHAR) else if (fColumns[i].column.dataType == CalpontSystemCatalog::CHAR)
ossSatCnt << ossSatCnt <<

View File

@ -1669,10 +1669,10 @@ void WESDHandler::onCleanupResult(int PmId, messageqcpp::SBS& Sbs) {
switch ((*aIt).fColType) switch ((*aIt).fColType)
{ {
case CalpontSystemCatalog::DATE: case CalpontSystemCatalog::DATE:
ossSatCnt << "invalid dates replaced with null: "; ossSatCnt << "invalid dates replaced with zero value: ";
break; break;
case CalpontSystemCatalog::DATETIME: case CalpontSystemCatalog::DATETIME:
ossSatCnt << "invalid date/times replaced with null: "; ossSatCnt << "invalid date/times replaced with zero value: ";
break; break;
case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::CHAR:
ossSatCnt << "character strings truncated: "; ossSatCnt << "character strings truncated: ";