LP1937294: Fix metarecord master record choice predictability issue
authorJason Stephenson <jason@sigio.com>
Fri, 19 Nov 2021 19:44:43 +0000 (14:44 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 23 Mar 2022 22:45:17 +0000 (18:45 -0400)
commitb035da7435ced7f7beca36a742fa9a80b62ac410
treefcc0efef172fb2a723d47c9ad9b666c654494b1e
parent171f873a72275bfb554f03e9ccd27d38b4326982
LP1937294: Fix metarecord master record choice predictability issue

The metabib master record was being chosen using indeterminant code.
In the case of a quality tie, which record would be chosen depends on
the order that they were returned from the database.  This commit adds
an additional order by on the biblio.record_entry.id to ensure that
the best matching record with the lowest id is chosen.

The live_t/lp1145213_test_func_asset.merge_record_assets.pg tests are
also adjusted to take this into account and should now pass on all Pg
versions and regardless of the order that the data is inserted.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/live_t/lp1145213_test_func_asset.merge_record_assets.pg
Open-ILS/src/sql/Pg/upgrade/XXXX.function.lp1937244-postgresql-changes.sql