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

Prevent too long identifier names #10221

Merged
merged 6 commits into from
Jul 30, 2018

Conversation

nickvergessen
Copy link
Member

Ref #10213

@MorrisJobke
Copy link
Member

Fails for the calendar:

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

@nickvergessen
Copy link
Member Author

Yeah wanted to fail it and now rebasing on #10213

@nickvergessen nickvergessen force-pushed the bugfix/noid/prevent-too-long-identifiers branch from 06b8f90 to 5a9d517 Compare July 13, 2018 13:04
Copy link
Member

@MorrisJobke MorrisJobke left a comment

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
Member

rullzer commented Jul 17, 2018

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

@georgehrke
Copy link
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

@@ -457,6 +460,43 @@ public function executeStep($version) {
$this->markAsExecuted($version);
}

public function ensureOracleIdentifierLengthLimit(Schema $schema) {
foreach ($schema->getTables() as $table) {
Copy link
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
Member Author

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
Member Author

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
Member

Sequence name "oc_twofactor_backupcodes_id_seq" is too long.

@nickvergessen
Copy link
Member Author

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

@MorrisJobke
Copy link
Member

Sequence name "oc_calendarsubscriptions_id_seq" is too long.

@nickvergessen
Copy link
Member Author

Postgres is so annoying, anyway pushed a fix

@MorrisJobke
Copy link
Member

Sequence name "oc_twofactor_backupcodes_id_seq" is too long.  

@MorrisJobke MorrisJobke mentioned this pull request Jul 24, 2018
21 tasks
@nickvergessen
Copy link
Member Author

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

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 24, 2018
@MorrisJobke MorrisJobke 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 nickvergessen force-pushed the bugfix/noid/prevent-too-long-identifiers branch from a349ee0 to ef5074a Compare July 27, 2018 12:46
@nickvergessen
Copy link
Member Author

Fixed and tested locally with postgres, mysql and sqlite

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

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

🐘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants