Skip to content

Increase size of login_name from 64 to 255#34269

Merged
PVince81 merged 1 commit into
masterfrom
fix-login_name-column-len
Jan 28, 2019
Merged

Increase size of login_name from 64 to 255#34269
PVince81 merged 1 commit into
masterfrom
fix-login_name-column-len

Conversation

@sharidas

Copy link
Copy Markdown
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
@sharidas
sharidas force-pushed the fix-login_name-column-len branch from 4c0bf20 to f1d8e79 Compare January 28, 2019 10:46
@codecov

codecov Bot commented Jan 28, 2019

Copy link
Copy Markdown

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

codecov Bot commented Jan 28, 2019

Copy link
Copy Markdown

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.

Comment thread core/Migrations/Version20190125162909.php Outdated
@sharidas
sharidas force-pushed the fix-login_name-column-len branch from f1d8e79 to 7302c4e Compare January 28, 2019 11:12
@sharidas

Copy link
Copy Markdown
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>
@sharidas
sharidas force-pushed the fix-login_name-column-len branch from 7302c4e to 75074b2 Compare January 28, 2019 11:41

@PVince81 PVince81 left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@sharidas please backport

@sharidas

Copy link
Copy Markdown
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