From 81837f718bf08fef57a5af4c2ab0df6138c30b41 Mon Sep 17 00:00:00 2001 From: "Frank M. Kromann" Date: Mon, 11 Apr 2005 19:22:01 +0000 Subject: [PATCH] Don't truncate the .options file when a database is started without the optional options parameter. --- ext/fbsql/php_fbsql.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c index 4222eb73304..2e5fe334fc8 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))