summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <abies@php.net>2004-06-01 08:38:33 +0000
committerArd Biesheuvel <abies@php.net>2004-06-01 08:38:33 +0000
commitff3a363d7a067ea07f5099f555d321f5f3340ec7 (patch)
treefde3c6fdd039fa29c9fd7bd18af72460592c0d9d
parent302fd9a77fa2ea5f8f4cd642a2a4b7029fb90bdc (diff)
downloadphp-git-ff3a363d7a067ea07f5099f555d321f5f3340ec7.tar.gz
Use constant IBASE_CREATE instead of just 0
-rw-r--r--ext/interbase/ibase_query.c5
-rw-r--r--ext/interbase/interbase.c1
-rwxr-xr-xext/interbase/php_ibase_includes.h1
-rwxr-xr-xext/interbase/tests/interbase.inc5
4 files changed, 8 insertions, 4 deletions
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 6493323081..76b539650f 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -1049,6 +1049,7 @@ PHP_FUNCTION(ibase_query)
switch (ZEND_NUM_ARGS()) {
long l;
+ zval *z;
default:
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3 TSRMLS_CC, "rrs",
@@ -1073,9 +1074,9 @@ PHP_FUNCTION(ibase_query)
break;
}
- /* assume the statement is 'CREATE DATABASE ...' if the link argument is int(0) */
+ /* the statement is 'CREATE DATABASE ...' if the link argument is IBASE_CREATE */
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS()
- TSRMLS_CC, "ls", &l, &query, &query_len) && l == 0) {
+ TSRMLS_CC, "zs", &z, &query, &query_len) ) {//&& l == PHP_IBASE_CREATE) {
isc_db_handle db = NULL;
isc_tr_handle trans = NULL;
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index f62ce1e675..03d9c572e6 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -465,6 +465,7 @@ PHP_MINIT_FUNCTION(ibase)
le_trans = zend_register_list_destructors_ex(_php_ibase_free_trans, NULL, "interbase transaction", module_number);
REGISTER_LONG_CONSTANT("IBASE_DEFAULT", PHP_IBASE_DEFAULT, CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IBASE_CREATE", PHP_IBASE_CREATE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_TEXT", PHP_IBASE_FETCH_BLOBS, CONST_PERSISTENT); /* deprecated, for BC only */
REGISTER_LONG_CONSTANT("IBASE_FETCH_BLOBS", PHP_IBASE_FETCH_BLOBS, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_FETCH_ARRAYS", PHP_IBASE_FETCH_ARRAYS, CONST_PERSISTENT);
diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h
index 6ec06efce3..9ee53172fe 100755
--- a/ext/interbase/php_ibase_includes.h
+++ b/ext/interbase/php_ibase_includes.h
@@ -114,6 +114,7 @@ typedef struct event {
enum php_interbase_option {
PHP_IBASE_DEFAULT = 0,
+ PHP_IBASE_CREATE = 0,
/* fetch flags */
PHP_IBASE_FETCH_BLOBS = 1,
PHP_IBASE_FETCH_ARRAYS = 2,
diff --git a/ext/interbase/tests/interbase.inc b/ext/interbase/tests/interbase.inc
index 55ca53c450..1401d9b821 100755
--- a/ext/interbase/tests/interbase.inc
+++ b/ext/interbase/tests/interbase.inc
@@ -14,8 +14,9 @@ function init_db()
{
global $test_base, $user, $password;
- $test_db = ibase_query(0, sprintf(" create Schema '%s' USER '%s' PASSWORD '%s' DEFAULT CHARACTER SET %s",
- $test_base, $user, $password, ($charset = ini_get('ibase.default_charset')) ? $charset : 'NONE'));
+ $test_db = ibase_query(IBASE_CREATE,
+ sprintf("CREATE SCHEMA '%s' USER '%s' PASSWORD '%s' DEFAULT CHARACTER SET %s",$test_base,
+ $user, $password, ($charset = ini_get('ibase.default_charset')) ? $charset : 'NONE'));
$tr = ibase_trans($test_db);
ibase_query($tr,"create table test1 (i integer, c varchar(100))");
ibase_commit_ret($tr);