X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FIDatabase.php;h=78889e52e0ab21e89b5bfdc003d239d4cc30020f;hp=9375efc2538e1003f7a1e59ae140426de8a04a00;hb=3df3b575c6617df64ec98533cc7141bd2314e274;hpb=b95ca29602793f39191c06cd6941e3f32ab1bbb8 diff --git a/includes/libs/rdbms/database/IDatabase.php b/includes/libs/rdbms/database/IDatabase.php index 9375efc253..78889e52e0 100644 --- a/includes/libs/rdbms/database/IDatabase.php +++ b/includes/libs/rdbms/database/IDatabase.php @@ -206,6 +206,7 @@ interface IDatabase { * Returns true if this database does an implicit sort when doing GROUP BY * * @return bool + * @deprecated Since 1.30; only use grouped or aggregated fields in the SELECT */ public function implicitGroupby(); @@ -420,12 +421,9 @@ interface IDatabase { /** * Get the inserted value of an auto-increment row * - * The value inserted should be fetched from nextSequenceValue() - * - * Example: - * $id = $dbw->nextSequenceValue( 'page_page_id_seq' ); - * $dbw->insert( 'page', [ 'page_id' => $id ] ); - * $id = $dbw->insertId(); + * This should only be called after an insert that used an auto-incremented + * value. If no such insert was previously done in the current database + * session, the return value is undefined. * * @return int */ @@ -1114,15 +1112,20 @@ interface IDatabase { public function anyString(); /** - * Returns an appropriately quoted sequence value for inserting a new row. - * MySQL has autoincrement fields, so this is just NULL. But the PostgreSQL - * subclass will return an integer, and save the value for insertId() + * Deprecated method, calls should be removed. + * + * This was formerly used for PostgreSQL and Oracle to handle + * self::insertId() auto-incrementing fields. It is no longer necessary + * since DatabasePostgres::insertId() has been reimplemented using + * `lastval()` and Oracle has been reimplemented using triggers. + * + * Implementations should return null if inserting `NULL` into an + * auto-incrementing field works, otherwise it should return an instance of + * NextSequenceValue and filter it on calls to relevant methods. * - * Any implementation of this function should *not* involve reusing - * sequence numbers created for rolled-back transactions. - * See https://bugs.mysql.com/bug.php?id=30767 for details. + * @deprecated since 1.30, no longer needed * @param string $seqName - * @return null|int + * @return null|NextSequenceValue */ public function nextSequenceValue( $seqName );