Problem/Motivation

Non-core database drivers may have specific strategies on automatic incrementing. For example, Oracle will allocate a last id with a failing insert that is discarded, and a good insert will get a new id instead.

That makes testChangePrimaryKeyToSerial fail because the check is on an exact value of the last id.

Proposed resolution

Use assertGreaterThanOrEqual in place of assertEquals.

Remaining tasks

Answer #4

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3355841-2.patch1.03 KBmondrake

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

Patch

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Seems like a simple change.

catch’s picture

Status: Reviewed & tested by the community » Needs review

If this is in DriverSpecificSchemaTestBase can't contrib drivers override the method? Not sure about having core use the less-specific assertion for drivers that pass with the more specific one.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Postponed (maintainer needs more info)

That I can not answer so moving to PNMI per #3

mondrake’s picture

Status: Postponed (maintainer needs more info) » Needs review

#4 we may, but here I don't think it's relevant the actual value, so by loosening the test we can exatcly avoid contrib to have to override.

Rather, we could write a separate test (this one really driver specific) with different cases of inserting or not a value in a serial column, forcing a gap skip in the autonumbering etc - but that would be a separate issue.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#3358646: Additional tests for DriverSpecificSchemaTestBase

Thanks for answering @mondrake. Opened #3358646: Additional tests for DriverSpecificSchemaTestBase per your comment.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 3355841-2.patch, failed testing. View results

mondrake’s picture

Status: Needs work » Reviewed & tested by the community

bot fluke

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

  • larowlan committed aaf2d2d1 on 10.1.x
    Issue #3355841 by mondrake: Allow DriverSpecificSchemaTestBase::...

  • larowlan committed 7d9c51d7 on 11.x
    Issue #3355841 by mondrake: Allow DriverSpecificSchemaTestBase::...
larowlan’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: +Bug Smash Initiative

Committed 7d9c51d and pushed to 11.x. Thanks!

Cherry picked to 10.1.x

I think addressing #4 in a followup feels like a reasonable compromise.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.