Bugs item #1841727, was opened at 2007-11-30 14:14
Message generated for change (Comment added) made by nielsnes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1841727&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: Works For Me
Priority: 5
Private: No
Submitted By: Romulo Goncalves (romulog)
Assigned to: Niels Nes (nielsnes)
Summary: pkey in temp table

Initial Comment:
Dear developers if I run the following query against M5-SQL server:
>CREATE TEMP TABLE PKTABLE (ptest1 int PRIMARY KEY);

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912517404944 (LWP 10828)]
0x00002aaabc428bbf in sql_trans_create_kc (tr=0xb5c638, k=0x0, c=0x13edde8) at 
/ufs/goncalve/MonetDB/sql/src/storage/store.mx:3580
3580            int nr = list_length(k->columns);
(gdb) 


Regards,
Romulo

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

>Comment By: Niels Nes (nielsnes)
Date: 2008-01-05 19:22

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

A simple test shows the following error (ie no crash)
!CONSTRAINT: constraints on temporary tables are not supported


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

Comment By: Romulo Goncalves (romulog)
Date: 2008-01-05 19:12

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

The bug need to be open. Not all the situations were covered.
The following query crashes the mserver:

create global temporary table t2 (id int primary key);

All the combinations should be tested. 

Regards,
Romulo

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

Comment By: Romulo Goncalves (romulog)
Date: 2007-12-01 15:45

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

In the stable branch a proper warning message is sent to the user in case
he tries to insert column constraints on temporary tables. That message
informs him that we do not support constraints on temp tables.

In the future such feature will be implemented on the current branch. So I
will open a feature request for constraints on temp tables.

It was fixed in:
sql/src/server sql_schema.mx, SQL_2-20, 1.132.2.2, 1.132.2.3

The test to cover this bug is:
src/test/BugTracker/Tests/pkey_in_temp_table.SF-1841727

Regards,
Romulo

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

Comment By: Martin Kersten (mlkersten)
Date: 2007-12-01 14:48

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

I don't see a reason to forbid it...
but the standard may dictate differently.
(most likely not)

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

Comment By: Romulo Goncalves (romulog)
Date: 2007-12-01 14:43

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

The problem is not the check but the key creation.
Should we accept or not pkey creation in temp tables?
If yes I remove the lines:
if (isTempTable(t))
3495                    return NULL;

if not I will have to warn the user that he cannot create pkey on temp
tables.


Regards,
Romulo


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

Comment By: Niels Nes (nielsnes)
Date: 2007-11-30 21:16

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

temp tables can do without key checking.. So make a nice warning.

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

Comment By: Romulo Goncalves (romulog)
Date: 2007-11-30 15:13

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

After some debug I found out that in MonetDB we do not allow temp tables
with primary key.

This line of code is in the SQL code:
sql_trans_create_ukey (tr=0xf534b8, t=0x1152a98, name=0x2aaabc674020
"pktable_ptest1_pkey", kt=pkey) 
at /ufs/goncalve/MonetDB/sql/src/storage/store.mx:3487

if (isTempTable(t))
3495                    return NULL;

Why?

I would like to know if we want to continue like this  (so I need to
create warning message to avoid the segmentation fault) or I should I
change it?
I take the second option. 

Regards,
Romulo

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

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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