Re: One failing unit test (iconv_read) on git master on OS X
Marc Abramowitz <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CE5C59B6.1FB8B%[email protected]> |
On 9/16/13 12:44 AM, "Frediano Ziglio" <[email protected]> wrote: >2013/9/15 Marc Abramowitz <[email protected]>: >>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 >> > >I would call it workaround! I would call it a hack, since it breaks other tests. :-) >> 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. Yeah, afterwards, I looked a little more and I can see that tds_dynamic_stream_init and tds_dynamic_stream_write set up a stream that should reallocate as needed. But beyond that, I'm having trouble following the details of how it works. tds_iconv was particularly hard for me to grok. I sent a few PRs to improve logging slightly, but I might not get further than that. I wonder if this means that FreeTDS has trouble with VARCHAR fields > 1024 bytes? I suppose I could test that.