diff options
Diffstat (limited to 'odb/mysql/connection.cxx')
-rw-r--r-- | odb/mysql/connection.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
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 |