[freetds] dbrpcsend and dbresults..

Arnar Birgisson ArnarB at oddi.is
Mon Jun 2 10:24:22 EDT 2003


Further on this.. as this gdb output shows, the DBPROC_ROWBUF sent to
buffer_add_row doesn't seem to be initialized (except with zeroes).
This happens on the first call to dbnextrow..

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/arnarb/testtds 
SQL Server Message 5701: Changed database context to
'starfsmannakerfi'.
SQL Server Message 5703: Changed language setting to us_english.
Got resultset 1

Breakpoint 1, dbnextrow (dbproc=0x804e0d8) at dblib.c:1474
1474            if (dbproc == NULL)
(gdb) n
1476            tds = (TDSSOCKET *) dbproc->tds_socket;
(gdb) n
1477            if (IS_TDSDEAD(tds)) {
(gdb) n
1483            if (!resinfo) {
(gdb) n
1488            if (dbproc->row_buf.buffering_on &&
buffer_is_full(&(dbproc->row_buf))
(gdb) n
1496                    if (-1 !=
buffer_index_of_resultset_row(&(dbproc->row_buf),
dbproc->row_buf.next_row)) {
(gdb) n
1506                            if ((ret =
tds_process_row_tokens(dbproc->tds_socket, &rowtype, &computeid)) ==
TDS_SUCCEED) {
(gdb) n
1507                                    if (rowtype == TDS_REG_ROW) {
(gdb) n
1510                                            resinfo =
tds->curr_resinfo;
(gdb) n
1511                                           
buffer_add_row(&(dbproc->row_buf), resinfo->current_row,
resinfo->row_size);
(gdb) s
buffer_add_row (buf=0x804e0dc, row=0x804ec60, row_size=112) at
dblib.c:301
301             assert(row_size > 0);
(gdb) n
302             assert(row_size <= buf->element_size);
(gdb) p row_size
$4 = 112
(gdb) p buf->element_size
$5 = 0
(gdb) bt
#0  buffer_add_row (buf=0x804e0dc, row=0x804ec60, row_size=112) at
dblib.c:302
#1  0x4002f2ee in dbnextrow (dbproc=0x804e0d8) at dblib.c:1511
#2  0x08048932 in main () at testtds.c:39
#3  0x4008117d in __libc_start_main (main=0x80487f0 <main>, argc=1,
ubp_av=0xbffff7f4, 
    init=0x80485c0 <_init>, fini=0x8048a20 <_fini>,
rtld_fini=0x4000a534 <_dl_fini>, stack_end=0xbffff7ec)
    at ../sysdeps/generic/libc-start.c:129
(gdb) p *buf
$6 = {buffering_on = 0, first_in_buf = 0, next_row = 1, newest = -1,
oldest = 0, elcount = 0, 
  element_size = 0, rows_in_buf = 0, rows = 0x0}
(gdb) 

again.. this is the latest CVS version running (updated earlier
today).

Arnar

>>> ArnarB at oddi.is 30.5.2003 11:23:40 >>>
Hi there..

I'm using 0.61, tried 0.61.1 which has the same problem.
I tried the CVS version as of 11:15 GMT today.. which fails on this
assertion:

httpd: dblib.c:302: buffer_add_row: Assertion `row_size <=
buf->element_size' failed.

Arnar

>>> freddyz77 at tin.it 28.5.2003 21:00:44 >>>
Hi Arnar!

Thanks for report.
I saw patch and problem... SELECT without rows are just skipped...
What version of freetds are you using? Please try 0.61.1 and current
snapshot. If snapshot work (it should) I'll try to merge the fix.

freddy77


_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org 
http://lists.ibiblio.org/mailman/listinfo/freetds 
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org 
http://lists.ibiblio.org/mailman/listinfo/freetds



More information about the FreeTDS mailing list