From 7d9671875f89453af03cc28e2ae82f3696fbe54a Mon Sep 17 00:00:00 2001 From: Daniel Frenzel Date: Fri, 9 Jan 2015 11:33:22 -0600 Subject: [PATCH] Made named connections inherit their charset from the default(unless charset is specified). --- Shared/lib/Dancer/Plugin/Database/Core.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Shared/lib/Dancer/Plugin/Database/Core.pm b/Shared/lib/Dancer/Plugin/Database/Core.pm index 437646c4..fe63a983 100644 --- a/Shared/lib/Dancer/Plugin/Database/Core.pm +++ b/Shared/lib/Dancer/Plugin/Database/Core.pm @@ -156,6 +156,9 @@ sub _get_settings { if (my $named_settings = $settings->{connections}{$name}) { # Take a (shallow) copy of the settings, so we don't change them $return_settings = { %$named_settings }; + # Make sure that the charset for the default connection is inherited by the + # named connection(s)(unless it has been set) + $return_settings->{charset} ||= $settings->{charset}; } else { # OK, didn't match anything $logger->('error',