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

incomplete database initialization #2875

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

incomplete database initialization #2875

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2011-09-05 16:08:55 +0200
From: @sjoerdmullender
To: SQL devs <>
Version: 11.5.7 (Aug2011-SP2) [obsolete]
CC: @njnes

Last updated: 2011-11-22 13:55:54 +0100

Comment 16183

Date: 2011-09-05 16:08:55 +0200
From: @sjoerdmullender

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110816 Fedora/3.6.20-1.fc14 Firefox/3.6.20
Build Identifier:

The database is not properly initialized in certain situations. See below.

Reproducible: Always

Steps to Reproduce:

1.start mserver5 with new (i.e. not yet existing) database
2.stop mserver5
3.start mserver5 again with same database
4.connect to mserver5 with mclient
5.dump database with \D

Actual Results:

Non-empty database:

START TRANSACTION;
SET SCHEMA "sys";
CREATE FUNCTION env () RETURNS TABLE( name varchar(1024), value varchar(2048)) EXTERNAL NAME sql.sql_environment;
CREATE FUNCTION var() RETURNS TABLE( name varchar(1024)) EXTERNAL NAME sql.sql_variables;
CREATE FUNCTION db_users () RETURNS TABLE( name varchar(2048)) EXTERNAL NAME sql.db_users;
COMMIT;

Expected Results:

Empty database:

START TRANSACTION;
COMMIT;

When mclient connects, the server executes the function SQLinitClient(). This function uses the global variable SQLnewcatalog to determine whether to execute the "createdb" scripts. The variable is ultimately initialized by the call to logger_funcs.log_isnew(). The second time the server is run, log_isnew() says that it is not new anymore, causing createdb to be skipped.

Comment 16206

Date: 2011-09-11 13:08:13 +0200
From: @njnes

We could verify (using a query on the base tables) if initialisation is done.
For example simply check for some default function should be enough.

Comment 16479

Date: 2011-10-27 10:59:18 +0200
From: @sjoerdmullender

Changeset 4751ff65d8e8 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=4751ff65d8e8

Changeset description:

Execute initialization code when sys.systemfunctions does not exist.
This fixes bug #2875.

Comment 16480

Date: 2011-10-27 13:10:44 +0200
From: @sjoerdmullender

Changeset 129f02da694c made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=129f02da694c

Changeset description:

Added test for bug #2875.

Comment 16481

Date: 2011-10-27 13:11:07 +0200
From: @sjoerdmullender

Bug is fixed.

Comment 16565

Date: 2011-11-22 13:55:54 +0100
From: @grobian

Fixed in Aug2011-SP3

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

Successfully merging a pull request may close this issue.

None yet
1 participant