Skip to content

Do not rely on INSERT returning in the same order as VALUES

There is no guarantee by SQL standard that the order of the returned values of INSERT are the same as the order of VALUES. Also there is neither any guarantee that the generated id follow the order of VALUES but the ORM relies on such order to keep records ordered in the same order as the user insert them (and also for sequence order with NULL value). So for database that supports multirow insert, we need to set explicitly the value for the column id to ensure to preserve the insert order.

Closes #12220 (closed)

Merge request reports