Skip to content

SQLSpecialColumns not working as expected in the shared standalone #92

Open

Description

@abhi-555

After using the fix provided in #79

I am still receiving zero rows upon running SQLSpecialColumns in the given test case in the shared standalone.

Can you please run the test case in the standalone SQLSpecialColumns.zip and confirm if this is working for you?

Test case
CREATE TABLE test_special( id integer, ival integer);
CREATE UNIQUE index test_special_id on public.test_special(id);
CREATE UNIQUE index test_special_ui on public.test_special(ival);

Activity

  1. davecramer commented on Feb 21, 2025

    @davecramer
    Contributor

    Yes, can confirm that it does not work. I'm at odds as the test case does work. Looking into it.
    Dave

  2. abhi-555 commented on Mar 11, 2025

    @abhi-555
    Author

    Can you please provide any updates on this?

  3. davecramer commented on Mar 11, 2025

    @davecramer
    Contributor

    Hi,

    I'm stuck trying to debug this. It works fine in the test cases for ODBC, however in a standalone program it doesn't.

    I'm still working on it.

  4. davecramer commented on Mar 12, 2025

    @davecramer
    Contributor

    @abhi-555 I just merged a PR that should fix this. Please let me know

  5. abhi-555 commented on Apr 14, 2025

    @abhi-555
    Author

    I have tested this. I am not getting the column name but the schema name in the result set. We are binding the result set to the second column in the query. Isn't that supposed to be column name according to the ODBC standard?

  6. davecramer commented on Apr 15, 2025

    @davecramer
    Contributor

    you are correct, sorry about that. I'll try to get something out in the next few days

  7. davecramer commented on Apr 16, 2025

    @davecramer
    Contributor

    OK just merged in #109 which should fix this.

  8. abhi-555 commented on May 20, 2025

    @abhi-555
    Author

    I tested the fix. It is working in cases when there is only one unique index on the table. However, if there are two(multiple) unique indexes on the table, we are getting columns from both the indexes in the result which is not the correct behaviour according to my understanding.

    We should ideally only get columns from one index in the result. Can you please check this case? Below is the use case for reference

    CREATE TABLE public.users (
    id integer
    username VARCHAR(40),
    email VARCHAR(50),
    );

    CREATE UNIQUE INDEX idx_users1 ON public.users(username);
    CREATE UNIQUE INDEX idx_users2 ON public.users(email);

  9. davecramer commented on May 20, 2025

    @davecramer
    Contributor

    Just read the docs, and you are correct. I will have a look shortly

  10. davecramer commented on Jun 12, 2025

    @davecramer
    Contributor

    I have committed code that should resolve this issue. Please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions