[Refdb-cvs] CVS: refdb/src refdbdbib.c,1.36.2.2,1.36.2.3
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2004-07-26 20:37:04
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26727 Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: added support for tracking number of refs not found;fixed duplicate references when using BASIS;fixed sequence errors in char tags Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.2 retrieving revision 1.36.2.3 diff -u -U2 -r1.36.2.2 -r1.36.2.3 --- refdbdbib.c 24 Jun 2004 20:32:16 -0000 1.36.2.2 +++ refdbdbib.c 26 Jul 2004 20:36:55 -0000 1.36.2.3 @@ -132,4 +132,5 @@ int n_mydistinct; unsigned long long n_id; + unsigned long long ndb_notfound = 0; /* number of refs not found */ size_t msg_len = 0; size_t result_len; @@ -473,4 +474,5 @@ gbdata.ptr_nmem_error = &nmem_error; gbdata.ptr_ndb_error = &ndb_error; + gbdata.ptr_ndb_notfound = &ndb_notfound; gbdata.ptr_clrequest = ptr_clrequest; @@ -534,4 +536,5 @@ } + /* tell client that data are ready */ numbyte = tiwrite(ptr_clrequest->fd, positive.text, TERM_YES); @@ -620,5 +623,5 @@ } /* now do the real query */ - sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix FROM %s where sorted_pos>0 ORDER BY id", table_name); + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix FROM %s WHERE sorted_pos>0 ORDER BY id", table_name); } else if (strcmp(bibsequence, "BAUTHORDATE") == 0) { @@ -1026,4 +1029,6 @@ ptr_addresult->success = nref_counter - ptr_biblio_info->n_startnumber + 1; ptr_addresult->failure = nfailed; + ptr_addresult->skipped = ndb_notfound; + numbyte = tread(ptr_clrequest->fd, inbuffer, COMMAND_INBUF_LEN); if (numbyte == -1) { /* socket read error */ @@ -1256,5 +1261,5 @@ } - sprintf(sql_command, "UPDATE %s SET sorted_pos="ULLSPEC" WHERE entry_id='%s'", table_name, (unsigned long long)(*nref_counter), id_string); + sprintf(sql_command, "UPDATE %s SET sorted_pos="ULLSPEC" WHERE sorted_pos>0 AND entry_id='%s'", table_name, (unsigned long long)(*nref_counter), id_string); LOG_PRINT(LOG_DEBUG, sql_command); dbires1 = dbi_conn_query(ptr_bibconns->conn, sql_command); @@ -1365,5 +1370,5 @@ /* select all unique author_abbrevlists */ - sprintf(sql_command, "SELECT DISTINCT author_abbrevlist,pubyear,sorted_pos FROM %s ORDER BY sorted_pos", table_name); + sprintf(sql_command, "SELECT DISTINCT author_abbrevlist,pubyear,sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY sorted_pos", table_name); LOG_PRINT(LOG_DEBUG, sql_command); dbires1 = dbi_conn_query(ptr_bibconns->conn, sql_command); @@ -1412,5 +1417,5 @@ } - sprintf(sql_command, "SELECT DISTINCT entry_id,sorted_pos from %s WHERE author_abbrevlist=%s AND pubyear=%d ORDER BY sorted_pos", table_name, item, n_pubyear); + sprintf(sql_command, "SELECT DISTINCT entry_id,sorted_pos from %s WHERE author_abbrevlist=%s AND pubyear=%d AND sorted_pos>0 ORDER BY sorted_pos", table_name, item, n_pubyear); LOG_PRINT(LOG_DEBUG, sql_command); @@ -2334,8 +2339,8 @@ /* this array of strings contains part of the variable names in the output file (the column names in the database) */ char tags[][50] = { - "ALLALISTSTYLE", "AUTHORLISTSTYLE", "EDITORLISTSTYLE", "SEDITORLISTSTYLE", + "ALLALISTSTYLE", "PUBDATESTYLE", "PUBDATESECSTYLE", @@ -2352,6 +2357,4 @@ "PUBPLACESTYLE", "REFNUMBERSTYLE", - "ALLALISTABBREVIATEFIRSTSTYLE", - "ALLALISTABBREVIATESUBSEQSTYLE", "AUTHORLISTABBREVIATEFIRSTSTYLE", "AUTHORLISTABBREVIATESUBSEQSTYLE", @@ -2360,12 +2363,14 @@ "SEDITORLISTABBREVIATEFIRSTSTYLE", "SEDITORLISTABBREVIATESUBSEQSTYLE", - "ALLALISTAUTHORNAMESNAMEFIRSTINITIALSTYLE", + "ALLALISTABBREVIATEFIRSTSTYLE", + "ALLALISTABBREVIATESUBSEQSTYLE", "AUTHORLISTAUTHORNAMESNAMEFIRSTINITIALSTYLE", "EDITORLISTAUTHORNAMESNAMEFIRSTINITIALSTYLE", "SEDITORLISTAUTHORNAMESNAMEFIRSTINITIALSTYLE", - "ALLALISTAUTHORNAMESNAMEOTHERINITIALSTYLE", + "ALLALISTAUTHORNAMESNAMEFIRSTINITIALSTYLE", "AUTHORLISTAUTHORNAMESNAMEOTHERINITIALSTYLE", "EDITORLISTAUTHORNAMESNAMEOTHERINITIALSTYLE", "SEDITORLISTAUTHORNAMESNAMEOTHERINITIALSTYLE", + "ALLALISTAUTHORNAMESNAMEOTHERINITIALSTYLE", "SERIALSTYLE", "ADDRESSSTYLE", |