LP1937294: Fix metarecord master record choice predictability issue
authorJason Stephenson <jason@sigio.com>
Fri, 19 Nov 2021 19:44:43 +0000 (14:44 -0500)
committerJason Stephenson <jason@sigio.com>
Thu, 17 Mar 2022 14:51:54 +0000 (10:51 -0400)
commit9b2d94c3ecda767a437aa751b16e2febf0ecfc6f
tree9cc340136018dd33c7bdf4f378f723272c7cfd8b
parent6b4c7c4e9ed9e7ccb2266c4fc0ef49753e9299d2
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>
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