Lines 69-80
sub _new_schema {
Link Here
|
69 |
|
69 |
|
70 |
|
70 |
|
71 |
|
71 |
|
72 |
my ( %encoding_attr, $encoding_query, $tz_query ); |
72 |
my ( %encoding_attr, $encoding_query, $tz_query, $sql_mode_query ); |
73 |
my $tz = $ENV{TZ}; |
73 |
my $tz = $ENV{TZ}; |
74 |
if ( $db_driver eq 'mysql' ) { |
74 |
if ( $db_driver eq 'mysql' ) { |
75 |
%encoding_attr = ( mysql_enable_utf8 => 1 ); |
75 |
%encoding_attr = ( mysql_enable_utf8 => 1 ); |
76 |
$encoding_query = "set NAMES 'utf8'"; |
76 |
$encoding_query = "set NAMES 'utf8'"; |
77 |
$tz_query = qq(SET time_zone = "$tz") if $tz; |
77 |
$tz_query = qq(SET time_zone = "$tz") if $tz; |
|
|
78 |
$sql_mode_query = q{SET sql_mode = 'IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'}; |
78 |
} |
79 |
} |
79 |
elsif ( $db_driver eq 'Pg' ) { |
80 |
elsif ( $db_driver eq 'Pg' ) { |
80 |
$encoding_query = "set client_encoding = 'UTF8';"; |
81 |
$encoding_query = "set client_encoding = 'UTF8';"; |
Lines 93-98
sub _new_schema {
Link Here
|
93 |
on_connect_do => [ |
94 |
on_connect_do => [ |
94 |
$encoding_query || (), |
95 |
$encoding_query || (), |
95 |
$tz_query || (), |
96 |
$tz_query || (), |
|
|
97 |
$sql_mode_query || (), |
96 |
] |
98 |
] |
97 |
} |
99 |
} |
98 |
); |
100 |
); |
99 |
- |
|
|