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

Increase size of login_name from 64 to 255 #34269

Merged
merged 1 commit into from
Jan 28, 2019
Merged

Conversation

sharidas
Copy link
Contributor

Increase size of column login_name from 64 to 255.
It would help to accomonate long strings.

Signed-off-by: Sujith H sharidasan@owncloud.com

Description

Increase the size of login_name column of table oc_authtoken. This would help to use long user name for login. This issue was seen when user was trying to authenticate with long username using OAuth2.

Related Issue

  • Fixes <issue_link>

Motivation and Context

Increasing the size of login_name column of the table oc_authtoken. This would help to use long user name for login.

How Has This Been Tested?

  • Install oC version 10.0.9 verified the oc_authtoken table:
mysql> desc oc_authtoken;
+---------------+----------------------+------+-----+---------+----------------+
| Field         | Type                 | Null | Key | Default | Extra          |
+---------------+----------------------+------+-----+---------+----------------+
| id            | int(10) unsigned     | NO   | PRI | NULL    | auto_increment |
| uid           | varchar(64)          | NO   |     |         |                |
| login_name    | varchar(64)          | NO   |     |         |                |
| password      | longtext             | YES  |     | NULL    |                |
| name          | longtext             | NO   |     | NULL    |                |
| token         | varchar(200)         | NO   | UNI |         |                |
| type          | smallint(5) unsigned | NO   |     | 0       |                |
| last_activity | int(10) unsigned     | NO   | MUL | 0       |                |
| last_check    | int(10) unsigned     | NO   |     | 0       |                |
+---------------+----------------------+------+-----+---------+----------------+
9 rows in set (0.00 sec)

mysql>
  • Upgrade the oC to 10.0.10 and applied this patch. After the upgrade the column got updated with size increased as shown below:
mysql> desc oc_authtoken;
+---------------+----------------------+------+-----+---------+----------------+
| Field         | Type                 | Null | Key | Default | Extra          |
+---------------+----------------------+------+-----+---------+----------------+
| id            | int(10) unsigned     | NO   | PRI | NULL    | auto_increment |
| uid           | varchar(64)          | NO   |     |         |                |
| login_name    | varchar(255)         | NO   |     |         |                |
| password      | longtext             | YES  |     | NULL    |                |
| name          | longtext             | NO   |     | NULL    |                |
| token         | varchar(200)         | NO   | UNI |         |                |
| type          | smallint(5) unsigned | NO   |     | 0       |                |
| last_activity | int(10) unsigned     | NO   | MUL | 0       |                |
| last_check    | int(10) unsigned     | NO   |     | 0       |                |
+---------------+----------------------+------+-----+---------+----------------+
9 rows in set (0.00 sec)

mysql>

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@sharidas sharidas added this to the development milestone Jan 28, 2019
@sharidas sharidas self-assigned this Jan 28, 2019
@sharidas sharidas changed the title Increase size of login_name from 64 to 255 [WIP] Increase size of login_name from 64 to 255 Jan 28, 2019
@codecov
Copy link

codecov bot commented Jan 28, 2019

Codecov Report

Merging #34269 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #34269      +/-   ##
============================================
- Coverage     64.76%   64.76%   -0.01%     
- Complexity    18365    18367       +2     
============================================
  Files          1198     1199       +1     
  Lines         69545    69548       +3     
  Branches       1281     1281              
============================================
  Hits          45042    45042              
- Misses        24130    24133       +3     
  Partials        373      373
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.11% <0%> (-0.01%) 18367 <2> (+2)
Impacted Files Coverage Δ Complexity Δ
core/Migrations/Version20190125162909.php 0% <0%> (ø) 2 <2> (?)

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 d6ff26c...f1d8e79. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 28, 2019

Codecov Report

Merging #34269 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #34269      +/-   ##
============================================
- Coverage     64.76%   64.76%   -0.01%     
- Complexity    18365    18367       +2     
============================================
  Files          1198     1199       +1     
  Lines         69545    69548       +3     
  Branches       1281     1281              
============================================
  Hits          45042    45042              
- Misses        24130    24133       +3     
  Partials        373      373
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.11% <0%> (-0.01%) 18367 <2> (+2)
Impacted Files Coverage Δ Complexity Δ
core/Migrations/Version20190125162909.php 0% <0%> (ø) 2 <2> (?)

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 d6ff26c...75074b2. Read the comment docs.

@sharidas
Copy link
Contributor Author

Verified the change by applying this patch to an updated oC instance and after upgrading oC instance.

@sharidas sharidas changed the title [WIP] Increase size of login_name from 64 to 255 Increase size of login_name from 64 to 255 Jan 28, 2019
Increase size of column login_name from 64 to 255.
It would help to accomonate long strings.

Signed-off-by: Sujith H <sharidasan@owncloud.com>
Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@PVince81 PVince81 merged commit a7048a4 into master Jan 28, 2019
@PVince81 PVince81 deleted the fix-login_name-column-len branch January 28, 2019 16:08
@PVince81
Copy link
Contributor

@sharidas please backport

@sharidas
Copy link
Contributor Author

Backported to stable10 #34280

@lock lock bot locked as resolved and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants