[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2005-02-09 Thread Frank M. Kromann
fmk Wed Feb  9 14:33:33 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c 
  Log:
  MFH: change return value from false to true, when a statement was executed 
with warnings
  
http://cvs.php.net/diff.php/php-src/ext/fbsql/php_fbsql.c?r1=1.86.2.13&r2=1.86.2.14&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.13 
php-src/ext/fbsql/php_fbsql.c:1.86.2.14
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.13 Wed Feb  9 13:50:49 2005
+++ php-src/ext/fbsql/php_fbsql.c   Wed Feb  9 14:33:32 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.13 2005/02/09 18:50:49 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.14 2005/02/09 19:33:32 fmk Exp $ */
 
 /* TODO:
  *
@@ -1859,7 +1859,7 @@
tp = fbcmdStatementType(md);
if (tp == NULL) {
fbcmdRelease(meta);
-   ZVAL_BOOL(return_value, 0)
+   ZVAL_BOOL(return_value, 1)
}
else if ((tp[0] == 'C') || (tp[0] == 'R'))
{

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2005-02-09 Thread Frank M. Kromann
fmk Wed Feb  9 13:50:50 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c 
  Log:
  MFH: Check for warnings and return the warning texts
  
http://cvs.php.net/diff.php/php-src/ext/fbsql/php_fbsql.c?r1=1.86.2.12&r2=1.86.2.13&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.12 
php-src/ext/fbsql/php_fbsql.c:1.86.2.13
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.12 Thu Jan 27 15:22:27 2005
+++ php-src/ext/fbsql/php_fbsql.c   Wed Feb  9 13:50:49 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.12 2005/01/27 20:22:27 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.13 2005/02/09 18:50:49 fmk Exp $ */
 
 /* TODO:
  *
@@ -1807,11 +1807,28 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No 
message");
}
link->errorText = strdup(emg);
-   link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
+   link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);
free(emg);
fbcemdRelease(emd);
result = 0;
}
+   else if (fbcmdWarningsFound(md))
+   {
+   FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md);
+   char* emg = fbcemdAllErrorMessages(emd);
+   if (FB_SQL_G(generateWarnings))
+   {
+   if (emg)
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Warning in statement: '%s' %s", sql, emg);
+   else
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "No 
message");
+   }
+   link->errorText = strdup(emg);
+   link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);
+   free(emg);
+   fbcemdRelease(emd);
+   result = 1;
+   }
return result;
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2005-01-27 Thread Frank M. Kromann
fmk Thu Jan 27 15:22:27 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c 
  Log:
  MFH: Hack to fix crash caused by FBCAccess not returning errors when creating 
an index that exists in the database.
  
http://cvs.php.net/diff.php/php-src/ext/fbsql/php_fbsql.c?r1=1.86.2.11&r2=1.86.2.12&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.11 
php-src/ext/fbsql/php_fbsql.c:1.86.2.12
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.11 Wed Dec 29 15:20:52 2004
+++ php-src/ext/fbsql/php_fbsql.c   Thu Jan 27 15:22:27 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.11 2004/12/29 20:20:52 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.12 2005/01/27 20:22:27 fmk Exp $ */
 
 /* TODO:
  *
@@ -1840,9 +1840,12 @@
md = meta;
 
tp = fbcmdStatementType(md);
-
-   if ((tp[0] == 'C') || (tp[0] == 'R'))
-   {
+   if (tp == NULL) {
+   fbcmdRelease(meta);
+   ZVAL_BOOL(return_value, 0)
+   }
+   else if ((tp[0] == 'C') || (tp[0] == 'R'))
+   {
if (sR == 1 && md) fbcmdRelease(md);
ZVAL_BOOL(return_value, 1)
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2004-12-29 Thread Frank M. Kromann
fmk Wed Dec 29 15:20:52 2004 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c 
  Log:
  MFH: Fix typo
  
http://cvs.php.net/diff.php/php-src/ext/fbsql/php_fbsql.c?r1=1.86.2.10&r2=1.86.2.11&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.10 
php-src/ext/fbsql/php_fbsql.c:1.86.2.11
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.10 Thu Dec 23 14:29:36 2004
+++ php-src/ext/fbsql/php_fbsql.c   Wed Dec 29 15:20:52 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.10 2004/12/23 19:29:36 iliaa Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.11 2004/12/29 20:20:52 fmk Exp $ */
 
 /* TODO:
  *
@@ -825,7 +825,7 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locking 
type.");
RETURN_FALSE;
}
-   if (Z_LVAL_PP(strIsolation) < 0 || Z_LVAL_PP(Isolation) > 4) {
+   if (Z_LVAL_PP(Isolation) < 0 || Z_LVAL_PP(Isolation) > 4) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid isolation 
type.");
RETURN_FALSE;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2004-12-23 Thread Ilia Alshanetsky
iliaa   Thu Dec 23 14:29:36 2004 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c 
  Log:
  MFH: Fixed several buffer overflows.
  
  
http://cvs.php.net/diff.php/php-src/ext/fbsql/php_fbsql.c?r1=1.86.2.9&r2=1.86.2.10&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.9 
php-src/ext/fbsql/php_fbsql.c:1.86.2.10
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.9  Tue Aug 24 14:00:05 2004
+++ php-src/ext/fbsql/php_fbsql.c   Thu Dec 23 14:29:36 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.9 2004/08/24 18:00:05 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.10 2004/12/23 19:29:36 iliaa Exp $ */
 
 /* TODO:
  *
@@ -459,11 +459,11 @@
 
if (FB_SQL_G(allowPersistent))
{
-   sprintf(buf, "%ld", FB_SQL_G(persistentCount));
+   snprintf(buf, sizeof(buf), "%ld", FB_SQL_G(persistentCount));
php_info_print_table_row(2, "Active Persistent Links", buf);
}
 
-   sprintf(buf, "%ld", FB_SQL_G(linkCount));
+   snprintf(buf, sizeof(buf), "%ld", FB_SQL_G(linkCount));
php_info_print_table_row(2, "Active Links", buf);
 
 /*
@@ -507,7 +507,9 @@
if (userName == NULL) userName = FB_SQL_G(userName);
if (userPassword == NULL) userPassword = FB_SQL_G(userPassword);
 
-   sprintf(name, "fbsql_%s_%s_%s", hostName, userName, userPassword);
+   if (snprintf(name, sizeof(name), "fbsql_%s_%s_%s", hostName, userName, 
userPassword) < 0) {
+   RETURN_FALSE;
+   }
 
if (!FB_SQL_G(allowPersistent)) {
persistent=0;
@@ -818,9 +820,21 @@
WRONG_PARAM_COUNT;
break;
}
+
+   if (Z_LVAL_PP(Locking) < 0 || Z_LVAL_PP(Locking) > 2) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locking 
type.");
+   RETURN_FALSE;
+   }
+   if (Z_LVAL_PP(strIsolation) < 0 || Z_LVAL_PP(Isolation) > 4) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid isolation 
type.");
+   RETURN_FALSE;
+   }
+
ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, 
"FrontBase-Link", le_link, le_plink);
 
-   sprintf(strSQL, "SET TRANSACTION LOCKING %s, ISOLATION %s;", 
strLocking[Z_LVAL_PP(Locking)], strIsolation[Z_LVAL_PP(Isolation)]);
+   if (snprintf(strSQL, sizeof(strSQL) , "SET TRANSACTION LOCKING %s, 
ISOLATION %s;", strLocking[Z_LVAL_PP(Locking)], 
strIsolation[Z_LVAL_PP(Isolation)]) < 0) {
+   RETURN_FALSE;
+   }
 
md = fbcdcExecuteDirectSQL(phpLink->connection, strSQL);
fbcmdRelease(md);
@@ -1417,7 +1431,9 @@
convert_to_string_ex(password);
userPassword = Z_STRVAL_PP(password);
 
-   sprintf(buffer, "SET AUTHORIZATION %s;", userName);
+   if (snprintf(buffer, sizeof(buffer), "SET AUTHORIZATION %s;", userName) 
< 0) {
+   RETURN_FALSE;
+   }
 
phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, buffer, phpLink);
if (Z_LVAL_P(return_value))
@@ -2084,7 +2100,9 @@
RETURN_FALSE;
}
 
-   sprintf(sql, "SELECT * FROM %s WHERE 1=0;", tableName);
+   if (snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE 1=0;", 
tableName) < 0) {
+   RETURN_FALSE;
+   }
 
phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink);
 }
@@ -2268,7 +2286,7 @@
{ 
int v = *((int*)data);
char b[128];
-   sprintf(b, "%d", v);
+   snprintf(b, sizeof(b), "%d", v);
phpfbestrdup(b, length, value);
}
break;
@@ -2277,7 +2295,7 @@
{ 
short int v = *((FBTinyInteger*)data);
char b[128];
-   sprintf(b, "%d", v);
+   snprintf(b, sizeof(b), "%d", v);
phpfbestrdup(b, length, value);
}
break;
@@ -2288,9 +2306,9 @@
FBLongInteger v = *((FBLongInteger*)data);
char b[128];
 #ifdef PHP_WIN32
-   sprintf(b, "%I64i", v);
+   snprintf(b, sizeof(b), "%I64i", v);
 #else
-   sprintf(b, "%ll", v);
+   snprintf(b, sizeof(b), "%ll", v);
 #endif
phpfbestrdup(b, length, value);
}
@@ -2300,7 +2318,7 @@
{
short v = *((short*)data);
char b[128];
-   sprintf(b, "%d", v);
+   snprintf(b, sizeof(b), "%d", v);
phpfbestrdup(b, length, value);
}
break; 
@@ -2313,7 +2331,7 @@
{
 

[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2004-08-24 Thread Frank M. Kromann
fmk Tue Aug 24 14:00:06 2004 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c 
  Log:
  Fix a possible crash in fbsql_database() if the function was called before a 
connection was made.
  
http://cvs.php.net/diff.php/php-src/ext/fbsql/php_fbsql.c?r1=1.86.2.8&r2=1.86.2.9&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.8 php-src/ext/fbsql/php_fbsql.c:1.86.2.9
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.8  Mon Feb  9 12:58:24 2004
+++ php-src/ext/fbsql/php_fbsql.c   Tue Aug 24 14:00:05 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.8 2004/02/09 17:58:24 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.9 2004/08/24 18:00:05 fmk Exp $ */
 
 /* TODO:
  *
@@ -1213,7 +1213,12 @@
if (phpLink->databaseName) free(phpLink->databaseName);
phpLink->databaseName = strdup(Z_STRVAL_PP(dbname));
}
-   RETURN_STRING(phpLink->databaseName, 1);
+   if (phpLink->databaseName) {
+   RETURN_STRING(phpLink->databaseName, 1);
+   }
+   else {
+   RETURN_FALSE;
+   }
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2004-02-09 Thread Ilia Alshanetsky
I presume this is a 'feature' and not a bug?

Ilia

On February 09, 2004 12:58 pm, Frank M. Kromann wrote:
> fmk   Mon Feb  9 12:58:25 2004 EDT
>
>   Modified files:  (Branch: PHP_4_3)
> /php-src/ext/fbsqlphp_fbsql.c
>   Log:
>   Delay creation of exec handle til it's needed

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2004-02-09 Thread Frank M. Kromann
fmk Mon Feb  9 12:58:25 2004 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c 
  Log:
  Delay creation of exec handle til it's needed
  http://cvs.php.net/diff.php/php-src/ext/fbsql/php_fbsql.c?r1=1.86.2.7&r2=1.86.2.8&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.7 php-src/ext/fbsql/php_fbsql.c:1.86.2.8
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.7  Thu Oct  2 14:48:18 2003
+++ php-src/ext/fbsql/php_fbsql.c   Mon Feb  9 12:58:24 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.7 2003/10/02 18:48:18 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.8 2004/02/09 17:58:24 fmk Exp $ */
 
 /* TODO:
  *
@@ -83,30 +83,28 @@
required buffereing from of results.
 
In the PHP code the 3 above a data structures are referenced by means of 
integers in the
-   range from 1 to som configurable maximum.  You can put a limit to the number 
of links, databases
-   and results.  The integer identifications is implemented by insertion in the 
list, which is passed
+   range from 1 to som configurable maximum. You can put a limit to the number of 
links, databases
+   and results. The integer identifications is implemented by insertion in the 
list, which is passed
as an argument to all the functions, please note the list is polymorph.
 
Database objects and link objects are all reused, base on the host name user 
name, host name database name 
-   user name.  So connecting twice to the same database as the same user will 
return the same database id.
+   user name. So connecting twice to the same database as the same user will 
return the same database id.
We use the same coding for that as fbsql does, explioiting the underlying 
implementation of the lists.
 
Persistent objects are put in the persistent list as well, but only by name, 
if you connect to a persistent object
-   and it is not in the list it is simply added and get a new index, and 
refcounted.  Tricky, tricky ...
+   and it is not in the list it is simply added and get a new index, and 
refcounted. Tricky, tricky ...
 */
 
 /* Some functions which should be exported from FBCAccess */
 
-void*fbaObjectAtIndex();
-void fbaRelease();
-unsigned int fbaCount();
+void*  fbaObjectAtIndex();
+void   fbaRelease();
+unsigned int   fbaCount();
 
 struct FBCAutoStartInfo {
-   FBArray* infoLines;
+   FBArray* infoLines;
 };
 
-
-
 struct PHPFBResult
 {
PHPFBLink*  link;   /* The 
link for the result, may be NULL if no link  */
@@ -115,7 +113,7 @@
FBCMetaData*ResultmetaData; /* The metadata 
describing the result */
FBCRowHandler*  rowHandler; /* The row 
handler, the Frontbase structure used for accessing rows in the result */
unsigned intbatchSize;  /* The number 
of row to fetch when expanding the number of rows in the row handler */
-   unsigned introwCount;   /* The number 
of rows in the results set.  The number of row is not in */
+   unsigned introwCount;   /* The number 
of rows in the results set. The number of row is not in */
/* general known when the select is 
done, one typically needs to fetch all the row
   to figure out how many row you got. 
When the rowCount is unknown the value is
   0x7 */
@@ -280,10 +278,10 @@
FBCMetaData *md = fbcdcCancelFetch(result->link->connection, 
result->fetchHandle);
fbcmdRelease(md);
}
-   if (result->rowHandler)  fbcrhRelease(result->rowHandler);
-   if (result->ResultmetaData)fbcmdRelease(result->ResultmetaData);
-   if (result->list)fbcplRelease(result->list);
-   if (result->array)   fbaRelease(result->array);
+   if (result->rowHandler) fbcrhRelease(result->rowHandler);
+   if (result->ResultmetaData) fbcmdRelease(result->ResultmetaData);
+   if (result->list)   fbcplRelease(result->list);
+   if (result->array)  fbaRelease(result->array);
efree(result);
}
 }
@@ -389,7 +387,7 @@
fbsql_globals->persistentCount  = 0;
fbsql_globals->linkCount= 0;
 }
-
+
 PHP_MINIT_FUNCTION(fbsql)
 {
ZEND_INIT_MODULE_GLOBALS(fbsql, php_fbsql_init_globals, NULL);
@@ -397,7 +395,7 @@
  

[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c

2003-10-02 Thread Frank M. Kromann
fmk Thu Oct  2 14:48:19 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c 
  Log:
  Fixing type cast
  
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.6 php-src/ext/fbsql/php_fbsql.c:1.86.2.7
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.6  Thu Jul  3 12:45:31 2003
+++ php-src/ext/fbsql/php_fbsql.c   Thu Oct  2 14:48:18 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.6 2003/07/03 16:45:31 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.7 2003/10/02 18:48:18 fmk Exp $ */
 
 /* TODO:
  *
@@ -2278,7 +2278,7 @@
 #ifdef FB_TinyInteger
case FB_TinyInteger:
{ 
-   short int   v = *((short int*)data);
+   short int   v = *((FBTinyInteger*)data);
char  b[128];
sprintf(b, "%d", v);
phpfbestrdup(b, length, value);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/fbsql php_fbsql.c php_fbsql.h

2003-07-03 Thread Frank M. Kromann
fmk Thu Jul  3 12:45:31 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/fbsql  php_fbsql.c php_fbsql.h 
  Log:
  Change fetch functions and protos so they make more sense.
  fetch_row or fetch_assoc should  not take the optional parameter
  
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.86.2.5 php-src/ext/fbsql/php_fbsql.c:1.86.2.6
--- php-src/ext/fbsql/php_fbsql.c:1.86.2.5  Fri Jun 13 23:36:09 2003
+++ php-src/ext/fbsql/php_fbsql.c   Thu Jul  3 12:45:31 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.86.2.5 2003/06/14 03:36:09 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.86.2.6 2003/07/03 16:45:31 fmk Exp $ */
 
 /* TODO:
  *
@@ -358,9 +358,9 @@
 /* {{{ PHP_INI
  */
 PHP_INI_BEGIN()
-   STD_PHP_INI_BOOLEAN  ("fbsql.allow_persistent", "1",   
 PHP_INI_SYSTEM, OnUpdateInt,allowPersistent,  zend_fbsql_globals, 
fbsql_globals)
-   STD_PHP_INI_BOOLEAN  ("fbsql.generate_warnings","0",   
 PHP_INI_SYSTEM, OnUpdateInt,generateWarnings, zend_fbsql_globals, 
fbsql_globals)
-   STD_PHP_INI_BOOLEAN  ("fbsql.autocommit",  
 "1",PHP_INI_SYSTEM, OnUpdateInt,autoCommit,   
zend_fbsql_globals, fbsql_globals)
+   STD_PHP_INI_BOOLEAN  ("fbsql.allow_persistent", "1",   
 PHP_INI_SYSTEM, OnUpdateBool,   allowPersistent,  zend_fbsql_globals, 
fbsql_globals)
+   STD_PHP_INI_BOOLEAN  ("fbsql.generate_warnings","0",   
 PHP_INI_SYSTEM, OnUpdateBool,   generateWarnings, zend_fbsql_globals, 
fbsql_globals)
+   STD_PHP_INI_BOOLEAN  ("fbsql.autocommit",  
 "1",PHP_INI_SYSTEM, OnUpdateBool,   autoCommit,   
zend_fbsql_globals, fbsql_globals)
STD_PHP_INI_ENTRY_EX ("fbsql.max_persistent",   "-1",  
 PHP_INI_SYSTEM, OnUpdateInt,maxPersistent,zend_fbsql_globals, 
fbsql_globals, display_link_numbers)
STD_PHP_INI_ENTRY_EX ("fbsql.max_links",   
 "128",  PHP_INI_SYSTEM, OnUpdateInt,maxLinks, zend_fbsql_globals, 
fbsql_globals, display_link_numbers)
STD_PHP_INI_ENTRY_EX ("fbsql.max_connections",  "128", 
 PHP_INI_SYSTEM, OnUpdateInt,maxConnections,   zend_fbsql_globals, 
fbsql_globals, display_link_numbers)
@@ -2706,7 +2706,7 @@
Fetch a row of data. Returns an indexed array */
 PHP_FUNCTION(fbsql_fetch_row)
 {
-   php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM);
+   php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM, 1);
 }
 /* }}} */
 
