Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS 0.64.dev.2005041 dblib rpc failure

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: liam AT inodes.org
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS 0.64.dev.2005041 dblib rpc failure
  • Date: Thu, 14 Apr 2005 10:39:45 +1000

On Wed, Apr 13, 2005 at 02:19:01PM +0100, Thompson, Bill D (London) wrote:

> would need a TDSDUMP to see why you're getting the results pending
> message,

Attached.

> but I can see an error in your code.

I've moved the dbhasretstat() to after the while(debresults()). The
TDSDUMP attached is of the modified code.

That is, the testcase now looks like:

...

if (dbsqlok(dbproc) == FAIL) {
dbcancel(dbproc);
dbclose(dbproc);
dbloginfree(login);
return 1;
}

while (dbresults(dbproc) != NO_MORE_RESULTS) {
dbbind(dbproc, 1, INTBIND,
(DBINT) 0, (BYTE *) &value);
dbnextrow(dbproc);
}

if (dbhasretstat(dbproc) == TRUE) {
if (dbretstatus(dbproc) != 0) {
dbcancel(dbproc);
return 0;
}
}

dbcancel(dbproc);

...

This all worked on 0.63 so irrespective of API calling conventions,
something appears to be wrong!

Any ideas?

Cheers.
util.c:273:Starting log file for FreeTDS 0.64.dev.20050411
on 2005-04-14 10:16:23 with debug flags 0x4fff.
iconv.c:86:Using trivial iconv
iconv.c:198:names for ISO-8859-1: ISO-8859-1
iconv.c:198:names for UTF-8: UTF-8
iconv.c:198:names for UCS-2LE: UCS-2LE
iconv.c:198:names for UCS-2BE: (null)
iconv.c:364:iconv to convert client-side data to the "ISO-8859-1" character
set
iconv.c:517:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
iconv.c:517:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
net.c:154:Connecting to IP_ADDR port 1433.
write.c:132:tds_put_string converting 9 bytes of "hostname"
write.c:160:tds_put_string wrote 18 bytes
write.c:132:tds_put_string converting 14 bytes of "Username"
write.c:160:tds_put_string wrote 28 bytes
write.c:160:tds_put_string wrote 0 bytes
write.c:132:tds_put_string converting 12 bytes of "IP_ADDR"
write.c:160:tds_put_string wrote 24 bytes
write.c:132:tds_put_string converting 10 bytes of "DB-Library"
write.c:160:tds_put_string wrote 20 bytes
write.c:132:tds_put_string converting 10 bytes of "us_english"
write.c:160:tds_put_string wrote 20 bytes
write.c:160:tds_put_string wrote 0 bytes
token.c:317:tds_process_login_tokens()
net.c:441:Received header
0000 04 01 01 a1 00 3c 01 00- |.....<..|

