mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
e68794b6d0
git-svn-id: file:///svn/tokudb@984 c7de825b-a66e-492c-adef-691d508d4ae1
93 lines
2.7 KiB
Groff
93 lines
2.7 KiB
Groff
.\" Process this file with
|
|
.\" groff -man -Tascii foo.1
|
|
.\"
|
|
.\" Copyright (c) 2007 Tokutek. All Rights Reserved.
|
|
.TH DB->open 3 "November 2007" Tokutek "TokuDB Programmer's Manual"
|
|
.SH NAME
|
|
DB->open
|
|
.SH SYNOPSIS
|
|
.LP
|
|
\fB #include <db.h>
|
|
.br
|
|
.sp
|
|
.HP 13
|
|
.BI "int DB->open(DB *" db ,
|
|
.br
|
|
.BI "DB_TXN *" txnid ,
|
|
.br
|
|
.BI "const char *" file ,
|
|
.br
|
|
.BI "const char *" database ,
|
|
.br
|
|
.BI "DBTYPE " type ,
|
|
.br
|
|
.BI "u_int32_t " flags ,
|
|
.br
|
|
.BI "int " mode );
|
|
.br
|
|
.SH DESCRIPTION
|
|
.B DB->open
|
|
opens the database named by
|
|
.I file
|
|
and
|
|
.I database.
|
|
.LP
|
|
The database is opened read/write.
|
|
.LP
|
|
The \fBDB->open\fR operation is expensive. If possible, open a
|
|
database once, and reuse the \fBDB\fR handle for many operations.
|
|
.SH PARAMETERS
|
|
.IP \fIdb
|
|
A unopened \fBDB\fR handle that was created using \fBdb_create()\fR.
|
|
.IP \fItxnid
|
|
Either \fBNULL\fR or a \fBTXNID\fR.
|
|
.IP \fIfile
|
|
The name of the file that holds the database.
|
|
.IP
|
|
The
|
|
.B file
|
|
must be non-\fBNULL\fR. TokuDB does not currently support in-memory databases.
|
|
.IP \fIdatabase
|
|
If \fBNULL\fR then the file contains only one unnamed database.
|
|
Otherwise \fIdatabase\fR specifies the name of a database stored
|
|
within the file.
|
|
.IP \fItype
|
|
must be set to \fBDB_BTREE\fR.
|
|
.IP \fIflags
|
|
must be zero or the bitwise-or of one or more of the following values:
|
|
.RS 4
|
|
.IP \fBDB_CREATE
|
|
Create the database if it does not exist. If the database does not
|
|
already exist and \fBDB_CREATE\fR is not specified, then the
|
|
\fBDB->open\fR will fail.
|
|
.RE
|
|
.IP \fImode
|
|
The mode (see \fBchmod\fR(2)) modified by the \fBumask\fR(2), used when a file is created.
|
|
.SH RETURN VALUE
|
|
.LP
|
|
Returns zero on success. The following non-zero errors can be returned:
|
|
.IP \fBDB_DEADLOCK
|
|
The system discovered deadlock cycle involving this and other transactions.
|
|
This operation was killed.
|
|
.IP \fBDB_LOCK_NOTGRANTED
|
|
In an environment configured for lock timeouts, the system was unable to grant a lock within the allowed time.
|
|
.IP \fBENOENT
|
|
The file or directory does not exist.
|
|
.IP \fBEINVAL
|
|
You passed invalid parameters to this operation. In many cases
|
|
\fBEINVAL\fR
|
|
is not a very helpful error code, indicating only that you did something wrong.
|
|
.SH CONFORMING TO
|
|
The TokuDB embedded database provides a subset of the functionality of
|
|
the Berkeley DB. Programs that work with TokuDB probably work with
|
|
with most versions of Berkeley DB with only recompilation or
|
|
relinking. The database files are incompatible, however, so to
|
|
convert from one library to the other you would need to dump the
|
|
database with one library's tool and load it with the other's.
|
|
.SH RESTRICTIONS
|
|
.LP
|
|
Restrictions: At most a few thousand databases per file.
|
|
.SH AUTHOR
|
|
Tokutek, Inc.
|
|
.SH COPYRIGHT
|
|
Copyright (c) 2007 Tokutek. All Rights Reserved.
|