Skip to Content.
Sympa Menu

freetds - [freetds] SP output parameter problem on 0.63

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Frank M. Kromann" <frank AT kromann.info>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] SP output parameter problem on 0.63
  • Date: Mon, 21 Nov 2005 11:45:33 -0800

Hi List,

I'm trying to fix the problems with parameters in the PHP extension, but
it seams the current CVS version of FreeTDS has a problem with output
parameters.

A freetds.log indicates that the bind function can bind both input and
output parameters and values are returned, but when i call dbnumrets() the
return value is 0.

I'm using this procedure:

drop procedure sp_test1
go
create procedure sp_test1 (
@param1 varchar(20),
@param2 varchar(20) output)
as
set @param2 = 'abcd'
return 0

And I have attached the log file.

The same code works fine on msdblib under Win32. Any clues ?

- Frank


util.c:276:Starting log file for FreeTDS 0.63
on 2005-11-21 11:43:50 with debug flags 0x4fff.
_iconv.c:86:Using trivial iconv
iconv.c:195:names for ISO-8859-1: ISO-8859-1
iconv.c:195:names for UTF-8: UTF-8
iconv.c:195:names for UCS-2LE: UCS-2LE
iconv.c:195:names for UCS-2BE: (null)
iconv.c:361:iconv to convert client-side data to the "ISO-8859-1" character
set
iconv.c:514:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
iconv.c:514:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
net.c:168:Connecting to 64.186.239.118 port 1433.
write.c:134:tds_put_string converting 6 bytes of "Idefix"
write.c:162:tds_put_string wrote 12 bytes
write.c:134:tds_put_string converting 3 bytes of "web"
write.c:162:tds_put_string wrote 6 bytes
write.c:134:tds_put_string converting 5 bytes of "PHP 5"
write.c:162:tds_put_string wrote 10 bytes
write.c:134:tds_put_string converting 24 bytes of "swwwing.intellefleet.com"
write.c:162:tds_put_string wrote 48 bytes
write.c:134:tds_put_string converting 10 bytes of "DB-Library"
write.c:162:tds_put_string wrote 20 bytes
write.c:134:tds_put_string converting 10 bytes of "us_english"
write.c:162:tds_put_string wrote 20 bytes
write.c:162:tds_put_string wrote 0 bytes
token.c:310:tds_process_login_tokens()
net.c:436:Received header
0000 04 01 01 dc 00 35 01 00- |...Ü.5..|

net.c:532:Received packet
0000 e3 37 00 01 14 53 00 77-00 77 00 77 00 69 00 6e |ã7...S.w .w.w.i.n|
0010 00 67 00 5f 00 49 00 6e-00 74 00 65 00 6c 00 6c |.g._.I.n .t.e.l.l|
0020 00 65 00 66 00 6c 00 65-00 65 00 74 00 06 6d 00 |.e.f.l.e .e.t..m.|
0030 61 00 73 00 74 00 65 00-72 00 ab 84 00 45 16 00 |a.s.t.e. r.«„.E..|
0040 00 02 00 33 00 43 00 68-00 61 00 6e 00 67 00 65 |...3.C.h .a.n.g.e|
0050 00 64 00 20 00 64 00 61-00 74 00 61 00 62 00 61 |.d. .d.a .t.a.b.a|
0060 00 73 00 65 00 20 00 63-00 6f 00 6e 00 74 00 65 |.s.e. .c .o.n.t.e|
0070 00 78 00 74 00 20 00 74-00 6f 00 20 00 27 00 53 |.x.t. .t .o. .'.S|
0080 00 77 00 77 00 77 00 69-00 6e 00 67 00 5f 00 49 |.w.w.w.i .n.g._.I|
0090 00 6e 00 74 00 65 00 6c-00 6c 00 65 00 66 00 6c |.n.t.e.l .l.e.f.l|
00a0 00 65 00 65 00 74 00 27-00 2e 00 09 4d 00 49 00 |.e.e.t.' ... M.I.|
00b0 52 00 41 00 43 00 55 00-4c 00 49 00 58 00 00 00 |R.A.C.U. L.I.X...|
00c0 00 e3 17 00 02 0a 75 00-73 00 5f 00 65 00 6e 00 |.ã....u. s._.e.n.|
00d0 67 00 6c 00 69 00 73 00-68 00 00 ab 6c 00 47 16 |g.l.i.s. h..«l.G.|
00e0 00 00 01 00 27 00 43 00-68 00 61 00 6e 00 67 00 |....'.C. h.a.n.g.|
00f0 65 00 64 00 20 00 6c 00-61 00 6e 00 67 00 75 00 |e.d. .l. a.n.g.u.|
0100 61 00 67 00 65 00 20 00-73 00 65 00 74 00 74 00 |a.g.e. . s.e.t.t.|
0110 69 00 6e 00 67 00 20 00-74 00 6f 00 20 00 75 00 |i.n.g. . t.o. .u.|
0120 73 00 5f 00 65 00 6e 00-67 00 6c 00 69 00 73 00 |s._.e.n. g.l.i.s.|
0130 68 00 2e 00 09 4d 00 49-00 52 00 41 00 43 00 55 |h... M.I .R.A.C.U|
0140 00 4c 00 49 00 58 00 00-00 00 e3 0f 00 03 05 69 |.L.I.X.. ..ã....i|
0150 00 73 00 6f 00 5f 00 31-00 01 00 00 e3 0b 00 05 |.s.o._.1 ....ã...|
0160 04 31 00 30 00 33 00 33-00 00 e3 0f 00 06 06 31 |.1.0.3.3 ..ã....1|
0170 00 39 00 36 00 36 00 30-00 39 00 00 ad 36 00 01 |.9.6.6.0 .9..­6..|
0180 07 00 00 00 16 4d 00 69-00 63 00 72 00 6f 00 73 |.....M.i .c.r.o.s|
0190 00 6f 00 66 00 74 00 20-00 53 00 51 00 4c 00 20 |.o.f.t. .S.Q.L. |
01a0 00 53 00 65 00 72 00 76-00 65 00 72 00 00 00 00 |.S.e.r.v .e.r....|
01b0 00 08 00 02 f8 e3 13 00-04 04 34 00 30 00 39 00 |....øã.. ..4.0.9.|
01c0 36 00 04 34 00 30 00 39-00 36 00 fd 00 00 00 00 |6..4.0.9 .6.ý....|
01d0 00 00 00 00 - |....|

token.c:314:looking for login token, got e3(ENVCHANGE)
token.c:105:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:179:tds_get_string: reading 40 from wire to give 20 to client.
read.c:179:tds_get_string: reading 12 from wire to give 6 to client.
token.c:314:looking for login token, got ab(INFO)
token.c:105:tds_process_default_tokens() marker is ab(INFO)
token.c:2427:tds_process_msg() reading message from server
read.c:179:tds_get_string: reading 102 from wire to give 51 to client.
read.c:179:tds_get_string: reading 18 from wire to give 9 to client.
token.c:2489:tds_process_msg() calling client msg handler
token.c:2502:tds_process_msg() returning TDS_SUCCEED
token.c:314:looking for login token, got e3(ENVCHANGE)
token.c:105:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:179:tds_get_string: reading 20 from wire to give 10 to client.
token.c:314:looking for login token, got ab(INFO)
token.c:105:tds_process_default_tokens() marker is ab(INFO)
token.c:2427:tds_process_msg() reading message from server
read.c:179:tds_get_string: reading 78 from wire to give 39 to client.
read.c:179:tds_get_string: reading 18 from wire to give 9 to client.
token.c:2489:tds_process_msg() calling client msg handler
token.c:2502:tds_process_msg() returning TDS_SUCCEED
token.c:314:looking for login token, got e3(ENVCHANGE)
token.c:105:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:179:tds_get_string: reading 10 from wire to give 5 to client.
read.c:179:tds_get_string: reading 2 from wire to give 1 to client.
token.c:314:looking for login token, got e3(ENVCHANGE)
token.c:105:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:179:tds_get_string: reading 8 from wire to give 4 to client.
token.c:314:looking for login token, got e3(ENVCHANGE)
token.c:105:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:179:tds_get_string: reading 12 from wire to give 6 to client.
token.c:314:looking for login token, got ad(LOGINACK)
read.c:179:tds_get_string: reading 44 from wire to give 22 to client.
token.c:314:looking for login token, got e3(ENVCHANGE)
token.c:105:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:179:tds_get_string: reading 8 from wire to give 4 to client.
read.c:179:tds_get_string: reading 8 from wire to give 4 to client.
token.c:2315:increasing block size from 4096 to 4096
token.c:314:looking for login token, got fd(DONE)
token.c:105:tds_process_default_tokens() marker is fd(DONE)
token.c:2131:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
token.c:2147:tds_process_end() state set to TDS_IDLE
util.c:117:Changing query state from IDLE to IDLE
token.c:387:leaving tds_process_login_tokens() returning 1
util.c:117:Changing query state from IDLE to QUERYING
mem.c:475:tds_free_all_results()
write.c:134:tds_put_string converting 19 bytes of "set textsize 64512 "
write.c:162:tds_put_string wrote 38 bytes
util.c:117:Changing query state from QUERYING to PENDING
net.c:663:Sending packet
0000 01 01 00 2e 00 00 00 00-73 00 65 00 74 00 20 00 |........ s.e.t. .|
0010 74 00 65 00 78 00 74 00-73 00 69 00 7a 00 65 00 |t.e.x.t. s.i.z.e.|
0020 20 00 36 00 34 00 35 00-31 00 32 00 20 00 | .6.4.5. 1.2. .|

