Date: Wednesday, January 4, 2006 @ 11:53:51
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/Connection.hpp (1.40 -> 1.41) include/Request.hpp (1.12
-> 1.13) include/RequestWithResultSetParameters.hpp (1.9 ->
1.10) src/Connection.cpp (1.48 -> 1.49) src/Request.cpp (1.7 ->
1.8) src/RequestWithResultSetParameters.cpp (1.7 -> 1.8)
Udpated to protocol version 33: removal of controllerNeedSkeleton
--------------------------------------------+
include/Connection.hpp | 4 +---
include/Request.hpp | 10 ++--------
include/RequestWithResultSetParameters.hpp | 7 ++-----
src/Connection.cpp | 26 ++++++++++----------------
src/Request.cpp | 7 ++-----
src/RequestWithResultSetParameters.cpp | 5 ++---
6 files changed, 19 insertions(+), 40 deletions(-)
Index: carob/include/Connection.hpp
diff -u carob/include/Connection.hpp:1.40 carob/include/Connection.hpp:1.41
--- carob/include/Connection.hpp:1.40 Fri Dec 30 11:38:24 2005
+++ carob/include/Connection.hpp Wed Jan 4 11:53:51 2006
@@ -38,7 +38,7 @@
/** Command prefix sent before each command */
#define CommandPrefix 0xB015CA
-#define ProtocolVersion 32
+#define ProtocolVersion 33
//#define Ping -1
#define StatementExecuteQuery 0
@@ -339,8 +339,6 @@
private:
/** This connection socket pointer */
DriverSocket* driverSocketPtr;
- /** true if the controller needs SQL templates of PreparedStatements */
- bool controllerNeedsSqlSkeleton;
/** true if the connection is closed (or not opened...) */
bool isClosed;
Index: carob/include/Request.hpp
diff -u carob/include/Request.hpp:1.12 carob/include/Request.hpp:1.13
--- carob/include/Request.hpp:1.12 Thu Dec 22 17:02:51 2005
+++ carob/include/Request.hpp Wed Jan 4 11:53:51 2006
@@ -53,12 +53,9 @@
* parameters to reconstruct it on the controller.
*
* @param out destination socket to controller
- * @param controllerWantsSqlSkeleton true if controller requires SQL
templates
- * for better parsing.
* @throws SocketIOException an error occurs on the stream
*/
- void sendToStream(const DriverSocket& out,
- bool controllerWantsSqlSkeleton) const
+ void sendToStream(const DriverSocket& out) const
throw (SocketIOException, UnexpectedException);
/**
* Returns the escapeProcessing value.
@@ -147,10 +144,7 @@
Request (const Request&);
/** SQL query (should be set in constructor). TODO: should probably be const
*/
std::wstring sqlQueryOrTemplate;
- /**
- * SQL query skeleton as it appears in PreparedStatements.
- * sqlTemplateIsNull must be set to true if is not a ParameterStatement
- */
+ /** Parameters of the PreparedStatement */
std::wstring preparedStatementParameters;
/** True if the connection has been set to read-only */
bool is_read_only;
Index: carob/include/RequestWithResultSetParameters.hpp
diff -u carob/include/RequestWithResultSetParameters.hpp:1.9
carob/include/RequestWithResultSetParameters.hpp:1.10
--- carob/include/RequestWithResultSetParameters.hpp:1.9 Fri Dec 2
16:19:55 2005
+++ carob/include/RequestWithResultSetParameters.hpp Wed Jan 4 11:53:51 2006
@@ -47,13 +47,10 @@
* Also serialize ResultSet parameters to the stream. Optionally used by
* serializers of those derived requests that expect a ResultSet.
* @param out destination socket to controller
- * @param controllerWantsSqlSkeleton true if controller requires SQL
templates
- * for better parsing.
* @throws SocketIOException an error occurs on the stream
- * @see Request#sendToStream(const DriverSocket&, bool) const
+ * @see Request#sendToStream(const DriverSocket&) const
*/
- void sendToStream(const DriverSocket& out,
- bool controllerWantsSqlSkeleton) const
+ void sendToStream(const DriverSocket& out) const
throw (SocketIOException, UnexpectedException);
/**
* Returns the cursorNameIsNull value
Index: carob/src/Connection.cpp
diff -u carob/src/Connection.cpp:1.48 carob/src/Connection.cpp:1.49
--- carob/src/Connection.cpp:1.48 Fri Dec 30 18:23:40 2005
+++ carob/src/Connection.cpp Wed Jan 4 11:53:51 2006
@@ -178,9 +178,7 @@
UnexpectedException)
{
wstring fctName(L"Connection::finalizeConnect");
- bool authenticated = false;
- bool authenticatedRead = false,
- needsSkelRead = false;
+ bool authenticated = false, authenticatedRead = false;
try
{
*driverSocketPtr>>authenticated;
@@ -193,21 +191,17 @@
}
else
{
- *driverSocketPtr>>controllerNeedsSqlSkeleton;
- needsSkelRead = true;
// So the controller can correctly parse our requests
*driverSocketPtr << LINE_SEPARATOR;
}
}
catch (SocketIOException sockIOExcpt)
{
- wstring msg(fctName + L" Authentication failed. Error ");
+ wstring msg(fctName + L" Authentication failed. Error while ");
if (!authenticatedRead)
- msg += L"while reading controller authenticated ack";
- else if (!needsSkelRead)
- msg += L"while reading need of sql skeleton";
+ msg += L"reading controller authenticated ack";
else
- msg += L" - unknown reason !";
+ msg += L"sending line separator";
throw AuthenticationException(msg
+ L"(" + sockIOExcpt.description() + L")");
return false;
@@ -483,7 +477,7 @@
setConnectionParametersOnRequest(request);
sendCommand(*driverSocketPtr, StatementExecuteQuery);
- request.sendToStream(*driverSocketPtr, controllerNeedsSqlSkeleton);
+ request.sendToStream(*driverSocketPtr);
if (isDebugEnabled())
logDebug(fctName, L"Executing read request " + (wstring)request);
@@ -580,7 +574,7 @@
if (!autoCommit)
writeExecutedInTransaction = true;
sendCommand(*driverSocketPtr, StatementExecute);
- request.sendToStream(*driverSocketPtr, controllerNeedsSqlSkeleton);
+ request.sendToStream(*driverSocketPtr);
if (isDebugEnabled())
logDebug(fctName, L"Executing Statement.execute(" + (wstring)request +
L")");
request.setId(receiveLongOrException());
@@ -621,7 +615,7 @@
if (!autoCommit)
writeExecutedInTransaction = true;
- request.sendToStream(*driverSocketPtr, controllerNeedsSqlSkeleton);
+ request.sendToStream(*driverSocketPtr);
}
void Connection::tryFetchNext(const wstring& cursorName, int fetchSize)
@@ -794,7 +788,7 @@
ProtocolException, UnexpectedException)
{
sendCommand(*driverSocketPtr, RetrieveExecuteQueryResult);
- request.sendToStream(*driverSocketPtr, controllerNeedsSqlSkeleton);
+ request.sendToStream(*driverSocketPtr);
return receiveResultSet();
}
@@ -803,7 +797,7 @@
ProtocolException, UnexpectedException)
{
sendCommand(*driverSocketPtr, RetrieveExecuteUpdateResult);
- request.sendToStream(*driverSocketPtr, controllerNeedsSqlSkeleton);
+ request.sendToStream(*driverSocketPtr);
return (int)receiveIntOrException();
}
std::list<ResultSetOrUpdateCount> Connection::retrieveExecuteResult(const
Request &request)
@@ -811,7 +805,7 @@
ProtocolException, UnexpectedException)
{
sendCommand(*driverSocketPtr, RetrieveExecuteResult);
- request.sendToStream(*driverSocketPtr, controllerNeedsSqlSkeleton);
+ request.sendToStream(*driverSocketPtr);
return fetchMultipleResultsFromStream();
}
Index: carob/src/Request.cpp
diff -u carob/src/Request.cpp:1.7 carob/src/Request.cpp:1.8
--- carob/src/Request.cpp:1.7 Thu Dec 22 17:02:51 2005
+++ carob/src/Request.cpp Wed Jan 4 11:53:51 2006
@@ -27,17 +27,14 @@
{
}
-void Request::sendToStream(const DriverSocket& out,
- bool controllerWantsSqlSkeleton) const
+void Request::sendToStream(const DriverSocket& out) const
throw (SocketIOException, UnexpectedException)
{
out<<sqlQueryOrTemplate;
out<<escape_processing;
out<<timeout_in_seconds;
out<<is_auto_commit;
- //If the statement has a skeleton, the sql_query_or_parameters
- //holds the skeleton parameters
- if (controllerWantsSqlSkeleton && !preparedStatementParameters.empty())
+ if (!preparedStatementParameters.empty())
{
out<<true;
out<<preparedStatementParameters;
Index: carob/src/RequestWithResultSetParameters.cpp
diff -u carob/src/RequestWithResultSetParameters.cpp:1.7
carob/src/RequestWithResultSetParameters.cpp:1.8
--- carob/src/RequestWithResultSetParameters.cpp:1.7 Fri Dec 2 15:53:07 2005
+++ carob/src/RequestWithResultSetParameters.cpp Wed Jan 4 11:53:51 2006
@@ -35,11 +35,10 @@
RequestWithResultSetParameters::~RequestWithResultSetParameters()
{
}
-void RequestWithResultSetParameters::sendToStream(const DriverSocket& out,
- bool controllerWantsSqlSkeleton) const
+void RequestWithResultSetParameters::sendToStream(const DriverSocket& out)
const
throw (SocketIOException, UnexpectedException)
{
- Request::sendToStream(out, controllerWantsSqlSkeleton);
+ Request::sendToStream(out);
out<<max_rows;
out<<fetch_size;
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits