From d08893d173565ccde81b9f7cbf487a67cee5532a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 13 Nov 2013 13:59:46 +0100 Subject: [PATCH] Preserve order of records within cluster PAZ-902 --- src/reclists.c | 15 +++---- test/test_facets_13.res | 4 +- test/test_facets_16.res | 4 +- test/test_facets_24.res | 4 +- test/test_facets_4.res | 4 +- test/test_facets_9.res | 4 +- test/test_filter_16.res | 4 +- test/test_filter_17.res | 4 +- test/test_filter_6.res | 4 +- test/test_filter_9.res | 4 +- test/test_http_10.res | 4 +- test/test_http_11.res | 4 +- test/test_http_23.res | 12 ++--- test/test_http_24.res | 2 +- test/test_http_25.res | 2 +- test/test_http_5.res | 4 +- test/test_http_6.res | 12 ++--- test/test_http_7.res | 4 +- test/test_http_8.res | 4 +- test/test_http_88.res | 4 +- test/test_http_89.res | 114 +++++++++++++++++++++++------------------------ test/test_http_9.res | 4 +- test/test_http_90.res | 4 +- test/test_icu_4.res | 4 +- test/test_icu_5.res | 4 +- test/test_icu_6.res | 4 +- test/test_icu_7.res | 4 +- test/test_icu_9.res | 4 +- test/test_post_10.res | 4 +- test/test_post_8.res | 4 +- test/test_sru_3.res | 4 +- test/test_url_3.res | 4 +- 32 files changed, 130 insertions(+), 131 deletions(-) diff --git a/src/reclists.c b/src/reclists.c index 0a9bd8c..8ef9ba4 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -366,21 +366,20 @@ struct record_cluster *reclist_insert(struct reclist *l, // We found a matching record. Merge them if (!strcmp(merge_key, (*p)->record->merge_key)) { - struct record_cluster *existing = (*p)->record; - struct record *re = existing->records; + struct record **re; - for (; re; re = re->next) + cluster = (*p)->record; + for (re = &cluster->records; *re; re = &(*re)->next) { - if (re->client == record->client && - record_compare(record, re, service)) + if ((*re)->client == record->client && + record_compare(record, *re, service)) { yaz_mutex_leave(l->mutex); return 0; } } - record->next = existing->records; - existing->records = record; - cluster = existing; + *re = record; + record->next = 0; break; } } diff --git a/test/test_facets_13.res b/test/test_facets_13.res index e0c22e6..f6386b0 100644 --- a/test/test_facets_13.res +++ b/test/test_facets_13.res @@ -9,12 +9,12 @@ How to program a computer Jack Collins + name="db1" checksum="75373906"> How to program a computer Jack Collins + name="db1" checksum="4195168235"> How to program a computer Jack Collins diff --git a/test/test_facets_16.res b/test/test_facets_16.res index 30fc531..bdb836a 100644 --- a/test/test_facets_16.res +++ b/test/test_facets_16.res @@ -9,12 +9,12 @@ How to program a computer Jack Collins + name="db1" checksum="75373906"> How to program a computer Jack Collins + name="db1" checksum="4195168235"> How to program a computer Jack Collins diff --git a/test/test_facets_24.res b/test/test_facets_24.res index 8983946..d1872d6 100644 --- a/test/test_facets_24.res +++ b/test/test_facets_24.res @@ -9,12 +9,12 @@ How to program a computer Jack Collins + name="db1" checksum="75373906"> How to program a computer Jack Collins + name="db1" checksum="4195168235"> How to program a computer Jack Collins diff --git a/test/test_facets_4.res b/test/test_facets_4.res index b1c2baa..c984b0e 100644 --- a/test/test_facets_4.res +++ b/test/test_facets_4.res @@ -9,12 +9,12 @@ How to program a computer Jack Collins + name="db1" checksum="75373906"> How to program a computer Jack Collins + name="db1" checksum="4195168235"> How to program a computer Jack Collins diff --git a/test/test_facets_9.res b/test/test_facets_9.res index b498c15..411ab45 100644 --- a/test/test_facets_9.res +++ b/test/test_facets_9.res @@ -9,12 +9,12 @@ How to program a computer Jack Collins + name="db1" checksum="75373906"> How to program a computer Jack Collins + name="db1" checksum="4195168235"> How to program a computer Jack Collins diff --git a/test/test_filter_16.res b/test/test_filter_16.res index 20cc9d5..d58b30d 100644 --- a/test/test_filter_16.res +++ b/test/test_filter_16.res @@ -245,12 +245,12 @@ How to program a computer Jack Collins + name="ztest slow" checksum="1993510496"> How to program a computer Jack Collins + name="ztest slow" checksum="1482143625"> How to program a computer Jack Collins diff --git a/test/test_filter_17.res b/test/test_filter_17.res index 20cc9d5..d58b30d 100644 --- a/test/test_filter_17.res +++ b/test/test_filter_17.res @@ -245,12 +245,12 @@ How to program a computer Jack Collins + name="ztest slow" checksum="1993510496"> How to program a computer Jack Collins + name="ztest slow" checksum="1482143625"> How to program a computer Jack Collins diff --git a/test/test_filter_6.res b/test/test_filter_6.res index b274741..e939ce3 100644 --- a/test/test_filter_6.res +++ b/test/test_filter_6.res @@ -107,12 +107,12 @@ How to program a computer Jack Collins + name="ztest slow" checksum="1993510496"> How to program a computer Jack Collins + name="ztest slow" checksum="1482143625"> How to program a computer Jack Collins diff --git a/test/test_filter_9.res b/test/test_filter_9.res index b274741..e939ce3 100644 --- a/test/test_filter_9.res +++ b/test/test_filter_9.res @@ -107,12 +107,12 @@ How to program a computer Jack Collins + name="ztest slow" checksum="1993510496"> How to program a computer Jack Collins + name="ztest slow" checksum="1482143625"> How to program a computer Jack Collins diff --git a/test/test_http_10.res b/test/test_http_10.res index c16d8bd..b4525f1 100644 --- a/test/test_http_10.res +++ b/test/test_http_10.res @@ -207,7 +207,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -215,7 +215,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_http_11.res b/test/test_http_11.res index 82f9909..5758335 100644 --- a/test/test_http_11.res +++ b/test/test_http_11.res @@ -207,7 +207,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -215,7 +215,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_http_23.res b/test/test_http_23.res index 66ad286..b3d061d 100644 --- a/test/test_http_23.res +++ b/test/test_http_23.res @@ -8,21 +8,21 @@ 11224466 11224467 + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins - 11224467 - 11224467 + 11224466 + 11224466 XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins - 11224466 - 11224466 + 11224467 + 11224467 XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY diff --git a/test/test_http_24.res b/test/test_http_24.res index e794d1b..ca1bbb7 100644 --- a/test/test_http_24.res +++ b/test/test_http_24.res @@ -1 +1 @@ -00366nam 22001698a 4504001001300000003000400013005001700017008004100034010001700075040001300092050001200105100001700117245003000134260001200164263000900176300001100185 11224467 DLC00000000000000.0910710c19910701nju 00010 eng  a 11224467  aDLCcDLC00a123-xyz10aJack Collins10aHow to program a computer1 aPenguin a8710 ap. cm. \ No newline at end of file +00366nam 22001698a 4504001001300000003000400013005001700017008004100034010001700075040001300092050001200105100001700117245003000134260001200164263000900176300001100185 11224466 DLC00000000000000.0910710c19910701nju 00010 eng  a 11224466  aDLCcDLC00a123-xyz10aJack Collins10aHow to program a computer1 aPenguin a8710 ap. cm. \ No newline at end of file diff --git a/test/test_http_25.res b/test/test_http_25.res index e794d1b..ca1bbb7 100644 --- a/test/test_http_25.res +++ b/test/test_http_25.res @@ -1 +1 @@ -00366nam 22001698a 4504001001300000003000400013005001700017008004100034010001700075040001300092050001200105100001700117245003000134260001200164263000900176300001100185 11224467 DLC00000000000000.0910710c19910701nju 00010 eng  a 11224467  aDLCcDLC00a123-xyz10aJack Collins10aHow to program a computer1 aPenguin a8710 ap. cm. \ No newline at end of file +00366nam 22001698a 4504001001300000003000400013005001700017008004100034010001700075040001300092050001200105100001700117245003000134260001200164263000900176300001100185 11224466 DLC00000000000000.0910710c19910701nju 00010 eng  a 11224466  aDLCcDLC00a123-xyz10aJack Collins10aHow to program a computer1 aPenguin a8710 ap. cm. \ No newline at end of file diff --git a/test/test_http_5.res b/test/test_http_5.res index d8a21e3..990e8de 100644 --- a/test/test_http_5.res +++ b/test/test_http_5.res @@ -9,7 +9,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -17,7 +17,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_http_6.res b/test/test_http_6.res index 7ae0a9c..55e4018 100644 --- a/test/test_http_6.res +++ b/test/test_http_6.res @@ -8,21 +8,21 @@ 11224466 11224467 + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins - 11224467 - 11224467 + 11224466 + 11224466 XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins - 11224466 - 11224466 + 11224467 + 11224467 XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY diff --git a/test/test_http_7.res b/test/test_http_7.res index 0f838d2..c515d5c 100644 --- a/test/test_http_7.res +++ b/test/test_http_7.res @@ -1,11 +1,11 @@ 00366nam a22001698a 4504 - 11224467 + 11224466 DLC 00000000000000.0 910710c19910701nju 00010 eng - 11224467 + 11224466 DLC diff --git a/test/test_http_8.res b/test/test_http_8.res index 12f1f5f..6067d40 100644 --- a/test/test_http_8.res +++ b/test/test_http_8.res @@ -132,7 +132,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -140,7 +140,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_http_88.res b/test/test_http_88.res index 7829578..ced51fb 100644 --- a/test/test_http_88.res +++ b/test/test_http_88.res @@ -9,7 +9,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -17,7 +17,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_http_89.res b/test/test_http_89.res index ec81a10..9bb5d30 100644 --- a/test/test_http_89.res +++ b/test/test_http_89.res @@ -17,19 +17,28 @@ Community colleges "Contract DOT-UT-10003." - A plan for community college computer development - 1971 - Universities and colleges - Community colleges - Cover title + name="Index Data MARC test server" checksum="3659474317"> + Computer science & technology + proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 + 1977 + Optical pattern recognition XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY - Universities and colleges + Optical pattern recognition PAZPAR2_NULL_b PAZPAR2_NULL_c - Community colleges + + + The use of passwords for controlled access to computer resources + 1977 + Wood, Helen M + Computers + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Computers PAZPAR2_NULL_b PAZPAR2_NULL_c @@ -49,28 +58,19 @@ PAZPAR2_NULL_c - The use of passwords for controlled access to computer resources - 1977 - Wood, Helen M - Computers + name="Index Data MARC test server" checksum="4182051184"> + A plan for community college computer development + 1971 + Universities and colleges + Community colleges + Cover title XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY - Computers + Universities and colleges PAZPAR2_NULL_b PAZPAR2_NULL_c - - - Computer science & technology - proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 - 1977 - Optical pattern recognition - XXXXXXXXXX - test-usersetting-2 data: - YYYYYYYYY - Optical pattern recognition + Community colleges PAZPAR2_NULL_b PAZPAR2_NULL_c @@ -111,20 +111,40 @@ score = relevance(41119); Tomography Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates - Reconstruction tomography in diagnostic radiology and nuclear medicine - proceedings of the workshop - 1977 - Tomography + name="Index Data MARC test server" checksum="2962705161"> + Computer processing of dynamic images from an Anger scintillation camera + the proceedings of a workshop + 1974 + Radioisotope scanning + Scintillation cameras + Imaging systems in medicine Includes bibliographical references and index XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY - Tomography + Radioisotope scanning + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Scintillation cameras + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Imaging systems in medicine PAZPAR2_NULL_b PAZPAR2_NULL_c + The Computer Bible + 1973-1980 + Bible. O.T + Bible + Hebrew and Greek; introductions in English + Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + The Puget Sound Region a portfolio of thematic computer maps @@ -142,36 +162,16 @@ score = relevance(41119); PAZPAR2_NULL_c - The Computer Bible - 1973-1980 - Bible. O.T - Bible - Hebrew and Greek; introductions in English - Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates - XXXXXXXXXX - test-usersetting-2 data: - YYYYYYYYY - - - Computer processing of dynamic images from an Anger scintillation camera - the proceedings of a workshop - 1974 - Radioisotope scanning - Scintillation cameras - Imaging systems in medicine + name="Index Data MARC test server" checksum="3485282028"> + Reconstruction tomography in diagnostic radiology and nuclear medicine + proceedings of the workshop + 1977 + Tomography Includes bibliographical references and index XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY - Radioisotope scanning - PAZPAR2_NULL_b - PAZPAR2_NULL_c - Scintillation cameras - PAZPAR2_NULL_b - PAZPAR2_NULL_c - Imaging systems in medicine + Tomography PAZPAR2_NULL_b PAZPAR2_NULL_c diff --git a/test/test_http_9.res b/test/test_http_9.res index 11def86..76bce60 100644 --- a/test/test_http_9.res +++ b/test/test_http_9.res @@ -84,7 +84,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -92,7 +92,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_http_90.res b/test/test_http_90.res index 837a9ff..480b05e 100644 --- a/test/test_http_90.res +++ b/test/test_http_90.res @@ -9,7 +9,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -17,7 +17,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_icu_4.res b/test/test_icu_4.res index b2abe57..d613a5e 100644 --- a/test/test_icu_4.res +++ b/test/test_icu_4.res @@ -100,7 +100,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -108,7 +108,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_icu_5.res b/test/test_icu_5.res index a6a3dfb..3a32ea6 100644 --- a/test/test_icu_5.res +++ b/test/test_icu_5.res @@ -60,7 +60,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -68,7 +68,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_icu_6.res b/test/test_icu_6.res index a8a5f9f..dd47b25 100644 --- a/test/test_icu_6.res +++ b/test/test_icu_6.res @@ -151,7 +151,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -159,7 +159,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_icu_7.res b/test/test_icu_7.res index 67eab02..58e54a3 100644 --- a/test/test_icu_7.res +++ b/test/test_icu_7.res @@ -151,7 +151,7 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -159,7 +159,7 @@ YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_icu_9.res b/test/test_icu_9.res index 39396ac..5be001a 100644 --- a/test/test_icu_9.res +++ b/test/test_icu_9.res @@ -38,7 +38,7 @@ score = relevance(72241); How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins XXXXXXXXXX @@ -46,7 +46,7 @@ score = relevance(72241); YYYYYYYYY + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins XXXXXXXXXX diff --git a/test/test_post_10.res b/test/test_post_10.res index cb1e60a..71a6d39 100644 --- a/test/test_post_10.res +++ b/test/test_post_10.res @@ -9,12 +9,12 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins diff --git a/test/test_post_8.res b/test/test_post_8.res index cb1e60a..71a6d39 100644 --- a/test/test_post_8.res +++ b/test/test_post_8.res @@ -9,12 +9,12 @@ How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2614320583"> How to program a computer Jack Collins + name="Index Data MARC test server" checksum="2788512872"> How to program a computer Jack Collins diff --git a/test/test_sru_3.res b/test/test_sru_3.res index 11b875c..f472496 100644 --- a/test/test_sru_3.res +++ b/test/test_sru_3.res @@ -21,12 +21,12 @@ How to program a computer Jack Collins + name="db1" checksum="75373906"> How to program a computer Jack Collins + name="db1" checksum="4195168235"> How to program a computer Jack Collins diff --git a/test/test_url_3.res b/test/test_url_3.res index 6dbbbe2..2a1d1f9 100644 --- a/test/test_url_3.res +++ b/test/test_url_3.res @@ -9,12 +9,12 @@ How to program a computer Jack Collins + name="marcserver" checksum="3602387"> How to program a computer Jack Collins + name="marcserver" checksum="64172"> How to program a computer Jack Collins -- 1.7.10.4