fix(ODBC): Poco:Data::ODBC - MSSQL (n)varchar(max) length issue #4324 (#4738)

* fix(ODBC): Poco:Data::ODBC - MSSQL (n)varchar(max) length issue #4324

* chore(ODBC): remove unused vars; fix SQL Server SDK include path #4324

* fix(ODBC): trim UTF16 string #4324

* chore(ODBC): add compile time big string diagnostics #4324

* chore(ODBC): add SQLServer big string vector test case #4324

* fix(ODBC): detect SQLServer header #4324

* chore: add listing msodbdcsql18 folder #4324

* ci: change odbc drivers installation order #4324

* chore(CMake): Add option ENABLE_DATA_SQL_SERVER_BIG_STRINGS, auto-detection of msodbcsql.h on Linux and macOS

* fix(ODBC): detect backend at runtime for string size; add Session::dbmsName() #4324

* fix(ODBC): wrong char to string conversion #4324

---------

Co-authored-by: cunj123 <n.belusic@pta.hr>
Co-authored-by: Matej Kenda <matejken@gmail.com>
This commit is contained in:
Aleksandar Fabijanic 2024-10-19 14:43:00 -05:00 committed by GitHub
parent 9a97e7ca0d
commit 36c808230c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
32 changed files with 558 additions and 198 deletions

View File

@ -752,7 +752,6 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: sudo apt -y update && sudo apt -y install libssl-dev unixodbc-dev alien libaio1 gnupg2 curl odbcinst1debian2 libodbc1 odbcinst # libmysqlclient-dev mysql-client odbc-postgresql - run: sudo apt -y update && sudo apt -y install libssl-dev unixodbc-dev alien libaio1 gnupg2 curl odbcinst1debian2 libodbc1 odbcinst # libmysqlclient-dev mysql-client odbc-postgresql
- run: ./configure --everything --no-samples --omit=ActiveRecord,ApacheConnector,CppParser,Crypto,Data/MySQL,Data/PostgreSQL,Data/SQLite,Encodings,JSON,JWT,MongoDB,Net,NetSSL_OpenSSL,NetSSL_Win,PDF,PageCompiler,PocoDoc,ProGen,Prometheus,Redis,SevenZip,Util,XML,Zip && make all -s -j6 && sudo make install
# - name: Setup MySQL ODBC connector # - name: Setup MySQL ODBC connector
# run: | # run: |
# wget https://dev.mysql.com/get/Downloads/Connector-ODBC/8.2/mysql-connector-odbc_8.2.0-1ubuntu22.04_amd64.deb # wget https://dev.mysql.com/get/Downloads/Connector-ODBC/8.2/mysql-connector-odbc_8.2.0-1ubuntu22.04_amd64.deb
@ -768,6 +767,8 @@ jobs:
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
ls /opt/microsoft/msodbcsql18/include
- run: ./configure --everything --no-samples --omit=ActiveRecord,ApacheConnector,CppParser,Crypto,Data/MySQL,Data/PostgreSQL,Data/SQLite,Encodings,JSON,JWT,MongoDB,Net,NetSSL_OpenSSL,NetSSL_Win,PDF,PageCompiler,PocoDoc,ProGen,Prometheus,Redis,SevenZip,Util,XML,Zip && make all -s -j6 && sudo make install
- uses: ./.github/actions/retry-action - uses: ./.github/actions/retry-action
with: with:
timeout_minutes: 90 timeout_minutes: 90

View File

@ -148,9 +148,11 @@ endif()
if(ODBC_FOUND) if(ODBC_FOUND)
option(ENABLE_DATA "Enable Data" ON) option(ENABLE_DATA "Enable Data" ON)
option(ENABLE_DATA_ODBC "Enable Data ODBC" ON) option(ENABLE_DATA_ODBC "Enable Data ODBC" ON)
option(ENABLE_DATA_SQL_SERVER_BIG_STRINGS "Enable MS SQL Server big strings" ON)
else() else()
option(ENABLE_DATA "Enable Data" OFF) option(ENABLE_DATA "Enable Data" OFF)
option(ENABLE_DATA_ODBC "Enable Data ODBC" OFF) option(ENABLE_DATA_ODBC "Enable Data ODBC" OFF)
option(ENABLE_DATA_SQL_SERVER_BIG_STRINGS "Enable MS SQL Server big strings" OFF)
endif() endif()
# Allow enabling and disabling components # Allow enabling and disabling components

View File

@ -2426,14 +2426,14 @@ void SQLExecutor::blob(int bigSize, const std::string& blobPlaceholder)
catch(DataException& ce) catch(DataException& ce)
{ {
std::cout << ce.displayText() << std::endl; std::cout << ce.displayText() << std::endl;
fail (__func__, __LINE__, __FILE__); failmsg (__func__);
} }
try { session() << "SELECT COUNT(*) FROM Person", into(count), now; } try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(DataException& ce) catch(DataException& ce)
{ {
std::cout << ce.displayText() << std::endl; std::cout << ce.displayText() << std::endl;
fail (__func__, __LINE__, __FILE__); failmsg (__func__);
} }
assertTrue (count == 1); assertTrue (count == 1);
@ -2444,7 +2444,7 @@ void SQLExecutor::blob(int bigSize, const std::string& blobPlaceholder)
catch(DataException& ce) catch(DataException& ce)
{ {
std::cout << ce.displayText() << std::endl; std::cout << ce.displayText() << std::endl;
fail (__func__, __LINE__, __FILE__); failmsg (__func__);
} }
assertTrue (res == img); assertTrue (res == img);
@ -2459,7 +2459,7 @@ void SQLExecutor::blob(int bigSize, const std::string& blobPlaceholder)
catch(DataException& ce) catch(DataException& ce)
{ {
std::cout << ce.displayText() << std::endl; std::cout << ce.displayText() << std::endl;
fail (__func__, __LINE__, __FILE__); failmsg (__func__);
} }
try try
@ -2470,7 +2470,7 @@ void SQLExecutor::blob(int bigSize, const std::string& blobPlaceholder)
catch(DataException& ce) catch(DataException& ce)
{ {
std::cout << ce.displayText() << std::endl; std::cout << ce.displayText() << std::endl;
fail (__func__, __LINE__, __FILE__); failmsg (__func__);
} }
// sometimes throws (intentionally, caught in caller) // sometimes throws (intentionally, caught in caller)

View File

@ -194,6 +194,8 @@ private:
return getValue<T>(pResult, val); return getValue<T>(pResult, val);
} }
void setName();
std::string _connector; std::string _connector;
mutable SessionHandle _handle; mutable SessionHandle _handle;
bool _reset; bool _reset;

View File

@ -62,6 +62,12 @@ SessionImpl::SessionImpl(const std::string& connectionString, std::size_t loginT
} }
void SessionImpl::setName()
{
setDBMSName("MySQL"s);
}
void SessionImpl::open(const std::string& connect) void SessionImpl::open(const std::string& connect)
{ {
if (connect != connectionString()) if (connect != connectionString())
@ -175,7 +181,7 @@ void SessionImpl::open(const std::string& connect)
// autocommit is initially on when a session is opened // autocommit is initially on when a session is opened
AbstractSessionImpl::setAutoCommit("", true); AbstractSessionImpl::setAutoCommit("", true);
setName();
_connected = true; _connected = true;
} }

View File

