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

New issue 3670 by thom.ger...@gmail.com: scmtools repository unique constraint path:local prevents using mysql 5.5 with wide charsets
https://code.google.com/p/reviewboard/issues/detail?id=3670

*** READ THIS BEFORE POSTING!
***
*** 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
to
*** secur...@reviewboard.org. Posting security-related issues to this bug
*** tracker causes us to have to do an emergency release.
***
*** For customer support, please post to reviewbo...@googlegroups.com
***
*** If you have a patch, please submit it to
http://reviews.reviewboard.org/
***
*** This bug tracker is public. Please check that any logs or other
information
*** 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?

./manage.py 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:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'OPTIONS': {'charset': 'utf8mb4'},
            'NAME': 'review',
        }
    }
3. Run python reviewboard/manage.py syncdb.


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

Expected: A new DB is successfully created.

Actual:
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:
https://code.google.com/hosting/settings

--
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 reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to