fmk             Thu Jan 27 15:13:05 2005 EDT

  Modified files:              
    /php-src/ext/fbsql  php_fbsql.c 
  Log:
  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.109&r2=1.110&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.109 php-src/ext/fbsql/php_fbsql.c:1.110
--- php-src/ext/fbsql/php_fbsql.c:1.109 Wed Dec 29 15:18:34 2004
+++ php-src/ext/fbsql/php_fbsql.c       Thu Jan 27 15:13:04 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_fbsql.c,v 1.109 2004/12/29 20:18:34 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.110 2005/01/27 20:13:04 fmk Exp $ */
 
 /* TODO:
  *
@@ -1455,7 +1455,7 @@
 {
        PHPFBLink* phpLink = NULL;
        zval **fbsql_link_index, **zcharset, **zin_out;
-       int id;
+       int id = -1;
        int charset = -1, in_out_both = 3;
 
        switch (ZEND_NUM_ARGS()) {
@@ -1944,7 +1944,6 @@
        unsigned int   sR = 1, cR = 0;
 
        meta = fbcdcExecuteDirectSQL(link->connection, sql);
-
        if (!mdOk(link, meta, sql))
        {
                fbcmdRelease(meta);
@@ -1959,8 +1958,11 @@
                        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)
@@ -2054,7 +2056,6 @@
        ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, 
"FrontBase-Link", le_link, le_plink);
 
        convert_to_string_ex(query);
-
        phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), 
phpLink, bs);
 }
 /* }}} */

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

Reply via email to