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

Add catalog::find_table_privileges function #204

Merged
merged 1 commit into from Aug 22, 2016
Merged

Add catalog::find_table_privileges function #204

merged 1 commit into from Aug 22, 2016

Conversation

mloskot
Copy link
Contributor

@mloskot mloskot commented Aug 18, 2016

Add catalog::table_privileges result set

It is convenient wrapper for ODBC API call SQLTablePrivileges and its result set.

@@ -100,6 +100,8 @@ TEST_CASE_METHOD(mysql_fixture, "catalog_tables_test", "[mysql][catalog][tables]
catalog_tables_test();
}

// TODO: Add catalog_table_privileges_test - SQLTablePrivileges returns empty result set
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have tried to call SQLTablePrivileges with variety of arguments (e.g. database name, empty database name, SQL_NTS or 0 for size, etc.) and this function always returns nothing. I have no idea why.

I'm using MySQL ODBC 5.3 Driver.

Copy link
Owner

Choose a reason for hiding this comment

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

I'd be ok with noting this issue in the documentation somewhere and omitting this test in MySQL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After merging, I'll try to look at it again and if still w/o luck, I'll document it.

@lexicalunit
Copy link
Owner

Looks good! After rebasing on master, running the code style formatter, and add verifying the test pass again you're good to merge 👍

@mloskot
Copy link
Contributor Author

mloskot commented Aug 22, 2016

BTW, I also removed TODO comments: Translate "YES","NO", strings to enum

I think it is better to stick to string values: 1) all catalog values are fetched as strings 2) some (buggy?) drivers may use driver-specific values, then we would be covered.

Tread off: from user's perspective, enums offered by nanodbc would be a convenient simplification of ODBC interface.

Add catalog::table_privileges result set.
It is convenient wrapper for ODBC API call SQLTablePrivileges and its result set.
@mloskot mloskot merged commit 4e3801a into lexicalunit:master Aug 22, 2016
@mloskot mloskot deleted the ml/catalog-table-privileges branch August 22, 2016 08:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants