src/dblib/unittests/t0005

Main

Hostnamekrb5.freetds.io
uname -aLinux krb5.freetds.io 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
date2024-03-23

==10877== Memcheck, a memory error detector
==10877== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==10877== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==10877== Command: ./t0005
==10877== 
--10877-- Valgrind options:
--10877--    --tool=memcheck
--10877--    --vgdb=no
--10877--    --num-callers=20
--10877--    --leak-check=yes
--10877--    -v
--10877--    --show-reachable=yes
--10877--    --log-fd=3
--10877--    --suppressions=/home/test/suppressions.supp
--10877--    --track-origins=yes
--10877-- Contents of /proc/version:
--10877--   Linux version 4.15.0-213-generic (buildd@lcy02-amd64-079) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
--10877-- 
--10877-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--10877-- Page sizes: currently 4096, max supported 4096
--10877-- Valgrind library directory: /usr/lib/valgrind
--10877-- Reading syms from /home/test/ftdstmp/ftds_comp100/test1/src/dblib/unittests/t0005
--10877-- Reading syms from /lib/x86_64-linux-gnu/ld-2.27.so
--10877--   Considering /lib/x86_64-linux-gnu/ld-2.27.so ..
--10877--   .. CRC mismatch (computed 2977d8b2 wanted c64f09ed)
--10877--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.27.so ..
--10877--   .. CRC is valid
--10877-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--10877--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--10877--   .. CRC mismatch (computed 41ddb025 wanted 9972f546)
--10877--    object doesn't have a symbol table
--10877--    object doesn't have a dynamic symbol table
--10877-- Scheduler: using generic scheduler lock implementation.
--10877-- Reading suppressions file: /home/test/suppressions.supp
--10877-- Reading suppressions file: /usr/lib/valgrind/default.supp
--10877-- REDIR: 0x4020d20 (ld-linux-x86-64.so.2:strlen) redirected to 0x580608c1 (???)
--10877-- REDIR: 0x4020b00 (ld-linux-x86-64.so.2:index) redirected to 0x580608db (???)
--10877-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--10877--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--10877--   .. CRC mismatch (computed 50df1b30 wanted 4800a4cf)
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--10877--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--10877--   .. CRC mismatch (computed f893b962 wanted 95ee359e)
--10877--    object doesn't have a symbol table
==10877== WARNING: new redirection conflicts with existing -- ignoring it
--10877--     old: 0x04020d20 (strlen              ) R-> (0000.0) 0x580608c1 ???
--10877--     new: 0x04020d20 (strlen              ) R-> (2007.0) 0x04c34db0 strlen
--10877-- REDIR: 0x401d540 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c35ee0 (strcmp)
--10877-- REDIR: 0x4021260 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c394f0 (mempcpy)
--10877-- Reading syms from /home/test/ftdstmp/ftds_comp100/src/dblib/.libs/libsybdb.so.5.1.0
--10877-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.27.so
--10877--   Considering /usr/lib/debug/.build-id/1f/06001733b9be9478b105faf0dac6bdf36c85de.debug ..
--10877--   .. build-id is valid
--10877-- Reading syms from /lib/x86_64-linux-gnu/libc-2.27.so
--10877--   Considering /lib/x86_64-linux-gnu/libc-2.27.so ..
--10877--   .. CRC mismatch (computed f250d419 wanted 4aacab51)
--10877--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so ..
--10877--   .. CRC is valid
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /lib/x86_64-linux-gnu/libcom_err.so.2.1
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /lib/x86_64-linux-gnu/libdl-2.27.so
--10877--   Considering /lib/x86_64-linux-gnu/libdl-2.27.so ..
--10877--   .. CRC mismatch (computed 56b0b30d wanted 7867693f)
--10877--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libdl-2.27.so ..
--10877--   .. CRC is valid
--10877-- Reading syms from /lib/x86_64-linux-gnu/libkeyutils.so.1.5
--10877--    object doesn't have a symbol table
--10877-- Reading syms from /lib/x86_64-linux-gnu/libresolv-2.27.so
--10877--   Considering /lib/x86_64-linux-gnu/libresolv-2.27.so ..
--10877--   .. CRC mismatch (computed 0da9c5d1 wanted b111a73d)
--10877--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libresolv-2.27.so ..
--10877--   .. CRC is valid
--10877-- REDIR: 0x53d3a50 (libc.so.6:memmove) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2d60 (libc.so.6:strncpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3d30 (libc.so.6:strcasecmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d27b0 (libc.so.6:strcat) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2d90 (libc.so.6:rindex) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d5480 (libc.so.6:rawmemchr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3bc0 (libc.so.6:mempcpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d39f0 (libc.so.6:bcmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2d20 (libc.so.6:strncmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2820 (libc.so.6:strcmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3b20 (libc.so.6:memset) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53f0db0 (libc.so.6:wcschr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2cc0 (libc.so.6:strnlen) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2890 (libc.so.6:strcspn) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3d80 (libc.so.6:strncasecmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2860 (libc.so.6:strcpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3ec0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2dc0 (libc.so.6:strpbrk) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d27e0 (libc.so.6:index) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d2c90 (libc.so.6:strlen) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53dd380 (libc.so.6:memrchr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3dd0 (libc.so.6:strcasecmp_l) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d39c0 (libc.so.6:memchr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53f1b70 (libc.so.6:wcslen) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3070 (libc.so.6:strspn) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3d00 (libc.so.6:stpncpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3cd0 (libc.so.6:stpcpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d54b0 (libc.so.6:strchrnul) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3e20 (libc.so.6:strncasecmp_l) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x5466700 (libc.so.6:__memcpy_chk) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x53d3900 (libc.so.6:strstr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--10877-- REDIR: 0x54c3280 (libc.so.6:__strrchr_avx2) redirected to 0x4c34730 (rindex)
--10877-- REDIR: 0x54c3450 (libc.so.6:__strlen_avx2) redirected to 0x4c34cf0 (strlen)
--10877-- REDIR: 0x53cc910 (libc.so.6:free) redirected to 0x4c32cd0 (free)
--10877-- REDIR: 0x53cc020 (libc.so.6:malloc) redirected to 0x4c31aa0 (malloc)
--10877-- REDIR: 0x54c3990 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x4c386e0 (memmove)
--10877-- REDIR: 0x54ba3d0 (libc.so.6:__strncmp_sse42) redirected to 0x4c35570 (__strncmp_sse42)
--10877-- REDIR: 0x53d35a0 (libc.so.6:__GI_strstr) redirected to 0x4c39760 (__strstr_sse2)
--10877-- REDIR: 0x54bf2e0 (libc.so.6:__memchr_avx2) redirected to 0x4c35f80 (memchr)
--10877-- REDIR: 0x54bf1c0 (libc.so.6:__strspn_sse42) redirected to 0x4c39990 (strspn)
--10877-- REDIR: 0x54bef30 (libc.so.6:__strcspn_sse42) redirected to 0x4c398d0 (strcspn)
--10877-- REDIR: 0x54c3090 (libc.so.6:__strchrnul_avx2) redirected to 0x4c39020 (strchrnul)
found sqlexpress.tempdb for sa in "../../../PWD"
--10877-- REDIR: 0x54c3970 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4c39130 (mempcpy)
SQL text will be read from ../../../src/dblib/unittests/t0005.sql
Starting ./t0005
--10877-- REDIR: 0x53cf050 (libc.so.6:calloc) redirected to 0x4c33a70 (calloc)
--10877-- REDIR: 0x54c2e60 (libc.so.6:__strchr_avx2) redirected to 0x4c34950 (index)
--10877-- REDIR: 0x54bfe40 (libc.so.6:__strcasecmp_avx) redirected to 0x4c355f0 (strcasecmp)
About to logon
--10877-- REDIR: 0x54c3e10 (libc.so.6:__memset_avx2_unaligned_erms) redirected to 0x4c385d0 (memset)
About to open
--10877-- REDIR: 0x53deb30 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c35da0 (strcmp)
--10877-- REDIR: 0x53ec810 (libc.so.6:__stpcpy_sse2_unaligned) redirected to 0x4c38200 (__stpcpy_sse2_unaligned)
--10877-- Reading syms from /lib/x86_64-linux-gnu/libnss_compat-2.27.so
--10877--   Considering /lib/x86_64-linux-gnu/libnss_compat-2.27.so ..
--10877--   .. CRC mismatch (computed dc0305b8 wanted 460e4052)
--10877--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libnss_compat-2.27.so ..
--10877--   .. CRC is valid
--10877-- REDIR: 0x53eb200 (libc.so.6:__strcpy_sse2_unaligned) redirected to 0x4c34dd0 (strcpy)
--10877-- Reading syms from /lib/x86_64-linux-gnu/libnss_nis-2.27.so
--10877--   Considering /lib/x86_64-linux-gnu/libnss_nis-2.27.so ..
--10877--   .. CRC mismatch (computed 38cb38d0 wanted 96404ac2)
--10877--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libnss_nis-2.27.so ..
--10877--   .. CRC is valid
--10877-- Reading syms from /lib/x86_64-linux-gnu/libnsl-2.27.so
--10877--   Considering /lib/x86_64-linux-gnu/libnsl-2.27.so ..
--10877--   .. CRC mismatch (computed 12772991 wanted 58367bd1)
--10877--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libnsl-2.27.so ..
--10877--   .. CRC is valid
--10877-- Reading syms from /lib/x86_64-linux-gnu/libnss_files-2.27.so
--10877--   Considering /lib/x86_64-linux-gnu/libnss_files-2.27.so ..
--10877--   .. CRC mismatch (computed 2270a715 wanted a5763524)
--10877--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libnss_files-2.27.so ..
--10877--   .. CRC is valid
--10877-- REDIR: 0x53cdc50 (libc.so.6:realloc) redirected to 0x4c33cb0 (realloc)
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/gconv/ISO8859-1.so
--10877--   Considering /usr/lib/x86_64-linux-gnu/gconv/ISO8859-1.so ..
--10877--   .. CRC mismatch (computed 83103428 wanted d26a1d18)
--10877--   Considering /usr/lib/debug/usr/lib/x86_64-linux-gnu/gconv/ISO8859-1.so ..
--10877--   .. CRC is valid
--10877-- REDIR: 0x54bfa60 (libc.so.6:__memcmp_avx2_movbe) redirected to 0x4c37e00 (bcmp)
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
--10877--   Considering /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so ..
--10877--   .. CRC mismatch (computed da5394b1 wanted a59039cd)
--10877--   Considering /usr/lib/debug/usr/lib/x86_64-linux-gnu/gconv/UTF-16.so ..
--10877--   .. CRC is valid
--10877-- REDIR: 0x54c14b0 (libc.so.6:__strncasecmp_avx) redirected to 0x4c356d0 (strncasecmp)
--10877-- REDIR: 0x54c3980 (libc.so.6:__memcpy_chk_avx_unaligned_erms) redirected to 0x4c395e0 (__memcpy_chk)
--10877-- Reading syms from /usr/lib/x86_64-linux-gnu/gconv/CP1252.so
--10877--   Considering /usr/lib/x86_64-linux-gnu/gconv/CP1252.so ..
--10877--   .. CRC mismatch (computed ba33c29d wanted cdb3aa71)
--10877--   Considering /usr/lib/debug/usr/lib/x86_64-linux-gnu/gconv/CP1252.so ..
--10877--   .. CRC is valid
creating table
	  1: create table #dblib0005 (i int not null, s char(10) not null)
insert
	  1: insert into #dblib0005 values (1, 'row 0001')
	  1: insert into #dblib0005 values (2, 'row 0002')
	  1: insert into #dblib0005 values (3, 'row 0003')
	  1: insert into #dblib0005 values (4, 'row 0004')
	  1: insert into #dblib0005 values (5, 'row 0005')
	  1: insert into #dblib0005 values (6, 'row 0006')
	  1: insert into #dblib0005 values (7, 'row 0007')
	  1: insert into #dblib0005 values (8, 'row 0008')
	  1: insert into #dblib0005 values (9, 'row 0009')
	  1: insert into #dblib0005 values (10, 'row 0010')
	  1: insert into #dblib0005 values (11, 'row 0011')
	  1: insert into #dblib0005 values (12, 'row 0012')
	  1: insert into #dblib0005 values (13, 'row 0013')
	  1: insert into #dblib0005 values (14, 'row 0014')
	  1: insert into #dblib0005 values (15, 'row 0015')
	  1: insert into #dblib0005 values (16, 'row 0016')
	  1: insert into #dblib0005 values (17, 'row 0017')
	  1: insert into #dblib0005 values (18, 'row 0018')
	  1: insert into #dblib0005 values (19, 'row 0019')
	  1: insert into #dblib0005 values (20, 'row 0020')
	  1: insert into #dblib0005 values (21, 'row 0021')
	  1: insert into #dblib0005 values (22, 'row 0022')
	  1: insert into #dblib0005 values (23, 'row 0023')
	  1: insert into #dblib0005 values (24, 'row 0024')
	  1: insert into #dblib0005 values (25, 'row 0025')
	  1: insert into #dblib0005 values (26, 'row 0026')
	  1: insert into #dblib0005 values (27, 'row 0027')
	  1: insert into #dblib0005 values (28, 'row 0028')
	  1: insert into #dblib0005 values (29, 'row 0029')
	  1: insert into #dblib0005 values (30, 'row 0030')
	  1: insert into #dblib0005 values (31, 'row 0031')
	  1: insert into #dblib0005 values (32, 'row 0032')
	  1: insert into #dblib0005 values (33, 'row 0033')
	  1: insert into #dblib0005 values (34, 'row 0034')
	  1: insert into #dblib0005 values (35, 'row 0035')
	  1: insert into #dblib0005 values (36, 'row 0036')
	  1: insert into #dblib0005 values (37, 'row 0037')
	  1: insert into #dblib0005 values (38, 'row 0038')
	  1: insert into #dblib0005 values (39, 'row 0039')
	  1: insert into #dblib0005 values (40, 'row 0040')
	  1: insert into #dblib0005 values (41, 'row 0041')
	  1: insert into #dblib0005 values (42, 'row 0042')
	  1: insert into #dblib0005 values (43, 'row 0043')
	  1: insert into #dblib0005 values (44, 'row 0044')
	  1: insert into #dblib0005 values (45, 'row 0045')
	  1: insert into #dblib0005 values (46, 'row 0046')
	  1: insert into #dblib0005 values (47, 'row 0047')
	  1: insert into #dblib0005 values (48, 'row 0048')
	  1: insert into #dblib0005 values (49, 'row 0049')
	  1: select * from #dblib0005 where i < 5 order by i
col 1 is i
col 2 is s
Read a row of data -> 1 row 0001  
Read a row of data -> 2 row 0002  
Read a row of data -> 3 row 0003  
Read a row of data -> 4 row 0004  
This query should succeeded as we have fetched the exact
number of rows in the result set
	  1: select * from #dblib0005 where i < 6 order by i
col 1 is i
col 2 is s
Read a row of data -> 1 row 0001  
Read a row of data -> 2 row 0002  
Read a row of data -> 3 row 0003  
Read a row of data -> 4 row 0004  
Testing anticipated failure
	  1: /*
	  2:  * The following query should fail because the test 
	  3:  * has not fetched all the rows in the result set.
	  4:  */
	  5: select * from #dblib0005 where i > 950 order by i
OK: anticipated error 20019 (Attempt to initiate a new Adaptive Server operation with results pending) arrived
calling dbcancel to flush results
Dropping proc
	  1: if object_id('t0005_proc') is not null drop procedure t0005_proc
creating proc
	  1: create proc t0005_proc (@b int out) as
	  2: begin
	  3: select * from #dblib0005 where i < 6 order by i
	  4: select @b = 42
	  5: end
	  6: 
calling proc
	  1: declare @myout int exec t0005_proc @b = @myout output
col 1 is i
col 2 is s
Read a row of data -> 1 row 0001  
Read a row of data -> 2 row 0002  
Read a row of data -> 3 row 0003  
Read a row of data -> 4 row 0004  
Read a row of data -> 5 row 0005  
Calling dbsqlexec before dbnextrow returns NO_MORE_ROWS
The following command should succeed because
we have fetched the exact number of rows in the result set
	  1: select getdate()
	  1: drop procedure t0005_proc
--10877-- Discarding syms at 0x7e47710-0x7e4925b in /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so due to munmap()
t0005.c OK
--10877-- Discarding syms at 0x804b600-0x804c508 in /usr/lib/x86_64-linux-gnu/gconv/CP1252.so due to munmap()
--10877-- Discarding syms at 0x7c44600-0x7c45292 in /usr/lib/x86_64-linux-gnu/gconv/ISO8859-1.so due to munmap()
--10877-- Discarding syms at 0x74032a0-0x74091ac in /lib/x86_64-linux-gnu/libnss_compat-2.27.so due to munmap()
--10877-- Discarding syms at 0x760e070-0x76150d9 in /lib/x86_64-linux-gnu/libnss_nis-2.27.so due to munmap()
--10877-- Discarding syms at 0x781c090-0x78298a7 in /lib/x86_64-linux-gnu/libnsl-2.27.so due to munmap()
--10877-- Discarding syms at 0x7a34350-0x7a3ad8f in /lib/x86_64-linux-gnu/libnss_files-2.27.so due to munmap()
==10877== 
==10877== HEAP SUMMARY:
==10877==     in use at exit: 0 bytes in 0 blocks
==10877==   total heap usage: 6,637 allocs, 6,637 frees, 1,806,256 bytes allocated
==10877== 
==10877== All heap blocks were freed -- no leaks are possible
==10877== 
==10877== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==10877== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Main