You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Build Identifier:
$ mclient -d test -u monetdb
password:
Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014-SP1)
Database: MonetDB v11.19.7 (Oct2014-SP1), 'mapi:monetdb://redacted:50000/test'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>create table foo (id integer, bar_id integer);
operation successful (3.868ms)
sql>create table foo_bar (id integer);
operation successful (2.002ms)
sql>insert into foo (id, bar_id) values (1,2), (3,4);
2 affected rows (4.187ms)
sql>insert into foo_bar (id) values (5), (6);
2 affected rows (7.795ms)
sql>select * from foo;
+------+--------+
| id | bar_id |
+======+========+
| 1 | 2 |
| 3 | 4 |
+------+--------+
2 tuples (2.818ms)
sql>select * from foo_bar;
+------+
| id |
+======+
| 5 |
| 6 |
+------+
2 tuples (3.284ms)
sql>
$ monetdb stop test
stopping database 'test'... done
$ monetdb start test
starting database 'test'... done
$ mclient -d test -u monetdb
password:
Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014-SP1)
Database: MonetDB v11.19.7 (Oct2014-SP1), 'mapi:monetdb://redacted:50000/test'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>select * from foo;
+------+--------+
| id | bar_id |
+======+========+
| 1 | 2 |
| 3 | 4 |
+------+--------+
2 tuples (2.990ms)
sql>select * from foo_bar;
+------+
| id |
+======+
| 2 |
| 4 |
| 5 |
| 6 |
+------+
4 tuples (2.093ms)
sql>
There are two colums associated to the "sys_foo_bar_id" BAT, because _ is not a reserved character in identifiers. I'm working around this by being careful not to create columns with related names, but this behavior still strikes me as a bug. BAT name generation should concatenate with a reserved character, or escape underscores.
Possibly the best approach would be to not code the SQL-level column and table name at all but rather use the OID for the column - this could potentially allow for ALTER TABLE ... RENAME TO and ALTER TABLE ... RENAME COLUMN without having to get the GDK logger involved in the business of renaming BATs.
Reproducible: Always
Actual Results:
Note that the contents of the foo_bar table have changed after the restart.
Date: 2015-01-15 01:34:50 +0100
From: sorear
To: SQL devs <>
Version: 11.19.7 (Oct2014-SP1)
CC: @njnes
Last updated: 2015-05-07 12:38:03 +0200
Comment 20557
Date: 2015-01-15 01:34:50 +0100
From: sorear
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Build Identifier:
$ mclient -d test -u monetdb
password:
Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014-SP1)
Database: MonetDB v11.19.7 (Oct2014-SP1), 'mapi:monetdb://redacted:50000/test'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>create table foo (id integer, bar_id integer);
operation successful (3.868ms)
sql>create table foo_bar (id integer);
operation successful (2.002ms)
sql>insert into foo (id, bar_id) values (1,2), (3,4);
2 affected rows (4.187ms)
sql>insert into foo_bar (id) values (5), (6);
2 affected rows (7.795ms)
sql>select * from foo;
+------+--------+
| id | bar_id |
+======+========+
| 1 | 2 |
| 3 | 4 |
+------+--------+
2 tuples (2.818ms)
sql>select * from foo_bar;
+------+
| id |
+======+
| 5 |
| 6 |
+------+
2 tuples (3.284ms)
sql>
$ monetdb stop test
stopping database 'test'... done
$ monetdb start test
starting database 'test'... done
$ mclient -d test -u monetdb
password:
Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014-SP1)
Database: MonetDB v11.19.7 (Oct2014-SP1), 'mapi:monetdb://redacted:50000/test'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>select * from foo;
+------+--------+
| id | bar_id |
+======+========+
| 1 | 2 |
| 3 | 4 |
+------+--------+
2 tuples (2.990ms)
sql>select * from foo_bar;
+------+
| id |
+======+
| 2 |
| 4 |
| 5 |
| 6 |
+------+
4 tuples (2.093ms)
sql>
There are two colums associated to the "sys_foo_bar_id" BAT, because _ is not a reserved character in identifiers. I'm working around this by being careful not to create columns with related names, but this behavior still strikes me as a bug. BAT name generation should concatenate with a reserved character, or escape underscores.
Possibly the best approach would be to not code the SQL-level column and table name at all but rather use the OID for the column - this could potentially allow for ALTER TABLE ... RENAME TO and ALTER TABLE ... RENAME COLUMN without having to get the GDK logger involved in the business of renaming BATs.
Reproducible: Always
Actual Results:
Note that the contents of the foo_bar table have changed after the restart.
Expected Results:
Kept the tables separate.
Comment 20567
Date: 2015-01-25 18:26:07 +0100
From: @njnes
For the stable release added a test too prevent bat level name conflicts. For the new feature release we will look into using the sql object numbers.
Comment 20568
Date: 2015-01-25 19:01:20 +0100
From: MonetDB Mercurial Repository <>
Changeset 324d579fa720 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=324d579fa720
Changeset description:
Comment 20572
Date: 2015-01-26 18:50:43 +0100
From: MonetDB Mercurial Repository <>
Changeset 609f87915225 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=609f87915225
Changeset description:
Comment 20576
Date: 2015-01-26 19:12:07 +0100
From: sorear
I think that changeset was supposed to reference bug #3653, not this one.
The text was updated successfully, but these errors were encountered: