diff options
| author | Jouni Ahto <jah@php.net> | 2000-06-27 21:36:26 +0000 |
|---|---|---|
| committer | Jouni Ahto <jah@php.net> | 2000-06-27 21:36:26 +0000 |
| commit | 1dfe76f5f6bfb7b866fd0ff88fff0d47ab7251b5 (patch) | |
| tree | b6d19e2cab2fc0be1cccea6543fc31bd33b043da /ext/dba/dba_db2.c | |
| parent | c860633741a1931d9f9e5298b21a8dc8efbc0fad (diff) | |
| download | php-git-1dfe76f5f6bfb7b866fd0ff88fff0d47ab7251b5.tar.gz | |
- dba_[p]open accepts now a new parameter, which kind of database to create
(DBA_BTREE or DBA_HASH), if the handler is either 'db2' or 'db3' and
mode 'c' or 'n'. It is ignored if mode is 'c' and the db already exists.
# Asked on the list 4 1/2 hours ago if anyone's got to say something to this,
# no response, so I'm assuming it's ok. And yes, I did test this.
Diffstat (limited to 'ext/dba/dba_db2.c')
| -rw-r--r-- | ext/dba/dba_db2.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c index de68974358..67eb366c60 100644 --- a/ext/dba/dba_db2.c +++ b/ext/dba/dba_db2.c @@ -76,6 +76,21 @@ DBA_OPEN_FUNC(db2) filemode = (*info->argv[0])->value.lval; } + if(info->argc > 1 + && ((info->mode == DBA_CREAT && type != DB_UNKNOWN) + || info->mode == DBA_TRUNC)) { + convert_to_long_ex(info->argv[1]); + switch ((*info->argv[1])->value.lval) { + case DBA_HASH: + type = DB_HASH; + break; + case DBA_BTREE: + default: + type = DB_BTREE; + break; + } + } + if(!db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) { info->dbf = malloc(sizeof(dba_db2_data)); memset(info->dbf, 0, sizeof(dba_db2_data)); |
