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

DBD::monetdb table_info error #2885

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

DBD::monetdb table_info error #2885

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

Comments

@monetdb-team
Copy link

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

Date: 2011-09-16 19:53:03 +0200
From: Rémy Chibois <>
To: clients devs <>
Version: 11.5.1 (Aug2011) [obsolete]

Last updated: 2011-09-30 10:58:46 +0200

Comment 16291

Date: 2011-09-16 19:53:03 +0200
From: Rémy Chibois <>

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/534.48.3 (KHTML, like Gecko) Version/5.1 Safari/534.48.3
Build Identifier:

When requesting database tables information through a database handle:

$dbh->table_info('', '%', '%)

The DBD::monetdb::db::monetdb_table_info subroutine issues an incorrect query to list schemas and tables (resulting in an error an no results)

I found the query to be:

==========
select cast( null as varchar( 128 ) ) as table_cat
, s."name" as table_schem
, t."name" as table_name
, case
when t."istable" = true and t."system" = false and t."temporary" = 0 then cast('TABLE' as varchar( 254 ) )
when t."istable" = true and t."system" = true and t."temporary" = 0 then cast('SYSTEM TABLE' as varchar( 254 ) )
when t."istable" = true and t."system" = false and t."temporary" = 1 then cast('LOCAL TEMPORARY' as varchar( 254 ) )
when t."istable" = false then cast('VIEW' as varchar( 254 ) )
else cast('INTERNAL TABLE TYPE' as varchar( 254 ) )
end as table_type
, cast( null as varchar( 254 ) ) as remarks
from sys."schemas" s
, sys."tables" t
where t."schema_id" = s."id"

This query fails because there's no (more) column "istable" in "sys.tables".

Reproducible: Always

Steps to Reproduce:

The following snippet will reproduce the error:

===========
!/usr/bin/env perl

use strict;
use warnings;

$|++;

use DBI();

my $dbh = DBI->connect('dbi:monetdb:database=testdb', 'monetdb', 'monetdb');

my $sth = $dbh->table_info('', '%', '%');

Actual Results:

DBD::monetdb::db table_info failed: SELECT: no such column 't.istable' at /opt/local/lib/perl5/vendor_perl/5.12.3/darwin-thread-multi-2level/MonetDB/CLI/MapiPP.pm line 120

Expected Results:

Table and schemas information as per DBI specs.

Comment 16292

Date: 2011-09-17 11:02:13 +0200
From: Rémy Chibois <>

Created attachment 74
Proposed patch to fix table type match

Attached file: DBD-monetdb-table-type.patch (text/plain, 870 bytes)
Description: Proposed patch to fix table type match

Comment 16295

Date: 2011-09-19 10:27:36 +0200
From: @sjoerdmullender

Changeset 4eafa029d4c9 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=4eafa029d4c9

Changeset description:

Fixed DBD::monetdb table_info and tabletype_info.
This fixes bug #2885.  With thanks to Rémy Chibois.

Comment 16299

Date: 2011-09-19 16:28:08 +0200
From: @sjoerdmullender

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

Changeset description:

Added test for bug #2885.

Comment 16301

Date: 2011-09-19 16:34:31 +0200
From: @sjoerdmullender

Seems to work now.

Comment 16327

Date: 2011-09-24 18:05:19 +0200
From: @drstmane

Changeset 2f69e26d0fb6 made by Stefan Manegold Stefan.Manegold@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

added filter to ignore path name
in error message of test for bug #2885
(sql/test/BugTracker-2011/Tests/perl-table_info.Bug-2885.pl)

Comment 16354

Date: 2011-09-30 10:58:46 +0200
From: @grobian

Released in Aug2011-SP1

Comment 16391

Date: 2011-10-10 16:28:05 +0200
From: @sjoerdmullender

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

Changeset description:

Improve filter pattern.
This way sql test/BugTracker-2011 perl-table_info.Bug-2885 also
reports success on Windows.
This is the same fix as changeset [ae36d70ba744](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ae36d70ba744)  applied to a different
filter.

Comment 18188

Date: 2012-11-28 13:45:05 +0100
From: @hannesmuehleisen

Changeset ac0fb4766f46 made by Hannes Muehleisen hannes@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

Update for test case sql/test/BugTracker-2011/Tests/perl-table_info.Bug-2885.pl - Bug #2886

Comment 18190

Date: 2012-11-28 13:45:09 +0100
From: @hannesmuehleisen

Changeset 092bbe1f3ee6 made by Hannes Muehleisen hannes@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

Update for test case sql/test/BugTracker-2011/Tests/perl-table_info.Bug-2885.pl - Bug #2886 - Approved outputs
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