Re: empty strings select as null bug

Jeffrey Shaw <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAJYh909=xyJsORcWg6doZNGhRZXWqGkMyv1yRrQJJDfF7iZ7mA@mail.gmail.com>
That was some great teamwork. Thanks for the fix, everyone!

On Thu, Jun 11, 2015 at 3:17 AM, Geoff Montee <[email protected]>
wrote:

> On Wed, Jun 10, 2015 at 10:39 PM, LacaK <[email protected]> wrote:
> >
> > I am using for testing NULL dbdata(), which should return nil for NULL
> data.
> > (In my case I know, that column exists)
> >
> > From Sybase documentation:
> > "A NULL BYTE pointer is returned if there is no such column or if the
> data
> > has a null value. To make sure that the data is really a null value, you
> > should always check for a return of 0 from *dbdatlen*."
> >
> > From Microsoft documentation:
> > "A NULL BYTE pointer is returned if there is no such column or if the
> data
> > has a null value. To make sure that the data is really a null value,
> check
> > for a return of 0 from *dbdatlen*."
> >
> > So you can use: dbdata()==nil && dbdatlen()==0
> >
>
> I decided to go with your test:
>
>
> https://github.com/GeoffMontee/tds_fdw/blob/b5f678cded099f9231473c520cf1dbe8363a470a/src/tds_fdw.c#L1855
>
> I think Jeff's bug is fixed.
>
> It's really good to know that dbdatlen() can return 0 in the case of
> an empty string.
>
> Thanks for your help, everyone!
>
> Geoff
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.