Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
c9996782
Unverified
Commit
c9996782
authored
Nov 10, 2020
by
IKEDA Soji
Committed by
GitHub
Nov 10, 2020
Browse files
Merge pull request #1029 from ikedas/issue-1028 by ikedas
MySQL: (42000) Invalid default value
parents
90b6c391
b2ef9b5f
Pipeline
#8660
failed with stage
in 113 minutes and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/DatabaseDriver/MySQL.pm
View file @
c9996782
...
...
@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2018 The Sympa Community. See the AUTHORS.md
file at the
# top-level directory of this distribution and at
# Copyright 2018
, 2020
The Sympa Community. See the AUTHORS.md
#
file at the
top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
...
...
@@ -62,12 +62,17 @@ sub connect {
# when the processes are running under mod_perl or CGI environment
# so that "SET NAMES utf8" will be skipped.
# - Set client-side character set to "utf8" or "utf8mb4".
# - Reset SQL mode that is given various default by versions of MySQL.
$self
->
__dbh
->
{'
mysql_auto_reconnect
'}
=
0
;
unless
(
defined
$self
->
__dbh
->
do
("
SET NAMES 'utf8mb4'
")
or
defined
$self
->
__dbh
->
do
("
SET NAMES 'utf8'
"))
{
$log
->
syslog
('
err
',
'
Cannot set client-side character set: %s
',
$self
->
error
);
}
unless
(
defined
$self
->
__dbh
->
do
("
SET SESSION sql_mode=''
"))
{
$log
->
syslog
('
err
',
'
Cannot reset SQL mode: %s
',
$self
->
error
);
return
undef
;
}
return
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment