Truncation of string values to 80 characters using placeholders and MSSQL
"Ed Avis" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm using the Perl library DBD::Sybase with freetds to connect to an
MSSQL 2000 server.
It normally works fine, including the use of placeholders in prepared
statements. However
when I do an INSERT statement, string values are silently truncated to
80 characters.
This test program demonstrates the problem.
#!/usr/bin/perl
use warnings;
use strict;
use DBI;
use DBD::Sybase;
my $str = 'x' x 81;
$ENV{TDSVER} = '8.0';
my $dbh = DBI->connect('dbi:Sybase:WCL-SQL-LIVE', 'wanisystems',
'cancel',
{ RaiseError => 1, ShowErrorStatement => 1 });
$dbh->do('create table #tmp (x char(100) not null)');
my $sth = $dbh->prepare('insert into #tmp values (?)');
$sth->execute($str);
finish $sth;
my $got = $dbh->selectall_arrayref('select * from #tmp')->[0]->[0];
if ($got ne $str) {
print "inserted: $str\n";
print "got back: $got\n";
}
The 81-character string has become 80 characters. I believe this
truncation happens on
insert, not on select; if I insert it using a literal SQL string rather
than placeholders
then it works fine.
I'm using the freetds-0.82.1-0.3.20110306dev packaged with Fedora. I
believe this is
based on a development snapshot at that date. In the changelog for
0.91RC2 I don't see
anything mentioning this problem, however I will upgrade freetds and
retest if you
believe that might help diagnose things. The maintainer of DBD::Sybase
suggested asking
on this list.
The TDSDUMP output is attached.
--
Ed Avis <[email protected]>
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
log.txt
(text/plain, 32.7 KB)
log.c:190:Starting log file for FreeTDS 0.82.1 on 2011-05-05 12:24:40 with debug flags 0x4fff. iconv.c:197:names for ISO-8859-1: ISO-8859-1 iconv.c:197:names for UTF-8: UTF-8 iconv.c:197:names for UCS-2LE: UCS-2LE iconv.c:197:names for UCS-2BE: UCS-2BE iconv.c:363:iconv to convert client-side data to the "ISO-8859-1" character set iconv.c:516:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" iconv.c:516:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" net.c:210:Connecting to 192.168.186.12 port 1433 (TDS version 8.0) net.c:266:tds_open_socket: connect(2) returned "Operation now in progress" net.c:307:tds_open_socket() succeeded util.c:162:Changed query state from DEAD to IDLE net.c:793:Sending packet 0000 12 01 00 34 00 00 00 00-00 00 15 00 06 01 00 1b |...4.... ........| 0010 00 01 02 00 1c 00 0c 03-00 28 00 04 ff 08 00 01 |........ .(......| 0020 55 00 00 00 4d 53 53 51-4c 53 65 72 76 65 72 00 |U...MSSQ LServer.| 0030 0d 36 00 00 - |.6..| net.c:604:Received header 0000 04 01 00 25 00 00 01 00- |...%....| net.c:683:Received packet 0000 00 00 15 00 06 01 00 1b-00 01 02 00 1c 00 01 03 |........ ........| 0010 00 1d 00 00 ff 08 00 07-f7 00 00 02 00 |........ .....| login.c:1007:detected flag 2 login.c:735:quietly sending TDS 7+ login packet token.c:312:tds_process_login_tokens() net.c:604:Received header 0000 04 01 01 89 00 38 01 00- |.....8..| net.c:683:Received packet 0000 e3 1b 00 01 06 6d 00 61-00 73 00 74 00 65 00 72 |.....m.a .s.t.e.r| 0010 00 06 6d 00 61 00 73 00-74 00 65 00 72 00 ab 6e |..m.a.s. t.e.r..n| 0020 00 45 16 00 00 02 00 25-00 43 00 68 00 61 00 6e |.E.....% .C.h.a.n| 0030 00 67 00 65 00 64 00 20-00 64 00 61 00 74 00 61 |.g.e.d. .d.a.t.a| 0040 00 62 00 61 00 73 00 65-00 20 00 63 00 6f 00 6e |.b.a.s.e . .c.o.n| 0050 00 74 00 65 00 78 00 74-00 20 00 74 00 6f 00 20 |.t.e.x.t . .t.o. | 0060 00 27 00 6d 00 61 00 73-00 74 00 65 00 72 00 27 |.'.m.a.s .t.e.r.'| 0070 00 2e 00 0c 57 00 43 00-4c 00 2d 00 53 00 51 00 |....W.C. L.-.S.Q.| 0080 4c 00 2d 00 50 00 52 00-4f 00 44 00 00 00 00 e3 |L.-.P.R. O.D.....| 0090 08 00 07 05 09 04 d0 00-34 00 e3 17 00 02 0a 75 |........ 4......u| 00a0 00 73 00 5f 00 65 00 6e-00 67 00 6c 00 69 00 73 |.s._.e.n .g.l.i.s| 00b0 00 68 00 00 ab 72 00 47-16 00 00 01 00 27 00 43 |.h...r.G .....'.C| 00c0 00 68 00 61 00 6e 00 67-00 65 00 64 00 20 00 6c |.h.a.n.g .e.d. .l| 00d0 00 61 00 6e 00 67 00 75-00 61 00 67 00 65 00 20 |.a.n.g.u .a.g.e. | 00e0 00 73 00 65 00 74 00 74-00 69 00 6e 00 67 00 20 |.s.e.t.t .i.n.g. | 00f0 00 74 00 6f 00 20 00 75-00 73 00 5f 00 65 00 6e |.t.o. .u .s._.e.n| 0100 00 67 00 6c 00 69 00 73-00 68 00 2e 00 0c 57 00 |.g.l.i.s .h....W.| 0110 43 00 4c 00 2d 00 53 00-51 00 4c 00 2d 00 50 00 |C.L.-.S. Q.L.-.P.| 0120 52 00 4f 00 44 00 00 00-00 ad 36 00 01 71 00 00 |R.O.D... ..6..q..| 0130 01 16 4d 00 69 00 63 00-72 00 6f 00 73 00 6f 00 |..M.i.c. r.o.s.o.| 0140 66 00 74 00 20 00 53 00-51 00 4c 00 20 00 53 00 |f.t. .S. Q.L. .S.| 0150 65 00 72 00 76 00 65 00-72 00 00 00 00 00 08 00 |e.r.v.e. r.......| 0160 07 f7 e3 13 00 04 04 34-00 30 00 39 00 36 00 04 |.......4 .0.9.6..| 0170 34 00 30 00 39 00 36 00-fd 00 00 00 00 00 00 00 |4.0.9.6. ........| 0180 00 - |.| token.c:316:looking for login token, got e3(ENVCHANGE) token.c:108:tds_process_default_tokens() marker is e3(ENVCHANGE) token.c:316:looking for login token, got ab(INFO) token.c:108:tds_process_default_tokens() marker is ab(INFO) token.c:2451:tds_process_msg() reading message from server token.c:2516:tds_process_msg() calling client msg handler ct.c:334:ct_con_props() action = CS_GET property = 9108 ct.c:486:fetching userdata 0x118be30 token.c:2529:tds_process_msg() returning TDS_SUCCEED token.c:316:looking for login token, got e3(ENVCHANGE) token.c:108:tds_process_default_tokens() marker is e3(ENVCHANGE) token.c:2281:tds_process_env_chg(): 5 bytes of collation data received token.c:2282:tds->collation was 0000 00 00 00 00 00 - |.....| iconv.c:996:setting server single-byte charset to "CP1252" iconv.c:516:tds_iconv_info_init: converting "ISO-8859-1"->"CP1252" token.c:2292:tds->collation now 0000 09 04 d0 00 34 - |....4| token.c:316:looking for login token, got e3(ENVCHANGE) token.c:108:tds_process_default_tokens() marker is e3(ENVCHANGE) token.c:316:looking for login token, got ab(INFO) token.c:108:tds_process_default_tokens() marker is ab(INFO) token.c:2451:tds_process_msg() reading message from server token.c:2516:tds_process_msg() calling client msg handler ct.c:334:ct_con_props() action = CS_GET property = 9108 ct.c:486:fetching userdata 0x118be30 token.c:2529:tds_process_msg() returning TDS_SUCCEED token.c:316:looking for login token, got ad(LOGINACK) token.c:316:looking for login token, got e3(ENVCHANGE) token.c:108:tds_process_default_tokens() marker is e3(ENVCHANGE) token.c:316:looking for login token, got fd(DONE) token.c:108:tds_process_default_tokens() marker is fd(DONE) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2217:tds_process_end() state set to TDS_IDLE token.c:2232: rows_affected = 0 token.c:393:leaving tds_process_login_tokens() returning 1 mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to QUERYING write.c:136:tds_put_string converting 19 bytes of "set textsize 64512 " write.c:164:tds_put_string wrote 38 bytes util.c:162:Changed query state from QUERYING to PENDING net.c:793: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. .| token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb10c, 0x7fff06fcb108, 0x100) util.c:162:Changed query state from PENDING to READING net.c:604:Received header 0000 04 01 00 11 00 38 01 00- |.....8..| net.c:683:Received packet 0000 fd 00 00 be 00 00 00 00-00 |........ .| token.c:510:processing result tokens. marker is fd(DONE) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2217:tds_process_end() state set to TDS_IDLE util.c:162:Changed query state from READING to IDLE token.c:2232: rows_affected = 0 util.c:110:logic error: cannot change query state from IDLE to PENDING token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb10c, 0x7fff06fcb108, 0x100) token.c:498:tds_process_tokens() state is COMPLETED ct.c:623:leaving ct_connect() returning 1 ct.c:3630:ct_options: CS_SET, option = 5025 ct.c:3828: tds_submit_optioncmd will be action(CS_SET) option(25) arg(0) arglen(1) query.c:2906:tds_submit_optioncmd() mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to QUERYING write.c:136:tds_put_string converting 29 bytes of "SET IMPLICIT_TRANSACTIONS OFF" write.c:164:tds_put_string wrote 58 bytes util.c:162:Changed query state from QUERYING to PENDING net.c:793:Sending packet 0000 01 01 00 42 00 00 01 00-53 00 45 00 54 00 20 00 |...B.... S.E.T. .| 0010 49 00 4d 00 50 00 4c 00-49 00 43 00 49 00 54 00 |I.M.P.L. I.C.I.T.| 0020 5f 00 54 00 52 00 41 00-4e 00 53 00 41 00 43 00 |_.T.R.A. N.S.A.C.| 0030 54 00 49 00 4f 00 4e 00-53 00 20 00 4f 00 46 00 |T.I.O.N. S. .O.F.| 0040 46 00 - |F.| token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb3fc, 0x7fff06fcb3f8, 0x100) util.c:162:Changed query state from PENDING to READING net.c:604:Received header 0000 04 01 00 11 00 38 01 00- |.....8..| net.c:683:Received packet 0000 fd 00 00 ba 00 00 00 00-00 |........ .| token.c:510:processing result tokens. marker is fd(DONE) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2217:tds_process_end() state set to TDS_IDLE util.c:162:Changed query state from READING to IDLE token.c:2232: rows_affected = 0 util.c:110:logic error: cannot change query state from IDLE to PENDING token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb3fc, 0x7fff06fcb3f8, 0x100) token.c:498:tds_process_tokens() state is COMPLETED ct.c:641:ct_cmd_alloc() ct.c:215:setting command state from IDLE to IDLE ct.c:660:ct_cmd_alloc() : allocating command list to head ct.c:682:ct_command() ct.c:215:setting command state from IDLE to IDLE ct.c:215:setting command state from IDLE to IDLE ct.c:215:setting command state from IDLE to READY ct.c:844:ct_send() command_type = 148 mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to QUERYING write.c:136:tds_put_string converting 16 bytes of "select @@version" write.c:164:tds_put_string wrote 32 bytes util.c:162:Changed query state from QUERYING to PENDING net.c:793:Sending packet 0000 01 01 00 28 00 00 01 00-73 00 65 00 6c 00 65 00 |...(.... s.e.l.e.| 0010 63 00 74 00 20 00 40 00-40 00 76 00 65 00 72 00 |c.t. .@. @.v.e.r.| 0020 73 00 69 00 6f 00 6e 00- |s.i.o.n.| ct.c:215:setting command state from READY to SENT ct.c:965:ct_send() succeeded ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb52c, 0x7fff06fcb528, 0x6914) util.c:162:Changed query state from PENDING to READING net.c:604:Received header 0000 04 01 01 9a 00 38 01 00- |.....8..| net.c:683:Received packet 0000 81 01 00 00 00 01 00 e7-58 02 09 04 d0 00 34 00 |........ X.....4.| 0010 d1 76 01 4d 00 69 00 63-00 72 00 6f 00 73 00 6f |.v.M.i.c .r.o.s.o| 0020 00 66 00 74 00 20 00 53-00 51 00 4c 00 20 00 53 |.f.t. .S .Q.L. .S| 0030 00 65 00 72 00 76 00 65-00 72 00 20 00 20 00 32 |.e.r.v.e .r. . .2| 0040 00 30 00 30 00 30 00 20-00 2d 00 20 00 38 00 2e |.0.0.0. .-. .8..| 0050 00 30 00 30 00 2e 00 32-00 30 00 33 00 39 00 20 |.0.0...2 .0.3.9. | 0060 00 28 00 49 00 6e 00 74-00 65 00 6c 00 20 00 58 |.(.I.n.t .e.l. .X| 0070 00 38 00 36 00 29 00 20-00 0a 00 09 00 4d 00 61 |.8.6.). .....M.a| 0080 00 79 00 20 00 20 00 33-00 20 00 32 00 30 00 30 |.y. . .3 . .2.0.0| 0090 00 35 00 20 00 32 00 33-00 3a 00 31 00 38 00 3a |.5. .2.3 .:.1.8.:| 00a0 00 33 00 38 00 20 00 0a-00 09 00 43 00 6f 00 70 |.3.8. .. ...C.o.p| 00b0 00 79 00 72 00 69 00 67-00 68 00 74 00 20 00 28 |.y.r.i.g .h.t. .(| 00c0 00 63 00 29 00 20 00 31-00 39 00 38 00 38 00 2d |.c.). .1 .9.8.8.-| 00d0 00 32 00 30 00 30 00 33-00 20 00 4d 00 69 00 63 |.2.0.0.3 . .M.i.c| 00e0 00 72 00 6f 00 73 00 6f-00 66 00 74 00 20 00 43 |.r.o.s.o .f.t. .C| 00f0 00 6f 00 72 00 70 00 6f-00 72 00 61 00 74 00 69 |.o.r.p.o .r.a.t.i| 0100 00 6f 00 6e 00 0a 00 09-00 53 00 74 00 61 00 6e |.o.n.... .S.t.a.n| 0110 00 64 00 61 00 72 00 64-00 20 00 45 00 64 00 69 |.d.a.r.d . .E.d.i| 0120 00 74 00 69 00 6f 00 6e-00 20 00 6f 00 6e 00 20 |.t.i.o.n . .o.n. | 0130 00 57 00 69 00 6e 00 64-00 6f 00 77 00 73 00 20 |.W.i.n.d .o.w.s. | 0140 00 4e 00 54 00 20 00 35-00 2e 00 32 00 20 00 28 |.N.T. .5 ...2. .(| 0150 00 42 00 75 00 69 00 6c-00 64 00 20 00 33 00 37 |.B.u.i.l .d. .3.7| 0160 00 39 00 30 00 3a 00 20-00 53 00 65 00 72 00 76 |.9.0.:. .S.e.r.v| 0170 00 69 00 63 00 65 00 20-00 50 00 61 00 63 00 6b |.i.c.e. .P.a.c.k| 0180 00 20 00 32 00 29 00 0a-00 fd 10 00 c1 00 01 00 |. .2.).. ........| 0190 00 00 - |..| token.c:510:processing result tokens. marker is 81(TDS7_RESULT) token.c:1520:processing TDS7 result metadata. mem.c:609:tds_free_all_results() token.c:1544:set current_results (1 column) to tds->res_info token.c:1555:setting up column 0 token.c:3294:adjust_character_column_size: Server charset: UCS-2LE Server column_size: 600 Client charset: ISO-8859-1 Client column_size: 300 token.c:1490:tds7_get_data_info: colname = (0 bytes) type = 39 (varchar) server's type = 231 (x UCS-2 varchar) column_varint_size = 2 column_size = 300 (600 on server) util.c:162:Changed query state from READING to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4049) token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb52c, 0x7fff06fcb528, 0x6914) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is d1(ROW) token.c:621:tds_process_tokens::SET_RETURN stopping on current token util.c:162:Changed query state from READING to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4040) ct.c:2300:ct_describe() ct.c:1890:_ct_get_client_type(type 39, user 0, size 300) ct.c:2321:ct_describe() datafmt->datatype = 0 server type 39 ct.c:1434:ct_bind() datafmt count = 1 column_number = 1 ct.c:1490:ct_fetch() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb52c, (nil), 0x1608) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is d1(ROW) token.c:2166:tds_process_row(): reading column 0 token.c:1915:tds_get_data: type 39, varint size 2 token.c:1975:tds_get_data(): wire column size is 374 util.c:162:Changed query state from READING to PENDING ct.c:1555:inside ct_fetch()process_row_tokens returned 1 ct.c:1704:_ct_bind_data() ct.c:1711:_ct_bind_data(): column_type: 39 column_len: 187 ct.c:2003:_ct_get_server_type(0) ct.c:1890:_ct_get_client_type(type 39, user 0, size 300) cs.c:463:cs_convert() ct.c:2003:_ct_get_server_type(0) ct.c:2003:_ct_get_server_type(0) cs.c:470:cs_convert() srctype = 47 (187) desttype = 47 (255) cs.c:495:cs_convert() srctype = desttype cs.c:531:cs_convert() desttype = character ct.c:1490:ct_fetch() ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb52c, 0x7fff06fcb528, 0x6914) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is fd(DONE) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 1 token.c:2217:tds_process_end() state set to TDS_IDLE util.c:162:Changed query state from READING to IDLE token.c:2232: rows_affected = 1 util.c:110:logic error: cannot change query state from IDLE to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4052) ct.c:1262:ct_results() results state = 2 ct.c:1263:ct_results() command type = 148 ct.c:1264:ct_results() dynamic cmd = 0 ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb52c, 0x7fff06fcb528, 0x6914) token.c:498:tds_process_tokens() state is COMPLETED ct.c:1157:ct_results() process_result_tokens returned 2 (type 4052) ct.c:215:setting command state from SENT to READY ct.c:1799:ct_cmd_drop() ct.c:1830:ct_cmd_drop() : command entry found in list ct.c:1835:ct_cmd_drop() : relinking list ct.c:1842:ct_cmd_drop() : relinked list ct.c:641:ct_cmd_alloc() ct.c:215:setting command state from IDLE to IDLE ct.c:660:ct_cmd_alloc() : allocating command list to head ct.c:682:ct_command() ct.c:215:setting command state from IDLE to IDLE ct.c:215:setting command state from IDLE to IDLE ct.c:215:setting command state from IDLE to READY ct.c:844:ct_send() command_type = 148 mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to QUERYING write.c:136:tds_put_string converting 40 bytes of "create table #tmp (x char(100) not null)" write.c:164:tds_put_string wrote 80 bytes util.c:162:Changed query state from QUERYING to PENDING net.c:793:Sending packet 0000 01 01 00 58 00 00 01 00-63 00 72 00 65 00 61 00 |...X.... c.r.e.a.| 0010 74 00 65 00 20 00 74 00-61 00 62 00 6c 00 65 00 |t.e. .t. a.b.l.e.| 0020 20 00 23 00 74 00 6d 00-70 00 20 00 28 00 78 00 | .#.t.m. p. .(.x.| 0030 20 00 63 00 68 00 61 00-72 00 28 00 31 00 30 00 | .c.h.a. r.(.1.0.| 0040 30 00 29 00 20 00 6e 00-6f 00 74 00 20 00 6e 00 |0.). .n. o.t. .n.| 0050 75 00 6c 00 6c 00 29 00- |u.l.l.).| ct.c:215:setting command state from READY to SENT ct.c:965:ct_send() succeeded ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcae1c, 0x7fff06fcae18, 0x6914) util.c:162:Changed query state from PENDING to READING net.c:604:Received header 0000 04 01 00 11 00 38 01 00- |.....8..| net.c:683:Received packet 0000 fd 00 00 c6 00 00 00 00-00 |........ .| token.c:510:processing result tokens. marker is fd(DONE) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2217:tds_process_end() state set to TDS_IDLE util.c:162:Changed query state from READING to IDLE token.c:2232: rows_affected = 0 util.c:110:logic error: cannot change query state from IDLE to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4052) ct.c:1262:ct_results() results state = 0 ct.c:1263:ct_results() command type = 148 ct.c:1264:ct_results() dynamic cmd = 0 ct.c:2356:ct_res_info() ct.c:2381:ct_res_info(): Number of rows is -1 ct.c:1100:ct_results() ct.c:2356:ct_res_info() ct.c:2381:ct_res_info(): Number of rows is -1 ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcae1c, 0x7fff06fcae18, 0x6914) token.c:498:tds_process_tokens() state is COMPLETED ct.c:1157:ct_results() process_result_tokens returned 2 (type 4052) ct.c:215:setting command state from SENT to READY ct.c:1799:ct_cmd_drop() ct.c:1830:ct_cmd_drop() : command entry found in list ct.c:1835:ct_cmd_drop() : relinking list ct.c:1842:ct_cmd_drop() : relinked list ct.c:2924:ct_capability() ct.c:3274:ct_capability returns success, value TRUE ct.c:641:ct_cmd_alloc() ct.c:215:setting command state from IDLE to IDLE ct.c:660:ct_cmd_alloc() : allocating command list to head ct.c:3298:ct_dynamic(717) ct.c:4784:_ct_allocate_dynamic() attaching dynamic command to head ct.c:215:setting command state from IDLE to READY ct.c:844:ct_send() command_type = 160 mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to QUERYING write.c:136:tds_put_string converting 3 bytes of "@P1" write.c:164:tds_put_string wrote 6 bytes util.c:162:Changed query state from QUERYING to PENDING net.c:793:Sending packet 0000 03 01 00 94 00 00 01 00-ff ff 0b 00 00 00 00 01 |........ ........| 0010 26 04 00 00 00 63 1e 00-00 00 09 04 d0 00 34 1e |&....c.. ......4.| 0020 00 00 00 40 00 50 00 31-00 20 00 76 00 61 00 72 |[email protected] . .v.a.r| 0030 00 63 00 68 00 61 00 72-00 28 00 38 00 30 00 29 |.c.h.a.r .(.8.0.)| 0040 00 00 00 63 3a 00 00 00-09 04 d0 00 34 3a 00 00 |...c:... ....4:..| 0050 00 69 00 6e 00 73 00 65-00 72 00 74 00 20 00 69 |.i.n.s.e .r.t. .i| 0060 00 6e 00 74 00 6f 00 20-00 23 00 74 00 6d 00 70 |.n.t.o. .#.t.m.p| 0070 00 20 00 76 00 61 00 6c-00 75 00 65 00 73 00 20 |. .v.a.l .u.e.s. | 0080 00 28 00 40 00 50 00 31-00 29 00 00 00 26 04 04 |.([email protected] .)...&..| 0090 01 00 00 00 - |....| ct.c:215:setting command state from READY to SENT ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb70c, 0x7fff06fcb708, 0x6914) util.c:162:Changed query state from PENDING to READING net.c:604:Received header 0000 04 01 00 2f 00 38 01 00- |.../.8..| net.c:683:Received packet 0000 ff 11 00 c3 00 00 00 00-00 79 00 00 00 00 ac 0d |........ .y......| 0010 00 00 01 38 00 00 00 26-04 04 01 00 00 00 fe 00 |...8...& ........| 0020 00 e0 00 00 00 00 00 - |.......| token.c:510:processing result tokens. marker is ff(DONEINPROC) token.c:2201:tds_process_end: more_results = 1 was_cancelled = 0 error = 0 done_count_valid = 1 token.c:2232: rows_affected = 0 token.c:510:processing result tokens. marker is 79(RETURNSTATUS) token.c:510:processing result tokens. marker is ac(PARAM) token.c:567:processing parameters for sp 11 token.c:569:calling tds_process_param_result token.c:1198:tds_process_param_result(0x118bef0, 0x7fff06fcb678) token.c:1596:processing result. type = 38(integer-null), varint_size 1 token.c:1617:processing result. column_size 4 token.c:1915:tds_get_data: type 38, varint size 1 token.c:1975:tds_get_data(): wire column size is 4 token.c:573:1 hidden return parameters token.c:510:processing result tokens. marker is fe(DONEPROC) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2217:tds_process_end() state set to TDS_IDLE util.c:162:Changed query state from READING to IDLE token.c:2232: rows_affected = 0 util.c:110:logic error: cannot change query state from IDLE to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4053) ct.c:1100:ct_results() ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb70c, 0x7fff06fcb708, 0x6914) token.c:498:tds_process_tokens() state is COMPLETED ct.c:1157:ct_results() process_result_tokens returned 2 (type 4052) ct.c:215:setting command state from SENT to READY ct.c:3298:ct_dynamic(720) ct.c:4809:_ct_locate_dynamic() looking for DBD1 ct.c:4812:_ct_locate_dynamic() matching with DBD1 ct.c:215:setting command state from READY to READY ct.c:844:ct_send() command_type = 160 ct.c:891:ct_send(CS_DESCRIBE_INPUT) ct.c:215:setting command state from READY to SENT ct.c:1100:ct_results() ct.c:2356:ct_res_info() ct.c:2375:ct_res_info(): Number of columns is 0 ct.c:1100:ct_results() ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb70c, 0x7fff06fcb708, 0x6914) token.c:498:tds_process_tokens() state is COMPLETED ct.c:1157:ct_results() process_result_tokens returned 2 (type 4052) ct.c:215:setting command state from SENT to READY ct.c:3298:ct_dynamic(718) ct.c:4809:_ct_locate_dynamic() looking for DBD1 ct.c:4812:_ct_locate_dynamic() matching with DBD1 ct.c:3339:ct_dynamic() calling param_clear ct.c:215:setting command state from READY to READY ct.c:3358:ct_param() ct.c:3359:ct_param() data addr = 0x11c2fd0 data length = 81 ct.c:4335: _ct_fill_param() status = 0 ct.c:2003:_ct_get_server_type(0) ct.c:844:ct_send() command_type = 160 ct.c:4250:paraminfoalloc: status = 0, maxlen 0 ct.c:4251:paraminfoalloc: name = , varint size 2 column_type 47 size 81, 81 column_cur_size 81 column_output = 0 ct.c:4079:paramrowalloc, size = 81, data = 0x11c24a0, row_size = 0 query.c:1626:tds_submit_execute() mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to QUERYING query.c:1315:tds_put_data_info putting status query.c:1409:tds_put_data: colsize = 81 query.c:1438:tds_put_data: not null param varint_size = 2 util.c:162:Changed query state from QUERYING to PENDING net.c:793:Sending packet 0000 03 01 00 86 00 00 01 00-0a 00 73 00 70 00 5f 00 |........ ..s.p._.| 0010 65 00 78 00 65 00 63 00-75 00 74 00 65 00 00 00 |e.x.e.c. u.t.e...| 0020 00 00 26 04 04 01 00 00-00 00 00 af 51 00 09 04 |..&..... ....Q...| 0030 d0 00 34 51 00 78 78 78-78 78 78 78 78 78 78 78 |..4Q.xxx xxxxxxxx| 0040 78 78 78 78 78 78 78 78-78 78 78 78 78 78 78 78 |xxxxxxxx xxxxxxxx| 0050 78 78 78 78 78 78 78 78-78 78 78 78 78 78 78 78 |xxxxxxxx xxxxxxxx| 0060 78 78 78 78 78 78 78 78-78 78 78 78 78 78 78 78 |xxxxxxxx xxxxxxxx| 0070 78 78 78 78 78 78 78 78-78 78 78 78 78 78 78 78 |xxxxxxxx xxxxxxxx| 0080 78 78 78 78 78 78 - |xxxxxx| ct.c:215:setting command state from READY to SENT ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb2dc, 0x7fff06fcb2d8, 0x6914) util.c:162:Changed query state from PENDING to READING net.c:604:Received header 0000 04 01 00 1f 00 38 01 00- |.....8..| net.c:683:Received packet 0000 ff 11 00 c3 00 01 00 00-00 79 00 00 00 00 fe 00 |........ .y......| 0010 00 e0 00 01 00 00 00 - |.......| token.c:510:processing result tokens. marker is ff(DONEINPROC) token.c:2201:tds_process_end: more_results = 1 was_cancelled = 0 error = 0 done_count_valid = 1 token.c:2232: rows_affected = 1 util.c:162:Changed query state from READING to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4054) token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb2dc, 0x7fff06fcb2d8, 0x6914) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is 79(RETURNSTATUS) token.c:510:processing result tokens. marker is fe(DONEPROC) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2217:tds_process_end() state set to TDS_IDLE util.c:162:Changed query state from READING to IDLE token.c:2232: rows_affected = 1 util.c:110:logic error: cannot change query state from IDLE to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4053) ct.c:2356:ct_res_info() ct.c:2381:ct_res_info(): Number of rows is -1 ct.c:1100:ct_results() ct.c:2356:ct_res_info() ct.c:2381:ct_res_info(): Number of rows is -1 ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb2dc, 0x7fff06fcb2d8, 0x6914) token.c:498:tds_process_tokens() state is COMPLETED ct.c:1157:ct_results() process_result_tokens returned 2 (type 4052) ct.c:215:setting command state from SENT to READY ct.c:641:ct_cmd_alloc() ct.c:215:setting command state from IDLE to IDLE ct.c:665:ct_cmd_alloc() : stepping thru existing commands ct.c:682:ct_command() ct.c:215:setting command state from IDLE to IDLE ct.c:215:setting command state from IDLE to IDLE ct.c:215:setting command state from IDLE to READY ct.c:844:ct_send() command_type = 148 mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to QUERYING write.c:136:tds_put_string converting 18 bytes of "select * from #tmp" write.c:164:tds_put_string wrote 36 bytes util.c:162:Changed query state from QUERYING to PENDING net.c:793:Sending packet 0000 01 01 00 2c 00 00 01 00-73 00 65 00 6c 00 65 00 |...,.... s.e.l.e.| 0010 63 00 74 00 20 00 2a 00-20 00 66 00 72 00 6f 00 |c.t. .*. .f.r.o.| 0020 6d 00 20 00 23 00 74 00-6d 00 70 00 |m. .#.t. m.p.| ct.c:215:setting command state from READY to SENT ct.c:965:ct_send() succeeded ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb2cc, 0x7fff06fcb2c8, 0x6914) util.c:162:Changed query state from PENDING to READING net.c:604:Received header 0000 04 01 00 8a 00 38 01 00- |.....8..| net.c:683:Received packet 0000 81 01 00 00 00 08 00 af-64 00 09 04 d0 00 34 01 |........ d.....4.| 0010 78 00 d1 64 00 78 78 78-78 78 78 78 78 78 78 78 |x..d.xxx xxxxxxxx| 0020 78 78 78 78 78 78 78 78-78 78 78 78 78 78 78 78 |xxxxxxxx xxxxxxxx| 0030 78 78 78 78 78 78 78 78-78 78 78 78 78 78 78 78 |xxxxxxxx xxxxxxxx| 0040 78 78 78 78 78 78 78 78-78 78 78 78 78 78 78 78 |xxxxxxxx xxxxxxxx| 0050 78 78 78 78 78 78 78 78-78 78 78 78 78 78 78 78 |xxxxxxxx xxxxxxxx| 0060 78 78 78 78 78 20 20 20-20 20 20 20 20 20 20 20 |xxxxx | 0070 20 20 20 20 20 20 20 20-20 fd 10 00 c1 00 01 00 | .......| 0080 00 00 - |..| token.c:510:processing result tokens. marker is 81(TDS7_RESULT) token.c:1520:processing TDS7 result metadata. mem.c:609:tds_free_all_results() token.c:1544:set current_results (1 column) to tds->res_info token.c:1555:setting up column 0 token.c:3294:adjust_character_column_size: Server charset: CP1252 Server column_size: 100 Client charset: ISO-8859-1 Client column_size: 100 token.c:1490:tds7_get_data_info: colname = x (1 bytes) type = 47 (char) server's type = 175 (xchar) column_varint_size = 2 column_size = 100 (100 on server) util.c:162:Changed query state from READING to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4049) token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb2cc, 0x7fff06fcb2c8, 0x6914) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is d1(ROW) token.c:621:tds_process_tokens::SET_RETURN stopping on current token util.c:162:Changed query state from READING to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4040) ct.c:2356:ct_res_info() ct.c:2375:ct_res_info(): Number of columns is 1 ct.c:2300:ct_describe() ct.c:1890:_ct_get_client_type(type 47, user 0, size 100) ct.c:2321:ct_describe() datafmt->datatype = 0 server type 47 ct.c:1434:ct_bind() datafmt count = 1 column_number = 1 ct.c:2356:ct_res_info() ct.c:2375:ct_res_info(): Number of columns is 1 ct.c:1490:ct_fetch() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb7bc, (nil), 0x1608) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is d1(ROW) token.c:2166:tds_process_row(): reading column 0 token.c:1915:tds_get_data: type 47, varint size 2 token.c:1975:tds_get_data(): wire column size is 100 util.c:162:Changed query state from READING to PENDING ct.c:1555:inside ct_fetch()process_row_tokens returned 1 ct.c:1704:_ct_bind_data() ct.c:1711:_ct_bind_data(): column_type: 47 column_len: 100 ct.c:2003:_ct_get_server_type(0) ct.c:1890:_ct_get_client_type(type 47, user 0, size 100) cs.c:463:cs_convert() ct.c:2003:_ct_get_server_type(0) ct.c:2003:_ct_get_server_type(0) cs.c:470:cs_convert() srctype = 47 (100) desttype = 47 (101) cs.c:495:cs_convert() srctype = desttype cs.c:531:cs_convert() desttype = character ct.c:2356:ct_res_info() ct.c:2375:ct_res_info(): Number of columns is 1 ct.c:1490:ct_fetch() ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb6ec, 0x7fff06fcb6e8, 0x6914) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is fd(DONE) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 1 token.c:2217:tds_process_end() state set to TDS_IDLE util.c:162:Changed query state from READING to IDLE token.c:2232: rows_affected = 1 util.c:110:logic error: cannot change query state from IDLE to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4052) ct.c:1262:ct_results() results state = 2 ct.c:1263:ct_results() command type = 148 ct.c:1264:ct_results() dynamic cmd = 0 ct.c:2356:ct_res_info() ct.c:2381:ct_res_info(): Number of rows is 1 ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb6ec, 0x7fff06fcb6e8, 0x6914) token.c:498:tds_process_tokens() state is COMPLETED ct.c:1157:ct_results() process_result_tokens returned 2 (type 4052) ct.c:215:setting command state from SENT to READY ct.c:1799:ct_cmd_drop() ct.c:1830:ct_cmd_drop() : command entry found in list ct.c:1835:ct_cmd_drop() : relinking list ct.c:1842:ct_cmd_drop() : relinked list ct.c:3298:ct_dynamic(711) ct.c:4809:_ct_locate_dynamic() looking for DBD1 ct.c:4812:_ct_locate_dynamic() matching with DBD1 ct.c:215:setting command state from READY to READY ct.c:844:ct_send() command_type = 160 query.c:1727:tds_submit_unprepare() DBD1 mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to QUERYING util.c:162:Changed query state from QUERYING to PENDING net.c:793:Sending packet 0000 03 01 00 17 00 00 01 00-ff ff 0f 00 00 00 00 00 |........ ........| 0010 26 04 04 01 00 00 00 - |&......| ct.c:215:setting command state from READY to SENT ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb5dc, 0x7fff06fcb5d8, 0x6914) util.c:162:Changed query state from PENDING to READING net.c:604:Received header 0000 04 01 00 16 00 38 01 00- |.....8..| net.c:683:Received packet 0000 79 00 00 00 00 fe 00 00-e0 00 01 00 00 00 |y....... ......| token.c:510:processing result tokens. marker is 79(RETURNSTATUS) token.c:510:processing result tokens. marker is fe(DONEPROC) token.c:2201:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2217:tds_process_end() state set to TDS_IDLE util.c:162:Changed query state from READING to IDLE token.c:2232: rows_affected = 1 util.c:110:logic error: cannot change query state from IDLE to PENDING ct.c:1157:ct_results() process_result_tokens returned 1 (type 4053) ct.c:1100:ct_results() ct.c:1100:ct_results() token.c:495:tds_process_tokens(0x118bef0, 0x7fff06fcb5dc, 0x7fff06fcb5d8, 0x6914) token.c:498:tds_process_tokens() state is COMPLETED ct.c:1157:ct_results() process_result_tokens returned 2 (type 4052) ct.c:215:setting command state from SENT to READY ct.c:4844:ct_deallocate_dynamic() : command entry found in list ct.c:4857:ct_deallocate_dynamic() : relinking list ct.c:4864:ct_deallocate_dynamic() : relinked list ct.c:1799:ct_cmd_drop() ct.c:1830:ct_cmd_drop() : command entry found in list ct.c:1835:ct_cmd_drop() : relinking list ct.c:1842:ct_cmd_drop() : relinked list ct.c:1853:ct_close() mem.c:609:tds_free_all_results() util.c:162:Changed query state from IDLE to DEAD ct.c:1865:ct_con_drop()