diff --git a/run_cppcheck.bat b/run_cppcheck.bat index af78df35e..cb17d1e25 100644 --- a/run_cppcheck.bat +++ b/run_cppcheck.bat @@ -14,6 +14,6 @@ :: :: --force: force checks all define combinations (default max is 12) -:: --suppress=objectIndex: seemingly false-positive (TODO: investigate this further) +:: --suppress=objectIndex: seemingly false-positive :: -iaws-sdk-cpp: avoid checking AWS C++ SDK source files in our repo -cppcheck.exe --force --suppress=objectIndex -iaws-sdk-cpp .\src\ 2> cppcheck-results.log \ No newline at end of file +cppcheck.exe --force --suppress=objectIndex -iaws-sdk-cpp .\src\ 2> cppcheck-results.log diff --git a/src/Tests/Tests/test_conn.cpp b/src/Tests/Tests/test_conn.cpp index 1652de343..a435a68bd 100644 --- a/src/Tests/Tests/test_conn.cpp +++ b/src/Tests/Tests/test_conn.cpp @@ -145,67 +145,3 @@ TEST(TestGetUserAgent, Success) { std::string expected = "ts-odbc." TIMESTREAMDRIVERVERSION " [tests]"; EXPECT_EQ(expected, conn.GetUserAgent()); } - -// TODO: enable gmock and mock the response from timestream -//class TestTSConnConnectDBStart : public testing::Test { -// protected: -// void SetUp() override { -// } -// -// void TearDown() override { -// m_conn.Disconnect(); -// } -// -// public: -// TSCommunication m_conn; -//}; -// -//TEST_F(TestTSConnConnectDBStart, ValidParameters) { -// ASSERT_NE(false, m_conn.ConnectionOptions(valid_opt_val)); -// EXPECT_EQ(true, m_conn.ConnectDBStart()); -// EXPECT_EQ(CONNECTION_OK, m_conn.Status()); -//} -// -//TEST_F(TestTSConnConnectDBStart, InvalidParameters) { -// ASSERT_TRUE( -// m_conn.ConnectionOptions(invalid_opt_val)); -// EXPECT_EQ(false, m_conn.ConnectDBStart()); -// EXPECT_EQ(CONNECTION_BAD, m_conn.Status()); -//} -// -//TEST_F(TestTSConnConnectDBStart, MissingParameters) { -// ASSERT_NE(true, m_conn.ConnectionOptions(missing_opt_val)); -// EXPECT_EQ(false, m_conn.ConnectDBStart()); -// EXPECT_EQ(CONNECTION_BAD, m_conn.Status()); -//} -// -//TEST(TestTSConnDropDBConnection, InvalidParameters) { -// TSCommunication conn; -// ASSERT_EQ(CONNECTION_BAD, conn.Status()); -// ASSERT_TRUE( -// conn.ConnectionOptions(invalid_opt_val)); -// ASSERT_NE(true, conn.ConnectDBStart()); -// ASSERT_EQ(CONNECTION_BAD, conn.Status()); -// conn.Disconnect(); -// EXPECT_EQ(CONNECTION_BAD, conn.Status()); -//} -// -//TEST(TestTSConnDropDBConnection, MissingParameters) { -// TSCommunication conn; -// ASSERT_EQ(CONNECTION_BAD, conn.Status()); -// ASSERT_NE(true, conn.ConnectionOptions(missing_opt_val)); -// ASSERT_NE(true, conn.ConnectDBStart()); -// ASSERT_EQ(CONNECTION_BAD, conn.Status()); -// conn.Disconnect(); -// EXPECT_EQ(CONNECTION_BAD, conn.Status()); -//} -// -//TEST(TestTSConnDropDBConnection, ValidParameters) { -// TSCommunication conn; -// ASSERT_NE(false, -// conn.ConnectionOptions(valid_opt_val)); -// ASSERT_NE(false, conn.ConnectDBStart()); -// ASSERT_EQ(CONNECTION_OK, conn.Status()); -// conn.Disconnect(); -// EXPECT_EQ(CONNECTION_BAD, conn.Status()); -//} diff --git a/src/Tests/Tests/test_odbc_connection.cpp b/src/Tests/Tests/test_odbc_connection.cpp index 7e77c5b5e..e04f8a7e3 100644 --- a/src/Tests/Tests/test_odbc_connection.cpp +++ b/src/Tests/Tests/test_odbc_connection.cpp @@ -224,7 +224,6 @@ TEST_F(TestSQLDriverConnect, SqlDriverNoprompt) { EXPECT_EQ(SQL_SUCCESS, ret); } -//// TODO - Revisit when parser code //// This should return SQL_SUCCESS_WITH_INFO (SQLSTATE 01S00 - Invalid /// connection / string attribute) TEST_F(TestSQLDriverConnect, UnsupportedKeyword) { diff --git a/src/timestreamsqlodbc/connection.cpp b/src/timestreamsqlodbc/connection.cpp index 362d4aa0b..2dcd9ee6b 100644 --- a/src/timestreamsqlodbc/connection.cpp +++ b/src/timestreamsqlodbc/connection.cpp @@ -128,7 +128,6 @@ char CC_connect(ConnectionClass *self) { } } -// TODO #36 - When we fix encoding, we should look into returning a code here. // This is called in connection.c and the return code isn't checked void CC_set_locale_encoding(ConnectionClass *self, const char *encoding) { if (self == NULL) @@ -141,14 +140,12 @@ void CC_set_locale_encoding(ConnectionClass *self, const char *encoding) { free(prev_encoding); } -// TODO #36 - Add return code - see above function comment void CC_determine_locale_encoding(ConnectionClass *self) { // Don't update if it's already set if ((self == NULL) || (self->locale_encoding != NULL)) return; // Get current db encoding and derive the locale encoding - // TODO #34 - Investigate locale CC_set_locale_encoding(self, "UTF8"); } diff --git a/src/timestreamsqlodbc/info.cpp b/src/timestreamsqlodbc/info.cpp index a977363d2..64d8bcab0 100644 --- a/src/timestreamsqlodbc/info.cpp +++ b/src/timestreamsqlodbc/info.cpp @@ -505,7 +505,6 @@ void SetTableTuples(QResultClass *res, const TableResultSet res_type, std::string catalog(""); bind_tbl[TABLES_CATALOG_NAME]->UpdateData((void *)catalog.c_str(), 0); - // TODO #630 - Revisit logic of adding tuples for SQLTables & SQLColumns for (size_t i = 0; i < binds.size(); i++) { // Add tuples for SQLColumns if (binds.size() > COLUMNS_SQL_DATA_TYPE) { @@ -604,7 +603,6 @@ void SetTableTuples(QResultClass *res, const TableResultSet res_type, } // Get new tuple and assign index of interest (NULL others) - // TODO #324 (SQL Plugin)- Should these be unique? TupleField *tuple = QR_AddNew(res); for (size_t i = 0; i < bind_tbl.size(); i++) { if (i == idx) @@ -659,7 +657,6 @@ void SetupColumnQResInfo(QResultClass *res, EnvironmentClass *unused) { INFO_VARCHAR_SIZE); } -// TODO #325 (SQL Plugin)- Fix patterns and escape characters for this void GenerateColumnQuery(std::string &query, const std::string &table_name, const std::string &column_name, const bool table_valid, const bool column_valid, const UWORD flag) { diff --git a/src/timestreamsqlodbc/multibyte.c b/src/timestreamsqlodbc/multibyte.c index 821eab9dc..bb59f9fe6 100644 --- a/src/timestreamsqlodbc/multibyte.c +++ b/src/timestreamsqlodbc/multibyte.c @@ -338,8 +338,6 @@ const char *derive_locale_encoding(const char *dbencoding) { wenc = "WIN1257"; break; } -#else - // TODO #34 - Investigate locale handling on Mac #endif /* WIN32 */ return wenc; } diff --git a/src/timestreamsqlodbc/mylog.c b/src/timestreamsqlodbc/mylog.c index e24f90abd..40185b4a8 100644 --- a/src/timestreamsqlodbc/mylog.c +++ b/src/timestreamsqlodbc/mylog.c @@ -253,7 +253,6 @@ static void MLOG_open() { char filebuf[1024], errbuf[2048]; BOOL open_error = FALSE; - // TODO (#585): Add option to log to stderr stream // MLOGFP = stderr; if (MLOGFP) return; diff --git a/src/timestreamsqlodbc/odbcapiw.c b/src/timestreamsqlodbc/odbcapiw.c index 1d4b101a2..ae309970e 100644 --- a/src/timestreamsqlodbc/odbcapiw.c +++ b/src/timestreamsqlodbc/odbcapiw.c @@ -885,7 +885,6 @@ RETCODE SQL_API SQLGetTypeInfoW(SQLHSTMT StatementHandle, } /* ODBC 2.x-specific functions */ -// TODO (#590): Add implementations for remaining ODBC 2.x function SQLRETURN SQL_API SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT iCol, SQLUSMALLINT iField, SQLPOINTER pCharAttr, diff --git a/src/timestreamsqlodbc/parse_result.cpp b/src/timestreamsqlodbc/parse_result.cpp index 0a009c5e1..6e1717ffc 100644 --- a/src/timestreamsqlodbc/parse_result.cpp +++ b/src/timestreamsqlodbc/parse_result.cpp @@ -274,7 +274,6 @@ bool AssignColumnHeaders(QResultClass *q_res, throw std::runtime_error("Unsupported Timestream type."); } } - // TODO Some historic fields needs to be removed, set 0 for now. CI_set_field_info(QR_get_fields(q_res), (int)i, column.GetName().c_str(), column_type_id, column_size, 0, 0, 0); @@ -423,29 +422,7 @@ bool AssignRowData(const Aws::TimestreamQuery::Model::Row &row, } } } - - // TODO Commented out for now, needs refactoring - // If there are more rows than schema suggests, we have Keyset data - /*if (row_size > row_schema_size) { - if (ks == NULL) { - QR_set_rstatus(q_res, PORES_INTERNAL_ERROR); - QR_set_message(q_res, - "Keyset was NULL, but Keyset data was expected."); - return false; - } - - auto row_column = row.value_begin() + row_schema_size; - if (sscanf(row_column->str().c_str(), "(%u,%hu)", &ks->blocknum, - &ks->offset) - != 2) { - QR_set_rstatus(q_res, PORES_INTERNAL_ERROR); - QR_set_message(q_res, "Failed to assign Keyset."); - return false; - } - row_column++; - ks->oid = std::stoul(row_column->str(), nullptr, 10); - }*/ - + // Increment relevant data q_res->cursTuple++; if (q_res->num_fields > 0)