From 4ea19dd03241a940a4194ac3bdea89bf7cca8f42 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Aug 2011 13:40:20 +0200 Subject: Add support for specifying client character set for MySQL database --- odb/mysql/connection.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'odb/mysql/connection.cxx') diff --git a/odb/mysql/connection.cxx b/odb/mysql/connection.cxx index b783f69..f8e88a0 100644 --- a/odb/mysql/connection.cxx +++ b/odb/mysql/connection.cxx @@ -32,6 +32,11 @@ namespace odb if (mysql_init (handle_) == 0) throw bad_alloc (); + if (*db_.charset () != '\0') + // Can only fail if we pass an unknown option. + // + mysql_options (handle_, MYSQL_SET_CHARSET_NAME, db_.charset ()); + // Force the CLIENT_FOUND_ROWS flag so that UPDATE returns the // number of found rows, not the number of changed rows. This // is necessary to distinguish between the object-not-persistent -- cgit v1.1