You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/04/14 15:13:30 UTC
[13/50] [abbrv] ignite git commit: IGNITE-3581: Moved enums to
separate structs for C++
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc-test/src/column_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/column_test.cpp b/modules/platforms/cpp/odbc-test/src/column_test.cpp
index 66d0214..adc40c4 100644
--- a/modules/platforms/cpp/odbc-test/src/column_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/column_test.cpp
@@ -68,9 +68,9 @@ BOOST_AUTO_TEST_CASE(TestColumnShort)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_SIGNED_SHORT, &shortBuf, sizeof(shortBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_SIGNED_SHORT, &shortBuf, sizeof(shortBuf), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(TestColumnShort)
BOOST_REQUIRE(shortBuf == data);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -116,9 +116,9 @@ BOOST_AUTO_TEST_CASE(TestColumnString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(TestColumnString)
BOOST_REQUIRE(std::string(strBuf) == data);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -166,9 +166,9 @@ BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf[0], strBuf.size(), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_CHAR, &strBuf[0], strBuf.size(), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -178,7 +178,7 @@ BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
res.append(strBuf.c_str());
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
res.append(strBuf.c_str());
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -198,7 +198,7 @@ BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
res.append(strBuf.c_str());
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -248,9 +248,9 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
- BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column1.IsValid());
@@ -260,7 +260,7 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
BOOST_REQUIRE(std::string(strBuf) == data1);
- BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column1.IsValid());
@@ -268,7 +268,7 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
BOOST_REQUIRE(column1.GetUnreadDataLength() == 0);
- BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column2.IsValid());
@@ -278,7 +278,7 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
BOOST_REQUIRE(std::string(strBuf) == data2);
- BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column2.IsValid());
@@ -314,9 +314,9 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArray)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf[0], buf.size(), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_BINARY, &buf[0], buf.size(), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -326,7 +326,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArray)
BOOST_REQUIRE_EQUAL_COLLECTIONS(buf.begin(), buf.end(), data.begin(), data.end());
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -364,9 +364,9 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayHalfBuffer)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf[0], buf.size(), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_BINARY, &buf[0], buf.size(), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -378,7 +378,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayHalfBuffer)
result.reserve(data.size());
std::copy(buf.begin(), buf.end(), std::back_inserter(result));
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -388,7 +388,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayHalfBuffer)
std::copy(buf.begin(), buf.end(), std::back_inserter(result));
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -437,9 +437,9 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf, sizeof(buf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_BINARY, &buf, sizeof(buf), &reslen, &offset);
- BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column1.IsValid());
@@ -449,7 +449,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
BOOST_REQUIRE_EQUAL_COLLECTIONS(buf, buf + reslen, data1.begin(), data1.end());
- BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column1.IsValid());
@@ -457,7 +457,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
BOOST_REQUIRE(column1.GetUnreadDataLength() == 0);
- BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column2.IsValid());
@@ -467,7 +467,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
BOOST_REQUIRE_EQUAL_COLLECTIONS(buf, buf + reslen, data2.begin(), data2.end());
- BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column2.IsValid());
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp b/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp
index dd8d1f6..c2fe4f8 100644
--- a/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp
@@ -38,181 +38,181 @@ BOOST_AUTO_TEST_CASE(TestConnectionInfoSupportedInfo)
ConnectionInfo info;
- SqlResult result;
+ SqlResult::Type result;
#ifdef SQL_DRIVER_NAME
result = info.GetInfo(SQL_DRIVER_NAME, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DRIVER_NAME
#ifdef SQL_DBMS_NAME
result = info.GetInfo(SQL_DBMS_NAME, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DBMS_NAME
#ifdef SQL_DRIVER_ODBC_VER
result = info.GetInfo(SQL_DRIVER_ODBC_VER, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DRIVER_ODBC_VER
#ifdef SQL_DBMS_VER
result = info.GetInfo(SQL_DBMS_VER, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DBMS_VER
#ifdef SQL_DRIVER_VER
result = info.GetInfo(SQL_DRIVER_VER, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DRIVER_VER
#ifdef SQL_COLUMN_ALIAS
result = info.GetInfo(SQL_COLUMN_ALIAS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_COLUMN_ALIAS
#ifdef SQL_IDENTIFIER_QUOTE_CHAR
result = info.GetInfo(SQL_IDENTIFIER_QUOTE_CHAR, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_IDENTIFIER_QUOTE_CHAR
#ifdef SQL_CATALOG_NAME_SEPARATOR
result = info.GetInfo(SQL_CATALOG_NAME_SEPARATOR, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CATALOG_NAME_SEPARATOR
#ifdef SQL_SPECIAL_CHARACTERS
result = info.GetInfo(SQL_SPECIAL_CHARACTERS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SPECIAL_CHARACTERS
#ifdef SQL_CATALOG_TERM
result = info.GetInfo(SQL_CATALOG_TERM, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CATALOG_TERM
#ifdef SQL_TABLE_TERM
result = info.GetInfo(SQL_TABLE_TERM, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TABLE_TERM
#ifdef SQL_SCHEMA_TERM
result = info.GetInfo(SQL_SCHEMA_TERM, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SCHEMA_TERM
#ifdef SQL_ASYNC_DBC_FUNCTIONS
result = info.GetInfo(SQL_ASYNC_DBC_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_ASYNC_DBC_FUNCTIONS
#ifdef SQL_GETDATA_EXTENSIONS
result = info.GetInfo(SQL_GETDATA_EXTENSIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_GETDATA_EXTENSIONS
#ifdef SQL_ODBC_INTERFACE_CONFORMANCE
result = info.GetInfo(SQL_ODBC_INTERFACE_CONFORMANCE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_ODBC_INTERFACE_CONFORMANCE
#ifdef SQL_SQL_CONFORMANCE
result = info.GetInfo(SQL_SQL_CONFORMANCE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SQL_CONFORMANCE
#ifdef SQL_CATALOG_USAGE
result = info.GetInfo(SQL_CATALOG_USAGE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CATALOG_USAGE
#ifdef SQL_SCHEMA_USAGE
result = info.GetInfo(SQL_SCHEMA_USAGE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SCHEMA_USAGE
#ifdef SQL_MAX_IDENTIFIER_LEN
result = info.GetInfo(SQL_MAX_IDENTIFIER_LEN, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_MAX_IDENTIFIER_LEN
#ifdef SQL_AGGREGATE_FUNCTIONS
result = info.GetInfo(SQL_AGGREGATE_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_AGGREGATE_FUNCTIONS
#ifdef SQL_AGGREGATE_FUNCTIONS
result = info.GetInfo(SQL_NUMERIC_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_AGGREGATE_FUNCTIONS
#ifdef SQL_STRING_FUNCTIONS
result = info.GetInfo(SQL_STRING_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_STRING_FUNCTIONS
#ifdef SQL_TIMEDATE_FUNCTIONS
result = info.GetInfo(SQL_TIMEDATE_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TIMEDATE_FUNCTIONS
#ifdef SQL_TIMEDATE_ADD_INTERVALS
result = info.GetInfo(SQL_TIMEDATE_ADD_INTERVALS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TIMEDATE_ADD_INTERVALS
#ifdef SQL_TIMEDATE_DIFF_INTERVALS
result = info.GetInfo(SQL_TIMEDATE_DIFF_INTERVALS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TIMEDATE_DIFF_INTERVALS
#ifdef SQL_DATETIME_LITERALS
result = info.GetInfo(SQL_DATETIME_LITERALS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DATETIME_LITERALS
#ifdef SQL_SYSTEM_FUNCTIONS
result = info.GetInfo(SQL_SYSTEM_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SYSTEM_FUNCTIONS
#ifdef SQL_CONVERT_FUNCTIONS
result = info.GetInfo(SQL_CONVERT_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CONVERT_FUNCTIONS
#ifdef SQL_OJ_CAPABILITIES
result = info.GetInfo(SQL_OJ_CAPABILITIES, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_OJ_CAPABILITIES
#ifdef SQL_POS_OPERATIONS
result = info.GetInfo(SQL_POS_OPERATIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_POS_OPERATIONS
#ifdef SQL_MAX_CONCURRENT_ACTIVITIES
result = info.GetInfo(SQL_MAX_CONCURRENT_ACTIVITIES, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_MAX_CONCURRENT_ACTIVITIES
#ifdef SQL_CURSOR_COMMIT_BEHAVIOR
result = info.GetInfo(SQL_CURSOR_COMMIT_BEHAVIOR, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CURSOR_COMMIT_BEHAVIOR
#ifdef SQL_CURSOR_ROLLBACK_BEHAVIOR
result = info.GetInfo(SQL_CURSOR_ROLLBACK_BEHAVIOR, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CURSOR_ROLLBACK_BEHAVIOR
#ifdef SQL_TXN_CAPABLE
result = info.GetInfo(SQL_TXN_CAPABLE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TXN_CAPABLE
#ifdef SQL_QUOTED_IDENTIFIER_CASE
result = info.GetInfo(SQL_QUOTED_IDENTIFIER_CASE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_QUOTED_IDENTIFIER_CASE
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc-test/src/row_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/row_test.cpp b/modules/platforms/cpp/odbc-test/src/row_test.cpp
index f38e9c5..c692291 100644
--- a/modules/platforms/cpp/odbc-test/src/row_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/row_test.cpp
@@ -84,20 +84,20 @@ void CheckRowData(Row& row, size_t rowIdx)
char bitBuf;
int* offset = 0;
- ApplicationDataBuffer appLongBuf(type_traits::IGNITE_ODBC_C_TYPE_SIGNED_LONG, &longBuf, sizeof(longBuf), &reslen, &offset);
- ApplicationDataBuffer appStrBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
- ApplicationDataBuffer appGuidBuf(type_traits::IGNITE_ODBC_C_TYPE_GUID, &guidBuf, sizeof(guidBuf), &reslen, &offset);
- ApplicationDataBuffer appBitBuf(type_traits::IGNITE_ODBC_C_TYPE_BIT, &bitBuf, sizeof(bitBuf), &reslen, &offset);
+ ApplicationDataBuffer appLongBuf(type_traits::OdbcNativeType::AI_SIGNED_LONG, &longBuf, sizeof(longBuf), &reslen, &offset);
+ ApplicationDataBuffer appStrBuf(type_traits::OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
+ ApplicationDataBuffer appGuidBuf(type_traits::OdbcNativeType::AI_GUID, &guidBuf, sizeof(guidBuf), &reslen, &offset);
+ ApplicationDataBuffer appBitBuf(type_traits::OdbcNativeType::AI_BIT, &bitBuf, sizeof(bitBuf), &reslen, &offset);
// Checking size.
BOOST_REQUIRE(row.GetSize() == 4);
// Checking 1st column.
- BOOST_REQUIRE(row.ReadColumnToBuffer(1, appLongBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(row.ReadColumnToBuffer(1, appLongBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(longBuf == rowIdx * 10);
// Checking 2nd column.
- BOOST_REQUIRE(row.ReadColumnToBuffer(2, appStrBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(row.ReadColumnToBuffer(2, appStrBuf) == SqlResult::AI_SUCCESS);
std::string strReal(strBuf, static_cast<size_t>(reslen));
std::string strExpected(GetStrColumnValue(rowIdx));
@@ -105,7 +105,7 @@ void CheckRowData(Row& row, size_t rowIdx)
BOOST_REQUIRE(strReal == strExpected);
// Checking 3rd column.
- BOOST_REQUIRE(row.ReadColumnToBuffer(3, appGuidBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(row.ReadColumnToBuffer(3, appGuidBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(guidBuf.Data1 == 0x2b218f63UL);
BOOST_REQUIRE(guidBuf.Data2 == 0x642aU);
@@ -121,7 +121,7 @@ void CheckRowData(Row& row, size_t rowIdx)
BOOST_REQUIRE(guidBuf.Data4[7] == 0x98 + rowIdx);
// Checking 4th column.
- BOOST_REQUIRE(row.ReadColumnToBuffer(4, appBitBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(row.ReadColumnToBuffer(4, appBitBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(bitBuf == rowIdx % 2);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h b/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h
index 31c2709..24461c2 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h
@@ -57,7 +57,7 @@ namespace ignite
* @param reslen Resulting data length.
* @param offset Pointer to buffer and reslen offset pointer.
*/
- ApplicationDataBuffer(type_traits::IgniteSqlType type, void* buffer,
+ ApplicationDataBuffer(type_traits::OdbcNativeType::Type type, void* buffer,
SqlLen buflen, SqlLen* reslen, int** offset = 0);
/**
@@ -341,7 +341,7 @@ namespace ignite
*
* @return Buffer type.
*/
- type_traits::IgniteSqlType GetType() const
+ type_traits::OdbcNativeType::Type GetType() const
{
return type;
}
@@ -413,7 +413,7 @@ namespace ignite
T* ApplyOffset(T* ptr) const;
/** Underlying data type. */
- type_traits::IgniteSqlType type;
+ type_traits::OdbcNativeType::Type type;
/** Buffer pointer. */
void* buffer;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/column.h b/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
index 1297279..a8b8863 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
@@ -82,7 +82,7 @@ namespace ignite
* @param dataBuf Application data buffer.
* @return Operation result.
*/
- SqlResult ReadToBuffer(ignite::impl::binary::BinaryReaderImpl& reader,
+ SqlResult::Type ReadToBuffer(ignite::impl::binary::BinaryReaderImpl& reader,
app::ApplicationDataBuffer& dataBuf);
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
index 5d8901d..0a3b02f 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
@@ -21,10 +21,6 @@
#include <stdint.h>
#include "system/odbc_constants.h"
-#include <ignite/odbc/system/odbc_constants.h>
-
-#include <ignite/odbc/system/odbc_constants.h>
-
namespace ignite
{
namespace odbc
@@ -35,206 +31,218 @@ namespace ignite
/**
* SQL result.
*/
- enum SqlResult
+ struct SqlResult
{
- /** Success. */
- SQL_RESULT_SUCCESS,
+ enum Type
+ {
+ /** Success. */
+ AI_SUCCESS,
- /** Success with info. */
- SQL_RESULT_SUCCESS_WITH_INFO,
+ /** Success with info. */
+ AI_SUCCESS_WITH_INFO,
- /** Error. */
- SQL_RESULT_ERROR,
+ /** Error. */
+ AI_ERROR,
- /** No more data. */
- SQL_RESULT_NO_DATA,
+ /** No more data. */
+ AI_NO_DATA,
- /** No more data. */
- SQL_RESULT_NEED_DATA
+ /** No more data. */
+ AI_NEED_DATA
+ };
};
/**
* Provides detailed information about the cause of a warning or error.
*/
- enum SqlState
+ struct SqlState
{
- /** Undefined state. Internal, should never be exposed to user. */
- SQL_STATE_UNKNOWN,
-
- /** Output data has been truncated. */
- SQL_STATE_01004_DATA_TRUNCATED,
-
- /** Invalid connection string attribute. */
- SQL_STATE_01S00_INVALID_CONNECTION_STRING_ATTRIBUTE,
-
- /** Error in row. */
- SQL_STATE_01S01_ERROR_IN_ROW,
-
- /**
- * The driver did not support the specified value and
- * substituted a similar value.
- */
- SQL_STATE_01S02_OPTION_VALUE_CHANGED,
-
- /** String data, length mismatch. */
- SQL_STATE_22026_DATA_LENGTH_MISMATCH,
-
- /** Invalid cursor state. */
- SQL_STATE_24000_INVALID_CURSOR_STATE,
-
- /** Invalid descriptor index. */
- SQL_STATE_07009_INVALID_DESCRIPTOR_INDEX,
-
- /**
- * The driver was unable to establish a connection with the data
- * source.
- */
- SQL_STATE_08001_CANNOT_CONNECT,
-
- /**
- * The specified ConnectionHandle had already been used
- * to establish a connection with a data source, and the connection
- * was still open.
- */
- SQL_STATE_08002_ALREADY_CONNECTED,
-
- /** The connection specified was not open. */
- SQL_STATE_08003_NOT_CONNECTED,
-
- /**
- * An error occurred for which there was no specific SQLSTATE
- * and for which no implementation-specific SQLSTATE was defined.
- */
- SQL_STATE_HY000_GENERAL_ERROR,
-
- /**
- * The driver was unable to allocate memory for the specified
- * handle.
- */
- SQL_STATE_HY001_MEMORY_ALLOCATION,
-
- /**
- * The argument TargetType was neither a valid data type
- * nor SQL_C_DEFAULT
- */
- SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE,
-
- /** Invalid use of null pointer. */
- SQL_STATE_HY009_INVALID_USE_OF_NULL_POINTER,
-
- /** Function sequence error. */
- SQL_STATE_HY010_SEQUENCE_ERROR,
-
- /**
- * Invalid string or buffer length
- */
- SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH,
-
- /**
- * Option type was out of range.
- */
- SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE,
-
- /** Column type out of range. */
- SQL_STATE_HY097_COLUMN_TYPE_OUT_OF_RANGE,
-
- /** The value specified for the argument InputOutputType was invalid. */
- SQL_STATE_HY105_INVALID_PARAMETER_TYPE,
-
- /** The value specified for the argument FetchOrientation was invalid. */
- SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE,
-
- /**
- * The driver does not support the feature of ODBC behavior that
- * the application requested.
- */
- SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
-
- /**
- * The connection timeout period expired before the data source
- * responded to the request.
- */
- SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT,
-
- /**
- * Driver does not support this function.
- */
- SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED
+ enum Type
+ {
+ /** Undefined state. Internal, should never be exposed to user. */
+ UNKNOWN,
+
+ /** Output data has been truncated. */
+ S01004_DATA_TRUNCATED,
+
+ /** Invalid connection string attribute. */
+ S01S00_INVALID_CONNECTION_STRING_ATTRIBUTE,
+
+ /** Error in row. */
+ S01S01_ERROR_IN_ROW,
+
+ /**
+ * The driver did not support the specified value and
+ * substituted a similar value.
+ */
+ S01S02_OPTION_VALUE_CHANGED,
+
+ /** String data, length mismatch. */
+ S22026_DATA_LENGTH_MISMATCH,
+
+ /** Invalid cursor state. */
+ S24000_INVALID_CURSOR_STATE,
+
+ /** Invalid descriptor index. */
+ S07009_INVALID_DESCRIPTOR_INDEX,
+
+ /**
+ * The driver was unable to establish a connection with the data
+ * source.
+ */
+ S08001_CANNOT_CONNECT,
+
+ /**
+ * The specified ConnectionHandle had already been used
+ * to establish a connection with a data source, and the connection
+ * was still open.
+ */
+ S08002_ALREADY_CONNECTED,
+
+ /** The connection specified was not open. */
+ S08003_NOT_CONNECTED,
+
+ /**
+ * An error occurred for which there was no specific SQLSTATE
+ * and for which no implementation-specific SQLSTATE was defined.
+ */
+ SHY000_GENERAL_ERROR,
+
+ /**
+ * The driver was unable to allocate memory for the specified
+ * handle.
+ */
+ SHY001_MEMORY_ALLOCATION,
+
+ /**
+ * The argument TargetType was neither a valid data type
+ * nor SQL_C_DEFAULT
+ */
+ SHY003_INVALID_APPLICATION_BUFFER_TYPE,
+
+ /** Invalid use of null pointer. */
+ SHY009_INVALID_USE_OF_NULL_POINTER,
+
+ /** Function sequence error. */
+ SHY010_SEQUENCE_ERROR,
+
+ /**
+ * Invalid string or buffer length
+ */
+ SHY090_INVALID_STRING_OR_BUFFER_LENGTH,
+
+ /**
+ * Option type was out of range.
+ */
+ SHY092_OPTION_TYPE_OUT_OF_RANGE,
+
+ /** Column type out of range. */
+ SHY097_COLUMN_TYPE_OUT_OF_RANGE,
+
+ /** The value specified for the argument InputOutputType was invalid. */
+ SHY105_INVALID_PARAMETER_TYPE,
+
+ /** The value specified for the argument FetchOrientation was invalid. */
+ SHY106_FETCH_TYPE_OUT_OF_RANGE,
+
+ /**
+ * The driver does not support the feature of ODBC behavior that
+ * the application requested.
+ */
+ SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+
+ /**
+ * The connection timeout period expired before the data source
+ * responded to the request.
+ */
+ SHYT01_CONNECTIOIN_TIMEOUT,
+
+ /**
+ * Driver does not support this function.
+ */
+ SIM001_FUNCTION_NOT_SUPPORTED
+ };
};
/**
* Diagnostic field type.
*/
- enum DiagnosticField
+ struct DiagnosticField
{
- /** Field type is unknown to the driver. */
- IGNITE_SQL_DIAG_UNKNOWN,
+ enum Type
+ {
+ /** Field type is unknown to the driver. */
+ UNKNOWN,
- /** Header record field: Count of rows in the cursor. */
- IGNITE_SQL_DIAG_HEADER_CURSOR_ROW_COUNT,
+ /** Header record field: Count of rows in the cursor. */
+ HEADER_CURSOR_ROW_COUNT,
- /**
- * Header record field: String that describes the SQL statement
- * that the underlying function executed.
- */
- IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION,
+ /**
+ * Header record field: String that describes the SQL statement
+ * that the underlying function executed.
+ */
+ HEADER_DYNAMIC_FUNCTION,
- /**
- * Header record field: Numeric code that describes the SQL
- * statement that was executed by the underlying function.
- */
- IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION_CODE,
+ /**
+ * Header record field: Numeric code that describes the SQL
+ * statement that was executed by the underlying function.
+ */
+ HEADER_DYNAMIC_FUNCTION_CODE,
- /** Header record field: Number of status records. */
- IGNITE_SQL_DIAG_HEADER_NUMBER,
+ /** Header record field: Number of status records. */
+ HEADER_NUMBER,
- /** Header record field: Last operation return code. */
- IGNITE_SQL_DIAG_HEADER_RETURNCODE,
+ /** Header record field: Last operation return code. */
+ HEADER_RETURNCODE,
- /** Header record field: Row count. */
- IGNITE_SQL_DIAG_HEADER_ROW_COUNT,
+ /** Header record field: Row count. */
+ HEADER_ROW_COUNT,
- /** Status record field: Class origin. */
- IGNITE_SQL_DIAG_STATUS_CLASS_ORIGIN,
+ /** Status record field: Class origin. */
+ STATUS_CLASS_ORIGIN,
- /** Status record field: Column number. */
- IGNITE_SQL_DIAG_STATUS_COLUMN_NUMBER,
+ /** Status record field: Column number. */
+ STATUS_COLUMN_NUMBER,
- /** Status record field: Connection name. */
- IGNITE_SQL_DIAG_STATUS_CONNECTION_NAME,
+ /** Status record field: Connection name. */
+ STATUS_CONNECTION_NAME,
- /** Status record field: Message text. */
- IGNITE_SQL_DIAG_STATUS_MESSAGE_TEXT,
+ /** Status record field: Message text. */
+ STATUS_MESSAGE_TEXT,
- /** Status record field: Native result code. */
- IGNITE_SQL_DIAG_STATUS_NATIVE,
+ /** Status record field: Native result code. */
+ STATUS_NATIVE,
- /** Status record field: Row number. */
- IGNITE_SQL_DIAG_STATUS_ROW_NUMBER,
+ /** Status record field: Row number. */
+ STATUS_ROW_NUMBER,
- /** Status record field: Server name. */
- IGNITE_SQL_DIAG_STATUS_SERVER_NAME,
+ /** Status record field: Server name. */
+ STATUS_SERVER_NAME,
- /** Status record field: SQLSTATE. */
- IGNITE_SQL_DIAG_STATUS_SQLSTATE,
+ /** Status record field: SQLSTATE. */
+ STATUS_SQLSTATE,
- /** Status record field: Subclass origin. */
- IGNITE_SQL_DIAG_STATUS_SUBCLASS_ORIGIN
+ /** Status record field: Subclass origin. */
+ STATUS_SUBCLASS_ORIGIN
+ };
};
/**
* Environment attribute.
*/
- enum EnvironmentAttribute
+ struct EnvironmentAttribute
{
- /** ODBC attribute is unknown to the driver. */
- IGNITE_SQL_ENV_ATTR_UNKNOWN,
+ enum Type
+ {
+ /** ODBC attribute is unknown to the driver. */
+ UNKNOWN,
- /** ODBC version. */
- IGNITE_SQL_ENV_ATTR_ODBC_VERSION,
+ /** ODBC version. */
+ ODBC_VERSION,
- /** Null-termination of strings. */
- IGNITE_SQL_ENV_ATTR_OUTPUT_NTS
+ /** Null-termination of strings. */
+ OUTPUT_NTS
+ };
};
/**
@@ -243,23 +251,23 @@ namespace ignite
* @param result Internal result type.
* @return ODBC result type.
*/
- int SqlResultToReturnCode(SqlResult result);
+ int SqlResultToReturnCode(SqlResult::Type result);
/**
- * Convert ODBC field type to internal DiagnosticField type value.
+ * Convert ODBC field type to internal DiagnosticField::Type type value.
*
* @param field ODBC field type.
- * @return Internal DiagnosticField type value.
+ * @return Internal DiagnosticField::Type type value.
*/
- DiagnosticField DiagnosticFieldToInternal(int16_t field);
+ DiagnosticField::Type DiagnosticFieldToInternal(int16_t field);
/**
- * Convert environment attribute to internal EnvironmentAttribute type value.
+ * Convert environment attribute to internal EnvironmentAttribute::Type type value.
*
* @param attr Environment attribute.
- * @return Internal EnvironmentAttribute type value.
+ * @return Internal EnvironmentAttribute::Type type value.
*/
- EnvironmentAttribute EnvironmentAttributeToInternal(int32_t attr);
+ EnvironmentAttribute::Type EnvironmentAttributeToInternal(int32_t attr);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
index d421952..c17d5ec 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
@@ -66,7 +66,7 @@ namespace ignite
* @param reslen Result value length pointer.
* @return True on success.
*/
- SqlResult GetInfo(InfoType type, void* buf, short buflen, short* reslen) const;
+ SqlResult::Type GetInfo(InfoType type, void* buf, short buflen, short* reslen) const;
private:
IGNITE_NO_COPY_ASSIGNMENT(ConnectionInfo);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h b/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h
index acf82ba..c3f27a2 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h
@@ -129,7 +129,7 @@ namespace ignite
* @param columnNum Associated column number.
* @return DiagnosticRecord associated with the instance.
*/
- static diagnostic::DiagnosticRecord CreateStatusRecord(SqlState sqlState,
+ static diagnostic::DiagnosticRecord CreateStatusRecord(SqlState::Type sqlState,
const std::string& message, int32_t rowNum = 0, int32_t columnNum = 0);
/**
@@ -172,7 +172,7 @@ namespace ignite
* @param connectStr Connection string.
* @return Operation result.
*/
- SqlResult InternalEstablish(const std::string& connectStr);
+ SqlResult::Type InternalEstablish(const std::string& connectStr);
/**
* Establish connection to ODBC server.
@@ -181,7 +181,7 @@ namespace ignite
* @param cfg Configuration.
* @return Operation result.
*/
- SqlResult InternalEstablish(const config::Configuration cfg);
+ SqlResult::Type InternalEstablish(const config::Configuration cfg);
/**
* Release established connection.
@@ -189,7 +189,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalRelease();
+ SqlResult::Type InternalRelease();
/**
* Get info of any type.
@@ -201,7 +201,7 @@ namespace ignite
* @param reslen Result value length pointer.
* @return Operation result.
*/
- SqlResult InternalGetInfo(config::ConnectionInfo::InfoType type, void* buf, short buflen, short* reslen);
+ SqlResult::Type InternalGetInfo(config::ConnectionInfo::InfoType type, void* buf, short buflen, short* reslen);
/**
* Create statement associated with the connection.
@@ -210,7 +210,7 @@ namespace ignite
* @param Pointer to valid instance on success and NULL on failure.
* @return Operation result.
*/
- SqlResult InternalCreateStatement(Statement*& statement);
+ SqlResult::Type InternalCreateStatement(Statement*& statement);
/**
* Perform transaction commit on all the associated connections.
@@ -218,7 +218,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalTransactionCommit();
+ SqlResult::Type InternalTransactionCommit();
/**
* Perform transaction rollback on all the associated connections.
@@ -226,7 +226,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalTransactionRollback();
+ SqlResult::Type InternalTransactionRollback();
/**
* Receive specified number of bytes.
@@ -251,7 +251,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult MakeRequestHandshake();
+ SqlResult::Type MakeRequestHandshake();
/**
* Constructor.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h
index 6937fcc..4eb1a38 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h
@@ -62,7 +62,7 @@ namespace ignite
* @param rowNum Associated row number.
* @param columnNum Associated column number.
*/
- virtual void AddStatusRecord(SqlState sqlState, const std::string& message,
+ virtual void AddStatusRecord(SqlState::Type sqlState, const std::string& message,
int32_t rowNum, int32_t columnNum) = 0;
/**
@@ -71,7 +71,7 @@ namespace ignite
* @param sqlState SQL state.
* @param message Message.
*/
- virtual void AddStatusRecord(SqlState sqlState, const std::string& message) = 0;
+ virtual void AddStatusRecord(SqlState::Type sqlState, const std::string& message) = 0;
protected:
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h
index 548eecd..45f47f0 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h
@@ -22,12 +22,12 @@
#define IGNITE_ODBC_API_CALL(...) \
diagnosticRecords.Reset(); \
- SqlResult result = (__VA_ARGS__); \
+ SqlResult::Type result = (__VA_ARGS__); \
diagnosticRecords.SetHeaderRecord(result)
#define IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS \
diagnosticRecords.Reset(); \
- diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS)
+ diagnosticRecords.SetHeaderRecord(SqlResult::AI_SUCCESS)
namespace ignite
{
@@ -79,7 +79,7 @@ namespace ignite
* @param rowNum Associated row number.
* @param columnNum Associated column number.
*/
- virtual void AddStatusRecord(SqlState sqlState, const std::string& message,
+ virtual void AddStatusRecord(SqlState::Type sqlState, const std::string& message,
int32_t rowNum, int32_t columnNum);
/**
@@ -88,7 +88,7 @@ namespace ignite
* @param sqlState SQL state.
* @param message Message.
*/
- virtual void AddStatusRecord(SqlState sqlState, const std::string& message);
+ virtual void AddStatusRecord(SqlState::Type sqlState, const std::string& message);
protected:
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h
index 80d5090..18cc93a 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h
@@ -53,7 +53,7 @@ namespace ignite
* @param rowNum Associated row number.
* @param columnNum Associated column number.
*/
- DiagnosticRecord(SqlState sqlState, const std::string& message,
+ DiagnosticRecord(SqlState::Type sqlState, const std::string& message,
const std::string& connectionName, const std::string& serverName,
int32_t rowNum = 0, int32_t columnNum = 0);
@@ -142,7 +142,7 @@ namespace ignite
private:
/** SQL state diagnostic code. */
- SqlState sqlState;
+ SqlState::Type sqlState;
/** An informational message on the error or warning. */
std::string message;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h
index b45bb7d..9a816da 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h
@@ -64,7 +64,7 @@ namespace ignite
*
* @param retCode Operation return code.
*/
- void SetHeaderRecord(SqlResult result);
+ void SetHeaderRecord(SqlResult::Type result);
/**
* Add status record to diagnostic records.
@@ -83,7 +83,7 @@ namespace ignite
*
* @return Result of the last operation.
*/
- SqlResult GetOperaionResult() const;
+ SqlResult::Type GetOperaionResult() const;
/**
* Get return code of the last operation.
@@ -169,7 +169,7 @@ namespace ignite
* @param buffer Buffer to put data to.
* @return Operation result.
*/
- SqlResult GetField(int32_t recNum, DiagnosticField field, app::ApplicationDataBuffer& buffer) const;
+ SqlResult::Type GetField(int32_t recNum, DiagnosticField::Type field, app::ApplicationDataBuffer& buffer) const;
private:
IGNITE_NO_COPY_ASSIGNMENT(DiagnosticRecordStorage);
@@ -196,7 +196,7 @@ namespace ignite
* Operation result. This field is mapped to "Return code" header
* record field.
*/
- SqlResult result;
+ SqlResult::Type result;
/**
* Header record field. The number of rows affected by an insert,
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h b/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h
index 0c8af64..3eeade6 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h
@@ -86,7 +86,7 @@ namespace ignite
* @return Pointer to valid instance on success or NULL on failure.
* @return Operation result.
*/
- SqlResult InternalCreateConnection(Connection*& connection);
+ SqlResult::Type InternalCreateConnection(Connection*& connection);
/**
* Perform transaction commit on all the associated connections.
@@ -94,7 +94,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalTransactionCommit();
+ SqlResult::Type InternalTransactionCommit();
/**
* Perform transaction rollback on all the associated connections.
@@ -102,7 +102,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalTransactionRollback();
+ SqlResult::Type InternalTransactionRollback();
/**
* Set attribute.
@@ -113,7 +113,7 @@ namespace ignite
* @param len Value length if the attribute is of string type.
* @return Operation result.
*/
- SqlResult InternalSetAttribute(int32_t attr, void* value, int32_t len);
+ SqlResult::Type InternalSetAttribute(int32_t attr, void* value, int32_t len);
/**
* Get attribute.
@@ -123,7 +123,7 @@ namespace ignite
* @param buffer Buffer to put value to.
* @return Operation result.
*/
- SqlResult InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer);
+ SqlResult::Type InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer);
/** ODBC version. */
int32_t odbcVersion;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/message.h b/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
index 7061fc9..60b2d9b 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
@@ -34,28 +34,34 @@ namespace ignite
{
namespace odbc
{
- enum RequestType
+ struct RequestType
{
- REQUEST_TYPE_HANDSHAKE = 1,
+ enum Type
+ {
+ HANDSHAKE = 1,
- REQUEST_TYPE_EXECUTE_SQL_QUERY = 2,
+ EXECUTE_SQL_QUERY = 2,
- REQUEST_TYPE_FETCH_SQL_QUERY = 3,
+ FETCH_SQL_QUERY = 3,
- REQUEST_TYPE_CLOSE_SQL_QUERY = 4,
+ CLOSE_SQL_QUERY = 4,
- REQUEST_TYPE_GET_COLUMNS_METADATA = 5,
+ GET_COLUMNS_METADATA = 5,
- REQUEST_TYPE_GET_TABLES_METADATA = 6,
+ GET_TABLES_METADATA = 6,
- REQUEST_TYPE_GET_PARAMS_METADATA = 7
+ GET_PARAMS_METADATA = 7
+ };
};
- enum ResponseStatus
+ struct ResponseStatus
{
- RESPONSE_STATUS_SUCCESS = 0,
+ enum Type
+ {
+ SUCCESS = 0,
- RESPONSE_STATUS_FAILED = 1
+ FAILED = 1
+ };
};
/**
@@ -93,7 +99,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_HANDSHAKE);
+ writer.WriteInt8(RequestType::HANDSHAKE);
writer.WriteInt64(version);
@@ -148,7 +154,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_EXECUTE_SQL_QUERY);
+ writer.WriteInt8(RequestType::EXECUTE_SQL_QUERY);
utility::WriteString(writer, cache);
utility::WriteString(writer, sql);
@@ -213,7 +219,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_CLOSE_SQL_QUERY);
+ writer.WriteInt8(RequestType::CLOSE_SQL_QUERY);
writer.WriteInt64(queryId);
}
@@ -255,7 +261,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_FETCH_SQL_QUERY);
+ writer.WriteInt8(RequestType::FETCH_SQL_QUERY);
writer.WriteInt64(queryId);
writer.WriteInt32(pageSize);
}
@@ -303,7 +309,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_GET_COLUMNS_METADATA);
+ writer.WriteInt8(RequestType::GET_COLUMNS_METADATA);
utility::WriteString(writer, schema);
utility::WriteString(writer, table);
@@ -359,7 +365,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_GET_TABLES_METADATA);
+ writer.WriteInt8(RequestType::GET_TABLES_METADATA);
utility::WriteString(writer, catalog);
utility::WriteString(writer, schema);
@@ -390,10 +396,8 @@ namespace ignite
/**
* Constructor.
*
- * @param catalog Catalog search pattern.
- * @param schema Schema search pattern.
- * @param table Table search pattern.
- * @param tableTypes Table types search pattern.
+ * @param cacheName Cache name.
+ * @param sqlQuery SQL query itself.
*/
QueryGetParamsMetaRequest(const std::string& cacheName, const std::string& sqlQuery) :
cacheName(cacheName),
@@ -416,7 +420,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_GET_PARAMS_METADATA);
+ writer.WriteInt8(RequestType::GET_PARAMS_METADATA);
utility::WriteString(writer, cacheName);
utility::WriteString(writer, sqlQuery);
@@ -431,7 +435,7 @@ namespace ignite
};
/**
- * Query close response.
+ * General response.
*/
class Response
{
@@ -439,7 +443,7 @@ namespace ignite
/**
* Constructor.
*/
- Response() : status(RESPONSE_STATUS_FAILED), error()
+ Response() : status(ResponseStatus::FAILED), error()
{
// No-op.
}
@@ -460,7 +464,7 @@ namespace ignite
{
status = reader.ReadInt8();
- if (status == RESPONSE_STATUS_SUCCESS)
+ if (status == ResponseStatus::SUCCESS)
ReadOnSuccess(reader);
else
utility::ReadString(reader, error);;
@@ -486,7 +490,7 @@ namespace ignite
protected:
/**
- * Read data if response status is RESPONSE_STATUS_SUCCESS.
+ * Read data if response status is ResponseStatus::SUCCESS.
*/
virtual void ReadOnSuccess(ignite::impl::binary::BinaryReaderImpl&)
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h
index 85a9474..878a4be 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h
@@ -59,7 +59,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -73,7 +73,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -82,14 +82,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
@@ -113,7 +113,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult MakeRequestGetColumnsMeta();
+ SqlResult::Type MakeRequestGetColumnsMeta();
/** Connection associated with the statement. */
Connection& connection;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h
index 68bb877..ade8fb0 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h
@@ -58,7 +58,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -73,7 +73,7 @@ namespace ignite
* @param columnBindings Application buffers to put data to.
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -82,14 +82,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
- * @return True on success.
+ * @return Result.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
@@ -124,21 +124,28 @@ namespace ignite
*
* @return True on success.
*/
- SqlResult MakeRequestExecute();
+ SqlResult::Type MakeRequestExecute();
/**
* Make query close request.
*
* @return True on success.
*/
- SqlResult MakeRequestClose();
+ SqlResult::Type MakeRequestClose();
/**
* Make data fetch request and use response to set internal state.
*
* @return True on success.
*/
- SqlResult MakeRequestFetch();
+ SqlResult::Type MakeRequestFetch();
+
+ /**
+ * Close query.
+ *
+ * @return Result.
+ */
+ SqlResult::Type InternalClose();
/** Connection associated with the statement. */
Connection& connection;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h
index 0fb1e5f..7d60728 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h
@@ -60,7 +60,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -74,7 +74,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -83,14 +83,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h
index 5cb7b6e..65bac33 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h
@@ -57,7 +57,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -71,7 +71,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -80,14 +80,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h
index 40be1ed..4959eaf 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h
@@ -33,14 +33,11 @@ namespace ignite
{
namespace query
{
- /**
- * Query.
- */
- class Query
+ /** Query type. */
+ struct QueryType
{
- public:
- /** Query type. */
- enum Type {
+ enum Type
+ {
/** Column metadata query type. */
COLUMN_METADATA,
@@ -62,7 +59,14 @@ namespace ignite
/** Type info query type. */
TYPE_INFO
};
+ };
+ /**
+ * Query.
+ */
+ class Query
+ {
+ public:
/**
* Destructor.
*/
@@ -76,7 +80,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute() = 0;
+ virtual SqlResult::Type Execute() = 0;
/**
* Fetch next result row to application buffers.
@@ -84,7 +88,7 @@ namespace ignite
* @param columnBindings Application buffers to put data to.
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings) = 0;
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings) = 0;
/**
* Get data of the specified column in the result set.
@@ -93,14 +97,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer) = 0;
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer) = 0;
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close() = 0;
+ virtual SqlResult::Type Close() = 0;
/**
* Get column metadata.
@@ -128,7 +132,7 @@ namespace ignite
*
* @return Query type.
*/
- Type GetType() const
+ QueryType::Type GetType() const
{
return type;
}
@@ -137,7 +141,7 @@ namespace ignite
/**
* Constructor.
*/
- Query(diagnostic::Diagnosable& diag, Type type) :
+ Query(diagnostic::Diagnosable& diag, QueryType::Type type) :
diag(diag),
type(type)
{
@@ -148,7 +152,7 @@ namespace ignite
diagnostic::Diagnosable& diag;
/** Query type. */
- Type type;
+ QueryType::Type type;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h
index 1d2f339..0f6660f 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h
@@ -58,7 +58,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Fetch next result row to application buffers.
@@ -66,7 +66,7 @@ namespace ignite
* @param columnBindings Application buffers to put data to.
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -75,14 +75,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Get column metadata.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h
index 6322435..cef963c 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h
@@ -60,7 +60,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -74,7 +74,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -83,14 +83,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
@@ -114,7 +114,7 @@ namespace ignite
*
* @return True on success.
*/
- SqlResult MakeRequestGetTablesMeta();
+ SqlResult::Type MakeRequestGetTablesMeta();
/** Connection associated with the statement. */
Connection& connection;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h
index d337d03..22b291a 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h
@@ -50,7 +50,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -64,7 +64,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -73,14 +73,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/row.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/row.h b/modules/platforms/cpp/odbc/include/ignite/odbc/row.h
index 888432e..9c0c117 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/row.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/row.h
@@ -61,7 +61,7 @@ namespace ignite
* @param dataBuf Application data buffer.
* @return True on success.
*/
- SqlResult ReadColumnToBuffer(uint16_t columnIdx, app::ApplicationDataBuffer& dataBuf);
+ SqlResult::Type ReadColumnToBuffer(uint16_t columnIdx, app::ApplicationDataBuffer& dataBuf);
/**
* Move to next row.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
index 596fc66..09122c3 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
@@ -393,7 +393,7 @@ namespace ignite
* @param strLengthOrIndicator Pointer to the length/indicator buffer.
* @return Operation result.
*/
- SqlResult InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator);
+ SqlResult::Type InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator);
/**
* Bind parameter.
@@ -429,7 +429,7 @@ namespace ignite
* @param resLen A pointer to a buffer for the parameter's length.
* @return Operation result.
*/
- SqlResult InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+ SqlResult::Type InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen);
/**
@@ -441,7 +441,7 @@ namespace ignite
* @param valueLen Value length.
* @return Operation result.
*/
- SqlResult InternalSetAttribute(int attr, void* value, SQLINTEGER valueLen);
+ SqlResult::Type InternalSetAttribute(int attr, void* value, SQLINTEGER valueLen);
/**
* Get statement attribute.
@@ -453,7 +453,7 @@ namespace ignite
* @param valueLen Resulting value length.
* @return Operation result.
*/
- SqlResult InternalGetAttribute(int attr, void* buf, SQLINTEGER bufLen, SQLINTEGER* valueLen);
+ SqlResult::Type InternalGetAttribute(int attr, void* buf, SQLINTEGER bufLen, SQLINTEGER* valueLen);
/**
* Get value of the column in the result set.
@@ -462,7 +462,7 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- SqlResult InternalGetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ SqlResult::Type InternalGetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
@@ -470,7 +470,7 @@ namespace ignite
* @param option indicates what needs to be freed
* @return Operation result.
*/
- SqlResult InternalFreeResources(int16_t option);
+ SqlResult::Type InternalFreeResources(int16_t option);
/**
* Close statement.
@@ -478,7 +478,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalClose();
+ SqlResult::Type InternalClose();
/**
* Prepare SQL query.
@@ -486,7 +486,7 @@ namespace ignite
* @param query SQL query.
* @return Operation result.
*/
- SqlResult InternalPrepareSqlQuery(const std::string& query);
+ SqlResult::Type InternalPrepareSqlQuery(const std::string& query);
/**
* Execute SQL query.
@@ -494,14 +494,14 @@ namespace ignite
* @param query SQL query.
* @return Operation result.
*/
- SqlResult InternalExecuteSqlQuery(const std::string& query);
+ SqlResult::Type InternalExecuteSqlQuery(const std::string& query);
/**
* Execute SQL query.
*
* @return Operation result.
*/
- SqlResult InternalExecuteSqlQuery();
+ SqlResult::Type InternalExecuteSqlQuery();
/**
* Fetch query result row with offset
@@ -509,14 +509,14 @@ namespace ignite
* @param offset Fetch offset
* @return Operation result.
*/
- SqlResult InternalFetchScroll(int16_t orientation, int64_t offset);
+ SqlResult::Type InternalFetchScroll(int16_t orientation, int64_t offset);
/**
* Fetch query result row.
*
* @return Operation result.
*/
- SqlResult InternalFetchRow();
+ SqlResult::Type InternalFetchRow();
/**
* Get number of columns in the result set.
@@ -524,7 +524,7 @@ namespace ignite
* @param res Columns number.
* @return Operation result.
*/
- SqlResult InternalGetColumnNumber(int32_t &res);
+ SqlResult::Type InternalGetColumnNumber(int32_t &res);
/**
* Get columns metadata.
@@ -534,7 +534,7 @@ namespace ignite
* @param column Column search pattern.
* @return Operation result.
*/
- SqlResult InternalExecuteGetColumnsMetaQuery(const std::string& schema,
+ SqlResult::Type InternalExecuteGetColumnsMetaQuery(const std::string& schema,
const std::string& table, const std::string& column);
/**
@@ -546,7 +546,7 @@ namespace ignite
* @param tableType Table type search pattern.
* @return Operation result.
*/
- SqlResult InternalExecuteGetTablesMetaQuery(const std::string& catalog,
+ SqlResult::Type InternalExecuteGetTablesMetaQuery(const std::string& catalog,
const std::string& schema, const std::string& table,
const std::string& tableType);
@@ -561,7 +561,7 @@ namespace ignite
* @param foreignTable Foreign key table name.
* @return Operation result.
*/
- SqlResult InternalExecuteGetForeignKeysQuery(const std::string& primaryCatalog,
+ SqlResult::Type InternalExecuteGetForeignKeysQuery(const std::string& primaryCatalog,
const std::string& primarySchema, const std::string& primaryTable,
const std::string& foreignCatalog, const std::string& foreignSchema,
const std::string& foreignTable);
@@ -574,7 +574,7 @@ namespace ignite
* @param table Table name.
* @return Operation result.
*/
- SqlResult InternalExecuteGetPrimaryKeysQuery(const std::string& catalog,
+ SqlResult::Type InternalExecuteGetPrimaryKeysQuery(const std::string& catalog,
const std::string& schema, const std::string& table);
/**
@@ -589,7 +589,7 @@ namespace ignite
* that can have a NULL value.
* @return Operation result.
*/
- SqlResult InternalExecuteSpecialColumnsQuery(int16_t type,
+ SqlResult::Type InternalExecuteSpecialColumnsQuery(int16_t type,
const std::string& catalog, const std::string& schema,
const std::string& table, int16_t scope, int16_t nullable);
@@ -599,7 +599,7 @@ namespace ignite
* @param sqlType SQL type for which to return info or SQL_ALL_TYPES.
* @return Operation result.
*/
- SqlResult InternalExecuteGetTypeInfoQuery(int16_t sqlType);
+ SqlResult::Type InternalExecuteGetTypeInfoQuery(int16_t sqlType);
/**
* Next results.
@@ -608,7 +608,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalNextResults();
+ SqlResult::Type InternalNextResults();
/**
* Get column attribute.
@@ -621,7 +621,7 @@ namespace ignite
* @param numbuf Numeric value buffer.
* @return Operation result.
*/
- SqlResult InternalGetColumnAttribute(uint16_t colIdx, uint16_t attrId,
+ SqlResult::Type InternalGetColumnAttribute(uint16_t colIdx, uint16_t attrId,
char* strbuf, int16_t buflen, int16_t* reslen, SqlLen* numbuf);
/**
@@ -630,7 +630,7 @@ namespace ignite
* @param rowCnt Number of rows affected by the statement.
* @return Operation result.
*/
- SqlResult InternalAffectedRows(int64_t& rowCnt);
+ SqlResult::Type InternalAffectedRows(int64_t& rowCnt);
/**
* Select next parameter data for which is required.
@@ -638,7 +638,7 @@ namespace ignite
* @param paramPtr Pointer to param id stored here.
* @return Operation result.
*/
- SqlResult InternalSelectParam(void** paramPtr);
+ SqlResult::Type InternalSelectParam(void** paramPtr);
/**
* Puts data for previously selected parameter or column.
@@ -647,7 +647,7 @@ namespace ignite
* @param len Data length.
* @return Operation result.
*/
- SqlResult InternalPutData(void* data, SqlLen len);
+ SqlResult::Type InternalPutData(void* data, SqlLen len);
/**
* Get type info of the parameter of the prepared statement.
@@ -659,13 +659,13 @@ namespace ignite
* @param nullable - Nullability flag.
* @return Operation result.
*/
- SqlResult InternalDescribeParam(int16_t paramNum, int16_t* dataType,
+ SqlResult::Type InternalDescribeParam(int16_t paramNum, int16_t* dataType,
SqlUlen* paramSize, int16_t* decimalDigits, int16_t* nullable);
/**
* Make request to data source to update parameters metadata.
*/
- SqlResult UpdateParamsMeta();
+ SqlResult::Type UpdateParamsMeta();
/**
* Constructor.