net.c:535:Received packet
0000 e3 25 00 01 0b 4f 00 41-00 5f 00 41 00 63 00 63 |.%...D.B ._.N.a.m|
0010 00 6f 00 75 00 6e 00 74-00 73 00 06 6d 00 61 00 |.e.x.x.x .x..m.a.|
0020 73 00 74 00 65 00 72 00-ab 7a 00 45 16 00 00 02 |s.t.e.r. .z.E....|
0030 00 2a 00 43 00 68 00 61-00 6e 00 67 00 65 00 64 |.*.C.h.a .n.g.e.d|
0040 00 20 00 64 00 61 00 74-00 61 00 62 00 61 00 73 |. .d.a.t .a.b.a.s|
0050 00 65 00 20 00 63 00 6f-00 6e 00 74 00 65 00 78 |.e. .c.o .n.t.e.x|
0060 00 74 00 20 00 74 00 6f-00 20 00 27 00 4f 00 41 |.t. .t.o . .'.D.B|
0070 00 5f 00 41 00 63 00 63-00 6f 00 75 00 6e 00 74 |._.N.a.m .e.x.x.x|
0080 00 73 00 27 00 2e 00 0d-57 00 53 00 4f 00 4d 00 |.x.'.... X.X.X.X.|
0090 54 00 45 00 41 00 50 00-4f 00 54 00 30 00 33 00 |X.X.X.X. X.X.X.X.|
00a0 34 00 00 00 00 e3 08 00-07 05 09 04 d0 00 34 00 |X....... ......4.|
00b0 e3 17 00 02 0a 75 00 73-00 5f 00 65 00 6e 00 67 |.....u.s ._.e.n.g|
00c0 00 6c 00 69 00 73 00 68-00 00 ab 74 00 47 16 00 |.l.i.s.h ...t.G..|
00d0 00 01 00 27 00 43 00 68-00 61 00 6e 00 67 00 65 |...'.C.h .a.n.g.e|
00e0 00 64 00 20 00 6c 00 61-00 6e 00 67 00 75 00 61 |.d. .l.a .n.g.u.a|
00f0 00 67 00 65 00 20 00 73-00 65 00 74 00 74 00 69 |.g.e. .s .e.t.t.i|
0100 00 6e 00 67 00 20 00 74-00 6f 00 20 00 75 00 73 |.n.g. .t .o. .u.s|
0110 00 5f 00 65 00 6e 00 67-00 6c 00 69 00 73 00 68 |._.e.n.g .l.i.s.h|
0120 00 2e 00 0d 57 00 53 00-4f 00 4d 00 54 00 45 00 |....X.X. X.X.X.X.|
0130 41 00 50 00 4f 00 54 00-30 00 33 00 34 00 00 00 |X.X.X.X. X.X.X...|
0140 00 ad 36 00 01 71 00 00-01 16 4d 00 69 00 63 00 |..6..q.. ..M.i.c.|
0150 72 00 6f 00 73 00 6f 00-66 00 74 00 20 00 53 00 |r.o.s.o. f.t. .S.|
0160 51 00 4c 00 20 00 53 00-65 00 72 00 76 00 65 00 |Q.L. .S. e.r.v.e.|
0170 72 00 00 00 00 00 08 00-02 a7 e3 13 00 04 04 34 |r....... .......4|
0180 00 30 00 39 00 36 00 04-34 00 30 00 39 00 36 00 |.0.9.6.. 4.0.9.6.|
0190 fd 00 00 00 00 00 00 00-00 |........ .|

token.c:321:looking for login token, got e3(ENVCHANGE)
token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:178:tds_get_string: reading 22 from wire to give 11 to client.
read.c:178:tds_get_string: reading 12 from wire to give 6 to client.
token.c:321:looking for login token, got ab(INFO)
token.c:106:tds_process_default_tokens() marker is ab(INFO)
token.c:2647:tds_process_msg() reading message from server
read.c:178:tds_get_string: reading 84 from wire to give 42 to client.
read.c:178:tds_get_string: reading 26 from wire to give 13 to client.
token.c:2709:tds_process_msg() calling client msg handler
token.c:2722:tds_process_msg() returning TDS_SUCCEED
token.c:321:looking for login token, got e3(ENVCHANGE)
token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
iconv.c:478:tds_iconv_info_init: use memcpy to convert "ISO-8859-1"->"CP1252"
token.c:321:looking for login token, got e3(ENVCHANGE)
token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:178:tds_get_string: reading 20 from wire to give 10 to client.
token.c:321:looking for login token, got ab(INFO)
token.c:106:tds_process_default_tokens() marker is ab(INFO)
token.c:2647:tds_process_msg() reading message from server
read.c:178:tds_get_string: reading 78 from wire to give 39 to client.
read.c:178:tds_get_string: reading 26 from wire to give 13 to client.
token.c:2709:tds_process_msg() calling client msg handler
token.c:2722:tds_process_msg() returning TDS_SUCCEED
token.c:321:looking for login token, got ad(LOGINACK)
read.c:178:tds_get_string: reading 44 from wire to give 22 to client.
token.c:321:looking for login token, got e3(ENVCHANGE)
token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:178:tds_get_string: reading 8 from wire to give 4 to client.
read.c:178:tds_get_string: reading 8 from wire to give 4 to client.
token.c:2535:increasing block size from 4096 to 4096
token.c:321:looking for login token, got fd(DONE)
token.c:106:tds_process_default_tokens() marker is fd(DONE)
token.c:2351:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
token.c:2367:tds_process_end() state set to TDS_IDLE
util.c:129:Changing query state from TDS_IDLE to TDS_IDLE
token.c:394:leaving tds_process_login_tokens() returning 1
dblib.c:1138:dbuse()
dblib.c:1054:dbcmd() bufsz = 0
dblib.c:1104:in dbsqlexec()
dblib.c:5818:in dbsqlsend()
util.c:129:Changing query state from TDS_IDLE to TDS_QUERYING
mem.c:453:tds_free_all_results()
write.c:132:tds_put_string converting 15 bytes of "use DB_Name"
write.c:160:tds_put_string wrote 30 bytes
util.c:129:Changing query state from TDS_QUERYING to TDS_PENDING
net.c:654:Sending packet
0000 01 01 00 26 00 00 01 00-75 00 73 00 65 00 20 00 |...&.... u.s.e. .|
0010 4f 00 41 00 5f 00 41 00-63 00 63 00 6f 00 75 00 |D.B._.N. a.m.e.x.|
0020 6e 00 74 00 73 00 - |x.x.x.|

dblib.c:4005:in dbsqlok()
net.c:441:Received header
0000 04 01 00 cb 00 3c 01 00- |.....<..|

net.c:535:Received packet
0000 e3 2f 00 01 0b 4f 00 41-00 5f 00 41 00 63 00 63 |./...D.B ._.N.a.m|
0010 00 6f 00 75 00 6e 00 74-00 73 00 0b 4f 00 41 00 |.x.x.x.x .x..D.B.|
0020 5f 00 41 00 63 00 63 00-6f 00 75 00 6e 00 74 00 |_.N.a.m. e.x.x.x.|
0030 73 00 ab 7a 00 45 16 00-00 01 00 2a 00 43 00 68 |x..z.E.. ...*.C.h|
0040 00 61 00 6e 00 67 00 65-00 64 00 20 00 64 00 61 |.a.n.g.e .d. .d.a|
0050 00 74 00 61 00 62 00 61-00 73 00 65 00 20 00 63 |.t.a.b.a .s.e. .c|
0060 00 6f 00 6e 00 74 00 65-00 78 00 74 00 20 00 74 |.o.n.t.e .x.t. .t|
0070 00 6f 00 20 00 27 00 4f-00 41 00 5f 00 41 00 63 |.o. .'.D .B._.N.a|
0080 00 63 00 6f 00 75 00 6e-00 74 00 73 00 27 00 2e |.a.m.e.x .x.x.'..|
0090 00 0d 57 00 53 00 4f 00-4d 00 54 00 45 00 41 00 |..X.X.X. X.X.X.X.|
00a0 50 00 4f 00 54 00 30 00-33 00 34 00 00 01 00 e3 |X.X.X.X. X.X.....|
00b0 08 00 07 05 09 04 d0 00-34 00 fd 00 00 e2 00 00 |........ 4.......|
00c0 00 00 00 - |...|