@ -29,6 +29,44 @@ target_include_directories(DataODBC
) )
target_compile_definitions(DataODBC PUBLIC THREADSAFE) target_compile_definitions(DataODBC PUBLIC THREADSAFE)
# Search for MS ODBC header file which is a pre-requisite to enable
# ENABLE_DATA_SQL_SERVER_BIG_STRINGS
find_file(
_msodbc_h
msodbcsql.h
HINTS
/usr/include
#macOS
/opt/homebrew/include/msodbcsql18
/opt/homebrew/include/msodbcsql17
#Linux
/opt/microsoft/msodbcsql18/include
/opt/microsoft/msodbcsql17/include/
/opt/microsoft/msodbcsql/include/
# Windows?
NO_CACHE
)
if (_msodbc_h)
get_filename_component(MSODBC_DIR ${_msodbc_h} DIRECTORY CACHE)
message(STATUS "ODBC: Found msodbcsql.h in: ${MSODBC_DIR}")
target_include_directories(DataODBC PUBLIC "${MSODBC_DIR}")
if (ENABLE_DATA_SQL_SERVER_BIG_STRINGS)
target_compile_definitions(DataODBC PUBLIC POCO_DATA_SQL_SERVER_BIG_STRINGS=1)
else()
target_compile_definitions(DataODBC PUBLIC POCO_DATA_SQL_SERVER_BIG_STRINGS=0)
endif()
else()
# Disable MS SQL specific setting when msodbcsql.h is not present
set(ENABLE_DATA_SQL_SERVER_BIG_STRINGS OFF CACHE BOOL FORCE "Enable MS SQL Server big strings")
endif()
unset(_msodbc_h)
POCO_INSTALL(DataODBC) POCO_INSTALL(DataODBC)
POCO_GENERATE_PACKAGE(DataODBC) POCO_GENERATE_PACKAGE(DataODBC)

View File

@ -12,6 +12,16 @@ POCO_ODBC_INCLUDE = /opt/homebrew/include
endif endif
endif endif
ifndef POCO_MSSQL_INCLUDE
ifeq (0, $(shell test -e /usr/include/msodbcsql.h; echo $$?))
POCO_MSSQL_INCLUDE = /usr/include
else ifeq (0, $(shell test -e /opt/microsoft/msodbcsql18/include/msodbcsql.h; echo $$?))
POCO_MSSQL_INCLUDE = /opt/microsoft/msodbcsql18/include
else ifeq (0, $(shell test -e /opt/homebrew/include/msodbcsql18/msodbcsql.h; echo $$?))
POCO_MSSQL_INCLUDE = /opt/homebrew/include/msodbcsql18
endif
endif
ifndef POCO_ODBC_LIB ifndef POCO_ODBC_LIB
ifeq (0, $(shell test -d /usr/lib/$(OSARCH)-linux-gnu; echo $$?)) ifeq (0, $(shell test -d /usr/lib/$(OSARCH)-linux-gnu; echo $$?))
POCO_ODBC_LIB = /usr/lib/$(OSARCH)-linux-gnu POCO_ODBC_LIB = /usr/lib/$(OSARCH)-linux-gnu
@ -34,7 +44,7 @@ LIBLINKEXT = $(SHAREDLIBLINKEXT)
endif endif
endif endif
INCLUDE += -I$(POCO_ODBC_INCLUDE) INCLUDE += -I$(POCO_ODBC_INCLUDE) -I$(POCO_MSSQL_INCLUDE)
SYSLIBS += -L$(POCO_ODBC_LIB) SYSLIBS += -L$(POCO_ODBC_LIB)
## ##

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="debug_shared|ARM64"> <ProjectConfiguration Include="debug_shared|ARM64">
@ -81,7 +81,7 @@
<RootNamespace>ODBC</RootNamespace> <RootNamespace>ODBC</RootNamespace>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
@ -172,63 +172,63 @@
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"/> <ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros"/> <PropertyGroup Label="UserMacros" />
<PropertyGroup> <PropertyGroup>
<_ProjectFileVersion>17.0.34714.143</_ProjectFileVersion> <_ProjectFileVersion>17.0.34714.143</_ProjectFileVersion>
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">PocoDataODBCA64d</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">PocoDataODBCA64d</TargetName>
@ -306,27 +306,33 @@
<OutDir>..\..\bin64\</OutDir> <OutDir>..\..\bin64\</OutDir>
<IntDir>obj64\ODBC\$(Configuration)\</IntDir> <IntDir>obj64\ODBC\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">
<OutDir>..\..\bin64\</OutDir> <OutDir>..\..\bin64\</OutDir>
<IntDir>obj64\ODBC\$(Configuration)\</IntDir> <IntDir>obj64\ODBC\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">
<OutDir>..\..\lib64\</OutDir> <OutDir>..\..\lib64\</OutDir>
<IntDir>obj64\ODBC\$(Configuration)\</IntDir> <IntDir>obj64\ODBC\$(Configuration)\</IntDir>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">
<OutDir>..\..\lib64\</OutDir> <OutDir>..\..\lib64\</OutDir>
<IntDir>obj64\ODBC\$(Configuration)\</IntDir> <IntDir>obj64\ODBC\$(Configuration)\</IntDir>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">
<OutDir>..\..\lib64\</OutDir> <OutDir>..\..\lib64\</OutDir>
<IntDir>obj64\ODBC\$(Configuration)\</IntDir> <IntDir>obj64\ODBC\$(Configuration)\</IntDir>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">
<OutDir>..\..\lib64\</OutDir> <OutDir>..\..\lib64\</OutDir>
<IntDir>obj64\ODBC\$(Configuration)\</IntDir> <IntDir>obj64\ODBC\$(Configuration)\</IntDir>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">
<ClCompile> <ClCompile>
@ -340,7 +346,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -377,9 +383,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -412,7 +418,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -441,9 +447,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -467,7 +473,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -496,9 +502,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -522,7 +528,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -559,9 +565,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -594,7 +600,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -623,9 +629,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -649,7 +655,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -678,10 +684,10 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
@ -705,7 +711,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -742,9 +748,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -777,7 +783,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -806,9 +812,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -832,7 +838,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -861,9 +867,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -876,26 +882,26 @@
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="include\Poco\Data\ODBC\Binder.h"/> <ClInclude Include="include\Poco\Data\ODBC\Binder.h" />
<ClInclude Include="include\Poco\Data\ODBC\ConnectionHandle.h"/> <ClInclude Include="include\Poco\Data\ODBC\ConnectionHandle.h" />
<ClInclude Include="include\Poco\Data\ODBC\Connector.h"/> <ClInclude Include="include\Poco\Data\ODBC\Connector.h" />
<ClInclude Include="include\Poco\Data\ODBC\Diagnostics.h"/> <ClInclude Include="include\Poco\Data\ODBC\Diagnostics.h" />
<ClInclude Include="include\Poco\Data\ODBC\EnvironmentHandle.h"/> <ClInclude Include="include\Poco\Data\ODBC\EnvironmentHandle.h" />
<ClInclude Include="include\Poco\Data\ODBC\Error.h"/> <ClInclude Include="include\Poco\Data\ODBC\Error.h" />
<ClInclude Include="include\Poco\Data\ODBC\Extractor.h"/> <ClInclude Include="include\Poco\Data\ODBC\Extractor.h" />
<ClInclude Include="include\Poco\Data\ODBC\Handle.h"/> <ClInclude Include="include\Poco\Data\ODBC\Handle.h" />
<ClInclude Include="include\Poco\Data\ODBC\ODBC.h"/> <ClInclude Include="include\Poco\Data\ODBC\ODBC.h" />
<ClInclude Include="include\Poco\Data\ODBC\ODBCException.h"/> <ClInclude Include="include\Poco\Data\ODBC\ODBCException.h" />
<ClInclude Include="include\Poco\Data\ODBC\ODBCMetaColumn.h"/> <ClInclude Include="include\Poco\Data\ODBC\ODBCMetaColumn.h" />
<ClInclude Include="include\Poco\Data\ODBC\ODBCStatementImpl.h"/> <ClInclude Include="include\Poco\Data\ODBC\ODBCStatementImpl.h" />
<ClInclude Include="include\Poco\Data\ODBC\Parameter.h"/> <ClInclude Include="include\Poco\Data\ODBC\Parameter.h" />
<ClInclude Include="include\Poco\Data\ODBC\Preparator.h"/> <ClInclude Include="include\Poco\Data\ODBC\Preparator.h" />
<ClInclude Include="include\Poco\Data\ODBC\SessionImpl.h"/> <ClInclude Include="include\Poco\Data\ODBC\SessionImpl.h" />
<ClInclude Include="include\Poco\Data\ODBC\TypeInfo.h"/> <ClInclude Include="include\Poco\Data\ODBC\TypeInfo.h" />
<ClInclude Include="include\Poco\Data\ODBC\Unicode.h"/> <ClInclude Include="include\Poco\Data\ODBC\Unicode.h" />
<ClInclude Include="include\Poco\Data\ODBC\Unicode_UNIXODBC.h"/> <ClInclude Include="include\Poco\Data\ODBC\Unicode_UNIXODBC.h" />
<ClInclude Include="include\Poco\Data\ODBC\Unicode_WIN32.h"/> <ClInclude Include="include\Poco\Data\ODBC\Unicode_WIN32.h" />
<ClInclude Include="include\Poco\Data\ODBC\Utility.h"/> <ClInclude Include="include\Poco\Data\ODBC\Utility.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="src\Binder.cpp"> <ClCompile Include="src\Binder.cpp">
@ -1031,6 +1037,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
</ResourceCompile> </ResourceCompile>
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"/> <ImportGroup Label="ExtensionTargets" />
</Project> </Project>

