Last modified: 2014-02-05 20:00:11 UTC
The function Database::upsert (added with Gerrit change #62106) has to get new sequence numbers to support databases, which does not have AUTO_INCREMENT, see Database::nextSequenceValue This makes the function unusable in Oracle, Postgres and Mssql on tables with a sequence.
This can be done already by adding the sequence value to the insert rows given to upsert, but that means more sequence numbers are used, because not all rows must be inserted. But when "nextval" on a INSERT IGNORE will also reserve the next sequence number for ignored rows, than there is no different as given it outside.
Maybe something like done in DatabaseOracle can be used, where the field for the sequence is added automatically to the insert part, this avoids changes to the rest of core. triggers on oracle maybe another option. I have no oracle to do this.
Doesn't Postgres have DEFAULT NEXTVAL('some_seq') and SERIAL columns?
Postgres is using DEFAULT NEXTVAL, but not Oracle. I found that Oracle will support DEFAULT NEXTVAL with version 12c, but MediaWiki supports Oracle 9.0.1 or later at the moment. Mssql also has sequence support (Implemented Database::nextSequenceValue), but I do not know how that works there (looks not like nativ sequences).
For upsert on Oracle bug 53710 exists, postgres has no problem, so there is no need to keep this open (but it is not a real dup, so marking INVALID)