summaryrefslogtreecommitdiff
path: root/ext/fbsql/php_fbsql.c
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>2005-04-11 19:22:01 +0000
committerFrank M. Kromann <fmk@php.net>2005-04-11 19:22:01 +0000
commit81837f718bf08fef57a5af4c2ab0df6138c30b41 (patch)
treed32acb7073e594f3f874efeb9467f5540f38e943 /ext/fbsql/php_fbsql.c
parent2a83dbdf1ccaf8be1dbb98734b5e0851fe723c6c (diff)
downloadphp-git-81837f718bf08fef57a5af4c2ab0df6138c30b41.tar.gz
Don't truncate the .options file when a database is started without the optional options parameter.
Diffstat (limited to 'ext/fbsql/php_fbsql.c')
-rw-r--r--ext/fbsql/php_fbsql.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c
index 4222eb7330..2e5fe334fc 100644
--- a/ext/fbsql/php_fbsql.c
+++ b/ext/fbsql/php_fbsql.c
@@ -1555,7 +1555,7 @@ PHP_FUNCTION(fbsql_create_db)
zval **fbsql_link_index = NULL, **database_name, **database_options = NULL;
int id;
int i, status;
- char *databaseName, *databaseOptions;
+ char *databaseName, *databaseOptions = NULL;
switch (ZEND_NUM_ARGS()) {
case 1:
@@ -1762,7 +1762,16 @@ PHP_FUNCTION(fbsql_start_db)
if (status == FBStopped)
{
- if (!fbcehStartDatabaseNamedWithOptions(phpLink->execHandler, databaseName, databaseOptions))
+ int dbstarted;
+ if (databaseOptions != NULL)
+ {
+ dbstarted = fbcehStartDatabaseNamedWithOptions(phpLink->execHandler, databaseName, databaseOptions);
+ }
+ else
+ {
+ dbstarted = fbcehStartDatabaseNamed(phpLink->execHandler, databaseName);
+ }
+ if (!dbstarted)
{
char* error = fbechErrorMessage(phpLink->execHandler);
if (FB_SQL_G(generateWarnings))