util.c:117:Changing query state from PENDING to READING
net.c:436:Received header
0000 04 01 00 11 00 35 01 00- |.....5..|

net.c:532:Received packet
0000 fd 00 00 be 00 00 00 00-00 |ý..¾.... .|

token.c:526:processing result tokens. marker is fd(DONE)
token.c:2131:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
token.c:2147:tds_process_end() state set to TDS_IDLE
util.c:117:Changing query state from READING to IDLE
util.c:117:Changing query state from IDLE to PENDING
token.c:514:tds_process_tokens() state is COMPLETED
dblib.c:983:dbuse()
dblib.c:899:dbcmd() bufsz = 0
dblib.c:949:in dbsqlexec()
dblib.c:5916:in dbsqlsend()
util.c:117:Changing query state from IDLE to QUERYING
mem.c:475:tds_free_all_results()
write.c:134:tds_put_string converting 24 bytes of "use swwwing_intellefleet"
write.c:162:tds_put_string wrote 48 bytes
util.c:117:Changing query state from QUERYING to PENDING
net.c:663:Sending packet
0000 01 01 00 38 00 00 01 00-75 00 73 00 65 00 20 00 |...8.... u.s.e. .|
0010 73 00 77 00 77 00 77 00-69 00 6e 00 67 00 5f 00 |s.w.w.w. i.n.g._.|
0020 69 00 6e 00 74 00 65 00-6c 00 6c 00 65 00 66 00 |i.n.t.e. l.l.e.f.|
0030 6c 00 65 00 65 00 74 00- |l.e.e.t.|

dblib.c:4010:in dbsqlok()
net.c:436:Received header
0000 04 01 00 ee 00 35 01 00- |...î.5..|

