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

SQLSetStmtOption(..., SQL_CONCURRENCY, SQL_CONCUR_READ_ONLY) should be allowed #2910

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


Copy link

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

Date: 2011-10-23 16:43:29 +0200
From: karlis <<k.vitols>>
To: clients devs <>
Version: 11.5.9 (Aug2011-SP3) [obsolete]

Last updated: 2012-01-26 15:32:08 +0100

Comment 16459

Date: 2011-10-23 16:43:29 +0200
From: karlis <<k.vitols>>

User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Build Identifier:

I have installed latest (as of 23.10.2011) server and client version of MonetDB on WIndows XP (also tried on Windows server 2003).

I try to retrieve data from MonetDB database - voc schema (that was created using "getting started guide"), using various SQLs:
select * from invoices;
select number, trip, invoice from invoices;
select count(*) from invoices;

All of these queries work, if I run them via MonetDB client. However, if I use a tool that connects via ODBC, then I always get generic error: ODBC error state: HYC00 code: 0 message: [MonetDB][ODBC Driver 11.5.3]Optional feature not implemented. Extended fetch failed.

I've tried 2 different tools and both say the same [MoneDB ... ] error - seems that tools parse this and give different errors regarding what exactly fails.

I must note, though, that ODBC does not fail completely. I managed to reverse engineer (fetch list of tables and table columns), which means that connection via ODBC has been successful to MonetDB using credentials I've entered.

Reproducible: Always

Steps to Reproduce:

  1. Establish ODBC connection to getting started database "VOC".
  2. Run SQL "select count(*) from invoices;"

Actual Results:

error: ... HYC00 code: 0 message: [MonetDB][ODBC Driver 11.5.3] ...

Expected Results:

I'd expect to receive numeric output in the given example from the query.

Comment 16460

Date: 2011-10-24 14:52:15 +0200
From: @sjoerdmullender

Fetching data works fine for me, so there must be something else going on.

Can you please create a log (see below) and attach it to this bug report.

To create a log, you need to start the application that uses the MonetDB ODBC driver with an extra environment variable. Probably the easiest way to do that is to start a cmd window (Start -> Run... -> cmd.exe) and in that window type

set ODBCDEBUG=C:....\odbc.log

and then start your application from this window.
The bit after the = should be the absolute pathname of a file you can write to. After the application is done it should contain a log of the complete interaction with the driver. Before attaching the file, please make sure it doesn't contain any sensitive information.

Instead of attaching, you can also send the file directly to me.

Comment 16461

Date: 2011-10-24 17:32:43 +0200
From: karlis <<k.vitols>>

Created attachment 82
ODBC log

In the log you will see 2 activities I performed via Oracle Business Intelligence - Administrator tool. First activity was to get rowcount (select count(*)...) and the other was to retrieve data.

Attached file: odbc.log (text/plain, 5634 bytes)
Description: ODBC log

Comment 16462

Date: 2011-10-24 21:37:14 +0200
From: @sjoerdmullender

I analyzed the log (thanks, they're really helpful) and saw that the problem is with the call SQLSetStmtOption(hdl, SQL_CONCURRENCY, SQL_CONCUR_READ_ONLY). Three times the application tries this call, and since this option is not implemented, the driver returns an error "Optional feature not implemented". In all three cases the application then immediately closes the connection.

I'm just reading up on the option. The application is just telling the driver that the cursors are going to be used read-only. Since that is not a problem (read-write cursors are not supported, read-only cursors shouldn't pose any problem), this is an option we can support. I will fix that for the next release. (It's too late for the Aug2011-SP2 release which is undergoing final testing.)

I'm changing the summary.

Comment 16463

Date: 2011-10-24 21:46:21 +0200
From: @sjoerdmullender

Changeset 942ca37cb3e3 made by Sjoerd Mullender in the MonetDB repo, refers to this bug.

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

Changeset description:

This should fix bug #2910.

Comment 16464

Date: 2011-10-24 22:05:20 +0200
From: karlis <<k.vitols>>

Created attachment 83
Another ODBC log

I attach another ODBC log file - just in case, you find it useful.. I have made 4 differenct calls from SAP Business Objects designer: 1) two calls via ODBC 2.x driver trying to retrieve select count() ... and select * ....;. 2) two calls via ODBC 3.x driver trying to retrieve select count () ... and select * from ... .

Attached file: odbc2.log (text/plain, 7839 bytes)
Description: Another ODBC log

Comment 16465

Date: 2011-10-25 16:04:01 +0200
From: @sjoerdmullender

(In reply to comment 5)

Created attachment 83 [details]
Another ODBC log

The errors in this log are all
[MonetDB][ODBC Driver 11.5.3]Syntax error or access violation
This is a generic error when the query fails. I see that the queries all use the table "passengers". Could it be that that table is not available in the "sys" schema (perhaps just in the "voc" schema)? If so, the queries should refer to "voc"."passengers" (with or without the quotes).

I will change the driver to provide the error message from the server to the application (instead of the generic message) with the same error code.

Comment 16652

Date: 2011-12-14 16:53:19 +0100
From: @sjoerdmullender

I'm closing this report. A number of issues with the ODBC driver have been fixed recently in the upcoming (Dec2011) release that had to do with the problem described in the description and first few comments. I have tested the driver against the Oracle Business Intelligence tool (both online and offline) and the driver and server now seem to be working.
There has not been a reply to comment 6, but I suspect that if there is a bug there, it's different from the original bug.

Comment 16834

Date: 2012-01-26 15:32:08 +0100
From: @sjoerdmullender

The Dec2011 version has been release, so declaring this bug as FIXED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant