summaryrefslogtreecommitdiff
path: root/ext/fbsql/php_fbsql.c
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>2005-01-27 20:13:04 +0000
committerFrank M. Kromann <fmk@php.net>2005-01-27 20:13:04 +0000
commita13734d2f7ef2b83e9b8dc566903d29cde1f887b (patch)
tree1100c73e282d1cf8616fb97ab9dcbbde64e00ab4 /ext/fbsql/php_fbsql.c
parent42155f60282a7c6514e70756b22d7f384277b75b (diff)
downloadphp-git-a13734d2f7ef2b83e9b8dc566903d29cde1f887b.tar.gz
Hack to fix crash caused by FBCAccess not returning errors when creating an index that exists in the database.
Diffstat (limited to 'ext/fbsql/php_fbsql.c')
-rw-r--r--ext/fbsql/php_fbsql.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c
index e13f9e4dfc..72e447a8d1 100644
--- a/ext/fbsql/php_fbsql.c
+++ b/ext/fbsql/php_fbsql.c
@@ -1455,7 +1455,7 @@ PHP_FUNCTION(fbsql_set_characterset)
{
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 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link,
unsigned int sR = 1, cR = 0;
meta = fbcdcExecuteDirectSQL(link->connection, sql);
-
if (!mdOk(link, meta, sql))
{
fbcmdRelease(meta);
@@ -1959,8 +1958,11 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link,
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 @@ PHP_FUNCTION(fbsql_query)
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);
}
/* }}} */