View File

@ -616,7 +616,7 @@ private:
toODBCDirection(dir), toODBCDirection(dir),
SQL_C_CHAR, SQL_C_CHAR,
Utility::sqlDataType(SQL_C_CHAR), Utility::sqlDataType(SQL_C_CHAR),
(SQLUINTEGER) size - 1, getStringColSize(size),
0, 0,
_charPtrs[pos], _charPtrs[pos],
(SQLINTEGER) size, (SQLINTEGER) size,
@ -683,7 +683,7 @@ private:
toODBCDirection(dir), toODBCDirection(dir),
SQL_C_WCHAR, SQL_C_WCHAR,
Utility::sqlDataType(SQL_C_WCHAR), Utility::sqlDataType(SQL_C_WCHAR),
(SQLUINTEGER)size - 1, getStringColSize(size),
0, 0,
_utf16CharPtrs[pos], _utf16CharPtrs[pos],
(SQLINTEGER)size, (SQLINTEGER)size,
@ -950,6 +950,11 @@ private:
} }
} }
SQLUINTEGER getStringColSize(SQLUINTEGER columnSize);
/// Returns the string column size.
/// If the back end is not SQL Server, it returns
/// the `columnSize` passed in.
void getColSizeAndPrecision(std::size_t pos, void getColSizeAndPrecision(std::size_t pos,
SQLSMALLINT cDataType, SQLSMALLINT cDataType,
SQLINTEGER& colSize, SQLINTEGER& colSize,

View File

@ -81,6 +81,12 @@ public:
return _handle; return _handle;
} }
const ConnectionHandle& connection() const
/// Returns the connection handle.
{
return _rConnection;
}
private: private:
Handle(const Handle&); Handle(const Handle&);
const Handle& operator=(const Handle&); const Handle& operator=(const Handle&);

View File

@ -58,6 +58,22 @@
#if __has_include(<msodbcsql.h>) #if __has_include(<msodbcsql.h>)
#include <msodbcsql.h> #include <msodbcsql.h>
#define POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT #define POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT
// To enable varchar(max) > 8000 bytes, set to 1.
//
// Notes:
//
// - this setting works in conjunction with
// the session "maxFieldSize" property, which
// ultimately determines the max string length.
//
// - increasing the "maxFieldSize" property may
// affect performance (more memory preallocated
// for prepared statements in order to safely
// accommodate data returned at execution)
#if !defined(POCO_DATA_SQL_SERVER_BIG_STRINGS)
#define POCO_DATA_SQL_SERVER_BIG_STRINGS 1
#endif
#endif #endif
#endif #endif

View File

@ -229,6 +229,9 @@ private:
/// Sets the transaction isolation level. /// Sets the transaction isolation level.
/// Called internally from getTransactionIsolation() /// Called internally from getTransactionIsolation()
void setName();
/// Sets the back end DBMS name.
std::string _connector; std::string _connector;
mutable ConnectionHandle _db; mutable ConnectionHandle _db;
Poco::Any _maxFieldSize; Poco::Any _maxFieldSize;

View File

