Active
Project:
Drupal core
Version:
main
Component:
database system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Jul 2021 at 14:34 UTC
Updated:
24 Jul 2026 at 16:11 UTC
Jump to comment: Most recent
This will not be easy at all, but I think it would be good to at least have a discussion.
Passing an arbitrary value to a serial (autoincrement) column has very different outcomes on different database engines.
Supposing the max ID in the db is 1, and the arbitrary value of ID in INSERT is 1000:
More info: https://github.com/doctrine/dbal/issues/4725
Comments
Comment #2
mondrakeComment #3
mondrakeComment #5
alexpottI'm not sure this will ever be possible given the anonymous user. Unless there's a db agnostic way to tell a serial field to start from 0.
Comment #6
mondrakeAre UID=0 and UID=1 for respectively anonymous user and administrator user the only cases in Drupal (core) where it's necessary to force an arbitrary value to a serial column?
Comment #11
mondrake