Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
0ac7cfc8
Commit
0ac7cfc8
authored
Jan 14, 2008
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Db::set_errpfx. closes #272
git-svn-id:
file:///svn/tokudb@1654
c7de825b-a66e-492c-adef-691d508d4ae1
parent
24a344be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
cxx/db.cpp
cxx/db.cpp
+4
-0
cxx/tests/test_error_stream.cpp
cxx/tests/test_error_stream.cpp
+3
-1
No files found.
cxx/db.cpp
View file @
0ac7cfc8
...
...
@@ -167,6 +167,10 @@ int Db::associate(DbTxn *txnid, Db *secondary, int (*callback)(Db *secondary, co
return
the_Env
->
maybe_throw_error
(
ret
);
}
void
Db
::
set_errpfx
(
const
char
*
errpfx
)
{
the_Env
->
set_errpfx
(
errpfx
);
}
void
Db
::
set_error_stream
(
std
::
ostream
*
new_error_stream
)
{
the_Env
->
set_error_stream
(
new_error_stream
);
}
cxx/tests/test_error_stream.cpp
View file @
0ac7cfc8
...
...
@@ -13,13 +13,15 @@ int test_error_stream(const char *dbfile) {
r
=
creat
(
dbfile
,
0777
);
assert
(
r
>=
0
);
close
(
r
);
DbEnv
env
(
DB_CXX_NO_EXCEPTIONS
);
env
.
set_errpfx
(
"my_
test
_error_stream"
);
env
.
set_errpfx
(
"my_
env
_error_stream"
);
env
.
set_error_stream
(
&
std
::
cerr
);
r
=
env
.
open
(
"."
,
DB_INIT_MPOOL
+
DB_CREATE
+
DB_PRIVATE
,
0777
);
assert
(
r
==
0
);
r
=
env
.
open
(
"."
,
DB_INIT_MPOOL
+
DB_CREATE
+
DB_PRIVATE
,
0777
);
assert
(
r
==
EINVAL
);
Db
db
(
&
env
,
0
);
db
.
set_errpfx
(
"my_db_error_stream"
);
db
.
set_error_stream
(
&
std
::
cerr
);
r
=
db
.
open
(
0
,
dbfile
,
0
,
DB_BTREE
,
DB_CREATE
,
0777
);
assert
(
r
!=
0
);
r
=
db
.
close
(
0
);
assert
(
r
==
0
);
r
=
db
.
close
(
0
);
assert
(
r
==
EINVAL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment