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

TypeException when creating table with data by selecting from sys.storagemodel() #3286

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

Comments

@monetdb-team
Copy link

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

Date: 2013-05-18 01:54:16 +0200
From: Tim H. <<monetdb.bug.reporter>>
To: MonetDB5 devs <>
Version: 11.15.7 (Feb2013-SP2)
CC: @njnes

Last updated: 2013-07-03 08:48:00 +0200

Comment 18737

Date: 2013-05-18 01:54:16 +0200
From: Tim H. <<monetdb.bug.reporter>>

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Build Identifier:

Consider the following SQL statements.

call sys.storagemodelinit();
create table estimated_storage
as (
select "table" as tblname,
max("count") as count
from sys.storagemodel()
where "schema" = 'sys'
group by "table")
with data;

The second statement fails with the following error:

SyntaxException:user.storagemodel[86]:invalid return target!
TypeException:user.main[7]:'user.storagemodel' undefined in:
(_11:bat[:oid,:str], _12:bat[:oid,:str], _13:bat[:oid,:str],
_14:bat[:oid,:str], _15:bat[:oid,:lng], _16:bat[:oid,:lng],
_17:bat[:oid,:lng], _18:bat[:oid,:lng], _19:bat[:oid,:bit])
:= user.storagemodel()

The workaround is to run the query in the create table statement by itself and then run the create table statement.

call sys.storagemodelinit();
select "table" as tblname,
max("count") as count
from sys.storagemodel()
where "schema" = 'sys'
group by "table";
create table estimated_storage
as (
select "table" as tblname,
max("count") as count
from sys.storagemodel()
where "schema" = 'sys'
group by "table")
with data;

The above SQL statements succeed, but only after completely exiting and restarting mclient (i.e. once the error happens, selecting from sys.storagemodel() always fails with the same error in the same mclient session).

Reproducible: Always

Steps to Reproduce:

  1. mclient -d dbname -u monetdb
  2. call sys.storagemodelinit();
  3. create table estimated_storage
    as (
    select "table" as tblname,
    max("count") as count
    from sys.storagemodel()
    where "schema" = 'sys'
    group by "table")
    with data;

Actual Results:

SyntaxException:user.storagemodel[86]:invalid return target!
TypeException:user.s3_1[6]:'user.storagemodel' undefined in: (_12:bat[:oid,:str], _13:bat[:oid,:str], _14:bat[:oid,:str], _15:bat[:oid,:str], _16:bat[:oid,:lng], _17:bat[:oid,:lng], _18:bat[:oid,:lng], _19:bat[:oid,:lng], _20:bat[:oid,:bit]) := user.storagemodel()
program contains errors

Expected Results:

operation successful (7.215ms)

Once this error occurs I must exit mclient completely before trying the workaround.

Comment 18742

Date: 2013-05-19 20:20:58 +0200
From: MonetDB Mercurial Repository <>

Changeset 32f653ab6e7a made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

fixed bug #3286. Only on top level query (mal) creation add calls
for sql exception.

Comment 18743

Date: 2013-05-19 20:44:41 +0200
From: @njnes

fixed by only returning the sql.exception on toplevel queries.

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