Skip to Content.
Sympa Menu

freetds - Re: [freetds] unknown column type - FreeTDS 0.61 MS SQL Server 2000 SP 3 PHP 4.3.2

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Stefan Sonnenberg-Carstens <s.sonnenberg AT coolspot.de>
  • To: "Frank M. Kromann" <frank AT kromann.info>, "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Cc:
  • Subject: Re: [freetds] unknown column type - FreeTDS 0.61 MS SQL Server 2000 SP 3 PHP 4.3.2
  • Date: Tue, 22 Jul 2003 20:21:15 +0200

I stress-tested the patch over all of our replicated databases with this
script :

...
$res = mssql_query("SELECT msrepl_tran_version,CAST(msrepl_tran_version as
CHAR(64)) FROM TABLE");
while($row = mssql_fetch_row($res)){
if( strcmp( mssql_guid_string( $row[0] ) , $row[1] ) == 0) {
echo "OK<br>";
}
}
...
It returned never an error, nor does it leak mem or such.
mssql_guid_string returns the same representation as seen in MS SQL
Enterprise
Admin.

Cheers,
Stefan Sonnenberg-Carstens


Am Dienstag, 22. Juli 2003 16:20 schrieb Frank M. Kromann:
> Hi Stefan,
>
> Thanks for the patch. It looks ok so I'll go ahead an apply it and I'll
> figure out a way to change the version in phpinfo. Using the tdsver is not
> a good idea as this can be changed in freetds.conf.
>
> - Frank
>
> > Here are my patches :
> >
> > for ext/mssql/php_mssql.c :
> >
> > --- php-4.3.2/ext/mssql/php_mssql.c 2003-05-21 02:06:41.000000000
>
> +0200
>
> > +++ php-4.3.2-LOCAL/ext/mssql/php_mssql.c 2003-07-22
>
> 13:34:35.000000000
>
> > +0200
> > @@ -800,6 +800,15 @@
> > Z_DVAL_P(result) = (double) floatcol8(offset);
> > Z_TYPE_P(result) = IS_DOUBLE;
> > break;
> > + case SQLUNIQUE:
> > + {
> > + int length = 16;
> > + char *data = charcol(offset);
> > + Z_STRVAL_P(result) =
>
> estrndup(data,length);
>
> > + Z_STRLEN_P(result) = length;
> > + Z_TYPE_P(result) = IS_STRING;
> > + }
> > + break;
> > case SQLVARBINARY:
> > case SQLBINARY:
> > case SQLIMAGE: {
> >
> > and for ext/mssql/php_mssql.h
> >
> > --- php-4.3.2/ext/mssql/php_mssql.h 2003-02-09 08:49:34.000000000
>
> +0100
>
> > +++ php-4.3.2-LOCAL/ext/mssql/php_mssql.h 2003-07-22
>
> 13:32:42.000000000
>
> > +0200
> > @@ -32,7 +32,7 @@
> > #endif
> >
> >
> > -#define MSSQL_VERSION "7.0"
> > +#define MSSQL_VERSION "8.0"
> > #include "sqlfront.h"
> > #include "sqldb.h"
> >
> > @@ -59,6 +59,7 @@
> > #define SQLIMAGE SYBIMAGE
> > #define SQLBINARY SYBBINARY
> > #define SQLVARBINARY SYBVARBINARY
> > +#define SQLUNIQUE SYBUNIQUE
> > #define DBERRHANDLE(a, b) dberrhandle(b)
> > #define DBMSGHANDLE(a, b) dbmsghandle(b)
> > #define DBSETOPT(a, b, c) dbsetopt(a, b, c, -1)
> >
> >
> > It works for me :
> > RedHat 9.0 + updates
> > FreeTDS 0.61 (configure --prefix=/usr/local/freetds/0.61/
>
> --enable-msdblib
>
> > --with-tdsver=8.0)
> > PHP 4.3.2 (configure --prefix=/usr/local/php/4.3.2/
> > --with-mssql=/usr/local/freetds/0.61/ --without-mysql)
> > Windows 2000 BackOffice Server SP 4 + MS SQL Server 2000 SP 3
> >
> > Perhaps +#define MSSQL_VERSION "8.0" is a bit "heavy", but looks nicer
>
> in
>
> > phpinfo() ...
> >
> > Am Montag 21 Juli 2003 17:34 schrieb Frank M. Kromann:
> > > Hi Stefan,
> > >
> > > At This time there is no support in the PHP extension for data types
>
> not
>
> > > available in SQL Server 6.x.
> > >
> > > The extension was created with Microsofts version of DBLIB (not
>
> updated
>
> > > since 6.x). As soon as I get the DBLIB from FreeTDS to work on Win32
>
> I'll
>
> > > start adding support for the new data types found in SQL Server 7.0
>
> and
>
> > > 2000.
> > >
> > > - Frank
> > >
> > > > As stated :
> > > > FreeTDS is installed this way :
> > > > ./configure --prefix=/usr/local --with-tdsver=8.0
> > > > make
> > > > make install
> > > > ldconfig
> > > > PHP is installed this way :
> > > > ./configure --prefix=/usr/local/php/4.3.2/ --with-mssql=/usr/local
> > > > --without-mysql
> > > > make
> > > > make install
> > > >
> > > > My freetds.conf looks like this :
> > > >
> > > > [global]
> > > > tds version = 8.0
> > > > initial block size = 512
> > > > swap broken dates = no
> > > > swap broken money = no
> > > > try server login = yes
> > > > try domain login = no
> > > > cross domain login = no
> > > > timeout = 30
> > > > connect timeout = 30
> > > > text size = 64512
> > > > [server]
> > > > host = x.x.x.x
> > > > port = 1433
> > > > tds version = 8.0
> > > >
> > > > I can connect, query etc.
> > > > But in several tables we have a column of type "uniqueidentifier" or
>
> 36;
>
> > > PHP
> > >
> > > > barks about that every time.
> > > >
> > > > Did I miss something ?
> > > >
> > > > I installed on a RedHat 9 box,
> > > > Thx in advance,
> > > >
> > > > Stefan Sonnenberg-Carstens
> > > >
> > > > _______________________________________________
> > > > 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






Archive powered by MHonArc 2.6.24.

Top of Page