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>
Mon, 10 Jan 2022 14:54:45 +0000 (09:54 -0500)
commitc011ff4dd9675620ad74d2ea657de10b29dd1c4b
tree734a016957e59df5a9f89e977219667f55392cd3
parentd7e680fee0421ebaab94f1c6c1479fd9bd5d2273
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