@ -33,10 +33,15 @@ namespace Data {
namespace ODBC { namespace ODBC {
class ConnectionHandle;
class ODBC_API Utility class ODBC_API Utility
/// Various utility functions /// Various utility functions
{ {
public: public:
inline static const std::string MS_SQL_SERVER_DBMS_NAME = "Microsoft SQL Server"s;
typedef std::map<std::string, std::string> DSNMap; typedef std::map<std::string, std::string> DSNMap;
typedef DSNMap DriverMap; typedef DSNMap DriverMap;
@ -162,6 +167,10 @@ public:
for (; it != end; ++it, ++tIt) dateTimeSync(*tIt, *it); for (; it != end; ++it, ++tIt) dateTimeSync(*tIt, *it);
} }
static std::string dbmsName(const ConnectionHandle& db);
/// Returns the back end DBMS name.
/// On error, returns "unknown".
private: private:
static const TypeInfo _dataTypes; static const TypeInfo _dataTypes;
/// C <==> SQL data type mapping /// C <==> SQL data type mapping

View File

@ -120,11 +120,11 @@ void Binder::bind(std::size_t pos, const std::string& val, Direction dir)
{ {
std::string tcVal; std::string tcVal;
transcode(val, tcVal); transcode(val, tcVal);
size = (SQLINTEGER)tcVal.size(); size = static_cast<SQLINTEGER>(tcVal.size());
pTCVal = reinterpret_cast<char*>(std::calloc((size_t)size+1, 1)); pTCVal = reinterpret_cast<char*>(std::calloc((size_t)size+1, 1));
std::memcpy(pTCVal, tcVal.data(), size); std::memcpy(pTCVal, tcVal.data(), size);
} }
else size = (SQLINTEGER)val.size(); else size = static_cast<SQLINTEGER>(val.size());
SQLPOINTER pVal = 0; SQLPOINTER pVal = 0;
SQLINTEGER colSize = 0; SQLINTEGER colSize = 0;
SQLSMALLINT decDigits = 0; SQLSMALLINT decDigits = 0;
@ -134,7 +134,7 @@ void Binder::bind(std::size_t pos, const std::string& val, Direction dir)
{ {
getColumnOrParameterSize(pos, size); getColumnOrParameterSize(pos, size);
char* pChar = (char*) std::calloc(size, sizeof(char)); char* pChar = (char*) std::calloc(size, sizeof(char));
pVal = (SQLPOINTER) pChar; pVal = static_cast<SQLPOINTER>(pChar);
_outParams.insert(ParamMap::value_type(pVal, size)); _outParams.insert(ParamMap::value_type(pVal, size));
_strings.insert(StringMap::value_type(pChar, const_cast<std::string*>(&val))); _strings.insert(StringMap::value_type(pChar, const_cast<std::string*>(&val)));
} }
@ -161,16 +161,18 @@ void Binder::bind(std::size_t pos, const std::string& val, Direction dir)
_lengthIndicator.push_back(pLenIn); _lengthIndicator.push_back(pLenIn);
if (Utility::isError(SQLBindParameter(_rStmt, int rc = SQLBindParameter(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT)pos + 1,
toODBCDirection(dir), toODBCDirection(dir),
SQL_C_CHAR, SQL_C_CHAR,
Utility::sqlDataType(SQL_C_CHAR), Utility::sqlDataType(SQL_C_CHAR),
(SQLUINTEGER) colSize, getStringColSize(colSize),
0, 0,
pVal, pVal,
(SQLINTEGER) size, (SQLINTEGER)size,
_lengthIndicator.back()))) _lengthIndicator.back());
if (Utility::isError(rc))
{ {
throw StatementException(_rStmt, "ODBC::Binder::bind(string):SQLBindParameter(std::string)"); throw StatementException(_rStmt, "ODBC::Binder::bind(string):SQLBindParameter(std::string)");
} }
@ -217,7 +219,7 @@ void Binder::bind(std::size_t pos, const UTF16String& val, Direction dir)
toODBCDirection(dir), toODBCDirection(dir),
SQL_C_WCHAR, SQL_C_WCHAR,
Utility::sqlDataType(SQL_C_WCHAR), Utility::sqlDataType(SQL_C_WCHAR),
(SQLUINTEGER)colSize, getStringColSize(colSize),
0, 0,
pVal, pVal,
(SQLINTEGER)size, (SQLINTEGER)size,
@ -504,6 +506,16 @@ void Binder::reset()
} }
SQLUINTEGER Binder::getStringColSize(SQLUINTEGER columnSize)
{
#if defined(POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT) && POCO_DATA_SQL_SERVER_BIG_STRINGS
if (Utility::dbmsName(_rStmt.connection()) == Utility::MS_SQL_SERVER_DBMS_NAME)
return SQL_SS_LENGTH_UNLIMITED;
#endif
return columnSize;
}
void Binder::getColSizeAndPrecision(std::size_t pos, void Binder::getColSizeAndPrecision(std::size_t pos,
SQLSMALLINT cDataType, SQLSMALLINT cDataType,
SQLINTEGER& colSize, SQLINTEGER& colSize,
@ -521,16 +533,37 @@ void Binder::getColSizeAndPrecision(std::size_t pos,
Dynamic::Var tmp; Dynamic::Var tmp;
bool foundSize(false); bool foundSize(false);
bool foundPrec(false); bool foundPrec(false);
// SQLServer driver reports COLUMN_SIZE 8000 for VARCHAR(MAX),
// so the size check must be skipped when big strings are enabled
#ifdef POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT
bool isVarchar(false);
switch (sqlDataType)
{
case SQL_VARCHAR:
case SQL_WVARCHAR:
case SQL_WLONGVARCHAR:
isVarchar = true;
break;
default: break;
}
#endif // POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT
foundSize = _pTypeInfo->tryGetInfo(cDataType, "COLUMN_SIZE", tmp); foundSize = _pTypeInfo->tryGetInfo(cDataType, "COLUMN_SIZE", tmp);
if (foundSize) colSize = tmp; if (foundSize) colSize = tmp;
else foundSize = _pTypeInfo->tryGetInfo(sqlDataType, "COLUMN_SIZE", tmp); else foundSize = _pTypeInfo->tryGetInfo(sqlDataType, "COLUMN_SIZE", tmp);
if (foundSize) colSize = tmp; if (foundSize) colSize = tmp;
if (actualSize > static_cast<std::size_t>(colSize)) if (actualSize > static_cast<std::size_t>(colSize)
#ifdef POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT
&& !isVarchar
#endif
)
{ {
throw LengthExceededException(Poco::format("ODBC::Binder::getColSizeAndPrecision();%d: Error binding column %z size=%z, max size=%ld)", throw LengthExceededException(Poco::format("ODBC::Binder::getColSizeAndPrecision();%d: Error binding column %z size=%z, max size=%ld)",
__LINE__, pos, actualSize, static_cast<long>(colSize))); __LINE__, pos, actualSize, static_cast<long>(colSize)));
} }
foundPrec = _pTypeInfo->tryGetInfo(cDataType, "MAXIMUM_SCALE", tmp); foundPrec = _pTypeInfo->tryGetInfo(cDataType, "MAXIMUM_SCALE", tmp);
if (foundPrec) decDigits = tmp; if (foundPrec) decDigits = tmp;
else foundPrec = _pTypeInfo->tryGetInfo(sqlDataType, "MAXIMUM_SCALE", tmp); else foundPrec = _pTypeInfo->tryGetInfo(sqlDataType, "MAXIMUM_SCALE", tmp);
@ -603,14 +636,14 @@ void Binder::getColumnOrParameterSize(std::size_t pos, SQLINTEGER& size)
ODBCMetaColumn col(_rStmt, pos); ODBCMetaColumn col(_rStmt, pos);
colSize = col.length(); colSize = col.length();
} }
catch (StatementException&) { } catch (StatementException&){}
try try
{ {
Parameter p(_rStmt, pos); Parameter p(_rStmt, pos);
paramSize = p.columnSize(); paramSize = p.columnSize();
} }
catch (StatementException&) {} catch (StatementException&){}
if (colSize == 0 && paramSize == 0) if (colSize == 0 && paramSize == 0)
paramSize = getParamSizeDirect(pos, size); paramSize = getParamSizeDirect(pos, size);

View File

@ -17,6 +17,13 @@
#include "Poco/Data/SessionFactory.h" #include "Poco/Data/SessionFactory.h"
#if POCO_DATA_SQL_SERVER_BIG_STRINGS
#pragma message ("MS SQLServer ODBC big string capability ENABLED")
#else
#pragma message ("MS SQLServer ODBC big string capability DISABLED")
#endif
namespace Poco { namespace Poco {
namespace Data { namespace Data {
namespace ODBC { namespace ODBC {

View File

@ -277,12 +277,9 @@ template<>
bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val, SQLSMALLINT cType) bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val, SQLSMALLINT cType)
{ {
std::size_t maxSize = _pPreparator->getMaxFieldSize(); std::size_t maxSize = _pPreparator->getMaxFieldSize();
std::size_t fetchedSize = 0;
std::size_t totalSize = 0;
SQLLEN len; SQLLEN len;
const int bufSize = CHUNK_SIZE; Poco::Buffer<char> apChar(CHUNK_SIZE);
Poco::Buffer<char> apChar(bufSize);
char* pChar = apChar.begin(); char* pChar = apChar.begin();
SQLRETURN rc = 0; SQLRETURN rc = 0;
@ -291,15 +288,29 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
do do
{ {
std::memset(pChar, 0, bufSize); std::memset(pChar, 0, CHUNK_SIZE);
len = 0; len = 0;
rc = SQLGetData(_rStmt, rc = SQLGetData(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
cType, //C data type cType, //C data type
pChar, //returned value pChar, //returned value
bufSize, //buffer length CHUNK_SIZE, //buffer length
&len); //length indicator &len); //length indicator
if (SQL_SUCCESS_WITH_INFO == rc)
{
StatementDiagnostics d(_rStmt);
std::size_t fieldCount = d.fields().size();
for (int i = 0; i < fieldCount; ++i)
{
if (d.sqlState(i) == "01004"s)
{
if (len == SQL_NO_TOTAL || len > CHUNK_SIZE) // only part of data was returned
len = CHUNK_SIZE-1; // SQLGetData terminates the returned string
}
}
}
if (SQL_NO_DATA != rc && Utility::isError(rc)) if (SQL_NO_DATA != rc && Utility::isError(rc))
throw StatementException(_rStmt, "ODBC::Extractor::extractManualImpl(string):SQLGetData()"); throw StatementException(_rStmt, "ODBC::Extractor::extractManualImpl(string):SQLGetData()");
@ -316,12 +327,11 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
break; break;
_lengths[pos] += len; _lengths[pos] += len;
fetchedSize = _lengths[pos] > CHUNK_SIZE ? CHUNK_SIZE : _lengths[pos]; if (_lengths[pos] <= maxSize)
totalSize += fetchedSize; val.append(pChar, len);
if (totalSize <= maxSize)
val.append(pChar, fetchedSize);
else else
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); throw DataException(format(FLD_SIZE_EXCEEDED_FMT, static_cast<std::size_t>(_lengths[pos]), maxSize));
}while (true); }while (true);
return true; return true;
@ -332,12 +342,8 @@ template<>
bool Extractor::extractManualImpl<UTF16String>(std::size_t pos, UTF16String& val, SQLSMALLINT cType) bool Extractor::extractManualImpl<UTF16String>(std::size_t pos, UTF16String& val, SQLSMALLINT cType)
{ {
std::size_t maxSize = _pPreparator->getMaxFieldSize(); std::size_t maxSize = _pPreparator->getMaxFieldSize();
std::size_t fetchedSize = 0;
std::size_t totalSize = 0;
SQLLEN len; SQLLEN len;
const int bufSize = CHUNK_SIZE; Poco::Buffer<UTF16String::value_type> apChar(CHUNK_SIZE);
Poco::Buffer<UTF16String::value_type> apChar(bufSize);
UTF16String::value_type* pChar = apChar.begin(); UTF16String::value_type* pChar = apChar.begin();
SQLRETURN rc = 0; SQLRETURN rc = 0;
@ -346,15 +352,29 @@ bool Extractor::extractManualImpl<UTF16String>(std::size_t pos, UTF16String& val
do do
{ {
std::memset(pChar, 0, bufSize); std::memset(pChar, 0, CHUNK_SIZE);
len = 0; len = 0;
rc = SQLGetData(_rStmt, rc = SQLGetData(_rStmt,
(SQLUSMALLINT)pos + 1, (SQLUSMALLINT)pos + 1,
cType, //C data type cType, //C data type
pChar, //returned value pChar, //returned value
bufSize, //buffer length CHUNK_SIZE, //buffer length
&len); //length indicator &len); //length indicator
if (SQL_SUCCESS_WITH_INFO == rc)
{
StatementDiagnostics d(_rStmt);
std::size_t fieldCount = d.fields().size();
for (int i = 0; i < fieldCount; ++i)
{
if (d.sqlState(i) == "01004"s)
{
if (len == SQL_NO_TOTAL || len > CHUNK_SIZE) // only part of data was returned
len = CHUNK_SIZE - 2;
}
}
}
if (SQL_NO_DATA != rc && Utility::isError(rc)) if (SQL_NO_DATA != rc && Utility::isError(rc))
throw StatementException(_rStmt, "ODBC::Extractor::extractManualImpl(UTF16String):SQLGetData()"); throw StatementException(_rStmt, "ODBC::Extractor::extractManualImpl(UTF16String):SQLGetData()");
@ -371,12 +391,10 @@ bool Extractor::extractManualImpl<UTF16String>(std::size_t pos, UTF16String& val
break; break;
_lengths[pos] += len; _lengths[pos] += len;
fetchedSize = _lengths[pos] > CHUNK_SIZE ? CHUNK_SIZE : _lengths[pos]; if (_lengths[pos] <= maxSize)
totalSize += fetchedSize; val.append(pChar, len / sizeof(UTF16Char));
if (totalSize <= maxSize)
val.append(pChar, fetchedSize / sizeof(UTF16Char));
else else
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); throw DataException(format(FLD_SIZE_EXCEEDED_FMT, static_cast<std::size_t>(_lengths[pos]), maxSize));
} while (true); } while (true);
return true; return true;
@ -390,7 +408,6 @@ bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
{ {
std::size_t maxSize = _pPreparator->getMaxFieldSize(); std::size_t maxSize = _pPreparator->getMaxFieldSize();
std::size_t fetchedSize = 0; std::size_t fetchedSize = 0;
std::size_t totalSize = 0;
SQLLEN len; SQLLEN len;
const int bufSize = CHUNK_SIZE; const int bufSize = CHUNK_SIZE;
@ -406,14 +423,12 @@ bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
std::memset(pChar, 0, bufSize); std::memset(pChar, 0, bufSize);
len = 0; len = 0;
rc = SQLGetData(_rStmt, rc = SQLGetData(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT)pos + 1,
cType, //C data type cType, //C data type
pChar, //returned value pChar, //returned value
bufSize, //buffer length bufSize, //buffer length
&len); //length indicator &len); //length indicator
_lengths[pos] += len;
if (SQL_NO_DATA != rc && Utility::isError(rc)) if (SQL_NO_DATA != rc && Utility::isError(rc))
throw StatementException(_rStmt, "ODBC::Extractor::extractManualImpl(CLOB):SQLGetData()"); throw StatementException(_rStmt, "ODBC::Extractor::extractManualImpl(CLOB):SQLGetData()");
@ -427,13 +442,13 @@ bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
break; break;
fetchedSize = len > CHUNK_SIZE ? CHUNK_SIZE : len; fetchedSize = len > CHUNK_SIZE ? CHUNK_SIZE : len;
totalSize += fetchedSize; _lengths[pos] += fetchedSize;
if (totalSize <= maxSize) if (_lengths[pos] <= maxSize)
val.appendRaw(pChar, fetchedSize); val.appendRaw(pChar, fetchedSize);
else else
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
}while (true); } while (true);
return true; return true;
} }

View File

@ -99,6 +99,12 @@ SessionImpl::~SessionImpl()
} }
void SessionImpl::setName()
{
setDBMSName(Utility::dbmsName(_db));
}
Poco::Data::StatementImpl::Ptr SessionImpl::createStatementImpl() Poco::Data::StatementImpl::Ptr SessionImpl::createStatementImpl()
{ {
return new ODBCStatementImpl(*this); return new ODBCStatementImpl(*this);
@ -173,6 +179,8 @@ void SessionImpl::open(const std::string& connect)
else else
throw ConnectionException(SQL_NULL_HDBC, throw ConnectionException(SQL_NULL_HDBC,
Poco::format("Connection to '%s' failed.", connectionString())); Poco::format("Connection to '%s' failed.", connectionString()));
setName();
} }

View File

@ -14,6 +14,7 @@
#include "Poco/Data/ODBC/Utility.h" #include "Poco/Data/ODBC/Utility.h"
#include "Poco/Data/ODBC/Handle.h" #include "Poco/Data/ODBC/Handle.h"
#include "Poco/Data/ODBC/ConnectionHandle.h"
#include "Poco/Data/ODBC/ODBCException.h" #include "Poco/Data/ODBC/ODBCException.h"
#include "Poco/NumberFormatter.h" #include "Poco/NumberFormatter.h"
#include "Poco/DateTime.h" #include "Poco/DateTime.h"
@ -156,4 +157,18 @@ void Utility::dateTimeSync(SQL_TIMESTAMP_STRUCT& ts, const Poco::DateTime& dt)
} }
std::string Utility::dbmsName(const ConnectionHandle& db)
{
const SQLSMALLINT bufSize = 1024;
SQLCHAR dbmsName[bufSize] = {0};
SQLSMALLINT retSize = 0;
SQLRETURN rc = Poco::Data::ODBC::SQLGetInfo(const_cast<SQLHDBC>(db.handle()), SQL_DBMS_NAME, dbmsName, bufSize, &retSize);
if (!isError(rc))
{
return std::string(reinterpret_cast<char*>(dbmsName), retSize);
}
return "unknown"s;
}
} } } // namespace Poco::Data::ODBC } } } // namespace Poco::Data::ODBC

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="debug_shared|ARM64"> <ProjectConfiguration Include="debug_shared|ARM64">
@ -81,7 +81,7 @@
<RootNamespace>TestSuite</RootNamespace> <RootNamespace>TestSuite</RootNamespace>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
@ -172,63 +172,63 @@
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"/> <ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros"/> <PropertyGroup Label="UserMacros" />
<PropertyGroup> <PropertyGroup>
<_ProjectFileVersion>17.0.34714.143</_ProjectFileVersion> <_ProjectFileVersion>17.0.34714.143</_ProjectFileVersion>
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">TestSuited</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">TestSuited</TargetName>
@ -314,31 +314,37 @@
<OutDir>bin64\</OutDir> <OutDir>bin64\</OutDir>
<IntDir>obj64\TestSuite\$(Configuration)\</IntDir> <IntDir>obj64\TestSuite\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">
<OutDir>bin64\</OutDir> <OutDir>bin64\</OutDir>
<IntDir>obj64\TestSuite\$(Configuration)\</IntDir> <IntDir>obj64\TestSuite\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">
<OutDir>bin64\static_mt\</OutDir> <OutDir>bin64\static_mt\</OutDir>
<IntDir>obj64\TestSuite\$(Configuration)\</IntDir> <IntDir>obj64\TestSuite\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">
<OutDir>bin64\static_mt\</OutDir> <OutDir>bin64\static_mt\</OutDir>
<IntDir>obj64\TestSuite\$(Configuration)\</IntDir> <IntDir>obj64\TestSuite\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">
<OutDir>bin64\static_md\</OutDir> <OutDir>bin64\static_md\</OutDir>
<IntDir>obj64\TestSuite\$(Configuration)\</IntDir> <IntDir>obj64\TestSuite\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">
<OutDir>bin64\static_md\</OutDir> <OutDir>bin64\static_md\</OutDir>
<IntDir>obj64\TestSuite\$(Configuration)\</IntDir> <IntDir>obj64\TestSuite\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IncludePath>C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\180\SDK\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">
<ClCompile> <ClCompile>
@ -352,7 +358,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -388,9 +394,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -421,7 +427,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -457,9 +463,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -490,7 +496,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -526,9 +532,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -559,7 +565,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -595,9 +601,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -628,7 +634,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -664,9 +670,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -697,7 +703,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -733,9 +739,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -766,7 +772,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -802,9 +808,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -835,7 +841,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -871,9 +877,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -904,7 +910,7 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
@ -940,9 +946,9 @@
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/> <PrecompiledHeader />
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat/> <DebugInformationFormat />
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -962,16 +968,16 @@
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="src\ODBCAccessTest.h"/> <ClInclude Include="src\ODBCAccessTest.h" />
<ClInclude Include="src\ODBCDB2Test.h"/> <ClInclude Include="src\ODBCDB2Test.h" />
<ClInclude Include="src\ODBCMySQLTest.h"/> <ClInclude Include="src\ODBCMySQLTest.h" />
<ClInclude Include="src\ODBCOracleTest.h"/> <ClInclude Include="src\ODBCOracleTest.h" />
<ClInclude Include="src\ODBCPostgreSQLTest.h"/> <ClInclude Include="src\ODBCPostgreSQLTest.h" />
<ClInclude Include="src\ODBCSQLiteTest.h"/> <ClInclude Include="src\ODBCSQLiteTest.h" />
<ClInclude Include="src\ODBCSQLServerTest.h"/> <ClInclude Include="src\ODBCSQLServerTest.h" />
<ClInclude Include="src\ODBCTest.h"/> <ClInclude Include="src\ODBCTest.h" />
<ClInclude Include="src\ODBCTestSuite.h"/> <ClInclude Include="src\ODBCTestSuite.h" />
<ClInclude Include="src\SQLExecutor.h"/> <ClInclude Include="src\SQLExecutor.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="src\Driver.cpp"> <ClCompile Include="src\Driver.cpp">
@ -1030,6 +1036,6 @@
<LanguageStandard_C>stdc11</LanguageStandard_C> <LanguageStandard_C>stdc11</LanguageStandard_C>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"/> <ImportGroup Label="ExtensionTargets" />
</Project> </Project>

View File

@ -66,6 +66,12 @@ using Poco::DateTime;
#endif #endif
#endif #endif
#if POCO_DATA_SQL_SERVER_BIG_STRINGS
#pragma message ("MS SQLServer ODBC big string capability ENABLED")
#else
#pragma message ("MS SQLServer ODBC big string capability DISABLED")
#endif
#define MS_SQL_SERVER_DSN "PocoDataSQLServerTest" #define MS_SQL_SERVER_DSN "PocoDataSQLServerTest"
#define MS_SQL_SERVER_SERVER POCO_ODBC_TEST_DATABASE_SERVER #define MS_SQL_SERVER_SERVER POCO_ODBC_TEST_DATABASE_SERVER
#define MS_SQL_SERVER_PORT "1433" #define MS_SQL_SERVER_PORT "1433"
@ -191,7 +197,7 @@ void ODBCSQLServerTest::testBLOB()
try try
{ {
executor().blob(maxFldSize, "CONVERT(VARBINARY(MAX),?)"); executor().blob(maxFldSize, "CONVERT(VARBINARY(MAX),?)");
fail (__func__, __LINE__, __FILE__); failmsg(__func__);
} }
catch (DataException&) catch (DataException&)
{ {
@ -211,7 +217,7 @@ void ODBCSQLServerTest::testBLOB()
try try
{ {
executor().blob(maxFldSize+1, "CONVERT(VARBINARY(MAX),?)"); executor().blob(maxFldSize+1, "CONVERT(VARBINARY(MAX),?)");
fail (__func__, __LINE__, __FILE__); failmsg (__func__);
} }
catch (DataException&) { } catch (DataException&) { }
} }
@ -219,8 +225,10 @@ void ODBCSQLServerTest::testBLOB()
void ODBCSQLServerTest::testBigString() void ODBCSQLServerTest::testBigString()
{ {
std::string lastName(8000, 'l'); #if defined(POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT) && POCO_DATA_SQL_SERVER_BIG_STRINGS
std::string firstName(8000, 'f'); const int limitSize = 8000, overLimitSize = 16002;
std::string lastName(overLimitSize, 'l');
std::string firstName(limitSize, 'f');
std::string address("Address"); std::string address("Address");
int age = 42; int age = 42;
@ -229,10 +237,87 @@ void ODBCSQLServerTest::testBigString()
recreatePersonBigStringTable(); recreatePersonBigStringTable();
session().setFeature("autoBind", bindValue(i)); session().setFeature("autoBind", bindValue(i));
session().setFeature("autoExtract", bindValue(i + 1)); session().setFeature("autoExtract", bindValue(i + 1));
session().setProperty("maxFieldSize", overLimitSize+1);
try try
{ {
session() << "DELETE FROM Person"s, now;
session() << "INSERT INTO Person VALUES (?,?,?,?)"s, session() << "INSERT INTO Person VALUES (?,?,?,?)"s,
use(lastName), use(firstName), use(address), use(age), now; use(lastName), use(firstName), use(address), use(age), now;
lastName.clear();
firstName.clear();
address.clear();
age = 0;
session() << "SELECT LastName /*VARCHAR(MAX)*/, FirstName /*VARCHAR(8000)*/, Address /*VARCHAR(30)*/, Age FROM Person"s,
into(lastName), into(firstName), into(address), into(age), now;
assertEqual(lastName, std::string(overLimitSize, 'l'));
assertEqual(firstName, std::string(limitSize, 'f'));
assertEqual(address, "Address"s);
assertEqual(age, 42);
}
catch (DataException& ce)
{
std::cout << ce.displayText() << std::endl;
failmsg (__func__);
}
i += 2;
}
#else
std::cout << "SQL Server extensions not enabled.";
#endif // POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT && POCO_DATA_SQL_SERVER_BIG_STRINGS
}
void ODBCSQLServerTest::testBigStringVector()
{
#if defined(POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT) && POCO_DATA_SQL_SERVER_BIG_STRINGS
const int limitSize = 8000, overLimitSize = 16002, entries = 10;
std::string lastName(overLimitSize, 'l');
std::vector<std::string> lastNameVec(entries, lastName);
std::string firstName(limitSize, 'f');
std::vector<std::string> firstNameVec(entries, firstName);
std::string address("Address");
std::vector<std::string> addressVec(entries, address);
int age = 42;
std::vector<int> ageVec(10, age);
for (int i = 0; i < 8;)
{
recreatePersonBigStringTable();
session().setFeature("autoBind", bindValue(i));
session().setFeature("autoExtract", bindValue(i + 1));
session().setProperty("maxFieldSize", overLimitSize + 1);
try
{
session() << "DELETE FROM Person"s, now;
session() << "INSERT INTO Person VALUES (?,?,?,?)"s,
use(lastNameVec), use(firstNameVec), use(addressVec), use(ageVec), now;
lastNameVec.clear();
firstNameVec.clear();
addressVec.clear();
ageVec.clear();
assertEqual(lastNameVec.size(), 0);
assertEqual(firstNameVec.size(), 0);
assertEqual(addressVec.size(), 0);
assertEqual(ageVec.size(), 0);
session() << "SELECT LastName /*VARCHAR(MAX)*/, FirstName /*VARCHAR(8000)*/, Address /*VARCHAR(30)*/, Age FROM Person"s,
into(lastNameVec), into(firstNameVec), into(addressVec), into(ageVec), now;
assertEqual(lastNameVec.size(), entries);
assertEqual(firstNameVec.size(), entries);
assertEqual(addressVec.size(), entries);
assertEqual(ageVec.size(), entries);
for (int i = 0; i < entries; ++i)
{
assertEqual(lastNameVec[i], std::string(overLimitSize, 'l'));
assertEqual(firstNameVec[i], std::string(limitSize, 'f'));
assertEqual(addressVec[i], "Address"s);
assertEqual(ageVec[i], 42);
}
} }
catch (DataException& ce) catch (DataException& ce)
{ {
@ -241,6 +326,9 @@ void ODBCSQLServerTest::testBigString()
} }
i += 2; i += 2;
} }
#else
std::cout << "SQL Server extensions not enabled.";
#endif // POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT && POCO_DATA_SQL_SERVER_BIG_STRINGS
} }
@ -1020,6 +1108,7 @@ CppUnit::Test* ODBCSQLServerTest::suite()
CppUnit_addTest(pSuite, ODBCSQLServerTest, testEmptyDB); CppUnit_addTest(pSuite, ODBCSQLServerTest, testEmptyDB);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testBLOB); CppUnit_addTest(pSuite, ODBCSQLServerTest, testBLOB);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testBigString); CppUnit_addTest(pSuite, ODBCSQLServerTest, testBigString);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testBigStringVector);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testBigBatch); CppUnit_addTest(pSuite, ODBCSQLServerTest, testBigBatch);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testBLOBContainer); CppUnit_addTest(pSuite, ODBCSQLServerTest, testBLOBContainer);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testBLOBStmt); CppUnit_addTest(pSuite, ODBCSQLServerTest, testBLOBStmt);

