[Monetdb-developers] simple sql corrupts db

Mark Bucciarelli mkbucc at gmail.com
Tue Apr 6 17:01:56 CEST 2010


a couple weeks ago i posted two bug
reports that show how a simple sql
script can corrupt the database (that
is, trigger load_idxcolumn: `kc->c'
assertion failures when connecting).

the reports include a test script that
duplicated the behavior 100% of the
time on my install (Feb2010).

i'm reposting the scripts below as it
seems there are more eyeballs
here than on tracker.

is one of the drop clauses i used
unsupported?

is there a workaround?

thanks,

m

$ ./test.sh
Creating Monet database tst
created database in maintenance mode: tst
starting database 'tst'... done
taken database out of maintenance mode: tst
stopping database 'tst'... done
starting database 'tst'... FAILED
start: starting 'tst' failed: database 'tst' has crashed after starting,
manual intervention needed, check merovingian's logfile for details
$ tail -3 /var/log/merovingian.log
2010-03-23 00:09:46 ERR tst[27143]: mserver5: store.mx:373: load_idxcolumn:
Assertion `kc->c' failed.
2010-03-23 00:09:46 MSG merovingian[28274]: database 'tst' (27143) was
killed by signal 6
2010-03-23 00:09:56 ERR control[28274]: (local): failed to fork mserver:
database 'tst' has crashed after starting, manual intervention needed,
check merovingian's logfile for details
$ cat test.sh
#! /bin/sh -e
#
# Create tst database in MonetDB.
#

user=monetdb
pass=monetdb
db=tst
schema=tst

#
# Note: doesn't abort if database already exists.
#

echo "Creating Monet database ${db}"
sudo monetdb create ${db} || exit 1
sudo monetdb start ${db} || exit 1
sudo monetdb release ${db}

export DOTMONETDBFILE="./.testmonetdb"
cat > ${DOTMONETDBFILE} << EOF
user=${user}
password=${pass}
language=sql
EOF

sql="CREATE SCHEMA "${schema}" AUTHORIZATION "${user}";"
mclient -d ${db} -s "${sql}"
mclient -d ${db} < test.sql

sudo monetdb stop tst
sudo monetdb start tst
#sudo monetdb stop tst && sudo monetdb destroy tst
$ cat test.sql
--
-- Setup two test tables, one that references the other.
-- 

CREATE TABLE "tst"."t1" (
"id" int NOT NULL,
CONSTRAINT "t1_id_pkey" PRIMARY KEY ("id")
);

CREATE TABLE "tst"."t2" (
"id" int NOT NULL,
"t1_id" int NOT NULL,
CONSTRAINT "t2_id_pkey" PRIMARY KEY ("id"),
CONSTRAINT "t2_t1_id_fkey" FOREIGN KEY ("t1_id") REFERENCES "tst"."
t1" ("id")
);
CREATE INDEX "t2_t1_id" ON "tst"."t2" ("t1_id");

--
-- Drop fkey constraint and index
-- 

DROP INDEX "tst"."t2_t1_id";
ALTER TABLE "tst"."t2" DROP CONSTRAINT t2_t1_id_fkey;

--
-- Drop fkey column that links tables.
--

ALTER TABLE "tst"."t2" DROP COLUMN t1_id;
$




More information about the developers-list mailing list