src/dblib/unittests/bcp

Main

Hostnameobol602
uname -aLinux obol602 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 x86_64 GNU/Linux
date2009-12-16

==23079== Memcheck, a memory error detector
==23079== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==23079== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h for copyright info
==23079== Command: ./bcp
==23079== 
--23079-- Valgrind options:
--23079--    --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--23079--    --tool=memcheck
--23079--    --num-callers=20
--23079--    --leak-check=yes
--23079--    -v
--23079--    --show-reachable=yes
--23079--    --log-fd=3
--23079--    --suppressions=/home/freddy/suppressions.supp
--23079-- Contents of /proc/version:
--23079--   Linux version 2.6.31-16-generic (buildd@crested) (gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8) ) #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009
--23079-- Arch and hwcaps: AMD64, amd64-sse3-cx16
--23079-- Page sizes: currently 4096, max supported 4096
--23079-- Valgrind library directory: /usr/lib/valgrind
--23079-- Reading syms from /mnt/sync/freetds/ftds_comp83/src/dblib/unittests/bcp (0x400000)
--23079-- Reading syms from /lib/ld-2.10.1.so (0x4000000)
--23079-- Reading debug info from /lib/ld-2.10.1.so ..
--23079-- .. CRC mismatch (computed 27e0048f wanted 447ba3bc)
--23079-- Reading debug info from /usr/lib/debug/lib/ld-2.10.1.so ..
--23079-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux (0x38000000)
--23079--    object doesn't have a dynamic symbol table
--23079-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--23079-- Reading suppressions file: /home/freddy/suppressions.supp
--23079-- Reading suppressions file: /usr/lib/valgrind/default.supp
--23079-- REDIR: 0x4017050 (strlen) redirected to 0x3803fa17 (vgPlain_amd64_linux_REDIR_FOR_strlen)
--23079-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so (0x4a20000)
--23079-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so (0x4c22000)
==23079== WARNING: new redirection conflicts with existing -- ignoring it
--23079--     new: 0x04017050 (strlen              ) R-> 0x04c26210 strlen
--23079-- REDIR: 0x4016ec0 (index) redirected to 0x4c25f60 (index)
--23079-- REDIR: 0x4016f40 (strcmp) redirected to 0x4c26510 (strcmp)
--23079-- Reading syms from /mnt/sync/freetds/ftds_comp83/src/dblib/.libs/libsybdb.so.5.0.0 (0x4e2a000)
--23079-- Reading syms from /lib/librt-2.10.1.so (0x50ed000)
--23079-- Reading debug info from /lib/librt-2.10.1.so ..
--23079-- .. CRC mismatch (computed e0bf5db1 wanted 745ed498)
--23079-- Reading debug info from /usr/lib/debug/lib/librt-2.10.1.so ..
--23079-- Reading syms from /usr/lib/libgnutls.so.26.14.10 (0x52f5000)
--23079-- Reading debug info from /usr/lib/libgnutls.so.26.14.10 ..
--23079-- .. CRC mismatch (computed e962bb1e wanted 1627984e)
--23079-- Reading debug info from /usr/lib/debug/usr/lib/libgnutls.so.26.14.10 ..
--23079-- Reading syms from /lib/libpthread-2.10.1.so (0x5597000)
--23079-- Reading debug info from /lib/libpthread-2.10.1.so ..
--23079-- .. CRC mismatch (computed 217e8639 wanted 7a12e000)
--23079-- Reading debug info from /usr/lib/debug/lib/libpthread-2.10.1.so ..
--23079-- Reading syms from /lib/libc-2.10.1.so (0x57b3000)
--23079-- Reading debug info from /lib/libc-2.10.1.so ..
--23079-- .. CRC mismatch (computed 9003397f wanted a4efd6e8)
--23079-- Reading debug info from /usr/lib/debug/lib/libc-2.10.1.so ..
--23079-- Reading syms from /usr/lib/libtasn1.so.3.1.5 (0x5b22000)
--23079-- Reading debug info from /usr/lib/libtasn1.so.3.1.5 ..
--23079-- .. CRC mismatch (computed 9c17bda6 wanted d502479b)
--23079--    object doesn't have a symbol table
--23079-- Reading syms from /lib/libz.so.1.2.3.3 (0x5d33000)
--23079-- Reading debug info from /lib/libz.so.1.2.3.3 ..
--23079-- .. CRC mismatch (computed 3957eb9d wanted 90f25be3)
--23079--    object doesn't have a symbol table
--23079-- Reading syms from /lib/libgcrypt.so.11.5.2 (0x5f4a000)
--23079-- Reading debug info from /lib/libgcrypt.so.11.5.2 ..
--23079-- .. CRC mismatch (computed 77ef73e7 wanted f3b95632)
--23079-- Reading debug info from /usr/lib/debug/lib/libgcrypt.so.11.5.2 ..
--23079-- Reading syms from /lib/libgpg-error.so.0.4.0 (0x61c2000)
--23079-- Reading debug info from /lib/libgpg-error.so.0.4.0 ..
--23079-- .. CRC mismatch (computed 5580a1c2 wanted 3127cddf)
--23079--    object doesn't have a symbol table
--23079-- REDIR: 0x58327e0 (rindex) redirected to 0x4c25dc0 (rindex)
--23079-- REDIR: 0x58323b0 (strlen) redirected to 0x4c261d0 (strlen)
--23079-- REDIR: 0x582d780 (malloc) redirected to 0x4c250d1 (malloc)
--23079-- REDIR: 0x58354c0 (memcpy) redirected to 0x4c265e0 (memcpy)
--23079-- REDIR: 0x5831e20 (strcmp) redirected to 0x4c264c0 (strcmp)
--23079-- REDIR: 0x5834020 (memset) redirected to 0x4c27080 (memset)
--23079-- REDIR: 0x5831e60 (strcpy) redirected to 0x4c26230 (strcpy)
--23079-- REDIR: 0x58338d0 (memchr) redirected to 0x4c265b0 (memchr)
--23079-- REDIR: 0x582d6a0 (free) redirected to 0x4c24ce1 (free)
--23079-- REDIR: 0x5837e90 (strchrnul) redirected to 0x4c27160 (strchrnul)
found sybase.FreeTDS for testuser in "../../../PWD"
--23079-- REDIR: 0x5834b50 (mempcpy) redirected to 0x4c271b0 (mempcpy)
SQL text will be read from ./bcp.sql
Starting ./bcp
--23079-- REDIR: 0x582cd70 (calloc) redirected to 0x4c243c9 (calloc)
About to logon
About to open sybase.FreeTDS
--23079-- REDIR: 0x5833950 (bcmp) redirected to 0x4c26d70 (bcmp)
--23079-- REDIR: 0x5835170 (stpcpy) redirected to 0x4c26e10 (stpcpy)
--23079-- Reading syms from /lib/libnss_compat-2.10.1.so (0x67c6000)
--23079-- Reading debug info from /lib/libnss_compat-2.10.1.so ..
--23079-- .. CRC mismatch (computed 87a816bf wanted 753a1f07)
--23079-- Reading debug info from /usr/lib/debug/lib/libnss_compat-2.10.1.so ..
--23079-- Reading syms from /lib/libnsl-2.10.1.so (0x69cf000)
--23079-- Reading debug info from /lib/libnsl-2.10.1.so ..
--23079-- .. CRC mismatch (computed 3749f1e8 wanted 750c9fd1)
--23079-- Reading debug info from /usr/lib/debug/lib/libnsl-2.10.1.so ..
--23079-- Reading syms from /lib/libnss_nis-2.10.1.so (0x6be9000)
--23079-- Reading debug info from /lib/libnss_nis-2.10.1.so ..
--23079-- .. CRC mismatch (computed 2839fa35 wanted 4fda88b3)
--23079-- Reading debug info from /usr/lib/debug/lib/libnss_nis-2.10.1.so ..
--23079-- Reading syms from /lib/libnss_files-2.10.1.so (0x6df4000)
--23079-- Reading debug info from /lib/libnss_files-2.10.1.so ..
--23079-- .. CRC mismatch (computed 1e8ecf79 wanted 95e01138)
--23079-- Reading debug info from /usr/lib/debug/lib/libnss_files-2.10.1.so ..
--23079-- REDIR: 0x5831da0 (index) redirected to 0x4c25e60 (index)
--23079-- REDIR: 0x5832580 (strncmp) redirected to 0x4c26450 (strncmp)
--23079-- REDIR: 0x5832660 (strncpy) redirected to 0x4c26300 (strncpy)
--23079-- REDIR: 0x5837e30 (rawmemchr) redirected to 0x4c27190 (rawmemchr)
--23079-- Reading syms from /usr/lib/gconv/ISO8859-1.so (0x7001000)
--23079-- Reading debug info from /usr/lib/gconv/ISO8859-1.so ..
--23079-- .. CRC mismatch (computed cb3aff31 wanted 2fb673ac)
--23079-- Reading debug info from /usr/lib/debug/usr/lib/gconv/ISO8859-1.so ..
--23079-- REDIR: 0x4017ae0 (stpcpy) redirected to 0x4c26fb0 (stpcpy)
--23079-- REDIR: 0x582e4c0 (realloc) redirected to 0x4c25182 (realloc)
Dropping sybase.FreeTDS..all_types_bcp_unittest
	  1: if exists (select 1 from sysobjects where type = 'U' and name = 'all_types_bcp_unittest') drop table all_types_bcp_unittest
