summaryrefslogtreecommitdiff
path: root/libodbcpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-08-12 23:04:37 +0000
committerrandomdan <randomdan@localhost>2010-08-12 23:04:37 +0000
commit1cf9af23ba071b152697ef81e64cc35988b1b8b2 (patch)
tree0849a5fdd0978c69afec854a3deca9f549d84cad /libodbcpp
parentTidy up hierarchy (diff)
downloadlibdbpp-odbc-1cf9af23ba071b152697ef81e64cc35988b1b8b2.tar.bz2
libdbpp-odbc-1cf9af23ba071b152697ef81e64cc35988b1b8b2.tar.xz
libdbpp-odbc-1cf9af23ba071b152697ef81e64cc35988b1b8b2.zip
Fix early assign of insCmd in sqlmerge
Fix bad use of length in binding string
Diffstat (limited to 'libodbcpp')
-rw-r--r--libodbcpp/column.cpp2
-rw-r--r--libodbcpp/param.cpp2
2 files changed, 2 insertions, 2 deletions
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<unsigned char *>::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<Glib::ustring>* p = Param::makeParam<Glib::ustring>(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;