net.c:532:Received packet
0000 e3 53 00 01 14 53 00 77-00 77 00 77 00 69 00 6e |ãS...S.w .w.w.i.n|
0010 00 67 00 5f 00 49 00 6e-00 74 00 65 00 6c 00 6c |.g._.I.n .t.e.l.l|
0020 00 65 00 66 00 6c 00 65-00 65 00 74 00 14 53 00 |.e.f.l.e .e.t..S.|
0030 77 00 77 00 77 00 69 00-6e 00 67 00 5f 00 49 00 |w.w.w.i. n.g._.I.|
0040 6e 00 74 00 65 00 6c 00-6c 00 65 00 66 00 6c 00 |n.t.e.l. l.e.f.l.|
0050 65 00 65 00 74 00 ab 84-00 45 16 00 00 01 00 33 |e.e.t.«„ .E.....3|
0060 00 43 00 68 00 61 00 6e-00 67 00 65 00 64 00 20 |.C.h.a.n .g.e.d. |
0070 00 64 00 61 00 74 00 61-00 62 00 61 00 73 00 65 |.d.a.t.a .b.a.s.e|
0080 00 20 00 63 00 6f 00 6e-00 74 00 65 00 78 00 74 |. .c.o.n .t.e.x.t|
0090 00 20 00 74 00 6f 00 20-00 27 00 53 00 77 00 77 |. .t.o. .'.S.w.w|
00a0 00 77 00 69 00 6e 00 67-00 5f 00 49 00 6e 00 74 |.w.i.n.g ._.I.n.t|
00b0 00 65 00 6c 00 6c 00 65-00 66 00 6c 00 65 00 65 |.e.l.l.e .f.l.e.e|
00c0 00 74 00 27 00 2e 00 09-4d 00 49 00 52 00 41 00 |.t.'... M.I.R.A.|
00d0 43 00 55 00 4c 00 49 00-58 00 00 01 00 fd 00 00 |C.U.L.I. X....ý..|
00e0 e2 00 00 00 00 00 - |â.....|

dblib.c:4029:dbsqlok() marker is e3
util.c:117:Changing query state from PENDING to READING
token.c:526:processing result tokens. marker is e3(ENVCHANGE)
token.c:105:tds_process_default_tokens() marker is e3(ENVCHANGE)
read.c:179:tds_get_string: reading 40 from wire to give 20 to client.
read.c:179:tds_get_string: reading 40 from wire to give 20 to client.
token.c:526:processing result tokens. marker is ab(INFO)
token.c:105:tds_process_default_tokens() marker is ab(INFO)
token.c:2427:tds_process_msg() reading message from server
read.c:179:tds_get_string: reading 102 from wire to give 51 to client.
read.c:179:tds_get_string: reading 18 from wire to give 9 to client.
token.c:2489:tds_process_msg() calling client msg handler
token.c:2502:tds_process_msg() returning TDS_SUCCEED
token.c:526:processing result tokens. marker is fd(DONE)
token.c:2131:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
token.c:2147:tds_process_end() state set to TDS_IDLE
util.c:117:Changing query state from READING to IDLE
util.c:117:Changing query state from IDLE to PENDING
dblib.c:4076:dbsqlok() end status was success
dblib.c:1153:dbresults()
token.c:514:tds_process_tokens() state is COMPLETED
rpc.c:129:dbrpcinit() added rpcname "sp_test1"
rpc.c:247:dbrpcparam() added parameter "@param1"
rpc.c:247:dbrpcparam() added parameter "@param2"
rpc.c:275:dbrpcsend()
rpc.c:379:parm_info_alloc(): parameter null-ness = 0
rpc.c:310:parameter size = 3, offset = 0, row_size = 4
rpc.c:315:copying 3 bytes of data to parameter #0
rpc.c:379:parm_info_alloc(): parameter null-ness = 0
rpc.c:310:parameter size = 1, offset = 4, row_size = 260
rpc.c:315:copying 1 bytes of data to parameter #1
util.c:117:Changing query state from IDLE to QUERYING
mem.c:475:tds_free_all_results()
query.c:1236:tds_put_data_info putting param_name
query.c:1265:tds_put_data_info putting status
query.c:1360:tds_put_data: colsize = 3
query.c:1389:tds_put_data: not null param varint_size = 2
query.c:1236:tds_put_data_info putting param_name
query.c:1265:tds_put_data_info putting status
query.c:1360:tds_put_data: colsize = 1
query.c:1389:tds_put_data: not null param varint_size = 2
util.c:117:Changing query state from QUERYING to PENDING
net.c:663:Sending packet
0000 03 01 00 4a 00 00 01 00-08 00 73 00 70 00 5f 00 |...J.... ..s.p._.|
0010 74 00 65 00 73 00 74 00-31 00 00 00 07 40 00 70 |t.e.s.t. 1....@.p|
0020 00 61 00 72 00 61 00 6d-00 31 00 00 a7 03 00 03 |.a.r.a.m .1..§...|
0030 00 61 62 63 07 40 00 70-00 61 00 72 00 61 00 6d |.abc.@.p .a.r.a.m|
0040 00 32 00 01 a7 ff 00 01-00 61 |.2..§ÿ.. .a|

