Skip to content

Prevent too long identifier names - #10221

Merged
rullzer merged 6 commits into
masterfrom
bugfix/noid/prevent-too-long-identifiers
Jul 30, 2018
Merged

Prevent too long identifier names#10221
rullzer merged 6 commits into
masterfrom
bugfix/noid/prevent-too-long-identifiers

Conversation

@nickvergessen

Copy link
Copy Markdown
Member

Ref #10213

@MorrisJobke

Copy link
Copy Markdown
Member

Fails for the calendar:

Index name "oc_calendar_resources_cache"."calendar_resources_cache_id_idx" is too long.

@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Yeah wanted to fail it and now rebasing on #10213

@nickvergessen
nickvergessenforce-pushed the bugfix/noid/prevent-too-long-identifiers branch from 06b8f90 to 5a9d517CompareJuly 13, 2018 13:04

@MorrisJobkeMorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested and works now 👍 Also code makes sense

@rullzer

Copy link
Copy Markdown
Member

Can't this still do 💥 is people chose a to long prefix?

@georgehrke

Copy link
Copy Markdown
Member

Can't this still do 💥 is people chose a to long prefix?

Well, that's the case for any table, not only this resource booking ones. If someone selects a 30-char long prefix it will just go 💥
We should properly document this though cc @MariusBluem

}

public function ensureOracleIdentifierLengthLimit(Schema $schema) {
foreach ($schema->getTables() as $table) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

1) Test\DB\MigrationsTest::testExecuteStepWithSchemaChange
Invalid argument supplied for foreach()
/drone/src/github.com/nextcloud/server/lib/private/DB/MigrationService.php:464
/drone/src/github.com/nextcloud/server/lib/private/DB/MigrationService.php:451
/drone/src/github.com/nextcloud/server/tests/lib/DB/MigrationsTest.php:120

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Fixed and also added unit tests for all the checks

@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Can't this still do boom is people chose a to long prefix?

Well if you use oracle you usually dont change such stuff anyway, because you know the limitations. The current code makes sure it works with a default prefix (3 chars). Anything else is not our business

@MorrisJobke

Copy link
Copy Markdown
Member
Sequence name "oc_twofactor_backupcodes_id_seq" is too long.

@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Right, default name on postgres is also not PRIMARY.
Let's see

@MorrisJobke

Copy link
Copy Markdown
Member

Sequence name "oc_calendarsubscriptions_id_seq" is too long.

@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Postgres is so annoying, anyway pushed a fix

@MorrisJobke

Copy link
Copy Markdown
Member
Sequence name "oc_twofactor_backupcodes_id_seq" is too long. 

@MorrisJobkeMorrisJobke mentioned this pull request Jul 24, 2018
21 tasks
@nickvergessen

Copy link
Copy Markdown
MemberAuthor

I shall set it up locally for faster debugging this week.

@MorrisJobkeMorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 24, 2018
@MorrisJobkeMorrisJobke mentioned this pull request Jul 26, 2018
51 tasks
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
nickvergessenforce-pushed the bugfix/noid/prevent-too-long-identifiers branch from a349ee0 to ef5074aCompareJuly 27, 2018 12:46
@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Fixed and tested locally with postgres, mysql and sqlite

@nickvergessennickvergessen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 27, 2018

@rullzerrullzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🐘

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@nickvergessen@MorrisJobke@rullzer@georgehrke