@@ -2714,7 +2714,7 @@
Detch a row of data. Returns an assoc array */
 PHP_FUNCTION(fbsql_fetch_assoc)
 {
-   php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC);
+   php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 1);
 }
 /* }}} */
 
@@ -2722,7 +2722,7 @@
Fetch a row of data. Returns an object */
 PHP_FUNCTION(fbsql_fetch_object)
 {
-   php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC);
+   php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 2);
if (Z_TYPE_P(return_value)==IS_ARRAY) {
object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, 
Z_ARRVAL_P(return_value));
}
@@ -2733,7 +2733,7 @@
Fetches a result row as an array (associative, numeric or both)*/
 PHP_FUNCTION(fbsql_fetch_array)
 {
-   php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH);
+   php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH, 2);
 }
 /* }}} */
 
@@ -2781,7 +2781,7 @@
}
 }
 
-static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
+static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int 
expected_args)
 {
 
PHPFBResult* result = NULL;
@@ -2789,6 +2789,10 @@
int rowIndex;
int i;
void **row;
+
+   if (ZEND_NUM_ARGS() > expected_args) {
+   WRONG_PARAM_COUNT;
+   }
 
switch (ZEND_NUM_ARGS()) {
case 1:
Index: php-src/ext/fbsql/php_fbsql.h
diff -u php-src/ext/fbsql/php_fbsql.h:1.21.2.3 php-src/ext/fbsql/php_fbsql.h:1.21.2.4
--- php-src/ext/fbsql/php_fbsql.h:1.21.2.3  Fri Jun 13 23:36:09 2003
+++ php-src/ext/fbsql/php_fbsql.h   Thu Jul  3 12:45:31 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.h,v 1.21.2.3 2003/06/14 03:36:09 fmk Exp $ */
+/* $Id: php_fbsql.h,v 1.21.2.4 2003/07/03 16:45:31 fmk Exp $ */
 
 #define HAVE_FBSQL 1
 
@@ -101,7 +101,7 @@
 PHP_FUNCTION(fbsql_get_autostart_info);
 /* PHP_FUNCTION(fbsql_set_autostart_