View File

@ -48,6 +48,7 @@ public:
void testBLOB() override; void testBLOB() override;
void testBigString(); void testBigString();
void testBigStringVector();
void testBigBatch(); void testBigBatch();
void testNull() override; void testNull() override;
void testBulk() override; void testBulk() override;

View File

@ -37,9 +37,8 @@ CppUnit::Test* ODBCTestSuite::suite()
// //
// For the time being, the workaround is to connect to DB2 after connecting to PostgreSQL and Oracle. // For the time being, the workaround is to connect to DB2 after connecting to PostgreSQL and Oracle.
addTest(pSuite, ODBCSQLServerTest::suite());
addTest(pSuite, ODBCOracleTest::suite()); addTest(pSuite, ODBCOracleTest::suite());
addTest(pSuite, ODBCSQLServerTest::suite());
addTest(pSuite, ODBCMySQLTest::suite()); addTest(pSuite, ODBCMySQLTest::suite());
addTest(pSuite, ODBCPostgreSQLTest::suite()); addTest(pSuite, ODBCPostgreSQLTest::suite());
addTest(pSuite, ODBCSQLiteTest::suite()); addTest(pSuite, ODBCSQLiteTest::suite());

View File

@ -130,6 +130,8 @@ public:
const std::string& connectorName() const; const std::string& connectorName() const;
/// Returns the name of the connector. /// Returns the name of the connector.
void setName();
private: private:
std::string _connectorName; std::string _connectorName;
mutable SessionHandle _sessionHandle; mutable SessionHandle _sessionHandle;

