Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set mysql_row_format=DYNAMIC for tokenowner table #1490

Merged
merged 1 commit into from Mar 7, 2019

Conversation

Projects
None yet
2 participants
@fredreichbier
Copy link
Member

fredreichbier commented Mar 6, 2019

Otherwise, we cannot create an index on user_id using the utf8mb4 charset on MariaDB 10.0.36.

We already talked about the row format of the tokenowner table here, but as it turns out, I had a slight misconception: In the utf8mb4 charset, every character in user_id actually takes 4 bytes, which means that the index on user_id requires a column size of 320 * 4 = 1280 bytes, which exceeds the limit of 767 size.

Thus, pi-manage createdb fails on my Ubuntu 16.04 with MariaDB 10.0.36:

sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1709, 'Index column size too large. The maximum column size is 767 bytes.') [SQL: u'CREATE INDEX ix_tokenowner_user_id ON tokenowner (user_id)'] (Background on this error at: http://sqlalche.me/e/e3q8)

Likewise, he migration script cannot create the index and prints

(_mysql_exceptions.OperationalError) (1709, 'Index column size too large. The maximum column size is 767 bytes.') [SQL: u'CREATE INDEX ix_tokenowner_user_id ON tokenowner (user_id)'] (Background on this error at: http://sqlalche.me/e/e3q8)

... but this message is suppressed by privacyidea-schema-upgrade.

So this PR sets mysql_row_format=DYNAMIC for the tokenowner table to fix this issue.

Set mysql_row_format=DYNAMIC for tokenowner table
Otherwise, we cannot create an index on user_id using the utf8mb4
charset

@fredreichbier fredreichbier requested a review from privacyidea/core Mar 6, 2019

@codecov

This comment has been minimized.

Copy link

codecov bot commented Mar 6, 2019

Codecov Report

Merging #1490 into master will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1490      +/-   ##
=========================================
+ Coverage   96.69%   96.8%   +0.11%     
=========================================
  Files         144     144              
  Lines       17249   17250       +1     
=========================================
+ Hits        16679   16699      +20     
+ Misses        570     551      -19
Impacted Files Coverage Δ
privacyidea/models.py 98.91% <100%> (ø) ⬆️
privacyidea/lib/crypto.py 95.91% <0%> (+0.34%) ⬆️
privacyidea/lib/utils.py 98.04% <0%> (+0.43%) ⬆️
privacyidea/lib/subscriptions.py 88.09% <0%> (+0.79%) ⬆️
privacyidea/lib/security/default.py 97.77% <0%> (+1.66%) ⬆️
privacyidea/lib/log.py 50.68% <0%> (+16.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72cab0f...77dea5c. Read the comment docs.

@plettich
Copy link
Member

plettich left a comment

looks good

@plettich plettich merged commit c89c545 into master Mar 7, 2019

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 96.69%)
Details
codecov/project 96.8% (+0.11%) compared to 72cab0f
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@plettich plettich deleted the tokenowner-rowformat branch Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.