dblib.c:4024:dbsqlok() marker is e3
util.c:129:Changing query state from TDS_PENDING to TDS_READING
token.c:526:processing result tokens. marker is e3(ENVCHANGE)
token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:178:tds_get_string: reading 22 from wire to give 11 to client.
read.c:178:tds_get_string: reading 22 from wire to give 11 to client.
token.c:526:processing result tokens. marker is ab(INFO)
token.c:106:tds_process_default_tokens() marker is ab(INFO)
token.c:2647:tds_process_msg() reading message from server
read.c:178:tds_get_string: reading 84 from wire to give 42 to client.
read.c:178:tds_get_string: reading 26 from wire to give 13 to client.
token.c:2709:tds_process_msg() calling client msg handler
token.c:2722:tds_process_msg() returning TDS_SUCCEED
token.c:526:processing result tokens. marker is e3(ENVCHANGE)
token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
token.c:526:processing result tokens. marker is fd(DONE)
token.c:2351:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
token.c:2367:tds_process_end() state set to TDS_IDLE
util.c:129:Changing query state from TDS_READING to TDS_IDLE
util.c:129:Changing query state from TDS_IDLE to TDS_PENDING
dblib.c:4070:dbsqlok() end status was success
dblib.c:1288:dbresults()
token.c:904:tds_process_row_tokens() state is COMPLETED
rpc.c:122:dbrpcinit() added rpcname "SP_TEST"
rpc.c:256:dbrpcsend()
util.c:129:Changing query state from TDS_IDLE to TDS_QUERYING
mem.c:453:tds_free_all_results()
util.c:129:Changing query state from TDS_QUERYING to TDS_PENDING
net.c:654:Sending packet
0000 03 01 00 3a 00 00 01 00-17 00 4c 00 49 00 53 00 |...:.... ..S.P._.|
0010 41 00 5f 00 47 00 65 00-74 00 4d 00 61 00 78 00 |T.E.S.T. X.X.X.X.|
0020 69 00 6d 00 75 00 6d 00-4d 00 65 00 6d 00 62 00 |X.X.X.X. X.X.X.X.|
0030 65 00 72 00 49 00 44 00-00 00 |X.X.X.X. ..|

dblib.c:4005:in dbsqlok()
net.c:441:Received header
0000 04 01 00 3f 00 3c 01 00- |...?.<..|

net.c:535:Received packet
0000 81 01 00 00 00 09 00 26-04 08 4d 00 65 00 6d 00 |.......& ..I.n.t.|
0010 62 00 65 00 72 00 49 00-44 00 d1 04 b0 d9 77 00 |e.g.e.r. I.....w.|
0020 ff 01 00 c1 00 01 00 00-00 79 00 00 00 00 fe 00 |........ .y......|
0030 00 e0 00 01 00 00 00 - |.......|

dblib.c:4024:dbsqlok() marker is 81
dblib.c:4030:dbsqlok() found result token
dblib.c:1288:dbresults()
mem.c:453:tds_free_all_results()
util.c:129:Changing query state from TDS_PENDING to TDS_READING
token.c:526:processing result tokens. marker is 81(TDS7_RESULT)
mem.c:453:tds_free_all_results()
token.c:1690:processing TDS7 result. set current_results to tds->res_info
read.c:178:tds_get_string: reading 16 from wire to give 8 to client.
token.c:1632:tds7_get_data_info:
colname = IntegerI (8 bytes)
type = 38 (integer-null)
server's type = 38 (integer-null)
column_varint_size = 1
column_size = 4 (4 on server)
util.c:129:Changing query state from TDS_READING to TDS_PENDING
dblib.c:1326:dbresults() process_result_tokens returned result_type = 4049
retcode = 1
util.c:129:Changing query state from TDS_PENDING to TDS_READING
token.c:526:processing result tokens. marker is d1(ROW)
util.c:129:Changing query state from TDS_READING to TDS_PENDING
dblib.c:1326:dbresults() process_result_tokens returned result_type = 4040
retcode = 1
dblib.c:2091:dbbind() column = 1 8 0
dblib.c:2123:dbbind() srctype = 56 desttype = 56
convert.c:2817:tds_willconvert()
convert.c:2821:tds_willconvert() 56 56 1
dblib.c:1545:dbnextrow()
dblib.c:1560:dbnextrow() dbresults_state = 2
util.c:129:Changing query state from TDS_PENDING to TDS_READING
token.c:914:processing row tokens. marker is d1(ROW)
token.c:2078:processing row. column is 0 varint size = 1
token.c:2135:processing row. column size is 4
token.c:2294:swapping coltype 56
util.c:129:Changing query state from TDS_READING to TDS_PENDING
dblib.c:6244:copy_data_to_host_var(56 [SYBINT4] len 4 => 56 [SYBINT4] len 0)
dblib.c:6265:copy_data_to_host_var() srctype == desttype
dblib.c:1616:leaving dbnextrow() returning -1
dblib.c:1288:dbresults()



Archive powered by MHonArc 2.6.24.

Top of Page