Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating databases after opening env? #162

Open
coleifer opened this issue Apr 19, 2018 · 1 comment
Open

Creating databases after opening env? #162

coleifer opened this issue Apr 19, 2018 · 1 comment

Comments

@coleifer
Copy link

In the database documentation it states:

Database can be created, opened or deleted before or after environment startup

If I try to use a database after opening the environment, however, I get a segfault.

Example code:

	void *env = sp_env();
	sp_setstring(env, "sophia.path", "_test", 0);
	sp_setstring(env, "db", "foo", 0);
	int rc = sp_open(env);
	if (rc == -1)
		goto error;

	sp_setstring(env, "db", "test", 0);
	void *db = sp_getobject(env, "db.test");  // db is null pointer?
        void *o = sp_document(db);  // segfault here.

Am I misunderstanding the documentation, or is this a bug?

@coleifer
Copy link
Author

coleifer commented Oct 23, 2018

Looks like the docs are out-of-date and this functionality was removed (along with sp_close and sp_drop).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant