[freetds] dblib bcp, t0017 broken

Thompson, Bill D (London) bill_d_thompson at ml.com
Fri Jan 27 07:15:25 EST 2006


Freddy

$ od -x t0017.in

0000000 0411 2233 4445 0000 0070 726f 7661 2064
0000020 6920 7465 7374 6f20 7175 6573 746f 2074
0000040 6573 746f 2064 6f76 7265 6262 6520 616e

so in the file there is a one byte prefix-len for the integer 
but we're telling bcp there is no prefix (because column is not null on
database)

11:56:31.013669 parsing host column 1
11:56:31.013725 prefix_len = 0 collen = 0
11:56:31.013765 Reading 4 bytes from hostfile.

remove that 1st byte form the file and things go much better...

"strange" data...

0030 00 30 00 30 00 31 00 37-00 02 63 00 32 00 d1 44 |.0.0.1.7 ..c.2..D|
0040 33 22 11 10 ff ff ff ff-ff ff ff ff ff ff ff ff |3"...... ........|
0050 ff ff ff ff ff ff ff ff-ff ff ff ff 45 00 00 00 |........ ....E...|
0060 70 72 6f 76 61 20 64 69-20 74 65 73 74 6f 20 71 |prova di  testo q|
0070 75 65 73 74 6f 20 74 65-73 74 6f 20 64 6f 76 72 |uesto te sto dovr|
0080 65 62 62 65 20 61 6e 64-61 72 65 20 61 20 66 69 |ebbe and are a fi|
0090 6e 69 72 65 20 69 6e 20-75 6e 20 63 61 6d 70 6f |nire in  un campo|
00a0 20 74 65 78 74         -                        | text|

d1           = row marker
44 33 22 11  = int data

0x10         = 16
followed by 16 * 0xff

This is the dummy textptr 

followed by 8 * 0xff

this is Dummy timestamp

45 00 00 00 length of text data to follow = 69

followed by 69 bytes of (italian) text

HTH,

Bill


-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of ZIGLIO,
Frediano, VF-IT
Sent: 27 January 2006 10:58
To: FreeTDS Development Group
Subject: [freetds] dblib bcp, t0017 broken


This tests insert invalid data cause it use not-nullable data type
(0x38) and length, 

11:49:23.803188 (net.c:673):Sending packet
0000 01 01 00 58 00 00 01 00-69 00 6e 00 73 00 65 00 |...X.... i.n.s.e.|
0010 72 00 74 00 20 00 62 00-75 00 6c 00 6b 00 20 00 |r.t. .b. u.l.k. .|
0020 64 00 62 00 6c 00 69 00-62 00 30 00 30 00 31 00 |d.b.l.i. b.0.0.1.|
0030 37 00 20 00 28 00 63 00-31 00 20 00 69 00 6e 00 |7. .(.c. 1. .i.n.|
0040 74 00 2c 00 20 00 63 00-32 00 20 00 74 00 65 00 |t.,. .c. 2. .t.e.|
0050 78 00 74 00 29 00 20 00-                        |x.t.). .|

start a bulk insert

11:49:23.803609 (util.c:119):Changing query state from PENDING to
READING
11:49:23.804916 (net.c:446):Received header
0000 04 01 00 11 00 38 01 00-                        |.....8..|

11:49:23.805053 (net.c:542):Received packet
0000 fd 00 00 c3 00 00 00 00-00                      |........ .|

ok from server

11:49:23.810320 (net.c:673):Sending packet
0000 07 01 00 a2 00 00 01 00-81 02 00 00 00 08 00 38 |........ .......8|

type 0x38 == not nullable integer (that is no size)

0010 02 63 00 31 00 00 00 08-00 23 00 fc 00 00 09 04 |.c.1.... .#......|
0020 d0 00 00 09 00 64 00 62-00 6c 00 69 00 62 00 30 |.....d.b .l.i.b.0|
0030 00 30 00 31 00 37 00 02-63 00 32 00 d1 04 11 22 |.0.1.7.. c.2...."|

0xd1 start data
0x04 data length ???
0x112233 data ?? (data in source file was 0x11223344)

0040 33 10 ff ff ff ff ff ff-ff ff ff ff ff ff ff ff |3....... ........|
0050 ff ff ff ff ff ff ff ff-ff ff 44 00 00 00 45 00 |........ ..D...E.|

what this strange data ?? Data in file was 0x45 long but here there is 2
time a size (44 00 00 00 and 45 00 00 00)

0060 00 00 70 72 6f 76 61 20-64 69 20 74 65 73 74 6f |..prova  di testo|
0070 20 71 75 65 73 74 6f 20-74 65 73 74 6f 20 64 6f | questo  testo do|
0080 76 72 65 62 62 65 20 61-6e 64 61 72 65 20 61 20 |vrebbe a ndare a |
0090 66 69 6e 69 72 65 20 69-6e 20 75 6e 20 63 61 6d |finire i n un cam|
00a0 70 6f                  -                        |po|

>From db (changing #dblib0017 to dblib0017 in test)

select * from test.dblib0017

c1          c2

----------- ---------------
857870596   E

857870596 = 0x33221104

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

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------



More information about the FreeTDS mailing list