Bugs item #1906287, was opened at 2008-03-03 14:27
Message generated for change (Comment added) made by nielsnes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1906287&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: SQL CVS Head
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Romulo Goncalves (romulog)
Assigned to: Niels Nes (nielsnes)
Summary: --set sql_debug=64 is breaking the DB...

Initial Comment:
If I start my mserver (M5-SQL) with the option --set sql_debug=64

and I create the following user and I set his default schema:

CREATE USER "skyserver" WITH PASSWORD 'skyserver' NAME 'sky server' SCHEMA 
"sys";
create schema "sky" authorization "skyserver";
alter user "skyserver" set schema "sky";

If I restarted my mserver and then I queried the users table. I saw that the 
default schema for user skyserver is again sys.

I think this is related with the load of the catalog. If I create a database 
with -set sql_debug=64 and then I restart the mserver without the option -set 
sql_debug=64 the mserver crash:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912518363936 (LWP 30327)]
0x00002aaabe4c1040 in temp_create (b=0x0) at 
/ufs/goncalve/MonetDB/sql/src/storage/bat/bat_utils.mx:133
133             temp_dup(b->batCacheid);
(gdb) up
#1  0x00002aaabe4be5c9 in load_bat (sname=0xdad7c8 "sys", tname=0xdad9b8 
"schemas", bname=0xdadad8 "id", type=6, sz=1024, cnt=0xdad900)
    at /ufs/goncalve/MonetDB/sql/src/storage/bat/bat_storage.mx:449
449             bat->ubid = temp_create(b);
(gdb) up
#2  0x00002aaabe4be94c in create_col (tr=0xdad688, c=0xdada68) at 
/ufs/goncalve/MonetDB/sql/src/storage/bat/bat_storage.mx:515
515                     c->data = load_bat( c->t->s->base.name, 
c->t->base.name, c->base.name, type, c->t->sz, &c->t->cnt);
(gdb) up
#3  0x00002aaabe4b0f67 in bootstrap_create_column (tr=0xdad688, t=0xdad8c8, 
name=0x2aaabe4f670f "id", sqltype=0x2aaabe4f6a1a "int", digits=32)
    at /ufs/goncalve/MonetDB/sql/src/storage/store.mx:1076
1076                    store_funcs.create_col(tr, col);
(gdb) up
#4  0x00002aaabe4b1632 in store_init (debug=0, store=store_bat, logdir=0x62be40 
"/ufs/goncalve/scratch/skyserver/", dbname=0x62be30 "demo", stk=0)
    at /ufs/goncalve/MonetDB/sql/src/storage/store.mx:1214
1214            bootstrap_create_column(tr, t, "id", "int", 32);
(gdb) 


Regards,
Romulo

----------------------------------------------------------------------

>Comment By: Niels Nes (nielsnes)
Date: 2008-05-28 09:55

Message:
Logged In: YES 
user_id=43556
Originator: NO

The test succeeds now. The default (delta) storage now adds the needed
update bats on load of the single user storage, which doesn't have update
bats.

----------------------------------------------------------------------

Comment By: Romulo Goncalves (romulog)
Date: 2008-05-26 14:16

Message:
Logged In: YES 
user_id=1498628
Originator: YES

The test for this bug was checked in at stable branch:

sql/src/test/BugTracker/Tests/set_sql_debug_64__breaking_the_DB.SF-1906287.py
plus the additional files:
set_sql_debug_64__breaking_the_DB.SF-1906287_create.sql
set_sql_debug_64__breaking_the_DB.SF-1906287_drop.sql





----------------------------------------------------------------------

Comment By: Romulo Goncalves (romulog)
Date: 2008-05-26 12:49

Message:
Logged In: YES 
user_id=1498628
Originator: YES

A mserver using the flag sql_debug=64 is a mserver for a single client
connection, so in this case the update bat is not used/created. 
If we start the mserver in this mode with empty database and execute the
previous sql code, the update bat will not be created. Once we re-start the
mserver for multi-client connections, where the schema table has
modifications, the load of the update bat will fail because it does not
exist. 

To fix this I propose the following fix:

[EMAIL PROTECTED] bat]$ cvs diff bat_storage.mx 
Index: bat_storage.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/bat_storage.mx,v
retrieving revision 1.16
diff -u -r1.16 bat_storage.mx
--- bat_storage.mx      23 May 2008 08:02:38 -0000      1.16
+++ bat_storage.mx      26 May 2008 12:42:45 -0000
@@ -449,6 +449,8 @@
 
        bat->uname = sql_message("U_%s", bat->name);
        b = quick_descriptor(logger_find_bat(bat_logger, bat->uname));
+       if (!b)
+               b = bat_new(TYPE_oid, type, sz);
        bat->ubid = temp_create(b);
 
        bat->ibid = e_bat(type);
[EMAIL PROTECTED] bat]$ 

If the update bat does not exist just create it. 
Niels do you agree? Ff yes I close the bug, create test, and check in it
in the stable branch....

Regards,
Romulo

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1906287&group_id=56967

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to