From 797838a4efa7ef96e98385dc55304ee395694ac4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 2 May 2015 02:46:37 +0100 Subject: Initialize year/month/day fields time struct --- libmysqlpp/command.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libmysqlpp') diff --git a/libmysqlpp/command.cpp b/libmysqlpp/command.cpp index 04628ec..1b1b4ae 100644 --- a/libmysqlpp/command.cpp +++ b/libmysqlpp/command.cpp @@ -135,6 +135,9 @@ MySQL::Command::bindParamT(unsigned int n, const boost::posix_time::time_duratio binds[n].buffer_type = MYSQL_TYPE_TIME; binds[n].buffer = realloc(binds[n].buffer, sizeof(MYSQL_TIME)); MYSQL_TIME & ts = *static_cast(binds[n].buffer); + ts.year = 0; + ts.month = 0; + ts.day = 0; ts.hour = v.hours(); ts.minute = v.minutes(); ts.second = v.seconds(); -- cgit v1.2.3