Patch needed by m2icat

From SRB

The following patches are needed when using the script which helps to convert an SRB MCAT database to an iRODS ICAT one.

The following is the cvs log entry for those changes:

Update of /projects/diglib/srb/CVSROOT/SRB2_0_0rel/utilities/src
In directory zuri:/scratch/slocal/srbtest/testc/SRB2_0_0rel/utilities/src

Modified Files:
    Spullmeta.c srbClientUtil.c
Log Message:
Set L_val, which is input to srbBulkQueryAnswer, to a few less than
before: DEFAULT_ROW_COUNT-5 instead of DEFAULT_ROW_COUNT to avoid a
fatal SQL_RSLT_TOO_LONG error.  I'm not sure why this is needed now,
but it seems to fix the problem.

In show_results_simple, add a call to clearSqlResult before continuing
to get more rows.  This is needed to keep the process from growing
excessively large (and hanging a platform) when doing an Spullmeta
that retrieves lots of information.

Here's the srbClientUtil.c patch:

zuri:/scratch/slocal/srbtest/testc/SRB2_0_0rel/utilities/src % cvs diff -r 1.220 srbClientUtil.c
Index: srbClientUtil.c
RCS file: /projects/diglib/srb/CVSROOT/SRB2_0_0rel/utilities/src/srbClientUtil.c,v
retrieving revision 1.220
retrieving revision 1.221
diff -r1.220 -r1.221
>     clearSqlResult (myresult); /* free memory before continuing */
zuri:/scratch/slocal/srbtest/testc/SRB2_0_0rel/utilities/src %

This is in function show_results_simple toward the end of it:
    if (myresult->continuation_index < 0) {
      if (!Fflag)
    fprintf(stdout, "Number of Items: %i\n",cnt);
    clearSqlResult (myresult); /* free memory before continuing */
    ii = srbGetMoreRows(conn, MDAS_CATALOG,myresult->continuation_index,
            myresult, L_val);
    if (myresult == NULL || ii != 0) {
      fprintf(stderr, "Error in srbGetMoreRows:%i\n",i);
      if (!Fflag)
    fprintf(stdout, "Number of Items: %i\n",cnt);
  if (!Fflag)
    fprintf(stdout, "Number of Items: %i\n",cnt);

And here's the Spullmeta.c patch:

zuri:/scratch/slocal/srbtest/testc/SRB2_0_0rel/utilities/src % cvs diff -r 1.8 Spullmeta.c
Index: Spullmeta.c
RCS file: /projects/diglib/srb/CVSROOT/SRB2_0_0rel/utilities/src/Spullmeta.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -r1.8 -r1.9
<     int L_val = DEFAULT_ROW_COUNT;
>     int L_val = DEFAULT_ROW_COUNT-5; /* Needs to be somewhat less than
>       DEFAULT_ROW_COUNT to avoid SQL_RSLT_TOO_LONG error.
>         Not sure why this is needed now, but it seems to work. */
zuri:/scratch/slocal/srbtest/testc/SRB2_0_0rel/utilities/src %