Skip to Content.
Sympa Menu

freetds - RE: [freetds] Problem with bcp and bigendian machine

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Problem with bcp and bigendian machine
  • Date: Fri, 12 Mar 2004 15:30:30 -0500

> From: ZIGLIO, Frediano, VF-IT [mailto:Frediano.Ziglio AT vodafone.com]
> Sent: March 12, 2004 8:02 AM
>
> I got this problem with bcp test
>
...
> Unclosed quotation mark before the character string 'insert bulk
> temp13:53:32.171087 tds_put_string convertin020 32 30 20 7c 20 36 62
> 20-32 30 20 37 20 34 20 36 |20 | 6b 20 7 4 6|
> 0030 35 20 36 64 20 7c 0a 30-30 32 30 20 33 32 20 33 |5 00-73 00 74 00
> 72 00 69 00 |p.u.t._. s.t.r.i.|
> 0060 6e 00 67 00 20 00 63 00-6f 00 6e 00 76 00 65 00 |n.g.
> .c. o.n.v.e.|
> 0070 72 90 7c 32 30 20 33 30 20 32-30 2...
> DB-LIBRARY error (severity 11, dberr 20599, oserr -1, dberrstr
> Unrecognized bcp datatype in server table., oserrstr OpenClient):
> send failed

Well, that is the weirdest dump I've looked at in while. What's going on
with this?


0650 6c 6c 5f 64 65 63 69 6d-61 6c 0a 09 2c 20 31 32 |ll_decim al.., 12|
0660 2e 33 34 20 2d 2d 20 6e-6f 74 5f 6e 75 6c 6c 5f |.34 -- n ot_null_|
0670 6e 75 6d 65 72 69 63 0a-0a 09 2c 20 31 32 33 34 |numeric. .., 1234|
0680 20 2d 2d 20 6e 6f 74 5f-6e 75 6c 6c 5f 69 6e 74 | -- not_ null_int|
0690 0a 09 2c 20 31 32 33 34-20 2d 2d 20 6e 6f 74 5f |.., 1234 -- not_|
06a0 6e 75 6c 6c 5f 73 6d 61-6c 6c 69 6e 74 0a 09 2c |null_sma llint..,|
06b0 20 31 32 33 20 20 2d 2d-20 6e 6f 74 5f 6e 75 6c | 123 -- not_nul|
06c0 6c 5f 74 69 6e 79 69 6e-74 0a 29 0a |l_tinyin t.).|
^^ ^^

For 0x0A, the ASCII part of the hex dump writes a newline instead of a '.'?

|
06d0 6c 6c 5f 64 65 63 69 6d-61 6c 0a 09 2c 20 31 32 |ll_decim al.., 12|
06e0 2e 33 34 20 2d 2d 20 6e-6f 74 5f 6e 75 6c 6c 5f |.34 -- n ot_null_|
06f0 6e 75 6d 65 72 69 63 0a-0a 09 2c 20 31 32 33 34 |numeric. .., 1"
65 72 69 63 0a-0a 09 2c 20 31 32 33 34 |numeric. .., 1"
^^^^^^^ this line is a repeat; don't know why.
13:53:32.183244 Error: tds_put_string: Gave up converting 377 bytes due to
error 7.
Troublesome bytes:
0000 30 30 20 37 34 20 30 30-20 36 39 20 30 30 20 36 |00 74 00 69 00 6|
0010 65 20 30 30 2d 36 37 20-30 30 20 32 30 20 30 30 |e 00-67 00 20 00|
0020 20 33 37 20 30 30 20 33-36 20 30 30 20 7c 72 2e | 37 00 3 6 00 |r.|
0030 74 2e 69 2e 6e 2e 20 67-2e 20 2e 37 2e 36 2e 7c |t.i.n. g . .7.6.||

This looks seriously confused. What could "rting76" be about? Bytes 0-2c
are a string of UCS-2 hex digits that decode to that string, which appears
again as ASCII in bytes 2e-3e (with ASCII '.' interleaved). It looks like a
hexdump of a hexdump. Surely not good input for tds_put_string().

I cannot reproduce it. HEAD works fine on i386 NetBSD.

However, I do see an implementation error that I know I fixed previously:

DB-LIBRARY error (severity 1, dberr 20068, oserr -1, dberrstr Batch
successfully bulk-copied to SQL Server., oserrstr OpenClient):

This message should not be produced by src/dblib/unittests/bcp.c. It uses
only bcp_sendrow() and bcp_batch(); the message should be emitted only by
bcp_exec(). We established as much back in December IIRC.

--jkl



-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.
If you, as the intended recipient of this message, the purpose of which is to
inform and update our clients, prospects and consultants of developments
relating to our services and products, would not like to receive further
e-mail correspondence from the sender, please "reply" to the sender
indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New York,
NY 10105.






Archive powered by MHonArc 2.6.24.

Top of Page