You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Fix makedate() and year() functions
* The year() function did not handle float/double input correctly * Makedate() did not handle year < 100 conversion * 0 date was converted to NULL for some functions In addition makedate did
This commit is contained in:
@ -1900,6 +1900,20 @@ int64_t DataConvert::intToDatetime(int64_t data, bool* date)
|
||||
{
|
||||
bool isDate = false;
|
||||
char buf[21] = {0};
|
||||
DateTime adaytime;
|
||||
if (data == 0)
|
||||
{
|
||||
adaytime.year = 0;
|
||||
adaytime.month = 0;
|
||||
adaytime.day = 0;
|
||||
adaytime.hour = 0;
|
||||
adaytime.minute = 0;
|
||||
adaytime.second = 0;
|
||||
adaytime.msecond = 0;
|
||||
if (date)
|
||||
*date = true;
|
||||
return *(reinterpret_cast<uint64_t*>(&adaytime));
|
||||
}
|
||||
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
||||
//string date = buf;
|
||||
string year, month, day, hour, min, sec, msec;
|
||||
@ -1964,7 +1978,7 @@ int64_t DataConvert::intToDatetime(int64_t data, bool* date)
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
DateTime adaytime;
|
||||
|
||||
if (year.empty())
|
||||
{
|
||||
// MMDD format. assume current year
|
||||
|
Reference in New Issue
Block a user