Creating sybase.FreeTDS..all_types_bcp_unittest
	  1: CREATE TABLE all_types_bcp_unittest (
	  2: 	  not_null_bit			bit NOT NULL
--23079-- REDIR: 0x5831be0 (strcat) redirected to 0x4c25fa0 (strcat)
	  3: 
	  4: 	, not_null_char			char(10) NOT NULL
	  5: 	, not_null_varchar		varchar(10) NOT NULL
	  6: 
	  7: 	, not_null_datetime		datetime NOT NULL
	  8: 	, not_null_smalldatetime	smalldatetime NOT NULL
	  9: 
	 10: 	, not_null_money		money NOT NULL
	 11: 	, not_null_smallmoney		smallmoney NOT NULL
	 12: 
	 13: 	, not_null_float		float NOT NULL
	 14: 	, not_null_real			real NOT NULL
	 15: 
	 16: 	, not_null_decimal		decimal(5,2) NOT NULL
	 17: 	, not_null_numeric		numeric(5,2) NOT NULL
	 18: 
	 19: 	, not_null_int			int NOT NULL
	 20: 	, not_null_smallint		smallint NOT NULL
	 21: 	, not_null_tinyint		tinyint NOT NULL
	 22: 
	 23: 	, nullable_char			char(10)  NULL
	 24: 	, nullable_varchar		varchar(10)  NULL
	 25: 
	 26: 	, nullable_datetime		datetime  NULL
	 27: 	, nullable_smalldatetime	smalldatetime  NULL
	 28: 
	 29: 	, nullable_money		money  NULL
	 30: 	, nullable_smallmoney		smallmoney  NULL
	 31: 
	 32: 	, nullable_float		float  NULL
	 33: 	, nullable_real			real  NULL
	 34: 
	 35: 	, nullable_decimal		decimal(5,2)  NULL
	 36: 	, nullable_numeric		numeric(5,2)  NULL
	 37: 
	 38: 	, nullable_int			int  NULL
	 39: 	, nullable_smallint		smallint  NULL
	 40: 	, nullable_tinyint		tinyint  NULL
	 41: 
	 42: 	/* Excludes: 
	 43: 	 * binary
	 44: 	 * image
	 45: 	 * uniqueidentifier
	 46: 	 * varbinary
	 47: 	 * text
	 48: 	 * timestamp
	 49: 	 * nchar
	 50: 	 * ntext
	 51: 	 * nvarchar
	 52: 	 */
	 53: )
	 54: 
	 55: INSERT all_types_bcp_unittest   
	 56: VALUES ( 1 -- not_null_bit
	 57: 
	 58: 	, 'a char' -- not_null_char
	 59: 	, 'a varchar' -- not_null_varchar
	 60: 
	 61: 	, 'Dec 17 2003  3:44PM' -- not_null_datetime
	 62: 	, 'Dec 17 2003  3:44PM' -- not_null_smalldatetime
	 63: 
	 64: 	, 12.34 -- not_null_money
	 65: 	, 12.34 -- not_null_smallmoney
	 66: 
	 67: 	, 12.34 -- not_null_float
	 68: 	, 12.34 -- not_null_real
	 69: 
	 70: 	, 12.34 -- not_null_decimal
	 71: 	, 12.34 -- not_null_numeric
	 72: 
	 73: 	, 1234 -- not_null_int
	 74: 	, 1234 -- not_null_smallint
	 75: 	, 123  -- not_null_tinyint
	 76: 
	 77: 	, 'a char' -- nullable_char
	 78: 	, 'a varchar' -- nullable_varchar
	 79: 
	 80: 	, 'Dec 17 2003  3:44PM' -- nullable_datetime
	 81: 	, 'Dec 17 2003  3:44PM' -- nullable_smalldatetime
	 82: 
	 83: 	, 12.34 -- nullable_money
	 84: 	, 12.34 -- nullable_smallmoney
	 85: 
	 86: 	, 12.34 -- nullable_float
	 87: 	, 12.34 -- nullable_real
	 88: 
	 89: 	, 12.34 -- nullable_decimal
	 90: 	, 12.34 -- nullable_numeric
	 91: 
	 92: 	, 1234 -- nullable_int
	 93: 	, 1234 -- nullable_smallint
	 94: 	, 123  -- nullable_tinyint
	 95: )
	 96: INSERT all_types_bcp_unittest
	 97: 				( not_null_bit			
	 98: 
	 99: 				, not_null_char			
	100: 				, not_null_varchar		
	101: 
	102: 				, not_null_datetime		
	103: 				, not_null_smalldatetime	
	104: 
	105: 				, not_null_money		
	106: 				, not_null_smallmoney		
	107: 
	108: 				, not_null_float		
	109: 				, not_null_real			
	110: 
	111: 				, not_null_decimal		
	112: 				, not_null_numeric		
	113: 
	114: 				, not_null_int			
	115: 				, not_null_smallint		
	116: 				, not_null_tinyint		
	117: 				) 
	118: VALUES (
	119: 	  1 -- not_null_bit
	120: 
	121: 	, 'a char' -- not_null_char
	122: 	, 'a varchar' -- not_null_varchar
	123: 
	124: 	, 'Dec 17 2003  3:44PM' -- not_null_datetime
	125: 	, 'Dec 17 2003  3:44PM' -- not_null_smalldatetime
	126: 
	127: 	, 12.34 -- not_null_money
	128: 	, 12.34 -- not_null_smallmoney
	129: 
	130: 	, 12.34 -- not_null_float
	131: 	, 12.34 -- not_null_real
	132: 
	133: 	, 12.34 -- not_null_decimal
	134: 	, 12.34 -- not_null_numeric
	135: 
	136: 	, 1234 -- not_null_int
	137: 	, 1234 -- not_null_smallint
	138: 	, 123  -- not_null_tinyint
	139: )
	  1: select colid, cast(c.name as varchar(30)) as name, c.length , '  '+ substring('NY', convert(bit,(c.status & 8))+1,1) as Nulls from syscolumns as c left join systypes as t on c.usertype = t.usertype where c.id = object_id('all_types_bcp_unittest') order by colid
--23079-- REDIR: 0x5832400 (strnlen) redirected to 0x4c26190 (strnlen)
colid  name                           length      Nulls
------ ------------------------------ ----------- -----
1      not_null_bit                   1             N  
2      not_null_char                  10            N  
3      not_null_varchar               10            N  
4      not_null_datetime              8             N  
5      not_null_smalldatetime         4             N  
6      not_null_money                 8             N  
7      not_null_smallmoney            4             N  
8      not_null_float                 8             N  
9      not_null_real                  4             N  
10     not_null_decimal               4             N  
11     not_null_numeric               4             N  
12     not_null_int                   4             N  
13     not_null_smallint              2             N  
14     not_null_tinyint               1             N  
15     nullable_char                  10            Y  
16     nullable_varchar               10            Y  
17     nullable_datetime              8             Y  
18     nullable_smalldatetime         4             Y  
19     nullable_money                 8             Y  
20     nullable_smallmoney            4             Y  
21     nullable_float                 8             Y  
22     nullable_real                  4             Y  
23     nullable_decimal               4             Y  
24     nullable_numeric               4             Y  
25     nullable_int                   4             Y  
26     nullable_smallint              2             Y  
27     nullable_tinyint               1             Y  
ok
preparing to insert into FreeTDS..all_types_bcp_unittest ... OK
Sending same row 10 times... 
Sending 5 more rows ... 
OK
15 rows copied.
done
	  1: select   'nullable_char' as col, count(*) nrows, datalength(nullable_char) as len, nullable_char as value from all_types_bcp_unittest group by nullable_char
	  2: UNION
	  3: select   'nullable_varchar' as col, count(*) nrows, datalength(nullable_varchar) as len, nullable_varchar as value from all_types_bcp_unittest group by nullable_varchar
	  4: UNION
	  5: select   'nullable_int' as col, count(*) nrows, datalength(nullable_int) as len, cast(nullable_int as varchar(6))as value from all_types_bcp_unittest group by nullable_int
	  6: order by col, len, nrows
	  7: 
col              nrows       len         value     
---------------- ----------- ----------- ----------
nullable_char    11          NULL        NULL      
nullable_char    6           6           a char    
nullable_int     11          NULL        NULL      
nullable_int     6           4           1234      
nullable_varchar 11          NULL        NULL      
nullable_varchar 6           9           a varchar 
Dropping table all_types_bcp_unittest
	  1: drop table all_types_bcp_unittest
bcp.c OK
--23079-- Discarding syms at 0x70014d0-0x7002058 in /usr/lib/gconv/ISO8859-1.so due to munmap()
--23079-- Discarding syms at 0x67c7310-0x67cc2c8 in /lib/libnss_compat-2.10.1.so due to munmap()
--23079-- Discarding syms at 0x6beb020-0x6bf14a8 in /lib/libnss_nis-2.10.1.so due to munmap()
--23079-- Discarding syms at 0x69d30c0-0x69e0978 in /lib/libnsl-2.10.1.so due to munmap()
--23079-- Discarding syms at 0x6df6170-0x6dfdb68 in /lib/libnss_files-2.10.1.so due to munmap()
==23079== 
==23079== HEAP SUMMARY:
==23079==     in use at exit: 300 bytes in 11 blocks
==23079==   total heap usage: 809 allocs, 798 frees, 570,003 bytes allocated
==23079== 
==23079== Searching for pointers to 11 not-freed blocks
==23079== Checked 245,560 bytes
==23079== 
==23079== LEAK SUMMARY:
==23079==    definitely lost: 0 bytes in 0 blocks
==23079==    indirectly lost: 0 bytes in 0 blocks
==23079==      possibly lost: 0 bytes in 0 blocks
==23079==    still reachable: 0 bytes in 0 blocks
==23079==         suppressed: 300 bytes in 11 blocks
==23079== 
==23079== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 5)
--23079-- 
--23079-- used_suppression:      1 getpwuid_r leak 3
--23079-- used_suppression:      5 getpwuid_r leak 2
--23079-- used_suppression:      5 getpwuid_r leak 1
--23079-- used_suppression:      2 Debian libc6 (2.10.x) stripped dynamic linker
--23079-- used_suppression:      2 Debian libc6 (2.10.x) stripped dynamic linker
==23079== 
==23079== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 5)

Main