Discussion:
[freetds] One failing unit test (iconv_read) on git master on OS X
Marc Abramowitz
2013-09-14 16:20:51 UTC
Permalink
On my Mac, all the tests are passing except for one: iconv_read. I'm willing to help debug it, if I could get a little bit of guidance on where to look?

I tried on an Ubuntu 10 system and I got a whole bunch of test failures, so I'll deal with those later.

```
=================================================================
FreeTDS 0.92.dev.20130718: src/tds/unittests/test-suite.log
=================================================================

# TOTAL: 19
# PASS: 18
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: iconv_fread
=================

out 1024 bytes expected 4077
res 0 out_len 1024
```

iconv-related output from ./configure and link line:

```
checking for iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
?
/bin/sh ../../libtool --tag=CC --mode=link gcc -D_THREAD_SAFE -g -O2 -Wdeclaration-after-statement -version-info 5:0:0 -o libsybdb.la -rpath /Users/marca/sw/lib dblib.lo dbutil.lo rpc.lo bcp.lo xact.lo dbpivot.lo ../tds/libtds.la ../replacements/libreplacements.la -liconv
```
Frediano Ziglio
2013-09-14 16:26:23 UTC
Permalink
Post by Marc Abramowitz
On my Mac, all the tests are passing except for one: iconv_read. I'm willing to help debug it, if I could get a little bit of guidance on where to look?
I tried on an Ubuntu 10 system and I got a whole bunch of test failures, so I'll deal with those later.
```
=================================================================
FreeTDS 0.92.dev.20130718: src/tds/unittests/test-suite.log
=================================================================
# TOTAL: 19
# PASS: 18
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: iconv_fread
=================
out 1024 bytes expected 4077
res 0 out_len 1024
```
```
checking for iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
?
/bin/sh ../../libtool --tag=CC --mode=link gcc -D_THREAD_SAFE -g -O2 -Wdeclaration-after-statement -version-info 5:0:0 -o libsybdb.la -rpath /Users/marca/sw/lib dblib.lo dbutil.lo rpc.lo bcp.lo xact.lo dbpivot.lo ../tds/libtds.la ../replacements/libreplacements.la -liconv
```
Enable dump to see what went wrong.

Frediano
Marc Abramowitz
2013-09-14 16:30:08 UTC
Permalink
The weird thing is that the test is complaining about out_len being 1024 bytes instead of 4077:

marca at marca-mac:~/dev/git-repos/freetds$ cat src/tds/unittests/iconv_fread.log
out 1024 bytes expected 4077
res 0 out_len 1024

But the output file has 4077 "a" characters (and then a space and two exclamation points):

marca at marca-mac:~/dev/git-repos/freetds$ wc -c src/tds/unittests/iconv_fread.out
4080 src/tds/unittests/iconv_fread.out
marca at marca-mac:~/dev/git-repos/freetds$ cat src/tds/unittests/iconv_fread.out
aaaaaa? !!

which looks like it might be correct.
Frediano Ziglio
2013-09-15 08:15:20 UTC
Permalink
Post by Marc Abramowitz
marca at marca-mac:~/dev/git-repos/freetds$ cat src/tds/unittests/iconv_fread.log
out 1024 bytes expected 4077
res 0 out_len 1024
marca at marca-mac:~/dev/git-repos/freetds$ wc -c src/tds/unittests/iconv_fread.out
4080 src/tds/unittests/iconv_fread.out
marca at marca-mac:~/dev/git-repos/freetds$ cat src/tds/unittests/iconv_fread.out
aaaaaa? !!
which looks like it might be correct.
Just looked at test. The test write the file then try to read back
with tds_bcp_read. The content is ok (lot of 'a' followed by a no
blank space and two exclamation points which are the terminator). The
fact that function returns only 1024 is wrong should return length of
'a' plus 1 (the space converted to iso8859-1).

For the dump probably you don't get cause there are no server
connection, try to add a line like

tdsdump_open("stderr");

Frediano
Marc Abramowitz
2013-09-14 17:31:46 UTC
Permalink
Post by Frediano Ziglio
Enable dump to see what went wrong.
Not having any luck. I'm sure I'm missing something simple:

marca at marca-mac:~/dev/git-repos/freetds$ TDSDUMP=stderr
TDSDUMPCONFIG=stderr src/tds/unittests/iconv_fread
res 0 out_len 1024
out 1024 bytes expected 4077
Marc Abramowitz
2013-09-15 09:08:44 UTC
Permalink
Post by Frediano Ziglio
For the dump probably you don't get cause there are no server
connection, try to add a line like
tdsdump_open("stderr");
Thanks!

Output is:

```
marca at marca-mac:~/dev/git-repos/freetds$ src/tds/unittests/iconv_fread
log.c:194:Starting log file for FreeTDS 0.92.dev.20130718
on 2013-09-15 02:03:33 with debug flags 0x4fff.
stream.c:108:Error: read_and_convert: tds_iconv returned errno 7
stream.c:110:Error: read_and_convert: Gave up converting 3054 bytes due to
error 7.
stream.c:113:Troublesome bytes:
?

```
Marc Abramowitz
2013-09-15 16:27:01 UTC
Permalink
Post by Marc Abramowitz
```
marca at marca-mac:~/dev/git-repos/freetds$ src/tds/unittests/iconv_fread
log.c:194:Starting log file for FreeTDS 0.92.dev.20130718
on 2013-09-15 02:03:33 with debug flags 0x4fff.
stream.c:108:Error: read_and_convert: tds_iconv returned errno 7
stream.c:110:Error: read_and_convert: Gave up converting 3054 bytes due to
error 7.
...
```
Is the test is trying to do the same as this?

marca at marca-mac:~/dev/git-repos/freetds$ head -c 4078
src/tds/unittests/iconv_fread.out | iconv -f UTF-8 -t ISO-8859-1 | wc -c
4077
marca at marca-mac:~/dev/git-repos/freetds$ head -c 4078
src/tds/unittests/iconv_fread.out | iconv -f UTF-8 -t ISO-8859-1 | hexdump
-C
00000000 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61
|aaaaaaaaaaaaaaaa|
*
00000fe0 61 61 61 61 61 61 61 61 61 61 61 61 90 |aaaaaaaaaaaa.|
00000fed


Is it basically to test that the sequence 0xC290 (UTF-8 for U+0090 control
character) is converted to 0x90 in ISO-8859-1?

It's curious that tds_iconv seems to fail (with errno 7 - what's that?)
when it's only 1024 bytes into the string; still in the middle of all the
'a' characters; it hasn't gotten to the special character yet it seems.

Marc
Marc Abramowitz
2013-09-15 18:24:53 UTC
Permalink
Post by Marc Abramowitz
It's curious that tds_iconv seems to fail (with errno 7 - what's that?)
when it's only 1024 bytes into the string; still in the middle of all the
'a' characters; it hasn't gotten to the special character yet it seems.
It looks like, according to errno and the iconv(3) man page [1] that errno
7 is E2BIG:

[E2BIG] Input conversion stopped due to lack of space in the output buffer.


So perhaps there's only 1024 bytes of space in the output buffer? I'll try
to dig in...

I also noticed that tds_bcp_fread is returning 0:

res 0 out_len 1024
out 1024 bytes expected 4077


which implies that it succeeded. It seems that it should return an error
code in this case? Maybe return E2BIG?

Marc

[1]: http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html
Marc Abramowitz
2013-09-15 20:52:57 UTC
Permalink
Post by Marc Abramowitz
So perhaps there's only 1024 bytes of space in the output buffer? I'll try
to dig in...
Interesting data point? If I make the following change, then it makes the
iconv_read test pass (although it makes a few other tests fail and one
hangs):

https://gist.github.com/msabramo/6574246





So it appears that it has something to do with it not allocating a big
enough buffer to not passing the right size.
Frediano Ziglio
2013-09-16 07:44:33 UTC
Permalink
Post by Marc Abramowitz
Post by Marc Abramowitz
So perhaps there's only 1024 bytes of space in the output buffer? I'll try
to dig in...
Interesting data point? If I make the following change, then it makes the
iconv_read test pass (although it makes a few other tests fail and one
https://gist.github.com/msabramo/6574246
I would call it workaround!
Post by Marc Abramowitz
So it appears that it has something to do with it not allocating a big
enough buffer to not passing the right size.
No, libTDS is expected to handle it and reallocate the buffer as
needed. The function is expected to handle whatever file length so
it's not always possible to understand the right size in advance.

Frediano
Marc Abramowitz
2013-09-16 13:56:20 UTC
Permalink
This post might be inappropriate. Click to display it.
Marc Abramowitz
2013-09-16 14:51:06 UTC
Permalink
By the way, here's my logs with a little bit of logging added in -- maybe
you can make some sense of what's going on:

stream.c:219:tds_dynamic_stream_init: stream->allocated = 1024
bulk.c:1047:tds_bcp_fread: *outbytes = deadbeef
bulk.c:1048:tds_bcp_fread: tds_dynamic_stream_init => 0
bulk.c:1059:tds_bcp_fread: calling tds_convert_stream...
stream.c:99:tds_convert_stream: calling tds_iconv with ol = 1024
iconv.c:916:tds_iconv: errno = 7
iconv.c:923:tds_iconv: set suppress->e2big = 1
stream.c:104:tds_convert_stream: calling ostream->write with 1024
stream.c:200:tds_dynamic_stream_write: s->allocated = 3072
stream.c:106:tds_convert_stream: ostream->write wrote 1024
stream.c:111:Error: tds_convert_stream: tds_iconv returned errno 7
stream.c:113:Error: tds_convert_stream: Gave up converting 3054 bytes due
to error 7.




It looks like maybe it does allocate the additional 3072 bytes needed
after the initial 1024 (stream.c:200), but tds_iconv doesn't pick up on
that and it has already given up?
Marc Abramowitz
2013-09-16 15:18:13 UTC
Permalink
A little more info:

stream.c:219:tds_dynamic_stream_init: stream->allocated = 1024
bulk.c:1047:tds_bcp_fread: *outbytes = deadbeef
bulk.c:1048:tds_bcp_fread: tds_dynamic_stream_init => 0
bulk.c:1059:tds_bcp_fread: calling tds_convert_stream...
stream.c:99:tds_convert_stream: calling tds_iconv with ol = 1024
iconv.c:819:tds_iconv: entering for loop...
iconv.c:821:tds_iconv: top of for loop iteration...
iconv.c:829:tds_iconv: calling tds_sys_iconv with *inbytesleft = 4078 and
*outbytesleft = 1024...
iconv.c:831:tds_iconv: tds_sys_iconv returned irreversible = -1; errno = 7
iconv.c:853:tds_iconv: errno = 7; breaking
iconv.c:926:tds_iconv: case E2BIG -- errno = 7
iconv.c:932:tds_iconv: setting suppress->e2big = 1
stream.c:104:tds_convert_stream: calling ostream->write with 1024
stream.c:200:tds_dynamic_stream_write: s->allocated = 3072
stream.c:106:tds_convert_stream: ostream->write wrote 1024
stream.c:111:Error: tds_convert_stream: tds_iconv returned errno 7
stream.c:113:Error: tds_convert_stream: Gave up converting 3054 bytes due
to error 7.
Marc Abramowitz
2013-09-16 15:43:04 UTC
Permalink
And it is not limited to OS X. I just got the tests working on my Ubuntu
10 box (it was a configuration problem) and the same test fails, in the
same way:

vagrant at lucid64:~/dev/git-repos/freetds$ TDSDUMP=stderr
src/tds/unittests/iconv_fread
log.c:194:Starting log file for FreeTDS 0.92.dev.20130718
on 2013-09-16 08:25:26 with debug flags 0x4fff.
iconv.c:332:tds_iconv_open(0xe11060, ISO-8859-1)
iconv.c:189:local name for ISO-8859-1 is ISO-8859-1
iconv.c:189:local name for UTF-8 is UTF-8
iconv.c:189:local name for UCS-2LE is UCS-2LE
iconv.c:189:local name for UCS-2BE is UCS-2BE
iconv.c:351:setting up conversions for client charset "ISO-8859-1"
iconv.c:353:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion
iconv.c:393:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion
iconv.c:396:tds_iconv_open: done
stream.c:219:tds_dynamic_stream_init: stream->allocated = 1024
bulk.c:1047:tds_bcp_fread: *outbytes = deadbeef
bulk.c:1048:tds_bcp_fread: tds_dynamic_stream_init => 0
bulk.c:1059:tds_bcp_fread: calling tds_convert_stream...
stream.c:99:tds_convert_stream: calling tds_iconv with ol = 1024
iconv.c:819:tds_iconv: entering for loop...
iconv.c:821:tds_iconv: top of for loop iteration...
iconv.c:829:tds_iconv: calling tds_sys_iconv with *inbytesleft = 4078 and
*outbytesleft = 1024...
iconv.c:831:tds_iconv: tds_sys_iconv returned irreversible = -1; errno = 7
iconv.c:853:tds_iconv: errno = 7; breaking
iconv.c:926:tds_iconv: case E2BIG -- errno = 7
iconv.c:932:tds_iconv: setting suppress->e2big = 1
stream.c:104:tds_convert_stream: calling ostream->write with 1024
stream.c:200:tds_dynamic_stream_write: s->allocated = 3072
stream.c:106:tds_convert_stream: ostream->write wrote 1024
stream.c:111:Error: tds_convert_stream: tds_iconv returned errno 7
stream.c:113:Error: tds_convert_stream: Gave up converting 3054 bytes due
to error 7.
Frediano Ziglio
2013-09-16 18:34:35 UTC
Permalink
Post by Marc Abramowitz
And it is not limited to OS X. I just got the tests working on my Ubuntu
10 box (it was a configuration problem) and the same test fails, in the
vagrant at lucid64:~/dev/git-repos/freetds$ TDSDUMP=stderr
src/tds/unittests/iconv_fread
log.c:194:Starting log file for FreeTDS 0.92.dev.20130718
on 2013-09-16 08:25:26 with debug flags 0x4fff.
iconv.c:332:tds_iconv_open(0xe11060, ISO-8859-1)
iconv.c:189:local name for ISO-8859-1 is ISO-8859-1
iconv.c:189:local name for UTF-8 is UTF-8
iconv.c:189:local name for UCS-2LE is UCS-2LE
iconv.c:189:local name for UCS-2BE is UCS-2BE
iconv.c:351:setting up conversions for client charset "ISO-8859-1"
iconv.c:353:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion
iconv.c:393:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion
iconv.c:396:tds_iconv_open: done
stream.c:219:tds_dynamic_stream_init: stream->allocated = 1024
bulk.c:1047:tds_bcp_fread: *outbytes = deadbeef
bulk.c:1048:tds_bcp_fread: tds_dynamic_stream_init => 0
bulk.c:1059:tds_bcp_fread: calling tds_convert_stream...
stream.c:99:tds_convert_stream: calling tds_iconv with ol = 1024
iconv.c:819:tds_iconv: entering for loop...
iconv.c:821:tds_iconv: top of for loop iteration...
iconv.c:829:tds_iconv: calling tds_sys_iconv with *inbytesleft = 4078 and
*outbytesleft = 1024...
iconv.c:831:tds_iconv: tds_sys_iconv returned irreversible = -1; errno = 7
iconv.c:853:tds_iconv: errno = 7; breaking
iconv.c:926:tds_iconv: case E2BIG -- errno = 7
iconv.c:932:tds_iconv: setting suppress->e2big = 1
stream.c:104:tds_convert_stream: calling ostream->write with 1024
stream.c:200:tds_dynamic_stream_write: s->allocated = 3072
stream.c:106:tds_convert_stream: ostream->write wrote 1024
stream.c:111:Error: tds_convert_stream: tds_iconv returned errno 7
stream.c:113:Error: tds_convert_stream: Gave up converting 3054 bytes due
to error 7.
Hi,
I believe you... I just don't understand why it always worked on my machine!

Frediano
Marc Abramowitz
2013-09-16 19:40:24 UTC
Permalink
Post by Frediano Ziglio
I believe you... I just don't understand why it always worked on my
machine!
What OS do you have? Do you have LC_* variables set?
Marc Abramowitz
2013-09-18 16:15:46 UTC
Permalink
Post by Marc Abramowitz
Post by Frediano Ziglio
I believe you... I just don't understand why it always worked on my machine!
What OS do you have? Do you have LC_* variables set?
And hopefully not beating a dead horse (but perhaps illustrating the usefulness
of Travis CI, which I mention in another thread), the iconv_fread test also
fails on Travis CI (which runs Ubuntu 12.04 LTS
Server Edition 64 bit):

https://travis-ci.org/msabramo/freetds/builds/11496984#L1940

It will be interesting to find out what is different about your machine that
causes that test to pass, because it might be masking bugs.
Frediano Ziglio
2013-09-28 08:43:38 UTC
Permalink
At the end I got it !!

$ ./iconv_fread
res 0 out_len 1024
out 1024 bytes expected 4077

I had to remove the --enable-extra-checks option (I don't understand
the reason but I'll fix it!)

Frediano
Post by Marc Abramowitz
Post by Marc Abramowitz
Post by Frediano Ziglio
I believe you... I just don't understand why it always worked on my machine!
What OS do you have? Do you have LC_* variables set?
And hopefully not beating a dead horse (but perhaps illustrating the usefulness
of Travis CI, which I mention in another thread), the iconv_fread test also
fails on Travis CI (which runs Ubuntu 12.04 LTS
https://travis-ci.org/msabramo/freetds/builds/11496984#L1940
It will be interesting to find out what is different about your machine that
causes that test to pass, because it might be masking bugs.
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Frediano Ziglio
2013-09-29 17:14:49 UTC
Permalink
Fixed

https://gitorious.org/freetds/freetds/commit/7dc0487768a2aee1db2d6b113a84f9a88c626264

Frediano
Post by Frediano Ziglio
At the end I got it !!
$ ./iconv_fread
res 0 out_len 1024
out 1024 bytes expected 4077
I had to remove the --enable-extra-checks option (I don't understand
the reason but I'll fix it!)
Frediano
Post by Marc Abramowitz
Post by Marc Abramowitz
Post by Frediano Ziglio
I believe you... I just don't understand why it always worked on my machine!
What OS do you have? Do you have LC_* variables set?
And hopefully not beating a dead horse (but perhaps illustrating the usefulness
of Travis CI, which I mention in another thread), the iconv_fread test also
fails on Travis CI (which runs Ubuntu 12.04 LTS
https://travis-ci.org/msabramo/freetds/builds/11496984#L1940
It will be interesting to find out what is different about your machine that
causes that test to pass, because it might be masking bugs.
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Marc Abramowitz
2013-09-30 15:21:15 UTC
Permalink
Awesome! I can confirm that the iconv_fread test now passes. Thanks!

I now have what looks to be an unrelated failure in another test.

marca at marca-mac:~/dev/git-repos/freetds$ src/ctlib/unittests/t0009
t0009.c: Retrieve compute results processing
...
SM-DB-VM2012 Message 156 severity 15 state 1 line 1:
"Incorrect syntax near the keyword 'compute'."
ct_results() result_type CS_CMD_FAIL.

This is apparently because I am using SQL Server 2012 and Microsoft removed
the COMPUTE keyword in this version. Perhaps it's possible to skip this
test on SQL Server 2012?
Post by Frediano Ziglio
Fixed
https://gitorious.org/freetds/freetds/commit/7dc0487768a2aee1db2d6b113a84f9a88c626264
Frediano
Post by Frediano Ziglio
At the end I got it !!
$ ./iconv_fread
res 0 out_len 1024
out 1024 bytes expected 4077
I had to remove the --enable-extra-checks option (I don't understand
the reason but I'll fix it!)
Frediano
Post by Marc Abramowitz
On 9/16/13 11:34 AM, "Frediano Ziglio" <freddy77 <at> gmail.com>
Post by Frediano Ziglio
I believe you... I just don't understand why it always worked on my machine!
What OS do you have? Do you have LC_* variables set?
And hopefully not beating a dead horse (but perhaps illustrating the
usefulness
Post by Frediano Ziglio
Post by Marc Abramowitz
of Travis CI, which I mention in another thread), the iconv_fread test
also
Post by Frediano Ziglio
Post by Marc Abramowitz
fails on Travis CI (which runs Ubuntu 12.04 LTS
https://travis-ci.org/msabramo/freetds/builds/11496984#L1940
It will be interesting to find out what is different about your machine
that
Post by Frediano Ziglio
Post by Marc Abramowitz
causes that test to pass, because it might be masking bugs.
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Frediano Ziglio
2013-09-30 15:49:53 UTC
Permalink
Yes, I think this is the right solution.

And also I agree to have removed this ugly feature :)

Frediano
Post by Marc Abramowitz
Awesome! I can confirm that the iconv_fread test now passes. Thanks!
I now have what looks to be an unrelated failure in another test.
marca at marca-mac:~/dev/git-repos/freetds$ src/ctlib/unittests/t0009
t0009.c: Retrieve compute results processing
...
"Incorrect syntax near the keyword 'compute'."
ct_results() result_type CS_CMD_FAIL.
This is apparently because I am using SQL Server 2012 and Microsoft removed
the COMPUTE keyword in this version. Perhaps it's possible to skip this
test on SQL Server 2012?
Post by Frediano Ziglio
Fixed
https://gitorious.org/freetds/freetds/commit/7dc0487768a2aee1db2d6b113a84f9a88c626264
Frediano
Post by Frediano Ziglio
At the end I got it !!
$ ./iconv_fread
res 0 out_len 1024
out 1024 bytes expected 4077
I had to remove the --enable-extra-checks option (I don't understand
the reason but I'll fix it!)
Frediano
Post by Marc Abramowitz
On 9/16/13 11:34 AM, "Frediano Ziglio" <freddy77 <at> gmail.com>
Post by Frediano Ziglio
I believe you... I just don't understand why it always worked on my machine!
What OS do you have? Do you have LC_* variables set?
And hopefully not beating a dead horse (but perhaps illustrating the
usefulness
Post by Frediano Ziglio
Post by Marc Abramowitz
of Travis CI, which I mention in another thread), the iconv_fread test
also
Post by Frediano Ziglio
Post by Marc Abramowitz
fails on Travis CI (which runs Ubuntu 12.04 LTS
https://travis-ci.org/msabramo/freetds/builds/11496984#L1940
It will be interesting to find out what is different about your machine
that
Post by Frediano Ziglio
Post by Marc Abramowitz
causes that test to pass, because it might be masking bugs.
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Marc Abramowitz
2013-09-30 19:00:23 UTC
Permalink
Here's a cheesy way to skip that test - I'm sure there is a better way to
detect the SQL Server version:

```
diff --git a/src/ctlib/unittests/t0009.c b/src/ctlib/unittests/t0009.c
index a033ffe..03878fa 100644
--- a/src/ctlib/unittests/t0009.c
+++ b/src/ctlib/unittests/t0009.c
@@ -5,6 +5,7 @@
#endif /* HAVE_STRING_H */

#include <stdio.h>
+#include <stdlib.h>
#include <ctpublic.h>
#include "common.h"

@@ -39,6 +40,11 @@ main(int argc, char *argv[])
CS_INT compute_col1;
CS_CHAR compute_col3[32];

+ if (getenv("TDSPWDSKIPCOMPUTE")) {
+ fprintf(stderr, "%s: TDSPWDSKIPCOMPUTE was set -
skipping\n", __FILE__);
+ return 0;
+ }
+
fprintf(stdout, "%s: Retrieve compute results processing\n",
__FILE__);
if (verbose) {
fprintf(stdout, "Trying login\n");
```
Post by Frediano Ziglio
Yes, I think this is the right solution.
And also I agree to have removed this ugly feature :)
Frediano
Post by Marc Abramowitz
Awesome! I can confirm that the iconv_fread test now passes. Thanks!
I now have what looks to be an unrelated failure in another test.
marca at marca-mac:~/dev/git-repos/freetds$ src/ctlib/unittests/t0009
t0009.c: Retrieve compute results processing
...
"Incorrect syntax near the keyword 'compute'."
ct_results() result_type CS_CMD_FAIL.
This is apparently because I am using SQL Server 2012 and Microsoft
removed
Post by Marc Abramowitz
the COMPUTE keyword in this version. Perhaps it's possible to skip this
test on SQL Server 2012?
On Sun, Sep 29, 2013 at 10:14 AM, Frediano Ziglio <freddy77 at gmail.com
Post by Frediano Ziglio
Fixed
https://gitorious.org/freetds/freetds/commit/7dc0487768a2aee1db2d6b113a84f9a88c626264
Post by Marc Abramowitz
Post by Frediano Ziglio
Frediano
Post by Frediano Ziglio
At the end I got it !!
$ ./iconv_fread
res 0 out_len 1024
out 1024 bytes expected 4077
I had to remove the --enable-extra-checks option (I don't understand
the reason but I'll fix it!)
Frediano
Post by Marc Abramowitz
On 9/16/13 11:34 AM, "Frediano Ziglio" <freddy77 <at> gmail.com>
Post by Frediano Ziglio
I believe you... I just don't understand why it always worked on
my
Post by Marc Abramowitz
Post by Frediano Ziglio
Post by Frediano Ziglio
Post by Marc Abramowitz
Post by Frediano Ziglio
machine!
What OS do you have? Do you have LC_* variables set?
And hopefully not beating a dead horse (but perhaps illustrating the
usefulness
Post by Frediano Ziglio
Post by Marc Abramowitz
of Travis CI, which I mention in another thread), the iconv_fread
test
Post by Marc Abramowitz
Post by Frediano Ziglio
also
Post by Frediano Ziglio
Post by Marc Abramowitz
fails on Travis CI (which runs Ubuntu 12.04 LTS
https://travis-ci.org/msabramo/freetds/builds/11496984#L1940
It will be interesting to find out what is different about your
machine
Post by Marc Abramowitz
Post by Frediano Ziglio
that
Post by Frediano Ziglio
Post by Marc Abramowitz
causes that test to pass, because it might be masking bugs.
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Loading...