mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-13 22:50:17 +02:00
MySQL:
Solaris compilation fixes VS90 project file Makefile few tidy-up code fixes
This commit is contained in:
@@ -278,7 +278,7 @@ void Binder::realBind(std::size_t pos, enum_field_types type, const void* buffer
|
||||
size_t s = _bindArray.size();
|
||||
_bindArray.resize(pos + 1);
|
||||
|
||||
memset(&_bindArray[s], 0, sizeof(MYSQL_BIND) * (_bindArray.size() - s));
|
||||
std::memset(&_bindArray[s], 0, sizeof(MYSQL_BIND) * (_bindArray.size() - s));
|
||||
}
|
||||
|
||||
MYSQL_BIND b = {0};
|
||||
|
@@ -198,7 +198,7 @@ void ResultMetadata::init(MYSQL_STMT* stmt)
|
||||
|
||||
{for (size_t i = 0; i < count; i++)
|
||||
{
|
||||
memset(&_row[i], 0, sizeof(MYSQL_BIND));
|
||||
std::memset(&_row[i], 0, sizeof(MYSQL_BIND));
|
||||
|
||||
_row[i].buffer_type = fields[i].type;
|
||||
_row[i].buffer_length = static_cast<unsigned int>(_columns[i].length());
|
||||
|
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "Poco/Data/MySQL/SessionImpl.h"
|
||||
#include "Poco/Data/MySQL/MySQLStatementImpl.h"
|
||||
#include "Poco/NumberParser.h"
|
||||
|
||||
|
||||
namespace
|
||||
@@ -118,7 +119,8 @@ SessionImpl::SessionImpl(const std::string& connectionString) : _mysql(0), _conn
|
||||
throw MySQLException("create session: specify database");
|
||||
}
|
||||
|
||||
if (atoi(options["port"].c_str()) == 0)
|
||||
unsigned int port = 0;
|
||||
if (!NumberParser::tryParseUnsigned(options["port"], port) || 0 == port || port > 65535)
|
||||
{
|
||||
throw MySQLException("create session: specify correct port (numeric in decimal notation)");
|
||||
}
|
||||
@@ -162,7 +164,7 @@ SessionImpl::SessionImpl(const std::string& connectionString) : _mysql(0), _conn
|
||||
options["user"].c_str(),
|
||||
options["password"].c_str(),
|
||||
options["db"].c_str(),
|
||||
atoi(options["port"].c_str()));
|
||||
port);
|
||||
|
||||
_connected = true;
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <mysql.h>
|
||||
#include "Poco/Data/MySQL/StatementExecutor.h"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -179,15 +180,9 @@ bool StatementExecutor::fetchColumn(size_t n, MYSQL_BIND *bind)
|
||||
|
||||
if ((res != 0) && (res != MYSQL_NO_DATA))
|
||||
{
|
||||
std::string msg;
|
||||
msg += "mysql_stmt_fetch_column(";
|
||||
|
||||
char buff[30];
|
||||
sprintf(buff, "%d", n);
|
||||
msg += buff;
|
||||
|
||||
msg += ") error";
|
||||
throw StatementException(msg, h, _query);
|
||||
std::ostringstream msg;
|
||||
msg << "mysql_stmt_fetch_column(" << n << ") error";
|
||||
throw StatementException(msg.str(), h, _query);
|
||||
}
|
||||
|
||||
return (res == 0);
|
||||
|
Reference in New Issue
Block a user