Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

ODBC: Report error from Excel when executing an invalid query #611

Conversation

jordanw-bq
Copy link
Contributor

Issue #, if available: #601

Description of changes:

  • save error type and details on connection errors
  • start checking error type when reporting error (first: query syntax)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

- save error type and details on connection errors
- start checking error type when reporting error (first: query syntax)

MYLOG(ES_TRACE, "entering\n");

if (EnvironmentHandle) {
Copy link

Choose a reason for hiding this comment

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

You should check this Statement, connection, then environment rather than the other way around. The most recently constructed handle gets priority.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reversed order of handle checks

if (Sqlstate)
utf8_to_ucs2(qstr_ansi, -1, Sqlstate, 6);
if (mtxt && tlen <= BufferLength) {
SQLULEN ulen = utf8_to_ucs2_lf(mtxt, tlen, FALSE, MessageText,
Copy link

@jduo jduo Jul 23, 2020

Choose a reason for hiding this comment

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

SQLCHAR inputs aren't guaranteed to be UTF-8. On Windows it depends on the OS codepage for example (usually codepage CP1252), though on Windows the DM does the conversion for you. This should likely be a separate issue to fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Will log another issue for this

@chloe-zh chloe-zh merged commit 3368d60 into opendistro-for-elasticsearch:develop Jul 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants