From 1cf9af23ba071b152697ef81e64cc35988b1b8b2 Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 12 Aug 2010 23:04:37 +0000 Subject: Fix early assign of insCmd in sqlmerge Fix bad use of length in binding string --- libodbcpp/column.cpp | 2 +- libodbcpp/param.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libodbcpp') diff --git a/libodbcpp/column.cpp b/libodbcpp/column.cpp index 6f45617..8237535 100644 --- a/libodbcpp/column.cpp +++ b/libodbcpp/column.cpp @@ -77,7 +77,7 @@ namespace ODBC { REBIND(SQL_TIMESTAMP_STRUCT, bindParamT) template<> void _Column::rebind(Command * cmd, unsigned int col) const \ { - cmd->bindParamS(col, (char *)value); + cmd->bindParamS(col, (const char *)value); } template <> diff --git a/libodbcpp/param.cpp b/libodbcpp/param.cpp index a86bce0..c4d2223 100644 --- a/libodbcpp/param.cpp +++ b/libodbcpp/param.cpp @@ -118,7 +118,7 @@ ODBC::Command::bindParamS(unsigned int i, const char * val, size_t len) { if (i < params.size()) { _Param* p = Param::makeParam(params[i]); - p->value.assign(val, len); + p->value.assign(val); p->bindLen = len; p->bind(this->hStmt, i + 1, SQL_C_CHAR, SQL_CHAR, 0, 0, p->value.data(), p->value.bytes()); return; -- cgit v1.2.3