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

MCOL-3716: Wrong min/max set for short strings

cpimport was doing unsigned comparisons for these, but initializing
max to MIN_BIGINT (0x8000000000000002), which is > than any ascii string,
so it would never get set.  Changed the init value to 0 for char
types.
This commit is contained in:
Patrick LeBlanc
2020-01-22 16:41:18 -05:00
parent a59217e5e6
commit c26adc6259
2 changed files with 7 additions and 7 deletions

View File

@@ -719,7 +719,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
errno = 0;
origVal = strtoll(field, 0, 10);
if (errno == ERANGE)
bSatVal = true;
}
@@ -804,7 +804,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
strcpy(field, "1");
fieldLength = 1;
}
if ( (column.dataType == CalpontSystemCatalog::DECIMAL ) ||
(column.dataType == CalpontSystemCatalog::UDECIMAL))
{
@@ -979,7 +979,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
strcpy(field, "1");
fieldLength = 1;
}
if ( (column.dataType == CalpontSystemCatalog::DECIMAL) ||
(column.dataType == CalpontSystemCatalog::UDECIMAL))
{
@@ -1411,7 +1411,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
strcpy(field, "1");
fieldLength = 1;
}
if ( (column.dataType == CalpontSystemCatalog::DECIMAL) ||
(column.dataType == CalpontSystemCatalog::UDECIMAL))
{
@@ -1642,7 +1642,7 @@ int BulkLoadBuffer::parseCol(ColumnInfo& columnInfo)
tokenNullFlag = true;
}
// convert the data into appropriate format.
// convert the data into appropriate format and update CP values
convert(field, tokenLength, tokenNullFlag,
buf + i * columnInfo.column.width,
columnInfo.column, bufStats);
@@ -1673,7 +1673,7 @@ int BulkLoadBuffer::parseCol(ColumnInfo& columnInfo)
lastInputRowInExtent += columnInfo.rowsPerExtent();
if (isUnsigned(columnInfo.column.dataType))
if (isUnsigned(columnInfo.column.dataType) || isCharType(columnInfo.column.dataType))
{
bufStats.minBufferVal = static_cast<int64_t>(MAX_UBIGINT);
bufStats.maxBufferVal = static_cast<int64_t>(MIN_UBIGINT);