Re: MAL query "sql.resultSet"
Hi all,
can you help me with the below query?
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards,Dennis
-------- Ursprüngliche Nachricht --------Von: Dennis Fassl
First question is what is happening? Does the mserver5 keep running? Does it crash? are there any messages on the mserver5 console (or in the merovingian.log in case you use merovingian (aka. monetdbd))? Second question is, why are you using MAL to create a SQL result set and send this via JDBC? What are you trying to do that cannot be done in SQL? Thanks! Stefan ----- On Nov 29, 2017, at 4:20 PM, dennis.fassl dennis.fassl@uni-konstanz.de wrote:
Hi all,
can you help me with the below query?
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
sql.init();
table_names := bat.new(nil:str); bat.append(table_names, "t0"); bat.append(table_names, "t1");
table_attrs := bat.new(nil:str); bat.append(table_attrs, "int_col"); bat.append(table_attrs, "str_col");
table_types := bat.new(nil:str); bat.append(table_types, "int"); bat.append(table_types, "str");
table_lens := bat.new(nil:int); bat.append(table_lens, 1); bat.append(table_lens, 1);
table_scales := bat.new(nil:int); bat.append(table_scales, 0); bat.append(table_scales, 0);
ints := bat.new(nil:int); bat.append(ints, 42); bat.append(ints, 23);
strs := bat.new(nil:str); bat.append(strs, "foo"); bat.append(strs, "bar");
sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs);
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
and the usual, but most important one: which version of MonetDB are you using on what OS? Best, Stefan ----- On Nov 29, 2017, at 7:55 PM, Stefan Manegold Stefan.Manegold@cwi.nl wrote:
First question is what is happening?
Does the mserver5 keep running? Does it crash? are there any messages on the mserver5 console (or in the merovingian.log in case you use merovingian (aka. monetdbd))?
Second question is, why are you using MAL to create a SQL result set and send this via JDBC? What are you trying to do that cannot be done in SQL?
Thanks!
Stefan
----- On Nov 29, 2017, at 4:20 PM, dennis.fassl dennis.fassl@uni-konstanz.de wrote:
Hi all,
can you help me with the below query?
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
sql.init();
table_names := bat.new(nil:str); bat.append(table_names, "t0"); bat.append(table_names, "t1");
table_attrs := bat.new(nil:str); bat.append(table_attrs, "int_col"); bat.append(table_attrs, "str_col");
table_types := bat.new(nil:str); bat.append(table_types, "int"); bat.append(table_types, "str");
table_lens := bat.new(nil:int); bat.append(table_lens, 1); bat.append(table_lens, 1);
table_scales := bat.new(nil:int); bat.append(table_scales, 0); bat.append(table_scales, 0);
ints := bat.new(nil:int); bat.append(ints, 42); bat.append(ints, 23);
strs := bat.new(nil:str); bat.append(strs, "foo"); bat.append(strs, "bar");
sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs);
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) | _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
Hi Stefan, I am using the "Dec2016-SP5" release on Ubuntu 14.04. monetdbd keeps running. mclient crashes after pressing "enter" the second time: mal>sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs); mal> dennis@dennis-XPS-L421X:~/uni/monetdb$ This is the output in merovingian.log: 2017-12-01 10:49:15 MSG mydb[29867]: # MonetDB 5 server v11.25.23 "Dec2016-SP5" 2017-12-01 10:49:15 MSG mydb[29867]: # Serving database 'mydb', using 4 threads 2017-12-01 10:49:15 MSG mydb[29867]: # Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers 2017-12-01 10:49:15 MSG mydb[29867]: # Found 7.678 GiB available main-memory. 2017-12-01 10:49:15 MSG mydb[29867]: # Copyright (c) 1993-July 2008 CWI. 2017-12-01 10:49:15 MSG mydb[29867]: # Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved 2017-12-01 10:49:15 MSG mydb[29867]: # Visit http://www.monetdb.org/ for further information 2017-12-01 10:49:15 MSG mydb[29867]: # Listening for UNIX domain connection requests on mapi:monetdb:///home/dennis/uni/monetdb/testdb/mydb/.mapi.sock 2017-12-01 10:49:15 MSG mydb[29867]: # MonetDB/SQL module loaded 2017-12-01 10:49:58 MSG merovingian[3889]: proxying client (local) for database 'mydb' to mapi:monetdb:///home/dennis/uni/monetdb/testdb/mydb/.mapi.sock?database=mydb 2017-12-01 10:49:58 MSG merovingian[3889]: target connection is on local UNIX domain socket, passing on filedescriptor instead of proxying 2017-12-01 10:52:39 MSG merovingian[3889]: proxying client (local) for database 'mydb' to mapi:monetdb:///home/dennis/uni/monetdb/testdb/mydb/.mapi.sock?database=mydb 2017-12-01 10:52:39 MSG merovingian[3889]: target connection is on local UNIX domain socket, passing on filedescriptor instead of proxying 2017-12-01 10:52:54 MSG merovingian[3889]: database 'mydb' (29867) has crashed (dumped core) What am I trying to do: The goal of the project is to use Cypher as an input language for MonetDB. I have a Cypher optimizer written in Java. The output of this optimizer should be used as input for MonetDB. In the end we want to compare the the runtime of a query in MonetDB and in Neo4J. Thanks and best regards, Dennis On 29.11.2017 20:13, Stefan Manegold wrote:
and the usual, but most important one: which version of MonetDB are you using on what OS?
Best, Stefan
----- On Nov 29, 2017, at 7:55 PM, Stefan Manegold Stefan.Manegold@cwi.nl wrote:
First question is what is happening?
Does the mserver5 keep running? Does it crash? are there any messages on the mserver5 console (or in the merovingian.log in case you use merovingian (aka. monetdbd))?
Second question is, why are you using MAL to create a SQL result set and send this via JDBC? What are you trying to do that cannot be done in SQL?
Thanks!
Stefan
----- On Nov 29, 2017, at 4:20 PM, dennis.fassl dennis.fassl@uni-konstanz.de wrote:
Hi all,
can you help me with the below query?
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
sql.init();
table_names := bat.new(nil:str); bat.append(table_names, "t0"); bat.append(table_names, "t1");
table_attrs := bat.new(nil:str); bat.append(table_attrs, "int_col"); bat.append(table_attrs, "str_col");
table_types := bat.new(nil:str); bat.append(table_types, "int"); bat.append(table_types, "str");
table_lens := bat.new(nil:int); bat.append(table_lens, 1); bat.append(table_lens, 1);
table_scales := bat.new(nil:int); bat.append(table_scales, 0); bat.append(table_scales, 0);
ints := bat.new(nil:int); bat.append(ints, 42); bat.append(ints, 23);
strs := bat.new(nil:str); bat.append(strs, "foo"); bat.append(strs, "bar");
sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs);
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list -- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
On 29/11/2017 16:20, dennis.fassl wrote:
Hi all,
can you help me with the below query? A simple GDB trace shows the following: 0 0x00007fffe84f67ae in sql_init_subtype (res=0x1c28f70, t=0x0, digits=1, scale=0) at /export/scratch1/mk/branches/default//package/sql/common/sql_types.c:158 #1 0x00007fffe84efe86 in res_col_create (tr=0x1b9b110, t=0x1c026d0, tn=0x1c26218 "t1", name=0x1cbab38 "str_col", typename=0x1cbd368 "str", digits=1, scale=0, mtype=4, val=0x19b7660) at /export/scratch1/mk/branches/default//package/sql/storage/bat/res_table.c:65 #2 0x00007fffe83cde30 in mvc_result_column (m=0x1ba11f0, tn=0x1c26218 "t1", name=0x1cbab38 "str_col", typename=0x1cbd368 "str", digits=1, scale=0, b=0x19b7660) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql_result.c:2616 #3 0x00007fffe8366971 in mvc_result_set_wrap (cntxt=0x7fffe974d020, mb=0x19c3660, stk=0x6526f0, pci=0x1c16260) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql.c:1926 #4 0x00007fffe836a062 in mvc_table_result_wrap (cntxt=0x7fffe974d020, mb=0x19c3660, stk=0x6526f0, pci=0x1c16260) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql.c:2300 #5 0x00007ffff79dd2c3 in runMALsequence (cntxt=0x7fffe974d020, mb=0x19c3660, startpc=1, stoppc=0, stk=0x6526f0, env=0x6526f0, pcicaller=0x0) at /export/scratch1/mk/branches/default//package/monetdb5/mal/mal_interpreter.c:645
This implies that the SQL type descriptor relies on a transaction context, which is not set. Whether this can be avoided remains to be seen. You might file a bugreport. In general, all MAL instructions at the SQL layer depend on the SQL context and often a transaction context. Mimicking this at the MAL layer is hardly feasible. JDBC is meant to support SQL only. regards, Martin
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
On 29/11/2017 19:55, Stefan Manegold wrote:
First question is what is happening?
Does the mserver5 keep running? Does it crash? are there any messages on the mserver5 console (or in the merovingian.log in case you use merovingian (aka. monetdbd))?
Second question is, why are you using MAL to create a SQL result set and send this via JDBC? What are you trying to do that cannot be done in SQL?
Thanks!
Stefan
----- On Nov 29, 2017, at 4:20 PM, dennis.fassl dennis.fassl@uni-konstanz.de wrote:
Hi all,
can you help me with the below query?
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
sql.init();
table_names := bat.new(nil:str); bat.append(table_names, "t0"); bat.append(table_names, "t1");
table_attrs := bat.new(nil:str); bat.append(table_attrs, "int_col"); bat.append(table_attrs, "str_col");
table_types := bat.new(nil:str); bat.append(table_types, "int"); bat.append(table_types, "str");
table_lens := bat.new(nil:int); bat.append(table_lens, 1); bat.append(table_lens, 1);
table_scales := bat.new(nil:int); bat.append(table_scales, 0); bat.append(table_scales, 0);
ints := bat.new(nil:int); bat.append(ints, 42); bat.append(ints, 23);
strs := bat.new(nil:str); bat.append(strs, "foo"); bat.append(strs, "bar");
sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs);
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
Indeed, using correct SQL type(s) is the key, here: ======== $ cat /tmp/y.mal -------- sql.init(); table_names := bat.new(nil:str); bat.append(table_names, "t0"); bat.append(table_names, "t1"); table_attrs := bat.new(nil:str); bat.append(table_attrs, "int_col"); bat.append(table_attrs, "str_col"); table_types := bat.new(nil:str); bat.append(table_types, "int"); bat.append(table_types, "str"); table_lens := bat.new(nil:int); bat.append(table_lens, 1); bat.append(table_lens, 1); table_scales := bat.new(nil:int); bat.append(table_scales, 0); bat.append(table_scales, 0); ints := bat.new(nil:int); bat.append(ints, 42); bat.append(ints, 23); strs := bat.new(nil:str); bat.append(strs, "foo"); bat.append(strs, "bar"); sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs); ======== $ mclient -lmal /tmp/y.mal -------- * mserver5 crashes with segfault * ======== $ diff -du /tmp/{y,z}.mal -------- --- /tmp/y.mal 2017-11-29 20:36:01.083347399 +0100 +++ /tmp/z.mal 2017-11-29 20:36:34.235347852 +0100 @@ -10,7 +10,7 @@ table_types := bat.new(nil:str); bat.append(table_types, "int"); -bat.append(table_types, "str"); +bat.append(table_types, "varchar"); table_lens := bat.new(nil:int); bat.append(table_lens, 1); ======== $ mclient -lmal /tmp/z.mal -------- % t0, t1 # table_name % int_col, str_col # name % int, varchar # type % 2, 3 # length [ 42, "foo" ] [ 23, "bar" ] ======== Best, Stefan ----- On Nov 29, 2017, at 8:15 PM, Martin Kersten martin@monetdb.org wrote:
On 29/11/2017 16:20, dennis.fassl wrote:
Hi all,
can you help me with the below query? A simple GDB trace shows the following: 0 0x00007fffe84f67ae in sql_init_subtype (res=0x1c28f70, t=0x0, digits=1, scale=0) at /export/scratch1/mk/branches/default//package/sql/common/sql_types.c:158 #1 0x00007fffe84efe86 in res_col_create (tr=0x1b9b110, t=0x1c026d0, tn=0x1c26218 "t1", name=0x1cbab38 "str_col", typename=0x1cbd368 "str", digits=1, scale=0, mtype=4, val=0x19b7660) at /export/scratch1/mk/branches/default//package/sql/storage/bat/res_table.c:65 #2 0x00007fffe83cde30 in mvc_result_column (m=0x1ba11f0, tn=0x1c26218 "t1", name=0x1cbab38 "str_col", typename=0x1cbd368 "str", digits=1, scale=0, b=0x19b7660) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql_result.c:2616 #3 0x00007fffe8366971 in mvc_result_set_wrap (cntxt=0x7fffe974d020, mb=0x19c3660, stk=0x6526f0, pci=0x1c16260) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql.c:1926 #4 0x00007fffe836a062 in mvc_table_result_wrap (cntxt=0x7fffe974d020, mb=0x19c3660, stk=0x6526f0, pci=0x1c16260) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql.c:2300 #5 0x00007ffff79dd2c3 in runMALsequence (cntxt=0x7fffe974d020, mb=0x19c3660, startpc=1, stoppc=0, stk=0x6526f0, env=0x6526f0, pcicaller=0x0) at /export/scratch1/mk/branches/default//package/monetdb5/mal/mal_interpreter.c:645
This implies that the SQL type descriptor relies on a transaction context, which is not set. Whether this can be avoided remains to be seen. You might file a bugreport.
In general, all MAL instructions at the SQL layer depend on the SQL context and often a transaction context. Mimicking this at the MAL layer is hardly feasible.
JDBC is meant to support SQL only.
regards, Martin
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
On 29/11/2017 19:55, Stefan Manegold wrote:
First question is what is happening?
Does the mserver5 keep running? Does it crash? are there any messages on the mserver5 console (or in the merovingian.log in case you use merovingian (aka. monetdbd))?
Second question is, why are you using MAL to create a SQL result set and send this via JDBC? What are you trying to do that cannot be done in SQL?
Thanks!
Stefan
----- On Nov 29, 2017, at 4:20 PM, dennis.fassl dennis.fassl@uni-konstanz.de wrote:
Hi all,
can you help me with the below query?
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
sql.init();
table_names := bat.new(nil:str); bat.append(table_names, "t0"); bat.append(table_names, "t1");
table_attrs := bat.new(nil:str); bat.append(table_attrs, "int_col"); bat.append(table_attrs, "str_col");
table_types := bat.new(nil:str); bat.append(table_types, "int"); bat.append(table_types, "str");
table_lens := bat.new(nil:int); bat.append(table_lens, 1); bat.append(table_lens, 1);
table_scales := bat.new(nil:int); bat.append(table_scales, 0); bat.append(table_scales, 0);
ints := bat.new(nil:int); bat.append(ints, 42); bat.append(ints, 23);
strs := bat.new(nil:str); bat.append(strs, "foo"); bat.append(strs, "bar");
sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs);
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
I think my previous mail is not needed anymore. Replacing str with varchar works for me as well. Thanks a lot! :) Best regards, Dennis On 29.11.2017 20:40, Stefan Manegold wrote:
Indeed, using correct SQL type(s) is the key, here:
======== $ cat /tmp/y.mal -------- sql.init();
table_names := bat.new(nil:str); bat.append(table_names, "t0"); bat.append(table_names, "t1");
table_attrs := bat.new(nil:str); bat.append(table_attrs, "int_col"); bat.append(table_attrs, "str_col");
table_types := bat.new(nil:str); bat.append(table_types, "int"); bat.append(table_types, "str");
table_lens := bat.new(nil:int); bat.append(table_lens, 1); bat.append(table_lens, 1);
table_scales := bat.new(nil:int); bat.append(table_scales, 0); bat.append(table_scales, 0);
ints := bat.new(nil:int); bat.append(ints, 42); bat.append(ints, 23);
strs := bat.new(nil:str); bat.append(strs, "foo"); bat.append(strs, "bar");
sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs); ======== $ mclient -lmal /tmp/y.mal -------- * mserver5 crashes with segfault * ======== $ diff -du /tmp/{y,z}.mal -------- --- /tmp/y.mal 2017-11-29 20:36:01.083347399 +0100 +++ /tmp/z.mal 2017-11-29 20:36:34.235347852 +0100 @@ -10,7 +10,7 @@
table_types := bat.new(nil:str); bat.append(table_types, "int"); -bat.append(table_types, "str"); +bat.append(table_types, "varchar");
table_lens := bat.new(nil:int); bat.append(table_lens, 1); ======== $ mclient -lmal /tmp/z.mal -------- % t0, t1 # table_name % int_col, str_col # name % int, varchar # type % 2, 3 # length [ 42, "foo" ] [ 23, "bar" ] ========
Best, Stefan
----- On Nov 29, 2017, at 8:15 PM, Martin Kersten martin@monetdb.org wrote:
On 29/11/2017 16:20, dennis.fassl wrote:
Hi all,
can you help me with the below query? A simple GDB trace shows the following: 0 0x00007fffe84f67ae in sql_init_subtype (res=0x1c28f70, t=0x0, digits=1, scale=0) at /export/scratch1/mk/branches/default//package/sql/common/sql_types.c:158 #1 0x00007fffe84efe86 in res_col_create (tr=0x1b9b110, t=0x1c026d0, tn=0x1c26218 "t1", name=0x1cbab38 "str_col", typename=0x1cbd368 "str", digits=1, scale=0, mtype=4, val=0x19b7660) at /export/scratch1/mk/branches/default//package/sql/storage/bat/res_table.c:65 #2 0x00007fffe83cde30 in mvc_result_column (m=0x1ba11f0, tn=0x1c26218 "t1", name=0x1cbab38 "str_col", typename=0x1cbd368 "str", digits=1, scale=0, b=0x19b7660) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql_result.c:2616 #3 0x00007fffe8366971 in mvc_result_set_wrap (cntxt=0x7fffe974d020, mb=0x19c3660, stk=0x6526f0, pci=0x1c16260) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql.c:1926 #4 0x00007fffe836a062 in mvc_table_result_wrap (cntxt=0x7fffe974d020, mb=0x19c3660, stk=0x6526f0, pci=0x1c16260) at /export/scratch1/mk/branches/default//package/sql/backends/monet5/sql.c:2300 #5 0x00007ffff79dd2c3 in runMALsequence (cntxt=0x7fffe974d020, mb=0x19c3660, startpc=1, stoppc=0, stk=0x6526f0, env=0x6526f0, pcicaller=0x0) at /export/scratch1/mk/branches/default//package/monetdb5/mal/mal_interpreter.c:645
This implies that the SQL type descriptor relies on a transaction context, which is not set. Whether this can be avoided remains to be seen. You might file a bugreport.
In general, all MAL instructions at the SQL layer depend on the SQL context and often a transaction context. Mimicking this at the MAL layer is hardly feasible.
JDBC is meant to support SQL only.
regards, Martin
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
On 29/11/2017 19:55, Stefan Manegold wrote:
First question is what is happening?
Does the mserver5 keep running? Does it crash? are there any messages on the mserver5 console (or in the merovingian.log in case you use merovingian (aka. monetdbd))?
Second question is, why are you using MAL to create a SQL result set and send this via JDBC? What are you trying to do that cannot be done in SQL?
Thanks!
Stefan
----- On Nov 29, 2017, at 4:20 PM, dennis.fassl dennis.fassl@uni-konstanz.de wrote:
Hi all,
can you help me with the below query?
Is there an other way to return query results using the jdbc interface (without using sql.resultSet)?
Thanks in advance!
Best regards, Dennis
-------- Ursprüngliche Nachricht -------- Von: Dennis Fassl
Datum: 25.11.17 16:55 (GMT+01:00) An: users-list@monetdb.org Betreff: MAL query "sql.resultSet" Hi all,
I am trying to execute the MAL query below. But the command "sql.resultSet" is terminating mclient. When using the JDBC interface I get "SQLException: Connection to server lost! (mserver still alive?)".
Do you have an idea why this is happening?
Thanks and regards, Dennis
sql.init();
table_names := bat.new(nil:str); bat.append(table_names, "t0"); bat.append(table_names, "t1");
table_attrs := bat.new(nil:str); bat.append(table_attrs, "int_col"); bat.append(table_attrs, "str_col");
table_types := bat.new(nil:str); bat.append(table_types, "int"); bat.append(table_types, "str");
table_lens := bat.new(nil:int); bat.append(table_lens, 1); bat.append(table_lens, 1);
table_scales := bat.new(nil:int); bat.append(table_scales, 0); bat.append(table_scales, 0);
ints := bat.new(nil:int); bat.append(ints, 42); bat.append(ints, 23);
strs := bat.new(nil:str); bat.append(strs, "foo"); bat.append(strs, "bar");
sql.resultSet(table_names, table_attrs, table_types, table_lens, table_scales, ints, strs);
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (4)
-
Dennis Fassl
-
dennis.fassl
-
Martin Kersten
-
Stefan Manegold