Skip to content

Commit 42a148b

Browse files
author
Richard Jones
committed
fix mysql breakage in 1.4.2
1 parent 111989d commit 42a148b

File tree

9 files changed

+58
-67
lines changed

9 files changed

+58
-67
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
This file contains the changes to the Roundup system over time. The entries
22
are given with the most recent entry first.
33

4+
2008-02-27 1.4.3
5+
Fixed:
6+
- MySQL backend bug introduced in 1.4.2 (TEXT columns need a size when
7+
being indexed)
8+
9+
410
2008-02-08 1.4.2
511
Feature:
612
- New config option in mail section: ignore_alternatives allows to

doc/announcement.txt

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
1-
I'm proud to release version 1.4.2 of Roundup.
2-
3-
New Features in 1.4.2:
4-
5-
- New config option in mail section: ignore_alternatives allows to
6-
ignore alternatives besides the text/plain part used for the content
7-
of a message in multipart/alternative attachments.
8-
- Admin copy of error email from mailgw includes traceback (thanks Ulrik
9-
Mikaelsson)
10-
- Messages created through the web are now given an in-reply-to header
11-
when email out to nosy (thanks Martin v. Löwis)
12-
- Nosy messages now include more information about issues (all link
13-
properties with a "name" attribute) (thanks Martin v. Löwis)
14-
15-
And things fixed:
16-
17-
- Searching date range by supplying just a date as the filter spec
18-
- Handle no time.tzset under Windows (sf #1825643)
19-
- Fix race condition in file storage transaction commit (sf #1883580)
20-
- Make user utils JS work with firstname/lastname again (sf #1868323)
21-
- Fix ZRoundup to work with Zope 2.8.5 (sf #1806125)
22-
- Fix race condition for key properties in rdbms backends (sf #1876683)
23-
- Handle Reject in mailgw final set/create (sf #1826425)
1+
I'm proud to release version 1.4.3 of Roundup.
2+
3+
Just one bug was fixed in 1.4.3:
4+
5+
- MySQL backend bug introduced in 1.4.2
246

257
If you're upgrading from an older version of Roundup you *must* follow
268
the "Software Upgrade" guidelines given in the maintenance documentation.

doc/upgrading.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ steps.
1313

1414
.. contents::
1515

16+
Migrating from 1.4.2 to 1.4.3
17+
=============================
18+
19+
If you are using the MySQL backend you will need to replace some indexes
20+
that may have been created by version 1.4.2.
21+
22+
You should to access your MySQL database directly and remove any indexes
23+
with a name ending in "_key_retired_idx". You should then re-add them with
24+
the same spec except the key column name needs a size. So an index on
25+
"_user (__retired, _name)" should become "_user (__retired, _name(255))".
26+
27+
1628
Migrating from 1.4.x to 1.4.2
1729
=============================
1830

doc/xmlrpc.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,35 @@ The server currently implements four methods. Each method requires that the
3636
user provide a username and password in the HTTP authorization header in order
3737
to authenticate the request against the tracker.
3838

39-
list
40-
:arguments: classname, [property_name]
39+
======= ====================================================================
40+
Command Description
41+
======= ====================================================================
42+
list arguments: *classname, [property_name]*
4143

4244
List all elements of a given ``classname``. If ``property_name`` is
4345
specified, that is the property that will be displayed for each
4446
element. If ``property_name`` is not specified the default label
4547
property will be used.
4648

47-
display
48-
:arguments: designator, [property_1, ..., property_N]
49+
display arguments: *designator, [property_1, ..., property_N]*
4950

5051
Display a single item in the tracker as specified by ``designator``
5152
(e.g. issue20 or user5). The default is to display all properties
5253
for the item. Alternatively, a list of properties to display can be
5354
specified.
5455

55-
create
56-
:arguments: classname, arg_1 ... arg_N
56+
create arguments: *classname, arg_1 ... arg_N*
5757

5858
Create a new instance of ``classname`` with ``arg_1`` through
5959
``arg_N`` as the values of the new instance. The arguments are
6060
name=value pairs (e.g. ``status='3'``).
6161

62-
set
63-
:arguments: designator, arg_1 ... arg_N
62+
set arguments: *designator, arg_1 ... arg_N*
6463

6564
Set the values of an existing item in the tracker as specified by
6665
``designator``. The new values are specified in ``arg_1`` through
6766
``arg_N``. The arguments are name=value pairs (e.g. ``status='3'``).
67+
======= ====================================================================
6868

6969
sample python client
7070
====================

roundup/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: __init__.py,v 1.49 2007-12-23 01:52:07 richard Exp $
18+
# $Id: __init__.py,v 1.50 2008-02-27 08:32:50 richard Exp $
1919

2020
'''Roundup - issue tracking for knowledge workers.
2121
@@ -68,6 +68,6 @@
6868
'''
6969
__docformat__ = 'restructuredtext'
7070

71-
__version__ = '1.4.2'
71+
__version__ = '1.4.3'
7272

7373
# vim: set filetype=python ts=4 sw=4 et si

roundup/backends/back_mysql.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: back_mysql.py,v 1.74 2007-10-26 01:34:43 richard Exp $
1+
#$Id: back_mysql.py,v 1.75 2008-02-27 08:32:50 richard Exp $
22
#
33
# Copyright (c) 2003 Martynas Sklyzmantas, Andrey Lebedev <[email protected]>
44
#
@@ -421,9 +421,19 @@ def create_class_table_indexes(self, spec):
421421
# TODO: create indexes on (selected?) Link property columns, as
422422
# they're more likely to be used for lookup
423423

424+
def add_class_key_required_unique_constraint(self, cn, key):
425+
# mysql requires sizes on TEXT indexes
426+
prop = self.classes[cn].getprops()[key]
427+
if isinstance(prop, String):
428+
sql = '''create unique index _%s_key_retired_idx
429+
on _%s(__retired__, _%s(255))'''%(cn, cn, key)
430+
else:
431+
sql = '''create unique index _%s_key_retired_idx
432+
on _%s(__retired__, _%s)'''%(cn, cn, key)
433+
self.sql(sql)
434+
424435
def create_class_table_key_index(self, cn, key):
425-
''' create the class table for the given spec
426-
'''
436+
# mysql requires sizes on TEXT indexes
427437
prop = self.classes[cn].getprops()[key]
428438
if isinstance(prop, String):
429439
sql = 'create index _%s_%s_idx on _%s(_%s(255))'%(cn, key, cn, key)

roundup/backends/rdbms_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: rdbms_common.py,v 1.195 2008-02-07 05:01:42 richard Exp $
18+
#$Id: rdbms_common.py,v 1.196 2008-02-27 08:32:50 richard Exp $
1919
""" Relational database (SQL) backend common code.
2020
2121
Basics:
@@ -562,7 +562,7 @@ def create_class_table_indexes(self, spec):
562562
# they're more likely to be used for lookup
563563

564564
def add_class_key_required_unique_constraint(self, cn, key):
565-
sql = '''create unique index _%s_key_retired_idx
565+
sql = '''create unique index _%s_key_retired_idx
566566
on _%s(__retired__, _%s)'''%(cn, cn, key)
567567
self.sql(sql)
568568

setup.py

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: setup.py,v 1.99 2007-11-07 21:24:24 richard Exp $
19+
# $Id: setup.py,v 1.100 2008-02-27 08:32:45 richard Exp $
2020

2121
from distutils.core import setup, Extension
2222
from distutils.util import get_platform
@@ -352,33 +352,9 @@ def main():
352352
'''In this release
353353
===============
354354
355-
The metakit backend has been removed due to lack of maintenance and
356-
presence of good alternatives (in particular sqlite built into Python 2.5)
357-
358-
Release 1.4.1 removes an old trace of the metakit backend that was
359-
preventing new tracker installation.
360-
361-
New Features in 1.4.0:
362-
363-
- Roundup has a new xmlrpc frontend that gives access to a tracker using
364-
XMLRPC.
365-
- Dates can now be in the year-range 1-9999
366-
- Add simple anti-spam recipe to docs
367-
- Allow customisation of regular expressions used in email parsing, thanks
368-
Bruno Damour
369-
- Italian translation by Marco Ghidinelli
370-
- Multilinks take any iterable
371-
- config option: specify port and local hostname for SMTP connections
372-
- Tracker index templating (i.e. when roundup_server is serving multiple
373-
trackers) (sf bug 1058020)
374-
- config option: Limit nosy attachments based on size (Philipp Gortan)
375-
- roundup_server supports SSL via pyopenssl
376-
- templatable 404 not found messages (sf bug 1403287)
377-
- Unauthorized email includes a link to the registration page for
378-
the tracker
379-
- config options: control whether author info/email is included in email
380-
sent by roundup
381-
- support for receiving OpenPGP MIME messages (signed or encrypted)
355+
Just one bug was fixed in 1.4.3:
356+
357+
- MySQL backend bug introduced in 1.4.2
382358
383359
There's also a ton of bugfixes.
384360

test/test_cgi.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# but WITHOUT ANY WARRANTY; without even the implied warranty of
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
#
11-
# $Id: test_cgi.py,v 1.33 2007-10-05 03:07:14 richard Exp $
11+
# $Id: test_cgi.py,v 1.34 2008-02-27 08:32:51 richard Exp $
1212

1313
import unittest, os, shutil, errno, sys, difflib, cgi, re
1414

@@ -89,6 +89,7 @@ def parseForm(self, form, classname='test', nodeid=None):
8989
makeForm(form))
9090
cl.classname = classname
9191
cl.nodeid = nodeid
92+
cl.language = ('en',)
9293
cl.db = self.db
9394
return cl.parsePropsFromForm(create=1)
9495

@@ -204,6 +205,7 @@ def testStringLinkId(self):
204205
cl.classname = 'issue'
205206
cl.nodeid = issue
206207
cl.db = self.db
208+
cl.language = ('en',)
207209
item = HTMLItem(cl, 'issue', issue)
208210
self.assertEqual(item.status.id, '1')
209211
self.assertEqual(item.status.name, '2')
@@ -222,6 +224,7 @@ def testStringMultilinkId(self):
222224
cl.classname = 'issue'
223225
cl.nodeid = issue
224226
cl.db = self.db
227+
cl.language = ('en',)
225228
cl.userid = '1'
226229
item = HTMLItem(cl, 'issue', issue)
227230
for keyword in item.keyword:
@@ -304,6 +307,7 @@ def testMixedMultilink(self):
304307
cl.classname = 'issue'
305308
cl.nodeid = None
306309
cl.db = self.db
310+
cl.language = ('en',)
307311
self.assertEqual(cl.parsePropsFromForm(create=1),
308312
({('issue', None): {'nosy': ['1','2', '3']}}, []))
309313

@@ -606,6 +610,7 @@ def _make_client(self, form, classname='user', nodeid='2', userid='2'):
606610
cl.nodeid = '1'
607611
cl.db = self.db
608612
cl.userid = '2'
613+
cl.language = ('en',)
609614
return cl
610615

611616
def testClassPermission(self):

0 commit comments

Comments
 (0)