Skip to content

Commit fb72633

Browse files
committed
issue2551216 - create mysql databases using COLLATE utf8_general_ci
Otherwise the test suite crashes in three tests under python2. With python3 the crash does not happaen, but python3 passes with this change as well.
1 parent 7addbd4 commit fb72633

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

.travis.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,6 @@ before_script:
139139
# set up postgresql database
140140
- psql -c "CREATE ROLE rounduptest WITH CREATEDB LOGIN PASSWORD 'rounduptest';" -U postgres
141141

142-
# HACK: workaround mysql bug: http://bugs.mysql.com/bug.php?id=74901
143-
# needed for test_mysql.mysqlDBTest.testFilteringSpecialChars
144-
# plus others. Otherwise we get:
145-
# COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
146-
- sed -i 's/CREATE DATABASE \%s/CREATE DATABASE \%s COLLATE utf8_general_ci/' roundup/backends/back_mysql.py
147-
148142
# build the .mo translation files and install them into a tree
149143
# (locale/locale under roundup directory root)
150144
# suitable for use by gettext.

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ Fixed:
112112
frontend. (John Rouillard)
113113
- prevent submit button from showing up when using _generic.item.html
114114
if the user doesn't have edit permissions. (John Rouillard)
115+
- issue2551216 - create new mysql databases using COLLATE
116+
utf8_general_ci to prevent crashes in test suite. (John Rouillard)
115117

116118
Features:
117119

roundup/backends/back_mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def db_create(config):
9292
kwargs = connection_dict(config)
9393
conn = MySQLdb.connect(**kwargs)
9494
cursor = conn.cursor()
95-
command = "CREATE DATABASE %s"%config.RDBMS_NAME
95+
command = "CREATE DATABASE %s COLLATE utf8_general_ci"%config.RDBMS_NAME
9696
if sys.version_info[0] > 2:
9797
command += ' CHARACTER SET utf8'
9898
logging.info(command)

0 commit comments

Comments
 (0)