View File

@ -79,6 +79,12 @@ SessionImpl::~SessionImpl()
} }
void SessionImpl::setName()
{
setDBMSName("PostgreSQL"s);
}
void SessionImpl::setConnectionTimeout(std::size_t aTimeout) void SessionImpl::setConnectionTimeout(std::size_t aTimeout)
{ {
_timeout = aTimeout; _timeout = aTimeout;
@ -145,6 +151,8 @@ void SessionImpl::open(const std::string& aConnectionString)
addFeature("binaryExtraction", addFeature("binaryExtraction",
&SessionImpl::setBinaryExtraction, &SessionImpl::setBinaryExtraction,
&SessionImpl::isBinaryExtraction); &SessionImpl::isBinaryExtraction);
setName();
} }

View File

@ -139,7 +139,10 @@ protected:
void setTransactionType(const std::string &prop, const Poco::Any& value); void setTransactionType(const std::string &prop, const Poco::Any& value);
Poco::Any getTransactionType(const std::string& prop) const; Poco::Any getTransactionType(const std::string& prop) const;
private: private:
void setName();
std::string _connector; std::string _connector;
sqlite3* _pDB; sqlite3* _pDB;
bool _connected; bool _connected;

View File

@ -82,6 +82,12 @@ SessionImpl::~SessionImpl()
} }
void SessionImpl::setName()
{
setDBMSName("SQLite"s);
}
Poco::Data::StatementImpl::Ptr SessionImpl::createStatementImpl() Poco::Data::StatementImpl::Ptr SessionImpl::createStatementImpl()
{ {
poco_check_ptr (_pDB); poco_check_ptr (_pDB);
@ -273,17 +279,17 @@ Poco::Any SessionImpl::getConnectionTimeout(const std::string& prop) const
return Poco::Any(_timeout/1000); return Poco::Any(_timeout/1000);
} }
void SessionImpl::setTransactionType(TransactionType transactionType) void SessionImpl::setTransactionType(TransactionType transactionType)
{ {
_transactionType = transactionType; _transactionType = transactionType;
} }
void SessionImpl::setTransactionType(const std::string &prop, const Poco::Any& value) void SessionImpl::setTransactionType(const std::string &prop, const Poco::Any& value)
{ {
setTransactionType(Poco::RefAnyCast<TransactionType>(value)); setTransactionType(Poco::RefAnyCast<TransactionType>(value));
} }
Poco::Any SessionImpl::getTransactionType(const std::string& prop) const Poco::Any SessionImpl::getTransactionType(const std::string& prop) const
{ {
return Poco::Any(_transactionType); return Poco::Any(_transactionType);
} }

