[freetds] Re: Bug: 0.62.dev

Christopher Taylor freetds at kiwi.net
Wed Apr 30 15:13:18 EDT 2003


Sure.. Basically:

================================================================
...
  sprintf(query, "selAffiliateCustomer %d, %d, NULL", last_customer_id, AFFILIATE_ID);
  dbcmd(dbproc1, query);
  if (dbsqlexec(dbproc1) == FAIL) { printf("Execution of SQL statement failed.\n"); dbexit(); return 1; }
  if (dbresults(dbproc1) == FAIL) { printf("Execution of SQL statement failed.\n"); dbexit(); return 1; }

  dbbind(dbproc1, 1, INTBIND, -1, (BYTE *)&next_customer_id);
  dbbind(dbproc1, 2, NTBSTRINGBIND, -1, (BYTE *)&db_last_change_date);

//DEBUG
printf("...begin while\n");
  while (dbnextrow(dbproc1) != NO_MORE_ROWS) {
//DEBUG
printf("...in while\n");
    //SOME CODE HERE
  }
//DEBUG
printf("...end while\n");
  dbfreebuf(dbproc1);
  dbexit();
...
================================================================

The program outpus:
...begin while
...in while


and then hangs. it's actually doesn't even loop. it just stops.


-- 
christopher taylor
software engineer and unix demigod
e-mail: ctaylor at kiwi.net

I have that old biological urge,
I have that old irresistible surge,
I'm hungry.


** Frediano Ziglio <freddyz77 at tin.it> [2003-04-30 20:46:35 +0200]:
// Il mer, 2003-04-30 alle 19:20, Christopher Taylor ha scritto:
// > Language: C
// > FreeTDS Version: 0.62.dev.20030430
// > TDS protocol version: 7.0
// > Platform: FreeBSD 4.6-RELEASE
// > SQL Server: Microsoft SQL 2000
// > Bug: dbnextrow(dbproc) returning -1 (MORE_ROWS) when end of recordset reached:
// > ie:
// > 
// > while (dbnextrow(dbproc) != NO_MORE_ROWS);
// > 
// > --caught in infinite loop.
// > 
// > Additional notes: was running 0.61, but my applications would crash whenever
// > an empty recordset was returned.
// 
// Could you send some code to reproduce the problem ?
// 
// freddy77
// 
// 
// _______________________________________________
// FreeTDS mailing list
// FreeTDS at lists.ibiblio.org
// http://lists.ibiblio.org/mailman/listinfo/freetds



More information about the FreeTDS mailing list