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

Readline auto-complete reads from 'tables' instead of 'sys.tables' #2639

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2010-08-03 15:40:45 +0200
From: Wouter Alink <>
To: SQL devs <>
Version: 11.1.1 (Mar2011) [obsolete]
CC: @njnes, @swingbit

Last updated: 2011-04-28 16:25:37 +0200

Comment 14606

Date: 2010-08-03 15:40:45 +0200
From: Wouter Alink <>

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 ( .NET CLR 3.5.30729; .NET4.0C)
Build Identifier:

When first issuing "START TRANSACTION;" on an mclient prompt and then copy-pasting the following table creation code, I get an error. If I redo the script line by line it works fine (see below). Probably some concurrency conflict.

Reproducible: Didn't try

Steps to Reproduce:

  1. start mclient -lsql
  2. type "start transaction;"
  3. copy-paste:

CREATE TABLE params_str (paramname VARCHAR(500), value VARCHAR(10000));
CREATE TABLE params_date (paramname VARCHAR(500), value DATE);
CREATE TABLE params_int (paramname VARCHAR(500), value INT);
CREATE TABLE params_double (paramname VARCHAR(500), value DOUBLE);
CREATE TABLE params_point (paramname VARCHAR(500), value POINT);

Actual Results:

sql>start transaction;
auto commit mode: off
sql>CREATE TABLE params_str (paramname VARCHAR(500), value VARCHAR(10000));
operation successful
sql>CREATE TABLE params_date (paramname VARCHAR(500), value DATE);
operation successful
sql>CREATE TABLE params_int MAPI = alink@localhost:50351
QUERY = SELECT name FROM tables
(paramname VARCHAR(500), value INT);
current transaction is aborted (please ROLLBACK)
sql>CREATE TABLE params_double (paramname VARCHAR(500), value DOUBLE);
current transaction is aborted (please ROLLBACK)
sql>CREATE TABLE params_point (paramname VARCHAR(500), value POINT);
current transaction is aborted (please ROLLBACK)
sql>rollback;
auto commit mode: on

Expected Results:

sql>start transaction;
auto commit mode: off
sql>CREATE TABLE params_str (paramname VARCHAR(500), value VARCHAR(10000));
operation successful
sql>CREATE TABLE params_int (paramname VARCHAR(500), value INT);
operation successful
sql>CREATE TABLE params_date (paramname VARCHAR(500), value DATE);
operation successful
sql>CREATE TABLE params_double (paramname VARCHAR(500), value DOUBLE);
operation successful
sql>CREATE TABLE params_point (paramname VARCHAR(500), value POINT);
operation successful
sql>commit;
auto commit mode: on
sql>

Comment 14607

Date: 2010-08-03 15:48:09 +0200
From: Wouter Alink <>

extra info: if the "create table"-statements are not within a single transaction (not prepended by 'start transaction'), the error message appears too, although each table does get created.

Comment 14753

Date: 2010-08-23 09:44:19 +0200
From: Wouter Alink <>

ahhhh... i still have trouble reading the exact error message:
the error says that there is an error in "SELECT name FROM tables", while that query is not being performed.

The bug is probably that there is a tab in the SQL script, which in turn triggers a 'readline' lookup for a list of table names. As the session was not in the 'sys'-schema, it cannot find the 'tables' table (it should have read 'sys.tables') and therefore invalidates the transaction.

Comment 14833

Date: 2010-08-30 09:22:19 +0200
From: @sjoerdmullender

The Jun2010-SP2 version has been released.

Comment 14896

Date: 2010-09-09 17:20:40 +0200
From: @sjoerdmullender

Changeset af483074f8f4 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

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

Changeset description:

Use fully qualified table name in readline completion.
This should fix bug #2639.

Comment 14897

Date: 2010-09-09 17:20:41 +0200
From: @sjoerdmullender

Changeset e18528196508 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

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

Changeset description:

Merge with Jun2010 branch:
Use fully qualified table name in readline completion.
This should fix bug #2639.

Comment 14898

Date: 2010-09-09 17:20:42 +0200
From: @sjoerdmullender

Changeset 05bccd5e318f made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

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

Changeset description:

Merge with Oct2010 branch:
Use fully qualified table name in readline completion.
This should fix bug #2639.

Comment 14899

Date: 2010-09-09 17:22:09 +0200
From: @sjoerdmullender

Wouter, can you check?

No test, since we can't test interactive mclient.

Comment 14900

Date: 2010-09-10 15:05:08 +0200
From: @sjoerdmullender

Changeset 6f7a65979668 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

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

Changeset description:

Added changelog message for fixed bug #2639.

Comment 14913

Date: 2010-09-15 15:45:10 +0200
From: @swingbit

I checked, the fix works.

Comment 15611

Date: 2011-03-25 15:50:18 +0100
From: @swingbit

I don't think that after the fix this works really as it should.

  1. log in as a non-privileged user, with a custom schema
  2. sql>select * from tabl[TAB]

After the fix, this internally looks for sys.tables, but in the prompt it gets completed to:
sql>select * from tables

which is incorrect, because in the custom schema there is no 'tables'.

That should have completed to
sql>select * from sys.tables

Comment 15679

Date: 2011-03-28 17:36:29 +0200
From: @sjoerdmullender

The Mar2011 version has been released.

Comment 15701

Date: 2011-03-30 12:59:11 +0200
From: @njnes

now the schema is added, solving this problem. Its not a very clean solution, but auto completion isn't by design.

Comment 15702

Date: 2011-03-30 12:59:27 +0200
From: @njnes

Changeset c48ef95dd242 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=c48ef95dd242

Changeset description:

always append schema name to auto completed table names. This is a somewhat
hackish solution to bug #2639.

Comment 15750

Date: 2011-04-28 16:25:37 +0200
From: @sjoerdmullender

The Apr2011 release has been uploaded.

@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants