Re: FreeTDS and PHP: empty strings and NVARCHAR

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4cnnGn3xXB_F8+gCypODzSyFSPGq+0ty7mk+zNZECkv0Q@mail.gmail.com>
2011/7/4 Mattia <[email protected]>:
> Hi,
> yesterday I modified PHP and FreeTDS codes to make them work with empty
> strings and nvarchar in stored procedures.
>
> 1. The empty_string.patch (against actual cvs of FreeTDS) is like the ct-lib
> patch (so datalen==0 is not null).
>

Yes, this breaks dblib compatibility. All documentation report datalen
== 0 as NULL input.

> 2. The nvarchar_export.patch defines XSYBNVARCHAR in sybdb.h (to use
> with php).
>

?? this should be not necessary, our dblib should convert to
SYBVARCHAR and PHP should be happy with given varchar... If this is
not true we should fix FreeTDS dblib instead.

> 3. The freetds092_with_nvarchar.patch (against php 5.3.6 stable) fixes a
> redefinition of type LBYTE to work with actual Freetds cvs and adds support
> for type SQLNVARCHAR (to use with mssql_bind function).
>

This is a PHP patch, I think you should split patch and send them.

> The first patch could break the dblib standard so it could remain an unofficial
> patch.
>
> The second one shouldn't cause problems. It could be merged in the main
> tree.
>
> I hope I have done something useful.
>
> Regards
>

bye
  freddy77
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.