Skip to content

Commit 32c5b6b

Browse files
committed
ODBC fixes and tests (Oracle, SQL Server, MySQL on Windows)
MySQL back-end compile fixes on Windows Nullable/NullType
1 parent 7029c95 commit 32c5b6b

21 files changed

Lines changed: 573 additions & 445 deletions

File tree

‎Data/Data_VS90.vcproj‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,6 @@
450450
RelativePath=".\include\Poco\Data\MetaColumn.h"
451451
>
452452
</File>
453-
<File
454-
RelativePath=".\include\Poco\Data\Nullable.h"
455-
>
456-
</File>
457453
<File
458454
RelativePath=".\include\Poco\Data\Position.h"
459455
>
Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
//
2-
// Connector.h
3-
//
4-
// $Id: //poco/1.4/Data/MySQL/include/Poco/Data/MySQL/Connector.h#1 $
5-
//
6-
// Library: Data
7-
// Package: MySQL
8-
// Module: Connector
9-
//
10-
// Definition of the Connector class.
11-
//
12-
// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
13-
// and Contributors.
14-
//
15-
// Permission is hereby granted, free of charge, to any person or organization
16-
// obtaining a copy of the software and accompanying documentation covered by
17-
// this license (the "Software") to use, reproduce, display, distribute,
18-
// execute, and transmit the Software, and to prepare derivative works of the
19-
// Software, and to permit third-parties to whom the Software is furnished to
20-
// do so, all subject to the following:
21-
//
22-
// The copyright notices in the Software and this entire statement, including
23-
// the above license grant, this restriction and the following disclaimer,
24-
// must be included in all copies of the Software, in whole or in part, and
25-
// all derivative works of the Software, unless such copies or derivative
26-
// works are solely in the form of machine-executable object code generated by
27-
// a source language processor.
28-
//
29-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31-
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
32-
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
33-
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
34-
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
35-
// DEALINGS IN THE SOFTWARE.
36-
//
37-
38-
39-
#ifndef Data_MySQL_Connector_INCLUDED
40-
#define Data_MySQL_Connector_INCLUDED
41-
42-
#include "MySQL.h"
43-
#include "Poco/Data/Connector.h"
44-
45-
namespace Poco {
46-
namespace Data {
47-
namespace MySQL {
48-
49-
class MySQL_API Connector: public Poco::Data::Connector
50-
/// Connector instantiates MySQL SessionImpl objects.
51-
{
52-
public:
53-
54-
static std::string KEY;
55-
56-
Connector();
57-
/// Creates the Connector.
58-
59-
virtual ~Connector();
60-
/// Destroys the Connector.
61-
62-
virtual const std::string& name() const;
63-
/// Returns the name associated with this connector.
64-
1+
//
2+
// Connector.h
3+
//
4+
// $Id: //poco/1.4/Data/MySQL/include/Poco/Data/MySQL/Connector.h#1 $
5+
//
6+
// Library: Data
7+
// Package: MySQL
8+
// Module: Connector
9+
//
10+
// Definition of the Connector class.
11+
//
12+
// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
13+
// and Contributors.
14+
//
15+
// Permission is hereby granted, free of charge, to any person or organization
16+
// obtaining a copy of the software and accompanying documentation covered by
17+
// this license (the "Software") to use, reproduce, display, distribute,
18+
// execute, and transmit the Software, and to prepare derivative works of the
19+
// Software, and to permit third-parties to whom the Software is furnished to
20+
// do so, all subject to the following:
21+
//
22+
// The copyright notices in the Software and this entire statement, including
23+
// the above license grant, this restriction and the following disclaimer,
24+
// must be included in all copies of the Software, in whole or in part, and
25+
// all derivative works of the Software, unless such copies or derivative
26+
// works are solely in the form of machine-executable object code generated by
27+
// a source language processor.
28+
//
29+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
32+
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
33+
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
34+
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
35+
// DEALINGS IN THE SOFTWARE.
36+
//
37+
38+
39+
#ifndef Data_MySQL_Connector_INCLUDED
40+
#define Data_MySQL_Connector_INCLUDED
41+
42+
#include "MySQL.h"
43+
#include "Poco/Data/Connector.h"
44+
45+
namespace Poco {
46+
namespace Data {
47+
namespace MySQL {
48+
49+
class MySQL_API Connector: public Poco::Data::Connector
50+
/// Connector instantiates MySQL SessionImpl objects.
51+
{
52+
public:
53+
54+
static std::string KEY;
55+
56+
Connector();
57+
/// Creates the Connector.
58+
59+
virtual ~Connector();
60+
/// Destroys the Connector.
61+
62+
virtual const std::string& name() const;
63+
/// Returns the name associated with this connector.
64+
6565
virtual Poco::AutoPtr<Poco::Data::SessionImpl> createSession(const std::string& connectionString,
66-
std::size_t timeout = Poco::Data::SessionImpl::LOGIN_TIMEOUT_DEFAULT);
67-
/// Creates a MySQL SessionImpl object and initializes it with the given connectionString.
68-
69-
static void registerConnector();
70-
/// Registers the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory
71-
72-
static void unregisterConnector();
73-
/// Unregisters the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory
74-
};
75-
76-
77-
} } } // namespace Poco::Data::MySQL
78-
79-
80-
#endif // Data_MySQL_Connector_INCLUDED
66+
std::size_t timeout = Poco::Data::SessionImpl::LOGIN_TIMEOUT_DEFAULT);
67+
/// Creates a MySQL SessionImpl object and initializes it with the given connectionString.
68+
69+
static void registerConnector();
70+
/// Registers the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory
71+
72+
static void unregisterConnector();
73+
/// Unregisters the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory
74+
};
75+
76+
77+
} } } // namespace Poco::Data::MySQL
78+
79+
80+
#endif // Data_MySQL_Connector_INCLUDED

‎Data/MySQL/include/Poco/Data/MySQL/MySQL.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
// defined with this macro as being exported.
5353
//
5454
#if defined(_WIN32) && defined(POCO_DLL)
55-
#if defined(MYSQL_EXPORTS)
55+
#if defined(MySQL_EXPORTS)
5656
#define MySQL_API __declspec(dllexport)
5757
#else
5858
#define MySQL_API __declspec(dllimport)
@@ -69,7 +69,7 @@
6969
// Automatically link Data library.
7070
//
7171
#if defined(_MSC_VER)
72-
#if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(MYSQL_EXPORTS)
72+
#if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(MySQL_EXPORTS)
7373
#if defined(POCO_DLL)
7474
#if defined(_DEBUG)
7575
#pragma comment(lib, "PocoDataMySQLd.lib")

‎Data/MySQL/include/Poco/Data/MySQL/MySQLStatementImpl.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class MySQL_API MySQLStatementImpl: public Poco::Data::StatementImpl
8181
virtual bool hasNext();
8282
/// Returns true if a call to next() will return data.
8383

84-
virtual std::size_t next();
84+
virtual std::size_t next();
8585
/// Retrieves the next row from the resultset.
8686
/// Will throw, if the resultset is empty.
8787

‎Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,37 +54,37 @@ class SessionHandle
5454
public:
5555

5656
explicit SessionHandle(MYSQL* mysql);
57-
/// Creates session handle
57+
/// Creates session handle
5858

5959
~SessionHandle();
60-
/// Destroy handle, close connection
60+
/// Destroy handle, close connection
6161

6262
void init(MYSQL* mysql = 0);
6363
/// Initializes the handle iff not initialized.
6464

6565
void options(mysql_option opt);
66-
/// Set connection options
66+
/// Set connection options
6767

6868
void options(mysql_option opt, bool b);
69-
/// Set connection options
69+
/// Set connection options
7070

7171
void options(mysql_option opt, unsigned int i);
72-
/// Set connection options
72+
/// Set connection options
7373

7474
void connect(const char* host, const char* user, const char* password, const char* db, unsigned int port);
75-
/// Connect to server
75+
/// Connect to server
7676

7777
void close();
78-
/// Close connection
78+
/// Close connection
7979

8080
void startTransaction();
81-
/// Start transaction
81+
/// Start transaction
8282

8383
void commit();
84-
/// Commit transaction
84+
/// Commit transaction
8585

8686
void rollback();
87-
/// Rollback trabsaction
87+
/// Rollback trabsaction
8888

8989
operator MYSQL* ();
9090

@@ -94,7 +94,7 @@ class SessionHandle
9494
SessionHandle& operator=(const SessionHandle&);
9595

9696
private:
97-
97+
9898
MYSQL* _pHandle;
9999
};
100100

‎Data/MySQL/include/Poco/Data/MySQL/SessionImpl.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ class MySQL_API SessionImpl: public Poco::Data::AbstractSessionImpl<SessionImpl>
138138
Poco::Any getInsertId(const std::string&);
139139
/// Get insert id
140140

141-
SessionHandle& handle();
142-
// Get handle
141+
SessionHandle& handle();
142+
// Get handle
143143

144144
const std::string& connectorName();
145145
/// Returns the name of the connector.
@@ -204,7 +204,7 @@ inline Poco::Any SessionImpl::getInsertId(const std::string&)
204204

205205
inline SessionHandle& SessionImpl::handle()
206206
{
207-
return _handle;
207+
return _handle;
208208
}
209209

210210

0 commit comments

Comments
 (0)