dblib.c:4010:in dbsqlok()
net.c:436:Received header
0000 04 01 00 48 00 35 01 00- |...H.5..|

net.c:532:Received packet
0000 ff 11 00 c1 00 01 00 00-00 ff 11 00 c1 00 01 00 |ÿ..Á.... .ÿ..Á...|
0010 00 00 79 02 00 00 00 ac-1d 00 07 40 00 70 00 61 |..y....¬ ...@.p.a|
0020 00 72 00 61 00 6d 00 32-00 01 a7 00 00 00 a7 ff |.r.a.m.2 ..§...§ÿ|
0030 00 04 00 61 62 63 64 fe-00 00 e0 00 01 00 00 00 |...abcdþ ..à.....|

dblib.c:4029:dbsqlok() marker is ff
util.c:117:Changing query state from PENDING to READING
token.c:526:processing result tokens. marker is ff(DONEINPROC)
token.c:2131:tds_process_end: more_results = 1
was_cancelled = 0
error = 0
done_count_valid = 1
token.c:2163: rows_affected = 1
util.c:117:Changing query state from READING to PENDING
dblib.c:4029:dbsqlok() marker is ff
util.c:117:Changing query state from PENDING to READING
token.c:526:processing result tokens. marker is ff(DONEINPROC)
token.c:2131:tds_process_end: more_results = 1
was_cancelled = 0
error = 0
done_count_valid = 1
token.c:2163: rows_affected = 1
util.c:117:Changing query state from READING to PENDING
dblib.c:4029:dbsqlok() marker is 79
dblib.c:4033:dbsqlok() found result token
dblib.c:1153:dbresults()
mem.c:475:tds_free_all_results()
util.c:117:Changing query state from PENDING to READING
token.c:526:processing result tokens. marker is 79(RETURNSTATUS)
token.c:699:tds_process_tokens: return status is 2
util.c:117:Changing query state from READING to PENDING
dblib.c:1188:dbresults() process_result_tokens returned result_type = 4043
retcode = 1
util.c:117:Changing query state from PENDING to READING
token.c:526:processing result tokens. marker is ac(PARAM)
read.c:179:tds_get_string: reading 14 from wire to give 7 to client.
token.c:1514:processing result. type = 39(varchar), varint_size 2
token.c:1535:processing result. column_size 255
token.c:3383:adjust_character_column_size:
Server charset: ISO-8859-1
Server column_size: 255
Client charset: ISO-8859-1
Client column_size: 255
token.c:1851:tds_get_data: column 0, type 39, varint size 2
token.c:1908:processing row. column size is 4
util.c:117:Changing query state from READING to PENDING
dblib.c:1188:dbresults() process_result_tokens returned result_type = 4042
retcode = 1
util.c:117:Changing query state from PENDING to READING
token.c:526:processing result tokens. marker is fe(DONEPROC)
token.c:2131:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
token.c:2147:tds_process_end() state set to TDS_IDLE
util.c:117:Changing query state from READING to IDLE
util.c:117:Changing query state from IDLE to PENDING
dblib.c:1188:dbresults() process_result_tokens returned result_type = 4053
retcode = 1
dblib.c:1153:dbresults()
mem.c:475:tds_free_all_results()
token.c:514:tds_process_tokens() state is COMPLETED
dblib.c:1188:dbresults() process_result_tokens returned result_type = 4052
retcode = 2
dblib.c:3893:dbnumrets() finds 0 columns
token.c:514:tds_process_tokens() state is COMPLETED
mem.c:475:tds_free_all_results()
util.c:117:Changing query state from IDLE to DEAD
dblib.c:5012:in dbfreebuf()



Archive powered by MHonArc 2.6.24.

Top of Page