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

Improve capabilities reporting #64

Merged
merged 9 commits into from
Nov 21, 2018
Merged

Improve capabilities reporting #64

merged 9 commits into from
Nov 21, 2018

Conversation

bpintea
Copy link
Collaborator

@bpintea bpintea commented Nov 21, 2018

This PR adds a few improvements in driver's capabilities reporting to the client application:

  • the "deprecated" SQLGetInfo() are now supported (mostly for the 2.x apps);
  • the catalog functions implemented as a facade (no ES/SQL support) offer now better interop: some apps query for number of columns in results, which was not available before;
  • SQLStatistics() is added to the list of facade catalog functions;
  • SQLGetTypeInfo() will forward to ES/SQL the type the app wants to filter the result by.

- add a list of attributes marked as "deprecated", but that are still
necessary for 2.x applications;
- also, set the size of written value, which is implicit for 3.x
applications, but which is expected by (some) 2.x ones.
Some catalog functions are required in order for the minimum driver
level to be achieved, so that apps can work with it. However, not all of
them have a current backing in ES/SQL. For these, a fake local empty
answer is provided.

With this change, some 2.x apps can now inquiry the columns count and
type (which 3.x apps would typically assume), which didn't work before.

The rest remains unchanged: the app will fetch no row and the call
succeeds.
- the function fakes an empty answer, no ES/SQL backing atp.
- updated README
- removed stale code in build.bat
- the catalog function will now propagate to ES/SQL the SQL type the app
is inquiring for (when not using the _ALL wildcard).
- add an early check for connection logging destination directory;
- if a connection-level logger can't be initialized, the failure is now
logged in the "general" logger, if available.
@bpintea bpintea mentioned this pull request Nov 21, 2018
Closed
Copy link
Collaborator

@edsavage edsavage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - one minor suggestion

STMT_FORCE_NODATA(STMH(hstmt));
return SQL_SUCCESS;
/*INDENT-OFF*/
# define SPECIAL_COLUMNS_EMPTY \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename to FOREIGN_KEYS_EMPTY

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice. Thanks for spotting it. Fixed now.

@bpintea bpintea merged commit 8d10a5f into elastic:master Nov 21, 2018
@bpintea bpintea deleted the feature/improve_cap_reporting branch November 21, 2018 19:05
bpintea added a commit that referenced this pull request Dec 13, 2018
* add "deprecated" SQLGetInfo attributes support

- add a list of attributes marked as "deprecated", but that are still
necessary for 2.x applications;
- also, set the size of written value, which is implicit for 3.x
applications, but which is expected by (some) 2.x ones.

* fix: add "fake" answers to unsupported catalog fn

Some catalog functions are required in order for the minimum driver
level to be achieved, so that apps can work with it. However, not all of
them have a current backing in ES/SQL. For these, a fake local empty
answer is provided.

With this change, some 2.x apps can now inquiry the columns count and
type (which 3.x apps would typically assume), which didn't work before.

The rest remains unchanged: the app will fetch no row and the call
succeeds.

* add SQLStatistics catalog function support

- the function fakes an empty answer, no ES/SQL backing atp.

* fix: update VS package reqs to cover DSN editor

- updated README
- removed stale code in build.bat

* minor improvements in connection attributes handling

* add support for filtering in SQLGetTypeInfo

- the catalog function will now propagate to ES/SQL the SQL type the app
is inquiring for (when not using the _ALL wildcard).

* expose SQLStatistics to the API

* minor connection logging setting validation

- add an early check for connection logging destination directory;
- if a connection-level logger can't be initialized, the failure is now
logged in the "general" logger, if available.

* fix: s/SPECIAL_COLUMNS_EMPTY/FOREIGN_KEYS_EMPTY

- fix copy&paste error.

(cherry picked from commit 8d10a5f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants