ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [26/50] ignite git commit: IGNITE-1786: Fixed realease build.
Date Mon, 25 Jan 2016 11:55:28 GMT
IGNITE-1786: Fixed realease build.


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

Branch: refs/heads/ignite-1786
Commit: 9250352c82875de1f9167d14b53f34cb37067b1e
Parents: 4528863
Author: isapego <isapego@gridgain.com>
Authored: Mon Jan 18 16:33:47 2016 +0300
Committer: isapego <isapego@gridgain.com>
Committed: Mon Jan 18 16:33:47 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/connection.h            | 16 ++++++++++++
 .../cpp/odbc/odbc-driver/src/connection.cpp     | 20 +++++++++++++++
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 10 ++------
 .../odbc/odbc-test/project/vs/odbc-test.vcxproj | 27 +++++++++++---------
 4 files changed, 53 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9250352c/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
index f0f22cf..56037f5 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
@@ -65,6 +65,13 @@ namespace ignite
             /**
              * Establish connection to ODBC server.
              *
+             * @param server Server (DSN).
+             */
+            void Establish(const std::string& server);
+
+            /**
+             * Establish connection to ODBC server.
+             *
              * @param host Host.
              * @param port Port.
              * @param cache Cache name to connect to.
@@ -167,6 +174,15 @@ namespace ignite
              * Establish connection to ODBC server.
              * Internal call.
              *
+             * @param server Server (DNS).
+             * @return Operation result.
+             */
+            SqlResult InternalEstablish(const std::string& server);
+
+            /**
+             * Establish connection to ODBC server.
+             * Internal call.
+             *
              * @param host Host.
              * @param port Port.
              * @param cache Cache name to connect to.

http://git-wip-us.apache.org/repos/asf/ignite/blob/9250352c/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
index 47494eb..28cd7ca 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
@@ -22,6 +22,7 @@
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/statement.h"
 #include "ignite/odbc/connection.h"
+#include "ignite/odbc/config/configuration.h"
 
 // TODO: implement appropriate protocol with de-/serialisation.
 namespace
@@ -73,6 +74,25 @@ namespace ignite
             return res;
         }
 
+        void Connection::Establish(const std::string& server)
+        {
+            IGNITE_ODBC_API_CALL(InternalEstablish(server));
+        }
+
+        SqlResult Connection::InternalEstablish(const std::string& server)
+        {
+            config::Configuration config;
+
+            if (server != config.GetDsn())
+            {
+                AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Unknown DNS.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            return InternalEstablish(config.GetHost(), config.GetPort(), config.GetCache());
+        }
+
         void Connection::Establish(const std::string& host, uint16_t port, const std::string&
cache)
         {
             IGNITE_ODBC_API_CALL(InternalEstablish(host, port, cache));

http://git-wip-us.apache.org/repos/asf/ignite/blob/9250352c/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index 6b2f4ae..4c8a172 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -165,7 +165,7 @@ SQLRETURN SQL_API SQLAllocConnect(SQLHENV env, SQLHDBC* conn)
     Connection *connection = environment->CreateConnection();
 
     if (!connection)
-        return SQL_ERROR;
+        return environment->GetDiagnosticRecords().GetReturnCode();
 
     *conn = reinterpret_cast<SQLHDBC>(connection);
 
@@ -375,15 +375,9 @@ SQLRETURN SQL_API SQLConnect(SQLHDBC        conn,
     if (!connection)
         return SQL_INVALID_HANDLE;
 
-    ignite::odbc::config::Configuration config;
-
     std::string server = SqlStringToString(serverName, serverNameLen);
 
-    //TODO: move into Establish()
-    if (server != config.GetDsn())
-        return SQL_ERROR;
-
-    connection->Establish(config.GetHost(), config.GetPort(), config.GetCache());
+    connection->Establish(server);
 
     return connection->GetDiagnosticRecords().GetReturnCode();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/9250352c/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
index 8c90fa6..2089f6f 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
@@ -29,26 +29,28 @@
     <UseDebugLibraries>true</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
     <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
     <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -88,9 +90,9 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <SDLCheck>false</SDLCheck>
+      <SDLCheck>true</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\..\odbc-driver\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
     </ClCompile>
     <Link>
@@ -102,14 +104,15 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <SDLCheck>false</SDLCheck>
+      <SDLCheck>true</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\..\odbc-driver\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <SubSystem>Console</SubSystem>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -118,16 +121,16 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>false</SDLCheck>
+      <SDLCheck>true</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\..\odbc-driver\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -136,16 +139,16 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>false</SDLCheck>
+      <SDLCheck>true</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\..\odbc-driver\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>


Mime
View raw message