Re: cvs: php4 /ext/fbsql php_fbsql.c

From: Date: Wed, 20 Mar 2002 07:30:22 +0000
Subject: Re: cvs: php4 /ext/fbsql php_fbsql.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10457@lists.php.net to get a copy of this message
Hi Andi, With the test I have performed, this works, but I'll test it against a system running on a 64 bit OS. As you can see in a later commit I changed LongInteger to match the actual definition within the databsae. (_I64 on Win32 and long long on other systems). - Frank > I don't know the API but are you sure you get this data aligned? > It might be unaligned as it's coming from the database. > In any case I would change v = *((long*)data); to memcpy(v, &data, > sizeof(long)) and the same for the tiny int. > > Andi > > At 18:33 19/03/2002 +0000, Frank M. Kromann wrote: > >fmk Tue Mar 19 13:33:07 2002 EDT > > > > Modified files: > > /php4/ext/fbsql php_fbsql.c > > Log: > > Adding support for TinyInteger and LongInteger database types > > > >Index: php4/ext/fbsql/php_fbsql.c > >diff -u php4/ext/fbsql/php_fbsql.c:1.77 php4/ext/fbsql/php_fbsql.c:1.78 > >--- php4/ext/fbsql/php_fbsql.c:1.77 Tue Mar 12 15:17:47 2002 > >+++ php4/ext/fbsql/php_fbsql.c Tue Mar 19 13:33:05 2002 > >@@ -16,7 +16,7 @@ > > +----------------------------------------------------------------------+ > > */ > > > >-/* $Id: php_fbsql.c,v 1.77 2002/03/12 20:17:47 andi Exp $ */ > >+/* $Id: php_fbsql.c,v 1.78 2002/03/19 18:33:05 fmk Exp $ */ > > > > /* TODO: > > * > >@@ -648,7 +648,6 @@ > > rawData = fbcdcFetch(result->link->connection, > > result->batchSize, result->fetchHandle); > > if (!fbcrhAddBatch(result->rowHandler, rawData)) > > result->rowCount = fbcrhRowCount(result->rowHandler); > > } > >- return 0; > > } > > > > > >@@ -2258,6 +2257,24 @@ > > int v = *((int*)data); > > char b[128]; > > sprintf(b, "%d", v); > >+ phpfbestrdup(b, length, value); > >+ } > >+ break; > >+ > >+ case FB_TinyInteger: > >+ { > >+ short int v = *((short int*)data); > >+ char b[128]; > >+ sprintf(b, "%d", v); > >+ phpfbestrdup(b, length, value); > >+ } > >+ break; > >+ > >+ case FB_LongInteger: > >+ { > >+ long v = *((long*)data); > >+ char b[128]; > >+ sprintf(b, "%li", v); > > phpfbestrdup(b, length, value); > > } > > break; > > > > > > > >-- > >PHP CVS Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.cvs (#10457) next »