View File

@ -204,6 +204,11 @@ public:
return (_statementCreator << t); return (_statementCreator << t);
} }
const std::string& dbmsName() const;
/// Returns the DBMS name. The name must be set by the
/// implementation.
/// Defaults to "unknown".
SharedPtr<StatementImpl> createStatementImpl(); SharedPtr<StatementImpl> createStatementImpl();
/// Creates a StatementImpl. /// Creates a StatementImpl.
@ -351,6 +356,12 @@ private:
// inlines // inlines
// //
inline const std::string& Session::dbmsName() const
{
return _pImpl->dbmsName();
}
inline bool Session::isAutocommit() const inline bool Session::isAutocommit() const
{ {
return _pImpl->isAutocommit(); return _pImpl->isAutocommit();

View File

@ -65,6 +65,11 @@ public:
virtual ~SessionImpl(); virtual ~SessionImpl();
/// Destroys the SessionImpl. /// Destroys the SessionImpl.
const std::string& dbmsName() const;
/// Returns the DBMS name. The name must be set by the
/// implementation.
/// Defaults to "unknown".
virtual Poco::SharedPtr<StatementImpl> createStatementImpl() = 0; virtual Poco::SharedPtr<StatementImpl> createStatementImpl() = 0;
/// Creates a StatementImpl. /// Creates a StatementImpl.
@ -195,6 +200,9 @@ public:
/// not supported by the underlying implementation. /// not supported by the underlying implementation.
protected: protected:
void setDBMSName(const std::string& name);
/// Sets the DBMS name.
void setConnectionString(const std::string& connectionString); void setConnectionString(const std::string& connectionString);
/// Sets the connection string. Should only be called on /// Sets the connection string. Should only be called on
/// disconnected sessions. Throws InvalidAccessException when called on /// disconnected sessions. Throws InvalidAccessException when called on
@ -205,6 +213,7 @@ private:
SessionImpl(const SessionImpl&); SessionImpl(const SessionImpl&);
SessionImpl& operator = (const SessionImpl&); SessionImpl& operator = (const SessionImpl&);
std::string _dbmsName;
std::string _connectionString; std::string _connectionString;
std::size_t _loginTimeout; std::size_t _loginTimeout;
}; };
@ -213,6 +222,19 @@ private:
// //
// inlines // inlines
// //
inline void SessionImpl::setDBMSName(const std::string& name)
{
_dbmsName = name;
}
inline const std::string& SessionImpl::dbmsName() const
{
return _dbmsName;
}
inline const std::string& SessionImpl::connectionString() const inline const std::string& SessionImpl::connectionString() const
{ {
return _connectionString; return _connectionString;

View File

@ -21,6 +21,7 @@ namespace Data {
SessionImpl::SessionImpl(const std::string& connectionString, std::size_t timeout): SessionImpl::SessionImpl(const std::string& connectionString, std::size_t timeout):
_dbmsName("unknown"s),
_connectionString(connectionString), _connectionString(connectionString),
_loginTimeout(timeout) _loginTimeout(timeout)
{ {

View File

@ -72,6 +72,7 @@ void DataTest::testSession()
assertTrue (sess.connector() == sess.impl()->connectorName()); assertTrue (sess.connector() == sess.impl()->connectorName());
assertTrue ("cs" == sess.impl()->connectionString()); assertTrue ("cs" == sess.impl()->connectionString());
assertTrue ("test:///cs" == sess.uri()); assertTrue ("test:///cs" == sess.uri());
assertTrue ("Test" == sess.dbmsName());
assertTrue (sess.getLoginTimeout() == Session::LOGIN_TIMEOUT_DEFAULT); assertTrue (sess.getLoginTimeout() == Session::LOGIN_TIMEOUT_DEFAULT);
sess.setLoginTimeout(123); sess.setLoginTimeout(123);

View File

@ -31,6 +31,7 @@ SessionImpl::SessionImpl(const std::string& init, std::size_t timeout):
addProperty("p1", &SessionImpl::setP, &SessionImpl::getP); addProperty("p1", &SessionImpl::setP, &SessionImpl::getP);
addProperty("p2", 0, &SessionImpl::getP); addProperty("p2", 0, &SessionImpl::getP);
addProperty("p3", &SessionImpl::setP, &SessionImpl::getP); addProperty("p3", &SessionImpl::setP, &SessionImpl::getP);
setDBMSName("Test");
} }

30
configure vendored
View File

@ -82,6 +82,10 @@ $(ls -C "$base"/build/config/)
Compile with -DPOCO_DATA_NO_SQL_PARSER Compile with -DPOCO_DATA_NO_SQL_PARSER
Disables compilation of the SQLParser. Disables compilation of the SQLParser.
--mssql-bigstring
Compile with -DPOCO_DATA_SQL_SERVER_BIG_STRINGS=1
Enables strings over 8000 bytes on MS SQL Server.
--sqlite-fts=<path> --sqlite-fts=<path>
Compile with -DPOCO_DATA_SQLITE_FTS. Compile with -DPOCO_DATA_SQLITE_FTS.
Compile SQLite with Full Text Search support. Compile SQLite with Full Text Search support.
@ -110,6 +114,9 @@ $(ls -C "$base"/build/config/)
--odbc-include=<path> --odbc-include=<path>
Specify the directory where ODBC header files are located. Specify the directory where ODBC header files are located.
--mssql-include=<path>
Specify the directory where MS SQL Server ODBC header files are located.
--mysql-lib=<path> --mysql-lib=<path>
Specify the directory where MySQL library is located. Specify the directory where MySQL library is located.
@ -170,11 +177,13 @@ includepath=""
librarypath="" librarypath=""
odbclib="" odbclib=""
odbcinclude="" odbcinclude=""
mssqlinclude=""
unbundled="" unbundled=""
trace="" trace=""
static="" static=""
shared="" shared=""
nosqlparser= nosqlparser=
mssqlbigstring=
omitMinimal="Crypto NetSSL_OpenSSL Zip Data Data/SQLite Data/ODBC Data/MySQL Data/PostgreSQL MongoDB Redis PDF DNSSD DNSSD/Avahi DNSSD/Bonjour CppParser PageCompiler" omitMinimal="Crypto NetSSL_OpenSSL Zip Data Data/SQLite Data/ODBC Data/MySQL Data/PostgreSQL MongoDB Redis PDF DNSSD DNSSD/Avahi DNSSD/Bonjour CppParser PageCompiler"
omitTypical="Data/ODBC Data/MySQL Data/PostgreSQL MongoDB Redis PDF DNSSD DNSSD/Avahi DNSSD/Bonjour CppParser" omitTypical="Data/ODBC Data/MySQL Data/PostgreSQL MongoDB Redis PDF DNSSD DNSSD/Avahi DNSSD/Bonjour CppParser"
omit=$omitTypical omit=$omitTypical
@ -208,6 +217,9 @@ while [ $# -ge 1 ]; do
--odbc-include=*) --odbc-include=*)
odbcinclude="$(echo "${1}" | awk '{print substr($0,16)}')" ;; odbcinclude="$(echo "${1}" | awk '{print substr($0,16)}')" ;;
--mssql-include=*)
mssqlinclude="$(echo "${1}" | awk '{print substr($0,16)}')" ;;
--mysql-lib=*) --mysql-lib=*)
mysqllib="$(echo "${1}" | awk '{print substr($0,13)}')" ;; mysqllib="$(echo "${1}" | awk '{print substr($0,13)}')" ;;
@ -255,6 +267,11 @@ while [ $# -ge 1 ]; do
nosqlparser=1 nosqlparser=1
;; ;;
--mssql-bigstring)
flags="$flags -DPOCO_DATA_SQL_SERVER_BIG_STRINGS=1"
mssqlbigstring=1
;;
--sqlite-thread-safe=*) --sqlite-thread-safe=*)
flags="$flags -DSQLITE_THREADSAFE=$(echo "${1}" | awk '{print substr($0,22)}')" ;; flags="$flags -DSQLITE_THREADSAFE=$(echo "${1}" | awk '{print substr($0,22)}')" ;;
@ -377,6 +394,9 @@ fi
if [ -n "$odbcinclude" ] ; then if [ -n "$odbcinclude" ] ; then
echo "POCO_ODBC_INCLUDE = $odbcinclude" >>"$build"/config.make echo "POCO_ODBC_INCLUDE = $odbcinclude" >>"$build"/config.make
fi fi
if [ -n "$mssqlinclude" ] ; then
echo "POCO_MSSQL_INCLUDE = $mssqlinclude" >>"$build"/config.make
fi
if [ -n "$mysqllib" ] ; then if [ -n "$mysqllib" ] ; then
echo "POCO_MYSQL_LIB = $mysqllib" >>"$build"/config.make echo "POCO_MYSQL_LIB = $mysqllib" >>"$build"/config.make
fi fi
@ -401,6 +421,9 @@ fi
if [ -n "$nosqlparser" ] ; then if [ -n "$nosqlparser" ] ; then
echo "POCO_DATA_NO_SQL_PARSER = $nosqlparser" >>"$build"/config.make echo "POCO_DATA_NO_SQL_PARSER = $nosqlparser" >>"$build"/config.make
fi fi
if [ -n "$mssqlbigstring" ] ; then
echo "POCO_DATA_SQL_SERVER_BIG_STRINGS = $mssqlbigstring" >>"$build"/config.make
fi
cat <<__EOF__ >>"$build"/config.make cat <<__EOF__ >>"$build"/config.make
export POCO_CONFIG export POCO_CONFIG
@ -428,6 +451,9 @@ fi
if [ -n "$odbcinclude" ] ; then if [ -n "$odbcinclude" ] ; then
echo "export POCO_ODBC_INCLUDE" >>"$build"/config.make echo "export POCO_ODBC_INCLUDE" >>"$build"/config.make
fi fi
if [ -n "$mssqlinclude" ] ; then
echo "export POCO_MSSQL_INCLUDE" >>"$build"/config.make
fi
if [ -n "$mysqllib" ] ; then if [ -n "$mysqllib" ] ; then
echo "export POCO_MYSQL_LIB" >>"$build"/config.make echo "export POCO_MYSQL_LIB" >>"$build"/config.make
fi fi
@ -452,7 +478,9 @@ fi
if [ -n "$nosqlparser" ] ; then if [ -n "$nosqlparser" ] ; then
echo "export POCO_DATA_NO_SQL_PARSER" >>"$build"/config.make echo "export POCO_DATA_NO_SQL_PARSER" >>"$build"/config.make
fi fi
if [ -n "$mssqlbigstring" ] ; then
echo "POCO_DATA_SQL_SERVER_BIG_STRINGS=$mssqlbigstring" >>"$build"/config.make
fi
# create config.build # create config.build
echo '# config.build generated by configure script' >"$build"/config.build echo '# config.build generated by configure script' >"$build"/config.build
cat <<__EOF__ >>"$build"/config.build cat <<__EOF__ >>"$build"/config.build