Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3670 by scmtools repository unique constraint path:local prevents using mysql 5.5 with wide charsets

*** You must complete this form in its entirety, or your bug report will be
*** rejected.
*** If you have a security issue to report, please send it confidentially
*** Posting security-related issues to this bug
*** tracker causes us to have to do an emergency release.
*** For customer support, please post to
*** If you have a patch, please submit it to
*** This bug tracker is public. Please check that any logs or other
*** that you include has been stripped of confidential information.

What version are you running?

2.1 alpha, head of master;  Also present in 2.0 branch.

What's the URL of the page containing the problem?

./ syncdb

What steps will reproduce the problem?
1. Create a blank mysql database in mysql 5.5 with a 4byte max width charset (utf8mb4 or utf32): `CREATE DATABASE review DEFAULT CHARACTER SET utf8mb4;`
2. Configure a new reviewboard site to use this db:
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'OPTIONS': {'charset': 'utf8mb4'},
            'NAME': 'review',
3. Run python reviewboard/ syncdb.

What is the expected output? What do you see instead?

Expected: A new DB is successfully created.

django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes') when creating the scmtools_repository table because of the unique_together ('archived_timestamp', 'path', 'local_site') constraint.

What operating system are you using? What browser?

Debian Wheezy, Mysql 5.5

Please provide any additional information below.

There is already a TODO on this file saying this constraint causes problems for other things and should be eliminated:
"# TODO: the path:local_site unique constraint causes problems when
# archiving repositories. We should really remove this constraint from
# the tables and enforce it in code whenever visible=True"

Additional workarounds:
Create the database as utf8, and convert all other tables to utf8mb4 when complete, and more convert the scmtools_repository table leaving `path` as a narrower column so it fits in to a unique constraint.

You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to