From 1ade888ed97c316739f7bbab638d96831fe61303 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 2 May 2015 18:41:53 +0100 Subject: Add support for RDBMS boolean/bit types --- libmysqlpp/command.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libmysqlpp/command.cpp') diff --git a/libmysqlpp/command.cpp b/libmysqlpp/command.cpp index 1b1b4ae..51db90f 100644 --- a/libmysqlpp/command.cpp +++ b/libmysqlpp/command.cpp @@ -92,6 +92,14 @@ MySQL::Command::bindParamI(unsigned int n, long long unsigned int v) binds[n].is_unsigned = 1; } void +MySQL::Command::bindParamB(unsigned int n, bool v) +{ + binds[n].buffer_type = MYSQL_TYPE_TINY; + binds[n].buffer = realloc(binds[n].buffer, sizeof(bool)); + *static_cast(binds[n].buffer) = (v ? 1 : 0); + binds[n].is_unsigned = 1; +} +void MySQL::Command::bindParamF(unsigned int n, double v) { binds[n].buffer_type = MYSQL_TYPE_DOUBLE; -- cgit v1.2.3