ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [09/28] ignite git commit: IGNITE-3801: ODBC: Added tests for OUTER JOIN. This closes #1027.
Date Wed, 07 Sep 2016 09:25:37 GMT
IGNITE-3801: ODBC: Added tests for OUTER JOIN. This closes #1027.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d06eaa23
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d06eaa23
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d06eaa23

Branch: refs/heads/ignite-1.6.7-test
Commit: d06eaa2344a753e08d1e3cb00e6b4ab83c6a9a01
Parents: c992213
Author: isapego <isapego@gridgain.com>
Authored: Sun Sep 4 16:52:04 2016 +0300
Committer: thatcoach <ppozerov@list.ru>
Committed: Sun Sep 4 16:52:04 2016 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/odbc-test/Makefile.am     |   1 +
 .../cpp/odbc-test/project/vs/odbc-test.vcxproj  |   1 +
 .../project/vs/odbc-test.vcxproj.filters        |   3 +
 .../cpp/odbc-test/src/sql_outer_join_test.cpp   | 498 +++++++++++++++++++
 .../odbc-test/src/sql_test_suite_fixture.cpp    |   6 +-
 .../cpp/odbc/src/config/connection_info.cpp     |   4 +-
 6 files changed, 507 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d06eaa23/modules/platforms/cpp/odbc-test/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/Makefile.am b/modules/platforms/cpp/odbc-test/Makefile.am
index 1ca85a7..c3dd86a 100644
--- a/modules/platforms/cpp/odbc-test/Makefile.am
+++ b/modules/platforms/cpp/odbc-test/Makefile.am
@@ -70,6 +70,7 @@ ignite_odbc_tests_SOURCES = \
     src/sql_operators_test.cpp \
     src/sql_value_expressions_test.cpp \
     src/sql_types_test.cpp \
+    src/sql_outer_join_test.cpp \
     ../odbc/src/cursor.cpp \
     ../odbc/src/config/connection_info.cpp \
     ../odbc/src/app/application_data_buffer.cpp \

http://git-wip-us.apache.org/repos/asf/ignite/blob/d06eaa23/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj b/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj
index cb5735f..b85f1e6 100644
--- a/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj
+++ b/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj
@@ -170,6 +170,7 @@
     <ClCompile Include="..\..\src\parser_test.cpp" />
     <ClCompile Include="..\..\src\row_test.cpp" />
     <ClCompile Include="..\..\src\sql_aggregate_functions_test.cpp" />
+    <ClCompile Include="..\..\src\sql_outer_join_test.cpp" />
     <ClCompile Include="..\..\src\sql_test_suite_fixture.cpp" />
     <ClCompile Include="..\..\src\sql_numeric_functions_test.cpp" />
     <ClCompile Include="..\..\src\sql_operators_test.cpp" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/d06eaa23/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters b/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters
index 270bdd6..ee5df76 100644
--- a/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters
+++ b/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters
@@ -106,6 +106,9 @@
     <ClCompile Include="..\..\src\sql_value_expressions_test.cpp">
       <Filter>Code</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\sql_outer_join_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\include\test_type.h">

http://git-wip-us.apache.org/repos/asf/ignite/blob/d06eaa23/modules/platforms/cpp/odbc-test/src/sql_outer_join_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/sql_outer_join_test.cpp b/modules/platforms/cpp/odbc-test/src/sql_outer_join_test.cpp
new file mode 100644
index 0000000..426041b
--- /dev/null
+++ b/modules/platforms/cpp/odbc-test/src/sql_outer_join_test.cpp
@@ -0,0 +1,498 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+#   define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include "sql_test_suite_fixture.h"
+#include "test_utils.h"
+
+using namespace ignite;
+
+using namespace boost::unit_test;
+
+BOOST_FIXTURE_TEST_SUITE(SqlOuterJoinTestSuite, ignite::SqlTestSuiteFixture)
+
+// Checking that left outer joins are supported.
+// Corresponds to SQL_OJ_LEFT flag.
+BOOST_AUTO_TEST_CASE(TestOuterJoinLeft)
+{
+    TestType in1;
+    TestType in2;
+
+    in1.i32Field = 20;
+    in2.i32Field = 30;
+
+    in1.i16Field = 40;
+    in2.i16Field = 20;
+
+    testCache.Put(1, in1);
+    testCache.Put(2, in2);
+
+    SQLINTEGER columns[2];
+    SQLLEN columnsLen[2];
+
+    SQLRETURN ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &columns[0], 0, &columnsLen[0]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLBindCol(stmt, 2, SQL_C_SLONG, &columns[1], 0, &columnsLen[1]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    SQLCHAR request[] = "SELECT T1.i32Field, T2.i16Field FROM "
+        "{oj TestType T1 LEFT OUTER JOIN TestType T2 ON T1.i32Field = T2.i16Field}";
+
+    ret = SQLExecDirect(stmt, request, SQL_NTS);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 20);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 20);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 30);
+
+    BOOST_CHECK_EQUAL(columnsLen[1], SQL_NULL_DATA);
+
+    ret = SQLFetch(stmt);
+    BOOST_CHECK(ret == SQL_NO_DATA);
+}
+
+// Checking that the column names in the ON clause of the outer join do not
+// have to be in the same order as their respective table names in the OUTER
+// JOIN clause. Corresponds to SQL_OJ_NOT_ORDERED flag. 
+BOOST_AUTO_TEST_CASE(TestOuterJoinOrdering)
+{
+    TestType in1;
+    TestType in2;
+
+    in1.i32Field = 20;
+    in2.i32Field = 30;
+
+    in1.i16Field = 40;
+    in2.i16Field = 20;
+
+    testCache.Put(1, in1);
+    testCache.Put(2, in2);
+
+    SQLINTEGER columns[2];
+    SQLLEN columnsLen[2];
+
+    SQLRETURN ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &columns[0], 0, &columnsLen[0]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLBindCol(stmt, 2, SQL_C_SLONG, &columns[1], 0, &columnsLen[1]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    SQLCHAR request[] = "SELECT T1.i32Field, T2.i16Field FROM "
+        "{oj TestType T1 LEFT OUTER JOIN TestType T2 ON T2.i16Field = T1.i32Field}";
+
+    ret = SQLExecDirect(stmt, request, SQL_NTS);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 20);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 20);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 30);
+
+    BOOST_CHECK_EQUAL(columnsLen[1], SQL_NULL_DATA);
+
+    ret = SQLFetch(stmt);
+    BOOST_CHECK(ret == SQL_NO_DATA);
+}
+
+// Checking that the comparison operator in the ON clause can be any of the ODBC
+// comparison operators. Corresponds to SQL_OJ_ALL_COMPARISON_OPS flag.
+// Operator '<'.
+BOOST_AUTO_TEST_CASE(TestOuterJoinOpsLess)
+{
+    TestType in1;
+    TestType in2;
+
+    in1.i32Field = 20;
+    in2.i32Field = 30;
+
+    in1.i16Field = 40;
+    in2.i16Field = 20;
+
+    testCache.Put(1, in1);
+    testCache.Put(2, in2);
+
+    SQLINTEGER columns[2];
+    SQLLEN columnsLen[2];
+
+    SQLRETURN ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &columns[0], 0, &columnsLen[0]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLBindCol(stmt, 2, SQL_C_SLONG, &columns[1], 0, &columnsLen[1]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    SQLCHAR request[] = "SELECT T1.i32Field, T2.i16Field FROM "
+        "{oj TestType T1 LEFT OUTER JOIN TestType T2 ON T2.i16Field < T1.i32Field}";
+
+    ret = SQLExecDirect(stmt, request, SQL_NTS);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 20);
+
+    BOOST_CHECK_EQUAL(columnsLen[1], SQL_NULL_DATA);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 30);
+
+    BOOST_CHECK_EQUAL(columnsLen[1], SQL_NULL_DATA);
+
+    ret = SQLFetch(stmt);
+    BOOST_CHECK(ret == SQL_NO_DATA);
+}
+
+// Checking that the comparison operator in the ON clause can be any of the ODBC
+// comparison operators. Corresponds to SQL_OJ_ALL_COMPARISON_OPS flag.
+// Operator '>'.
+BOOST_AUTO_TEST_CASE(TestOuterJoinOpsGreater)
+{
+    TestType in1;
+    TestType in2;
+
+    in1.i32Field = 20;
+    in2.i32Field = 30;
+
+    in1.i16Field = 40;
+    in2.i16Field = 20;
+
+    testCache.Put(1, in1);
+    testCache.Put(2, in2);
+
+    SQLINTEGER columns[2];
+    SQLLEN columnsLen[2];
+
+    SQLRETURN ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &columns[0], 0, &columnsLen[0]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLBindCol(stmt, 2, SQL_C_SLONG, &columns[1], 0, &columnsLen[1]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    SQLCHAR request[] = "SELECT T1.i32Field, T2.i16Field FROM "
+        "{oj TestType T1 LEFT OUTER JOIN TestType T2 ON T2.i16Field > T1.i32Field}";
+
+    ret = SQLExecDirect(stmt, request, SQL_NTS);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 20);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 40);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 30);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 40);
+
+    ret = SQLFetch(stmt);
+    BOOST_CHECK(ret == SQL_NO_DATA);
+}
+
+// Checking that the comparison operator in the ON clause can be any of the ODBC
+// comparison operators. Corresponds to SQL_OJ_ALL_COMPARISON_OPS flag.
+// Operator '<='.
+BOOST_AUTO_TEST_CASE(TestOuterJoinOpsLessOrEqual)
+{
+    TestType in1;
+    TestType in2;
+
+    in1.i32Field = 20;
+    in2.i32Field = 30;
+
+    in1.i16Field = 40;
+    in2.i16Field = 20;
+
+    testCache.Put(1, in1);
+    testCache.Put(2, in2);
+
+    SQLINTEGER columns[2];
+    SQLLEN columnsLen[2];
+
+    SQLRETURN ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &columns[0], 0, &columnsLen[0]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLBindCol(stmt, 2, SQL_C_SLONG, &columns[1], 0, &columnsLen[1]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    SQLCHAR request[] = "SELECT T1.i32Field, T2.i16Field FROM "
+        "{oj TestType T1 LEFT OUTER JOIN TestType T2 ON T2.i16Field <= T1.i32Field}";
+
+    ret = SQLExecDirect(stmt, request, SQL_NTS);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 20);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 20);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 30);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 20);
+
+    ret = SQLFetch(stmt);
+    BOOST_CHECK(ret == SQL_NO_DATA);
+}
+
+// Checking that the comparison operator in the ON clause can be any of the ODBC
+// comparison operators. Corresponds to SQL_OJ_ALL_COMPARISON_OPS flag.
+// Operator '>='.
+BOOST_AUTO_TEST_CASE(TestOuterJoinOpsGreaterOrEqual)
+{
+    TestType in1;
+    TestType in2;
+
+    in1.i32Field = 20;
+    in2.i32Field = 30;
+
+    in1.i16Field = 40;
+    in2.i16Field = 20;
+
+    testCache.Put(1, in1);
+    testCache.Put(2, in2);
+
+    SQLINTEGER columns[2];
+    SQLLEN columnsLen[2];
+
+    SQLRETURN ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &columns[0], 0, &columnsLen[0]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLBindCol(stmt, 2, SQL_C_SLONG, &columns[1], 0, &columnsLen[1]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    SQLCHAR request[] = "SELECT T1.i32Field, T2.i16Field FROM "
+        "{oj TestType T1 LEFT OUTER JOIN TestType T2 ON T2.i16Field >= T1.i32Field}";
+
+    ret = SQLExecDirect(stmt, request, SQL_NTS);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 20);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 40);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 20);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 20);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 30);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 40);
+
+    ret = SQLFetch(stmt);
+    BOOST_CHECK(ret == SQL_NO_DATA);
+}
+
+// Checking that the comparison operator in the ON clause can be any of the ODBC
+// comparison operators. Corresponds to SQL_OJ_ALL_COMPARISON_OPS flag.
+// Operator '!='.
+BOOST_AUTO_TEST_CASE(TestOuterJoinOpsNotEqual)
+{
+    TestType in1;
+    TestType in2;
+
+    in1.i32Field = 20;
+    in2.i32Field = 30;
+
+    in1.i16Field = 40;
+    in2.i16Field = 20;
+
+    testCache.Put(1, in1);
+    testCache.Put(2, in2);
+
+    SQLINTEGER columns[2];
+    SQLLEN columnsLen[2];
+
+    SQLRETURN ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &columns[0], 0, &columnsLen[0]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLBindCol(stmt, 2, SQL_C_SLONG, &columns[1], 0, &columnsLen[1]);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    SQLCHAR request[] = "SELECT T1.i32Field, T2.i16Field FROM "
+        "{oj TestType T1 LEFT OUTER JOIN TestType T2 ON T2.i16Field != T1.i32Field}";
+
+    ret = SQLExecDirect(stmt, request, SQL_NTS);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 20);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 40);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 30);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 40);
+
+    ret = SQLFetch(stmt);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+    BOOST_CHECK_NE(columnsLen[0], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[0], 30);
+
+    BOOST_CHECK_NE(columnsLen[1], SQL_NULL_DATA);
+    BOOST_CHECK_EQUAL(columns[1], 20);
+
+    ret = SQLFetch(stmt);
+    BOOST_CHECK(ret == SQL_NO_DATA);
+}
+
+BOOST_AUTO_TEST_SUITE_END()

http://git-wip-us.apache.org/repos/asf/ignite/blob/d06eaa23/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp b/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
index 69b4bfa..657b854 100644
--- a/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
+++ b/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
@@ -117,17 +117,17 @@ namespace ignite
         ret = SQLBindCol(stmt, 1, type, column, bufSize, resSize);
 
         if (!SQL_SUCCEEDED(ret))
-            BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt)) ;
+            BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
 
         ret = SQLExecDirect(stmt, reinterpret_cast<SQLCHAR*>(const_cast<char*>(request)),
SQL_NTS);
 
         if (!SQL_SUCCEEDED(ret))
-            BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt)) ;
+            BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
 
         ret = SQLFetch(stmt);
 
         if (!SQL_SUCCEEDED(ret))
-            BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt)) ;
+            BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
 
         ret = SQLFetch(stmt);
         BOOST_CHECK(ret == SQL_NO_DATA) ;

http://git-wip-us.apache.org/repos/asf/ignite/blob/d06eaa23/modules/platforms/cpp/odbc/src/config/connection_info.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/config/connection_info.cpp b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
index 744a88e..ca8d1a0 100644
--- a/modules/platforms/cpp/odbc/src/config/connection_info.cpp
+++ b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
@@ -298,9 +298,7 @@ namespace ignite
 #ifdef SQL_OJ_CAPABILITIES
                 // Bitmask enumerating the types of outer joins supported by the 
                 // driver and data source.
-                intParams[SQL_OJ_CAPABILITIES] = SQL_OJ_LEFT | SQL_OJ_RIGHT |
-                    SQL_OJ_FULL | SQL_OJ_NESTED | SQL_OJ_INNER |
-                    SQL_OJ_ALL_COMPARISON_OPS;
+                intParams[SQL_OJ_CAPABILITIES] = SQL_OJ_LEFT | SQL_OJ_NOT_ORDERED | SQL_OJ_ALL_COMPARISON_OPS;
 #endif // SQL_OJ_CAPABILITIES
 
 #ifdef SQL_POS_OPERATIONS


Mime
View raw message