From 1db56546ee0c004cf7c49ac8b7a5380e225cfe98 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 12 Jun 2019 15:05:20 +0100 Subject: [PATCH] TIMESTAMP namespace fixes Namespace issues in the TIMESTAMP code caused compiling to break. This patch fixes that. --- utils/funcexp/func_day.cpp | 6 +++--- utils/funcexp/func_dayname.cpp | 6 +++--- utils/funcexp/func_dayofweek.cpp | 6 +++--- utils/funcexp/func_dayofyear.cpp | 6 +++--- utils/funcexp/func_extract.cpp | 8 ++++---- utils/funcexp/func_hour.cpp | 6 +++--- utils/funcexp/func_minute.cpp | 6 +++--- utils/funcexp/func_month.cpp | 6 +++--- utils/funcexp/func_monthname.cpp | 6 +++--- utils/funcexp/func_quarter.cpp | 6 +++--- utils/funcexp/func_second.cpp | 6 +++--- utils/funcexp/func_time.cpp | 8 ++++---- utils/funcexp/func_time_format.cpp | 6 +++--- utils/funcexp/func_time_to_sec.cpp | 6 +++--- utils/funcexp/func_timediff.cpp | 16 ++++++++-------- utils/funcexp/func_to_days.cpp | 6 +++--- utils/funcexp/func_week.cpp | 6 +++--- utils/funcexp/func_weekday.cpp | 6 +++--- utils/funcexp/func_year.cpp | 6 +++--- utils/funcexp/func_yearweek.cpp | 6 +++--- writeengine/bulk/we_tableinfo.cpp | 2 +- writeengine/server/we_ddlcommon.h | 2 +- 22 files changed, 69 insertions(+), 69 deletions(-) diff --git a/utils/funcexp/func_day.cpp b/utils/funcexp/func_day.cpp index 7d3d83f1a..c8ba97e6c 100644 --- a/utils/funcexp/func_day.cpp +++ b/utils/funcexp/func_day.cpp @@ -64,10 +64,10 @@ int64_t Func_day::getIntVal(rowgroup::Row& row, case CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); return m_time.day; } diff --git a/utils/funcexp/func_dayname.cpp b/utils/funcexp/func_dayname.cpp index 15b56d1a7..02955fcf4 100644 --- a/utils/funcexp/func_dayname.cpp +++ b/utils/funcexp/func_dayname.cpp @@ -76,10 +76,10 @@ int64_t Func_dayname::getIntVal(rowgroup::Row& row, case CalpontSystemCatalog::TIMESTAMP: { val = parm[0]->data()->getIntVal(row, isNull); - TimeStamp timestamp(val); + dataconvert::TimeStamp timestamp(val); int64_t seconds = timestamp.second; - MySQLTime time; - gmtSecToMySQLTime(seconds, time, fTimeZone); + dataconvert::MySQLTime time; + dataconvert::gmtSecToMySQLTime(seconds, time, fTimeZone); year = time.year; month = time.month; day = time.day; diff --git a/utils/funcexp/func_dayofweek.cpp b/utils/funcexp/func_dayofweek.cpp index 941572948..e66e1d864 100644 --- a/utils/funcexp/func_dayofweek.cpp +++ b/utils/funcexp/func_dayofweek.cpp @@ -74,10 +74,10 @@ int64_t Func_dayofweek::getIntVal(rowgroup::Row& row, case CalpontSystemCatalog::TIMESTAMP: { val = parm[0]->data()->getIntVal(row, isNull); - TimeStamp timestamp(val); + dataconvert::TimeStamp timestamp(val); int64_t seconds = timestamp.second; - MySQLTime time; - gmtSecToMySQLTime(seconds, time, fTimeZone); + dataconvert::MySQLTime time; + dataconvert::gmtSecToMySQLTime(seconds, time, fTimeZone); year = time.year; month = time.month; day = time.day; diff --git a/utils/funcexp/func_dayofyear.cpp b/utils/funcexp/func_dayofyear.cpp index c53224813..6d4fc9fcf 100644 --- a/utils/funcexp/func_dayofyear.cpp +++ b/utils/funcexp/func_dayofyear.cpp @@ -73,10 +73,10 @@ int64_t Func_dayofyear::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); year = m_time.year; month = m_time.month; day = m_time.day; diff --git a/utils/funcexp/func_extract.cpp b/utils/funcexp/func_extract.cpp index da28bc3dd..b8b1f90bc 100644 --- a/utils/funcexp/func_extract.cpp +++ b/utils/funcexp/func_extract.cpp @@ -249,11 +249,11 @@ int64_t Func_extract::getIntVal(rowgroup::Row& row, case CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); - DateTime dt; + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::DateTime dt; dt.year = m_time.year; dt.month = m_time.month; dt.day = m_time.day; diff --git a/utils/funcexp/func_hour.cpp b/utils/funcexp/func_hour.cpp index 4752a8b10..6959ce526 100644 --- a/utils/funcexp/func_hour.cpp +++ b/utils/funcexp/func_hour.cpp @@ -111,10 +111,10 @@ int64_t Func_hour::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); return m_time.hour; } diff --git a/utils/funcexp/func_minute.cpp b/utils/funcexp/func_minute.cpp index 4a5d59e7d..10b3f1ef6 100644 --- a/utils/funcexp/func_minute.cpp +++ b/utils/funcexp/func_minute.cpp @@ -111,10 +111,10 @@ int64_t Func_minute::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); return m_time.minute; } diff --git a/utils/funcexp/func_month.cpp b/utils/funcexp/func_month.cpp index 8362f3296..94708fb1b 100644 --- a/utils/funcexp/func_month.cpp +++ b/utils/funcexp/func_month.cpp @@ -63,10 +63,10 @@ int64_t Func_month::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); return m_time.month; } diff --git a/utils/funcexp/func_monthname.cpp b/utils/funcexp/func_monthname.cpp index 8c2ffcd3d..831d16586 100644 --- a/utils/funcexp/func_monthname.cpp +++ b/utils/funcexp/func_monthname.cpp @@ -104,10 +104,10 @@ int64_t Func_monthname::getIntVal(rowgroup::Row& row, case CalpontSystemCatalog::TIMESTAMP: { val = parm[0]->data()->getIntVal(row, isNull); - TimeStamp timestamp(val); + dataconvert::TimeStamp timestamp(val); int64_t seconds = timestamp.second; - MySQLTime time; - gmtSecToMySQLTime(seconds, time, fTimeZone); + dataconvert::MySQLTime time; + dataconvert::gmtSecToMySQLTime(seconds, time, fTimeZone); return time.month; } diff --git a/utils/funcexp/func_quarter.cpp b/utils/funcexp/func_quarter.cpp index 10bd2c62c..e402444a7 100644 --- a/utils/funcexp/func_quarter.cpp +++ b/utils/funcexp/func_quarter.cpp @@ -67,10 +67,10 @@ int64_t Func_quarter::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); month = m_time.month; break; } diff --git a/utils/funcexp/func_second.cpp b/utils/funcexp/func_second.cpp index de7f9ebf4..4f12cfca8 100644 --- a/utils/funcexp/func_second.cpp +++ b/utils/funcexp/func_second.cpp @@ -110,10 +110,10 @@ int64_t Func_second::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); return m_time.second; } diff --git a/utils/funcexp/func_time.cpp b/utils/funcexp/func_time.cpp index 9efced0be..b83c678db 100644 --- a/utils/funcexp/func_time.cpp +++ b/utils/funcexp/func_time.cpp @@ -120,11 +120,11 @@ string Func_time::getStrVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); - Time time; + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::Time time; time.hour = m_time.hour; time.minute = m_time.minute; time.second = m_time.second; diff --git a/utils/funcexp/func_time_format.cpp b/utils/funcexp/func_time_format.cpp index ce5eeb32d..08739b046 100644 --- a/utils/funcexp/func_time_format.cpp +++ b/utils/funcexp/func_time_format.cpp @@ -74,10 +74,10 @@ string Func_time_format::getStrVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); hour = m_time.hour; min = m_time.minute; sec = m_time.second; diff --git a/utils/funcexp/func_time_to_sec.cpp b/utils/funcexp/func_time_to_sec.cpp index 9a05a5589..f8391d12f 100644 --- a/utils/funcexp/func_time_to_sec.cpp +++ b/utils/funcexp/func_time_to_sec.cpp @@ -73,10 +73,10 @@ int64_t Func_time_to_sec::getIntVal(rowgroup::Row& row, case CalpontSystemCatalog::TIMESTAMP: { val = parm[0]->data()->getIntVal(row, isNull); - TimeStamp timestamp(val); + dataconvert::TimeStamp timestamp(val); int64_t seconds = timestamp.second; - MySQLTime time; - gmtSecToMySQLTime(seconds, time, fTimeZone); + dataconvert::MySQLTime time; + dataconvert::gmtSecToMySQLTime(seconds, time, fTimeZone); hour = time.hour; min = time.minute; sec = time.second; diff --git a/utils/funcexp/func_timediff.cpp b/utils/funcexp/func_timediff.cpp index e95e3315e..1254f2d1b 100644 --- a/utils/funcexp/func_timediff.cpp +++ b/utils/funcexp/func_timediff.cpp @@ -134,11 +134,11 @@ string Func_timediff::getStrVal(rowgroup::Row& row, break; } int64_t temp = parm[0]->data()->getTimestampIntVal(row, isNull); - TimeStamp timestamp(temp); + dataconvert::TimeStamp timestamp(temp); int64_t seconds = timestamp.second; - MySQLTime time; - gmtSecToMySQLTime(seconds, time, fTimeZone); - DateTime dt; + dataconvert::MySQLTime time; + dataconvert::gmtSecToMySQLTime(seconds, time, fTimeZone); + dataconvert::DateTime dt; dt.year = time.year; dt.month = time.month; dt.day = time.day; @@ -196,11 +196,11 @@ string Func_timediff::getStrVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { int64_t temp = parm[1]->data()->getTimestampIntVal(row, isNull); - TimeStamp timestamp(temp); + dataconvert::TimeStamp timestamp(temp); int64_t seconds = timestamp.second; - MySQLTime time; - gmtSecToMySQLTime(seconds, time, fTimeZone); - DateTime dt; + dataconvert::MySQLTime time; + dataconvert::gmtSecToMySQLTime(seconds, time, fTimeZone); + dataconvert::DateTime dt; dt.year = time.year; dt.month = time.month; dt.day = time.day; diff --git a/utils/funcexp/func_to_days.cpp b/utils/funcexp/func_to_days.cpp index 58055afab..b51eb5aff 100644 --- a/utils/funcexp/func_to_days.cpp +++ b/utils/funcexp/func_to_days.cpp @@ -87,10 +87,10 @@ int64_t Func_to_days::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); year = m_time.year; month = m_time.month; day = m_time.day; diff --git a/utils/funcexp/func_week.cpp b/utils/funcexp/func_week.cpp index 2c15c671e..326f1c13a 100644 --- a/utils/funcexp/func_week.cpp +++ b/utils/funcexp/func_week.cpp @@ -77,10 +77,10 @@ int64_t Func_week::getIntVal(rowgroup::Row& row, case CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); year = m_time.year; month = m_time.month; day = m_time.day; diff --git a/utils/funcexp/func_weekday.cpp b/utils/funcexp/func_weekday.cpp index 21612a7cc..9b6cc8c63 100644 --- a/utils/funcexp/func_weekday.cpp +++ b/utils/funcexp/func_weekday.cpp @@ -73,10 +73,10 @@ int64_t Func_weekday::getIntVal(rowgroup::Row& row, case CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getTimestampIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); year = m_time.year; month = m_time.month; day = m_time.day; diff --git a/utils/funcexp/func_year.cpp b/utils/funcexp/func_year.cpp index 12d265fda..94abdd79a 100644 --- a/utils/funcexp/func_year.cpp +++ b/utils/funcexp/func_year.cpp @@ -63,10 +63,10 @@ int64_t Func_year::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); return m_time.year; } diff --git a/utils/funcexp/func_yearweek.cpp b/utils/funcexp/func_yearweek.cpp index f1656f62e..3ae72a7f2 100644 --- a/utils/funcexp/func_yearweek.cpp +++ b/utils/funcexp/func_yearweek.cpp @@ -80,10 +80,10 @@ int64_t Func_yearweek::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIMESTAMP: { - TimeStamp timestamp(parm[0]->data()->getIntVal(row, isNull)); + dataconvert::TimeStamp timestamp(parm[0]->data()->getIntVal(row, isNull)); int64_t seconds = timestamp.second; - MySQLTime m_time; - gmtSecToMySQLTime(seconds, m_time, fTimeZone); + dataconvert::MySQLTime m_time; + dataconvert::gmtSecToMySQLTime(seconds, m_time, fTimeZone); year = m_time.year; month = m_time.month; day = m_time.day; diff --git a/writeengine/bulk/we_tableinfo.cpp b/writeengine/bulk/we_tableinfo.cpp index 763523644..0d93c12b7 100644 --- a/writeengine/bulk/we_tableinfo.cpp +++ b/writeengine/bulk/we_tableinfo.cpp @@ -991,7 +991,7 @@ void TableInfo::reportTotals(double elapsedTime) "invalid date/times replaced with zero value : "; } - else if (fColumns[i].column.dataType == CalpontSystemCatalog::TIMESTAMP) + else if (fColumns[i].column.dataType == execplan::CalpontSystemCatalog::TIMESTAMP) { ossSatCnt << "invalid timestamps replaced with zero value : "; diff --git a/writeengine/server/we_ddlcommon.h b/writeengine/server/we_ddlcommon.h index 40733dc6a..9fcc06f7b 100644 --- a/writeengine/server/we_ddlcommon.h +++ b/writeengine/server/we_ddlcommon.h @@ -448,7 +448,7 @@ inline int convertDataType(int dataType) break; case ddlpackage::DDL_TIMESTAMP: - calpontDataType = CalpontSystemCatalog::TIMESTAMP; + calpontDataType = execplan::CalpontSystemCatalog::TIMESTAMP; break; case ddlpackage::DDL_CLOB: