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

[AD-751] make getColumns/getTables pass nullptr for catalog and schema params to JDBC #77

Merged
merged 190 commits into from
May 30, 2022

Conversation

birschick-bq
Copy link
Contributor

Summary

make changes so getColumns/getTables tests pass nullptr to JDBC

Description

Make getColumns pass nullptr to JDBC when ODBC receives nullptr as parameter.

Related Issue

https://bitquill.atlassian.net/browse/AD-751

Additional Reviewers

@affonsoBQ
@alexey-temnikov
@alinaliBQ
@andiem-bq
@birschick-bq
@mitchell-elholm
@RoyZhang2022

andiemontoyeah and others added 30 commits January 10, 2022 14:30
change the install options for OpenSSL, since vcpkg is a preferred option
remove the WiX Toolset v4 requirement
add steps for the fix for ignite-odbc-tests.profraw error in README.
added some comments for my own convenience. Will remove later
fixed by updating ChildId in tlsCheckBox = CreateCheckBox
add comment to illustrate plan on what to do for the configuration window
bugfix to make tlsCheckBox and tlsAllowInvalidHostnamesCheckBox read into the saved values
… files to be consistent with configuration.h

Files that had the change connection_string_parser.cpp, connection_string_parser.h, dsn_config.cpp, batch_query.cpp, data_query.cpp.
…iguration_window.h

 Add small letter case to keep format consistency in dsn_configuration_window.h
fixed one typo (Create authentication settings group box)
added SSH User, SSH Host. SSH Strict Host Key Checking, and SSH Known Hosts File onto the UI. However, the code to save the written values would be done in later commits.
Bruce Irschick and others added 18 commits February 16, 2022 10:47
* Updating JDBC version (#72)

* [AD-370] upload odbc driver build on push to develop (#71)

* [AD-730] upload odbc driver build at push to develop

* [AD-730] update github actions to upload with v3

* [AD-730] Test artifact upload action

* temporarily comment out if statement guard to test upload-artifact github action

* [AD-730] upload performance test executable

* [AD-730] update readme

* [AD-730] upload Release folder as artifact

* our odbc needs more than just the ignite.odbc.dll to run properly

* [AD-730] update to upload artifacts for release build

* previously, I uploaded the Debug builds, but the Release build is the one that requires less dependencies.

* [AD-730] add back if statment

* add the if statement back in win-build.yml to ensure that the odbc driver performance artifact is only published when pushed to develop

* [AD-730] fix typo of performance test plan

Co-authored-by: affonsoBQ <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
* first test

* fix performance test crash

* fix performance test crash

* fix whitespace issue

* rework based on comments
* [AD-550] JNI implementation for getImportedKeys

* [AD-550] update Pull Request Template

* added reviewees Roy Zhang and Micthell Elholm

* [AD-550] add todo note to unit test

* [AD-550] define GetImportedKeys in database_metadata.h/.cpp

* add ODBC wrapper code to the JNI call for GetImportedKeys

* [AD-550] initialize string vars to be empty string in column_metadata_query

* [AD-550] modify ForeignKeysQuery to accept 3 arguments only

* modified ForeignKeysQuery to only accept catalog, schema, and table, as other fields are not needed.

* [AD-550] update column metadata for foreign keys

* [AD-550] fix typo in primary_key_meta.h

* [AD-550] define vars for foreign key meta

* [AD-550] add getter functions for vars in foreign_key_meta.h

* [AD-550] support vars in foreign key meta to be optional

* [AD-550] add headers for boost optional

* [AD-550] add headers and constructors for foreign key meta

* added ForeignKeyMeta constructor, and copy constructor
*added ForeignKeyMeta destructor
* define ForeignKeyMetaVector
* basically, complete foreign_key_meta.h

* [AD-550] implement resultset.getSmallInt

* implement resultset.getSmallInt taking column indices or column names as parameters
* make ColumnMeta::dataType be updated with  resultSet.Get()->GetSmallInt to simplify code and readbility

* [AD-550] Add foreign_key_meta.cpp

* implemented functions:
ReadForeignKeysColumnMetaVector
ForeignKeyMeta::Read

* [AD-550] update CMakeLists to include foreign_key_meta.cpp

* [AD-550] implement MakeRequestGetForeignKeysMeta

* MakeRequestGetForeignKeysMeta calls GetImportedKeys to get Jni ResultSet object for foreign keys, and then reads the resultSet object to fill in the meta object.

* [AD-550] update ForeignKeysQuery::DataAvailable and ForeignKeysQuery::Close

* update meta object accordingly whenForeignKeysQuery::Close() is called.
* return boolean for whether data is available based on meta object

* [AD-550] implement ForeignKeysQuery::Execute and FetchNextRow

* the code for ForeignKeysQuery::Execute and ForeignKeysQuery::FetchNextRow is based on ColumnMetadataQuery::Execute and ColumnMetadataQuery::FetchNextRow

* [AD-550] fix Mac and Linux build

* remove extra qualification on GetSmallInt function

* [AD-550] implement ForeignKeysQuery::GetColumn

* had formatting changes as well

* [AD-550] JNI implementation for getImportedKeys

* [AD-550] update Pull Request Template

* added reviewees Roy Zhang and Micthell Elholm

* [AD-550] add todo note to unit test

* [AD-550] define GetImportedKeys in database_metadata.h/.cpp

* add ODBC wrapper code to the JNI call for GetImportedKeys

* [AD-550] initialize string vars to be empty string in column_metadata_query

* [AD-550] modify ForeignKeysQuery to accept 3 arguments only

* modified ForeignKeysQuery to only accept catalog, schema, and table, as other fields are not needed.

* [AD-550] update column metadata for foreign keys

* [AD-550] fix typo in primary_key_meta.h

* [AD-550] define vars for foreign key meta

* [AD-550] add getter functions for vars in foreign_key_meta.h

* [AD-550] support vars in foreign key meta to be optional

* [AD-550] add headers for boost optional

* [AD-550] add headers and constructors for foreign key meta

* added ForeignKeyMeta constructor, and copy constructor
*added ForeignKeyMeta destructor
* define ForeignKeyMetaVector
* basically, complete foreign_key_meta.h

* [AD-550] implement resultset.getSmallInt

* implement resultset.getSmallInt taking column indices or column names as parameters
* make ColumnMeta::dataType be updated with  resultSet.Get()->GetSmallInt to simplify code and readbility

* [AD-550] Add foreign_key_meta.cpp

* implemented functions:
ReadForeignKeysColumnMetaVector
ForeignKeyMeta::Read

* [AD-550] update CMakeLists to include foreign_key_meta.cpp

* [AD-550] implement MakeRequestGetForeignKeysMeta

* MakeRequestGetForeignKeysMeta calls GetImportedKeys to get Jni ResultSet object for foreign keys, and then reads the resultSet object to fill in the meta object.

* [AD-550] update ForeignKeysQuery::DataAvailable and ForeignKeysQuery::Close

* update meta object accordingly whenForeignKeysQuery::Close() is called.
* return boolean for whether data is available based on meta object

* [AD-550] implement ForeignKeysQuery::Execute and FetchNextRow

* the code for ForeignKeysQuery::Execute and ForeignKeysQuery::FetchNextRow is based on ColumnMetadataQuery::Execute and ColumnMetadataQuery::FetchNextRow

* [AD-550] fix Mac and Linux build

* remove extra qualification on GetSmallInt function

* [AD-550] implement ForeignKeysQuery::GetColumn

* had formatting changes as well

* [AD-550] update docs for foreign_keys_query.h

* [AD-550] refine SQLForeignKey call

* [AD-550] add draft foreign key test for JNI test

* [AD-550] add test tables for jni test

* [AD-550] update test TestDocumentDbDatabaseMetaDataGetImportedKeys

* update test to query virtual table jni_test_001_sub_doc

* [AD-550] add SQLForeignKeys sql api test

* [AD-550] add logs for ReadForeignKeysColumnMetaVector

* PK* variables will contain the list of foreign keys in the specified table

* [AD-550] reformat jni_test

* [AD-550] implement TestDatabaseMetaDataGetImportedKeys for java_test

* [AD-550] add test document meta_queries_test_002_with_array

* this document will be used to test SQLForeignKeys in meta_queries_test

* [AD-550] refactor TestSQLForeignKeys test

* reason: I see that `SQLCHAR empty[] = "";` is used in meta_queries_test, and I think that might be a better way of writing the parameters

* [AD-550] add test for SQLForeignKeys in meta_queries_test

tests added:
* TestGetDataWithForeignKeysReturnsOneFromLocalServer
* TestGetDataWithForeignKeysReturnsNone
* they use test table meta_queries_test_002_with_array

* [AD-550] clean up

* add doc for SQLForeignKeys
* remove comments

* [AD-550] remove commented out code

* [AD-550] remove unneeded commented out code

* [AD-550] make ODBC pass nullptr for JString catalog and schema for SQLForeignKeys

*  in getImportedKeys, null boost::optional strings will be passed as nullptr to JDBC
* make jni test and java test pass null boost::optional strings to JNI calls for getImportedKeys
* ODBC now passes boost::optional strings foreignCatalog and foreignSchema to ExecuteGetForeignKeysQuery function.

* [AD-550] add if check for sqlStrLen

* if sqlString is empty, return boost::none

* [AD-550] debug `choco install cppcheck -y` not working on GitHub Actions

* [AD-550] add tests for testing empty string parameters

* added Java test TestDatabaseMetaDataGetImportedKeysReturnsNone
* added Jni test TestDocumentDbDatabaseMetaDataGetImportedKeysReturnsNone

* [AD-550] disable cppcheck

* created [AD-752](https://bitquill.atlassian.net/browse/AD-752) to investigate it further.

* [AD-550] change the place for code doc for function SQLForeignKeys

* [AD-550] update if statement check of SqlStringToOptString

* to resolve code review comment

* [AD-550] resolve code review comment

* The sqlStrLen is an int32_t, so "!sqlStrLen" can be removed

* [AD-550] make boost optional strings constant where needed

* previously, I changed `const std::string` to `boost::optional< std::string >` in some areas, and this is now fixed by replacing the latter with `boost::optional< const std::string >`

* [AD-550] SqlStringToOptString fix

* also fixed SqlStringToConstOptString
* reason: SQL_NTS is a flag that indicates that the string passed is a null-terminated string.

* [AD-550] make tests pass null to SQLForeignKeys

* [AD-550] add test case for TestGetDataWithForeignKeysReturnsNone

*  even with the correct table name, as long as empty strings are passed as catalog/schema, SQL_NO_DATA should be returned

* [AD-550] update SqlStringToOptString

* [AD-550] update TestSQLForeignKeys to pass NULL as parameters properly

* [AD-550] move `const` out of `boost::optional< const std::string >`

* reason: `const boost::optional< std::string >` works better than `boost::optional< const std::string >`.
* this commit is to resolve code review comments

* [AD-550] add meta_queries test that passes catalog as empty string

* [AD-550] Set `fetched` to false in ForeignKeysQuery::Close()

* [AD-550] add explicit conversion to boost::optional variable initialization

* [AD-550] resolve code review comment

* remove duplicate code

* [AD-550] remove function

* removed unneeded function: SqlStringToConstOptString
### Summary

[AD-649] Add missing documentation

### Description
Update ODBC driver documentation

- [x] Documentation about connections string ( Parameters description)
- [x] Documentation about DSN configuration window ( with screenshots)
- [x] Documentation how the ODBC driver works ( ODBC and JDBC integration)
- [x] Documentation what is supported ( link with JDBC driver)

### Related Issue

https://bitquill.atlassian.net/browse/AD-649

* Updating JDBC version (#72)

* [AD-370] upload odbc driver build on push to develop (#71)

* [AD-730] upload odbc driver build at push to develop

* [AD-730] update github actions to upload with v3

* [AD-730] Test artifact upload action

* temporarily comment out if statement guard to test upload-artifact github action

* [AD-730] upload performance test executable

* [AD-730] update readme

* [AD-730] upload Release folder as artifact

* our odbc needs more than just the ignite.odbc.dll to run properly

* [AD-730] update to upload artifacts for release build

* previously, I uploaded the Debug builds, but the Release build is the one that requires less dependencies.

* [AD-730] add back if statment

* add the if statement back in win-build.yml to ensure that the odbc driver performance artifact is only published when pushed to develop

* [AD-730] fix typo of performance test plan

* [AD-735] large dataset crash issue (#74)

### Summary

ODBC driver will not run on large document tests

### Description
The performance test crashes for large document tests. 

1. The root cause is the wrong memory is passed to SQLBindCol(). The parameter TargetValuePtr is passed &cols[i][0].data_dat[i]. The i could exceed 255 for large table while its max valid value should be 254. The correct value should be 0.
2. The SQLExtendedFetch is deprecated. Replace it with SQLFetch.

### Related Issue

https://bitquill.atlassian.net/browse/AD-735

* [AD-509] Update mac developer environment setup

* Adjust formatting

* Add note about llvm

* Add note about iodbc

* Update README.md

change the install options for OpenSSL, since vcpkg is a preferred option

* Update README.md

remove the WiX Toolset v4 requirement

* Update README.md

add steps for the fix for ignite-odbc-tests.profraw error in README.

* [AD-517] Remove old properties + add new properties

* remove SSL settings and add TLS checkbox on the Configuration Window

* add comments for my own work

added some comments for my own convenience. Will remove later

* fix tls checkbox on Configuration Window

fixed by updating ChildId in tlsCheckBox = CreateCheckBox

* add TlsAllowInvalidHostnames checkbox and TLS CA edit to the Configuration Window

* Update configuration.cpp

add comment to illustrate plan on what to do for the configuration window

* Update dsn_configuration_window.cpp

bugfix to make tlsCheckBox and tlsAllowInvalidHostnamesCheckBox read into the saved values

* change defaultFetchSize to fetchSize in configuration.h

* change Default DSN name to DocumentDB DSN

* add App Name, Fetch Size, Read Preference, and login timeout to configuration window

* [AD-522] bugfix - change DefaultFetchSize to fetchSize in all related files to be consistent with configuration.h

Files that had the change connection_string_parser.cpp, connection_string_parser.h, dsn_config.cpp, batch_query.cpp, data_query.cpp.

* [AD-522] save read preference settings

* [AD-522] remove commented out code

* [AD-522] Implement replicaSet and retryReads on Configuration Window

* [AD-517] Re-enable unit tests - WIP -  still need to cleanup

* [AD-522] add space to code lines for format consistency in configuration_window.h

* Add more unit tests

* Remove extra file

* [AD-522] Add small letter case to keep format consistency in dsn_configuration_window.h

 Add small letter case to keep format consistency in dsn_configuration_window.h
fixed one typo (Create authentication settings group box)

* Remove redundant declaration

* [AD-522] add variable definitions for SSH tunnel settings for config UI

* [AD-522] add function definition for SSH Tunnel

added SSH User, SSH Host. SSH Strict Host Key Checking, and SSH Known Hosts File onto the UI. However, the code to save the written values would be done in later commits.

* [AD-522] code draft for configuration.cpp

add draft variable definition to Enable ssh tunnel boolean value

* Revert "change defaultFetchSize to fetchSize in configuration.h"

This reverts commit f311e3b.

* Revert "[AD-522] bugfix - change DefaultFetchSize to fetchSize in all related files to be consistent with configuration.h"

This reverts commit 2bcd2a4.

* [AD-517] * Change the C++ version to use to compile.

* [AD-522] change fetchSize to defaultFetchSize on configuration window for consistency with JDBC driver

* [AD-517] * Changed checks.yml so that it doesn't fail on code review errors.

* Revert "[AD-522] bugfix - change DefaultFetchSize to fetchSize in all related files to be consistent with configuration.h""

This reverts commit 124b725.

* [AD-522] make TLS allow invalid hostnames checkbox enabled only when tls Check box is checked

* Revert "Revert "[AD-522] bugfix - change DefaultFetchSize to fetchSize in all related files to be consistent with configuration.h"""

This reverts commit aa7731a.

* Improvements from review

* Updated comments

* [AD-522] save SSH values for re-read, make settings window into 2 columns

Make ssl and additional settings groups to be on the right side of the column on the configuration window. This is subject to change later.
I created the function
void DsnConfigurationWindow::RetrieveSshParameters(config::Configuration& cfg) const
to save SSH values.
The width value in the DsnConfigurationWindow constructor is doubled from 360 to 720 and added the margin value. The margins currently look imbalanced on the settings box, and will be fixed in later commits.
Make Ok button and Cancel buttons aligned with the right column
bugfix - allow the SSH strict host checking checkbox to be checked on and off by adding the case ChildId::SSH_STRICT_HOST_KEY_CHECKING_CHECK_BOX definition.

* Removed includes no longer being used in configuration.h

* Some formatting improvements

* [Ad-522] add sshEnable variable in DSN config

- added sshEnable variable definition and getter/setter for sshEnable.
- added code for parsing sshEnable in the connection string parser

* [AD-522] change from GetSshEnable to IsSshEnable for consistency

* [AD-522] comment out deprecated readPreference variable

start on transitioning from readPreferenceEdit to readPreference combo box

* [AD-522] add SSH enable checkbox, SSH private key passphrase, and SSH private key file

* add SSH Enable variable in configuration.h and configuration.cpp
* add SSH checkbox in SSH group setting
* add SSH private key file edit in SSH group setting
* add SSH private key pass phrase in SSH group setting
** SSH private key passphrase label requires double the row height due to the label being long.
* make SSH setting items disabled/enabled as SSH enable checkbox is unchecked/checked
* save SSH variables to configuration when Ok button is pressed.

* [AD-522] read_preference.h fix

* add guards to read_preference.h fix
* include read_preference.h in dsn_configuration_window.cpp
* add draft code for read preference in dsn_configuration_window.cpp

* [AD-522] update fields in configuration window

* modified order of fields in the configuration window.
- Retry reads checkbox is now in the first row under "Additional Settings".
- SSH Strict host key check is now in the last row under "Internal SSH Tunnel Settings"
- Allow invalid hostnames checkbox now is in 2nd row under "TLS/SSL settings"
* added warning sentences for Allow invalid hostnames checkbox and SSH strict host key check

* Improvements from code review + address some warnings

* Change connection _test to use hostname key instead of address

* Change connection_test to use databse key instead of schema key

* [AD-522] implement read Preference

* add SpaceToUnderscore function
* implement read Preference in Config window and save the value

* Attempt to fix windows 32 build

* [AD-522] refactor dsn_configuration_window.cpp

refactor code format; remove spaces and  unnecessary comments

* [AD-522] fix config window margins

now the config window is symmetric

* Fix formatting

* [AD-522] add HasText() function to window.h

* previously, the definition of HasText was mistakenly committed in commit cbaeedd.
* add header of HasText() to resolve building errors in origin
* update HasText() function to make code simpler

* [AD-522] make "rs0" the default value of replicaSet

* [AD-522] implement database, hostname, port fields. And disable ok button unless all required fields are filled

* implement database, hostname, port fields.
* disable ok button unless all required fields (database, hostname, port, username, password) are filled
* added boolean created to indicate whether the configuration window has been created. If has, then check for disabling/enabling the Ok button

* [AD-522] rename SSH Known Hosts File label for clarity

* [AD-522] refactor logs for retrieving TSL settings

Make the sentences align

* [AD-522] rename TLS CA File label for clarity

* change label length to the same label length as connection settings group

* [AD-522] move authorization setting fields to connection fields

reason: only username and password are authorization settings, the rest are not. We chose to put username, password in the connections group because all fields in the connections group are required.

* [AD-522] bugfix-comment out address field related code in RetrieveConnectionParameters

* [AD-522] rename sslSettings to tlsSettings and add comment for connection settings group

* [AD-522] remove protocol version from config window

* [AD-522] bug fix sshKnownHostsFile not saved when Ok button is pressed

* [AD-522] remove commented out #include headers

* [AD-522] disable  SSH Known Hosts File edit when SSH Strict Host Key Check check box is unchecked

* move SSH Strict Host Key Checking check box above SSH Known Hosts File edit in the config window

* [AD-522] refactor - remove commented out header code

* [AD-522] add comments in configuration.cpp for planning

* modify commented out example code in dsn_configuration_window.cpp for clarity

* [AD-522] change from SSL to TLS for consistency

* SSL_SETTINGS_GROUP_BOX is changed to TLS_SETTINGS_GROUP_BOX

* [AD-522] remove commented out code

Removed commented out code:
* RetrieveAuthParameters
* CreateAuthSettingsGroup
* CreateAdditionalSettingsGroup function and CreateSslSettingsGroup function for 1 column window
* protocol version - related code
* authSettingsGroupBox code

* [AD-522] remove std::auto_ptr<Window> authSettingsGroupBox;

* [AD-522] remove address field auto pointer initialization

* [AD-522] remove address field from config window constructor

* [AD-522] refactor - remove unneeded commented out code in HasText

* [AD-522] refactor - remove white spaces and update comment

* [AD-522] debug scan_method.h

* SpaceToUnderscore is called in scan_method.cpp to make reads better
* added guards to scan_method.h

* [AD-522] implement Schema group settings box

* fixed bug in dsn_config.cpp to save scanLimit correctly

* [AD-522] update readPreference default value to unknown

* removed unneeded commented out code
* removed unnecessary code to get string value on readPreference

* [AD-522] refactor - remove unnecessary comments

* [AD-522] adjust window size and additional settings group label size

* additional settings group label size is now the same as other settings group in the same column

* Revert "Merge branch 'develop' into alinaliBQ/AD-522/config_window"

This reverts commit 8d609da, reversing
changes made to 0aa2052.

* [AD-522] keyboard user interface design + disable DSN empty strimg warning dialog

* make cursor go to checkboxes on the Config window and not skip them when tab key is pressed
* when DSN field is empty, Ok Button is disabled
* make default replicaSet value empty string (default is disable repliaSet)
* refactor - removed unneeded comments

* [AD-522] add end_point header to resolve build errors

end_point related code still exist in connection.cpp, so I readded the header for end_point

* Revert "Revert "Merge branch 'develop' into alinaliBQ/AD-522/config_window""

This reverts commit df0cad5.

* [AD-522] resolve errors after merging develop branch

* GetAddresses() is deprecated, replaced it with GetHostname() and GetTcpPort() to get hostname and port number, respectively.
* replaced GetSchema() with GetSchemaName()
* removed commented out code
* refactor with dsn_configuration_window.cpp

* [AD-512] Resolve issue with missing include file.

* [AD-522] make BoolParseResult recognizable

* [AD-522] fix build errors after develop branch merge

* update schema checkbox string
* make edit row height single
* update SetTcpPort to SetPort etc
* define default value for sshEnable

* [AD-522] enable encrypt password for ssh private key passphrase

* modify refresh schema checkbox string to fit better
* remove log message for ssh private key passphrase to increase security

* [AD-521] add comments and notes for starting AD-521

* [AD-509] update readMe to include directions about saving Java bin and server directories.

* reason: ODBC JNI calls have a dependency on `jvm.dll`, as a result, the ODBC driver cannot operate properly unless the Java bin and server directories are included in the path.

* [AD-522] reduce space between ssh private key passphrase and the checkbox below

* [AD-521] define constants for Java GetSshLocalPort method call

* [AD-521] integrate code review feedback from Andie

* refactors with comment changes and log changes

* [AD-521] refactor code

* make open brace bracket start on new line for JVMException
* remove excess space

* [AD-427] Tracer Code - Limited Capability to load metadata - work-in-progress.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Windows build.

* [AD-427] Fix Windows build.

* [AD-427] Fix Windows build.

* [AD-522] remove space and add new line at the end of enum types

* [AD-522] add new lines at the end of Enum type files

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-521] add changes for Java.cpp from Bruce's AD-427 branch

* those changes are not included in the previous merge, and are now added

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-521] JNI wrapper calls to iSshTunnelActive and getSshLocalPort

* some draft comments are left to be cleaned up

* [AD-521] debug getSshLocalPort

* change function type signature from optional to int
* refactor - remove comments

* [AD-521] change return value in getSshLocalPort from boolean to a 0

* try to fix access memory issue in TestDriverManagerGetConnection

* [AD-522] resolve build errors after merge

* fix bug for schema name not correctly loaded on the config window
* removed unnecessary headers

* [AD-427] Added ResultSet.next and ResultSet.GetString()

* [AD-522] address code review comments

* change to enum class type for read_preference.h and scan_method.h
* change the way enum class objects are read
* add static cast to enum types so SetSelection function can work with it
* refactor - removed unnecessary comments
* refactor - changes code doc in connection_string_parser.h

* [AD-521] implement tests for JNI wrapper code

* test for TestDocumentDbConnectionGetSshTunnelPortSshTunnelNotActive is not yet active, need to be enabled when we can get external SSH tunnel working.
* bug fix: re-implemented DocumentDbConnectionGetSshLocalPort and DocumentDbConnectionIsSshTunnelActive.
connection.Get()->GetRef() is passed as first parameter because jobject is required for CallIntMethod and CallBooleanMethod.
* better JNI wrapper code is needed in the future so warnings/errors pop up when we pass jobject instead of jclass to the methods.

* [AD-521] refactor - remove comments and commented out code

* [AD-589] implement JNI method call for GetDatabaseMetadata

* define the method constant for DocumentDbConnection.getDatabaseMetadata()
* create JNI wrapper function for DocumentDbConnection.getMetaData

* [AD-589] implement unit test for DocumentDbConnection.getMetaData

* [AD-521] add calls to AutoCloseConnection in unit tests

* pass & errInfo instead of * errInfo in DocumentDbConnectionGetSshLocalPort and DocumentDbConnectionIsSshTunnelActive.

* [AD-521] remove unnecessary comment

* [AD-589] fix merge issues

* I missed this part of code when I was resolving the merge conflicts. Now they are corrected

* [AD-589] update getMetaData JNI wrapper code to pass &errInfo

* implement unit test for getMetaData

* [AD-589] implement JNI wrapper for DocumentDbDatabaseSchemaMetadataGetSchemaName

* implement Java class for
* define constant for DocumentDbDatabaseSchemaMetadataGetSchemaName
*  add empty test function for TestDocumentDbDatabaseSchemaMetadataGetSchemaName

* [AD-589] implement unit test for DbDatabaseSchemaMetadataGetSchemaName

* [AD-521] refactor - change case of ssh to SSH for consistency

* [AD-589] address code review comments

* rename DocumentDbConnectionGetMetaData to DocumentDbConnectionGetDatabaseMetaData

* [AD-589] change case from MetaData to Metadata to match Java method name

* [AD-589] refactor: change from metaData to metadata

changes occurred in:
* DocumentDbConnectionGetDatabaseMetadata
* DocumentDbDatabaseSchemaMetadataGetSchemaName
* TestDocumentDbConnectionGetDatabaseMetadata
* TestDocumentDbDatabaseSchemaMetadataGetSchemaName

* Birschick bq/sync up (#21)

* Updating JDBC version (#72)

* [AD-370] upload odbc driver build on push to develop (#71)

* [AD-730] upload odbc driver build at push to develop

* [AD-730] update github actions to upload with v3

* [AD-730] Test artifact upload action

* temporarily comment out if statement guard to test upload-artifact github action

* [AD-730] upload performance test executable

* [AD-730] update readme

* [AD-730] upload Release folder as artifact

* our odbc needs more than just the ignite.odbc.dll to run properly

* [AD-730] update to upload artifacts for release build

* previously, I uploaded the Debug builds, but the Release build is the one that requires less dependencies.

* [AD-730] add back if statment

* add the if statement back in win-build.yml to ensure that the odbc driver performance artifact is only published when pushed to develop

* [AD-730] fix typo of performance test plan

Co-authored-by: affonsoBQ <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>

* [AD-735] large dataset crash issue (#23)

* first test

* fix performance test crash

* fix performance test crash

* fix whitespace issue

* rework based on comments

Co-authored-by: Andie Montoya <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: affonsoBQ <[email protected]>
Co-authored-by: RoyZhang2022 <[email protected]>

* [AD-649] Add missing documentation (#73)

* Initial user/developer documentation
Co-authored-by: andiem-bq <[email protected]>
Co-authored-by: Bruce Irschick <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>

Co-authored-by: affonsoBQ <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: Andie Montoya <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: RoyZhang2022 <[email protected]>
* Updating JDBC version (#72)

* [AD-370] upload odbc driver build on push to develop (#71)

* [AD-730] upload odbc driver build at push to develop

* [AD-730] update github actions to upload with v3

* [AD-730] Test artifact upload action

* temporarily comment out if statement guard to test upload-artifact github action

* [AD-730] upload performance test executable

* [AD-730] update readme

* [AD-730] upload Release folder as artifact

* our odbc needs more than just the ignite.odbc.dll to run properly

* [AD-730] update to upload artifacts for release build

* previously, I uploaded the Debug builds, but the Release build is the one that requires less dependencies.

* [AD-730] add back if statment

* add the if statement back in win-build.yml to ensure that the odbc driver performance artifact is only published when pushed to develop

* [AD-730] fix typo of performance test plan

* [AD-735] large dataset crash issue (#74)

### Summary

ODBC driver will not run on large document tests

### Description
The performance test crashes for large document tests. 

1. The root cause is the wrong memory is passed to SQLBindCol(). The parameter TargetValuePtr is passed &cols[i][0].data_dat[i]. The i could exceed 255 for large table while its max valid value should be 254. The correct value should be 0.
2. The SQLExtendedFetch is deprecated. Replace it with SQLFetch.

### Related Issue

https://bitquill.atlassian.net/browse/AD-735

* [AD-509] Update mac developer environment setup

* Adjust formatting

* Add note about llvm

* Add note about iodbc

* Update README.md

change the install options for OpenSSL, since vcpkg is a preferred option

* Update README.md

remove the WiX Toolset v4 requirement

* Update README.md

add steps for the fix for ignite-odbc-tests.profraw error in README.

* [AD-517] Remove old properties + add new properties

* remove SSL settings and add TLS checkbox on the Configuration Window

* add comments for my own work

added some comments for my own convenience. Will remove later

* fix tls checkbox on Configuration Window

fixed by updating ChildId in tlsCheckBox = CreateCheckBox

* add TlsAllowInvalidHostnames checkbox and TLS CA edit to the Configuration Window

* Update configuration.cpp

add comment to illustrate plan on what to do for the configuration window

* Update dsn_configuration_window.cpp

bugfix to make tlsCheckBox and tlsAllowInvalidHostnamesCheckBox read into the saved values

* change defaultFetchSize to fetchSize in configuration.h

* change Default DSN name to DocumentDB DSN

* add App Name, Fetch Size, Read Preference, and login timeout to configuration window

* [AD-522] bugfix - change DefaultFetchSize to fetchSize in all related files to be consistent with configuration.h

Files that had the change connection_string_parser.cpp, connection_string_parser.h, dsn_config.cpp, batch_query.cpp, data_query.cpp.

* [AD-522] save read preference settings

* [AD-522] remove commented out code

* [AD-522] Implement replicaSet and retryReads on Configuration Window

* [AD-517] Re-enable unit tests - WIP -  still need to cleanup

* [AD-522] add space to code lines for format consistency in configuration_window.h

* Add more unit tests

* Remove extra file

* [AD-522] Add small letter case to keep format consistency in dsn_configuration_window.h

 Add small letter case to keep format consistency in dsn_configuration_window.h
fixed one typo (Create authentication settings group box)

* Remove redundant declaration

* [AD-522] add variable definitions for SSH tunnel settings for config UI

* [AD-522] add function definition for SSH Tunnel

added SSH User, SSH Host. SSH Strict Host Key Checking, and SSH Known Hosts File onto the UI. However, the code to save the written values would be done in later commits.

* [AD-522] code draft for configuration.cpp

add draft variable definition to Enable ssh tunnel boolean value

* Revert "change defaultFetchSize to fetchSize in configuration.h"

This reverts commit f311e3b.

* Revert "[AD-522] bugfix - change DefaultFetchSize to fetchSize in all related files to be consistent with configuration.h"

This reverts commit 2bcd2a4.

* [AD-517] * Change the C++ version to use to compile.

* [AD-522] change fetchSize to defaultFetchSize on configuration window for consistency with JDBC driver

* [AD-517] * Changed checks.yml so that it doesn't fail on code review errors.

* Revert "[AD-522] bugfix - change DefaultFetchSize to fetchSize in all related files to be consistent with configuration.h""

This reverts commit 124b725.

* [AD-522] make TLS allow invalid hostnames checkbox enabled only when tls Check box is checked

* Revert "Revert "[AD-522] bugfix - change DefaultFetchSize to fetchSize in all related files to be consistent with configuration.h"""

This reverts commit aa7731a.

* Improvements from review

* Updated comments

* [AD-522] save SSH values for re-read, make settings window into 2 columns

Make ssl and additional settings groups to be on the right side of the column on the configuration window. This is subject to change later.
I created the function
void DsnConfigurationWindow::RetrieveSshParameters(config::Configuration& cfg) const
to save SSH values.
The width value in the DsnConfigurationWindow constructor is doubled from 360 to 720 and added the margin value. The margins currently look imbalanced on the settings box, and will be fixed in later commits.
Make Ok button and Cancel buttons aligned with the right column
bugfix - allow the SSH strict host checking checkbox to be checked on and off by adding the case ChildId::SSH_STRICT_HOST_KEY_CHECKING_CHECK_BOX definition.

* Removed includes no longer being used in configuration.h

* Some formatting improvements

* [Ad-522] add sshEnable variable in DSN config

- added sshEnable variable definition and getter/setter for sshEnable.
- added code for parsing sshEnable in the connection string parser

* [AD-522] change from GetSshEnable to IsSshEnable for consistency

* [AD-522] comment out deprecated readPreference variable

start on transitioning from readPreferenceEdit to readPreference combo box

* [AD-522] add SSH enable checkbox, SSH private key passphrase, and SSH private key file

* add SSH Enable variable in configuration.h and configuration.cpp
* add SSH checkbox in SSH group setting
* add SSH private key file edit in SSH group setting
* add SSH private key pass phrase in SSH group setting
** SSH private key passphrase label requires double the row height due to the label being long.
* make SSH setting items disabled/enabled as SSH enable checkbox is unchecked/checked
* save SSH variables to configuration when Ok button is pressed.

* [AD-522] read_preference.h fix

* add guards to read_preference.h fix
* include read_preference.h in dsn_configuration_window.cpp
* add draft code for read preference in dsn_configuration_window.cpp

* [AD-522] update fields in configuration window

* modified order of fields in the configuration window.
- Retry reads checkbox is now in the first row under "Additional Settings".
- SSH Strict host key check is now in the last row under "Internal SSH Tunnel Settings"
- Allow invalid hostnames checkbox now is in 2nd row under "TLS/SSL settings"
* added warning sentences for Allow invalid hostnames checkbox and SSH strict host key check

* Improvements from code review + address some warnings

* Change connection _test to use hostname key instead of address

* Change connection_test to use databse key instead of schema key

* [AD-522] implement read Preference

* add SpaceToUnderscore function
* implement read Preference in Config window and save the value

* Attempt to fix windows 32 build

* [AD-522] refactor dsn_configuration_window.cpp

refactor code format; remove spaces and  unnecessary comments

* [AD-522] fix config window margins

now the config window is symmetric

* Fix formatting

* [AD-522] add HasText() function to window.h

* previously, the definition of HasText was mistakenly committed in commit cbaeedd.
* add header of HasText() to resolve building errors in origin
* update HasText() function to make code simpler

* [AD-522] make "rs0" the default value of replicaSet

* [AD-522] implement database, hostname, port fields. And disable ok button unless all required fields are filled

* implement database, hostname, port fields.
* disable ok button unless all required fields (database, hostname, port, username, password) are filled
* added boolean created to indicate whether the configuration window has been created. If has, then check for disabling/enabling the Ok button

* [AD-522] rename SSH Known Hosts File label for clarity

* [AD-522] refactor logs for retrieving TSL settings

Make the sentences align

* [AD-522] rename TLS CA File label for clarity

* change label length to the same label length as connection settings group

* [AD-522] move authorization setting fields to connection fields

reason: only username and password are authorization settings, the rest are not. We chose to put username, password in the connections group because all fields in the connections group are required.

* [AD-522] bugfix-comment out address field related code in RetrieveConnectionParameters

* [AD-522] rename sslSettings to tlsSettings and add comment for connection settings group

* [AD-522] remove protocol version from config window

* [AD-522] bug fix sshKnownHostsFile not saved when Ok button is pressed

* [AD-522] remove commented out #include headers

* [AD-522] disable  SSH Known Hosts File edit when SSH Strict Host Key Check check box is unchecked

* move SSH Strict Host Key Checking check box above SSH Known Hosts File edit in the config window

* [AD-522] refactor - remove commented out header code

* [AD-522] add comments in configuration.cpp for planning

* modify commented out example code in dsn_configuration_window.cpp for clarity

* [AD-522] change from SSL to TLS for consistency

* SSL_SETTINGS_GROUP_BOX is changed to TLS_SETTINGS_GROUP_BOX

* [AD-522] remove commented out code

Removed commented out code:
* RetrieveAuthParameters
* CreateAuthSettingsGroup
* CreateAdditionalSettingsGroup function and CreateSslSettingsGroup function for 1 column window
* protocol version - related code
* authSettingsGroupBox code

* [AD-522] remove std::auto_ptr<Window> authSettingsGroupBox;

* [AD-522] remove address field auto pointer initialization

* [AD-522] remove address field from config window constructor

* [AD-522] refactor - remove unneeded commented out code in HasText

* [AD-522] refactor - remove white spaces and update comment

* [AD-522] debug scan_method.h

* SpaceToUnderscore is called in scan_method.cpp to make reads better
* added guards to scan_method.h

* [AD-522] implement Schema group settings box

* fixed bug in dsn_config.cpp to save scanLimit correctly

* [AD-522] update readPreference default value to unknown

* removed unneeded commented out code
* removed unnecessary code to get string value on readPreference

* [AD-522] refactor - remove unnecessary comments

* [AD-522] adjust window size and additional settings group label size

* additional settings group label size is now the same as other settings group in the same column

* Revert "Merge branch 'develop' into alinaliBQ/AD-522/config_window"

This reverts commit 8d609da, reversing
changes made to 0aa2052.

* [AD-522] keyboard user interface design + disable DSN empty strimg warning dialog

* make cursor go to checkboxes on the Config window and not skip them when tab key is pressed
* when DSN field is empty, Ok Button is disabled
* make default replicaSet value empty string (default is disable repliaSet)
* refactor - removed unneeded comments

* [AD-522] add end_point header to resolve build errors

end_point related code still exist in connection.cpp, so I readded the header for end_point

* Revert "Revert "Merge branch 'develop' into alinaliBQ/AD-522/config_window""

This reverts commit df0cad5.

* [AD-522] resolve errors after merging develop branch

* GetAddresses() is deprecated, replaced it with GetHostname() and GetTcpPort() to get hostname and port number, respectively.
* replaced GetSchema() with GetSchemaName()
* removed commented out code
* refactor with dsn_configuration_window.cpp

* [AD-512] Resolve issue with missing include file.

* [AD-522] make BoolParseResult recognizable

* [AD-522] fix build errors after develop branch merge

* update schema checkbox string
* make edit row height single
* update SetTcpPort to SetPort etc
* define default value for sshEnable

* [AD-522] enable encrypt password for ssh private key passphrase

* modify refresh schema checkbox string to fit better
* remove log message for ssh private key passphrase to increase security

* [AD-521] add comments and notes for starting AD-521

* [AD-509] update readMe to include directions about saving Java bin and server directories.

* reason: ODBC JNI calls have a dependency on `jvm.dll`, as a result, the ODBC driver cannot operate properly unless the Java bin and server directories are included in the path.

* [AD-522] reduce space between ssh private key passphrase and the checkbox below

* [AD-521] define constants for Java GetSshLocalPort method call

* [AD-521] integrate code review feedback from Andie

* refactors with comment changes and log changes

* [AD-521] refactor code

* make open brace bracket start on new line for JVMException
* remove excess space

* [AD-427] Tracer Code - Limited Capability to load metadata - work-in-progress.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Windows build.

* [AD-427] Fix Windows build.

* [AD-427] Fix Windows build.

* [AD-522] remove space and add new line at the end of enum types

* [AD-522] add new lines at the end of Enum type files

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-521] add changes for Java.cpp from Bruce's AD-427 branch

* those changes are not included in the previous merge, and are now added

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-427] Fix Mac build.

* [AD-521] JNI wrapper calls to iSshTunnelActive and getSshLocalPort

* some draft comments are left to be cleaned up

* [AD-521] debug getSshLocalPort

* change function type signature from optional to int
* refactor - remove comments

* [AD-521] change return value in getSshLocalPort from boolean to a 0

* try to fix access memory issue in TestDriverManagerGetConnection

* [AD-522] resolve build errors after merge

* fix bug for schema name not correctly loaded on the config window
* removed unnecessary headers

* [AD-427] Added ResultSet.next and ResultSet.GetString()

* [AD-522] address code review comments

* change to enum class type for read_preference.h and scan_method.h
* change the way enum class objects are read
* add static cast to enum types so SetSelection function can work with it
* refactor - removed unnecessary comments
* refactor - changes code doc in connection_string_parser.h

* [AD-521] implement tests for JNI wrapper code

* test for TestDocumentDbConnectionGetSshTunnelPortSshTunnelNotActive is not yet active, need to be enabled when we can get external SSH tunnel working.
* bug fix: re-implemented DocumentDbConnectionGetSshLocalPort and DocumentDbConnectionIsSshTunnelActive.
connection.Get()->GetRef() is passed as first parameter because jobject is required for CallIntMethod and CallBooleanMethod.
* better JNI wrapper code is needed in the future so warnings/errors pop up when we pass jobject instead of jclass to the methods.

* [AD-521] refactor - remove comments and commented out code

* [AD-589] implement JNI method call for GetDatabaseMetadata

* define the method constant for DocumentDbConnection.getDatabaseMetadata()
* create JNI wrapper function for DocumentDbConnection.getMetaData

* [AD-589] implement unit test for DocumentDbConnection.getMetaData

* [AD-521] add calls to AutoCloseConnection in unit tests

* pass & errInfo instead of * errInfo in DocumentDbConnectionGetSshLocalPort and DocumentDbConnectionIsSshTunnelActive.

* [AD-521] remove unnecessary comment

* [AD-589] fix merge issues

* I missed this part of code when I was resolving the merge conflicts. Now they are corrected

* [AD-589] update getMetaData JNI wrapper code to pass &errInfo

* implement unit test for getMetaData

* [AD-589] implement JNI wrapper for DocumentDbDatabaseSchemaMetadataGetSchemaName

* implement Java class for
* define constant for DocumentDbDatabaseSchemaMetadataGetSchemaName
*  add empty test function for TestDocumentDbDatabaseSchemaMetadataGetSchemaName

* [AD-589] implement unit test for DbDatabaseSchemaMetadataGetSchemaName

* [AD-521] refactor - change case of ssh to SSH for consistency

* [AD-589] address code review comments

* rename DocumentDbConnectionGetMetaData to DocumentDbConnectionGetDatabaseMetaData

* [AD-589] change case from MetaData to Metadata to match Java method name

* [AD-589] refactor: change from metaData to metadata

changes occurred in:
* DocumentDbConnectionGetDatabaseMetadata
* DocumentDbDatabaseSchemaMetadataGetSchemaName
* TestDocumentDbConnectionGetDatabaseMetadata
* TestDocumentDbDatabaseSchemaMetadataGetSchemaName

* Birschick bq/sync up (#21)

* Updating JDBC version (#72)

* [AD-370] upload odbc driver build on push to develop (#71)

* [AD-730] upload odbc driver build at push to develop

* [AD-730] update github actions to upload with v3

* [AD-730] Test artifact upload action

* temporarily comment out if statement guard to test upload-artifact github action

* [AD-730] upload performance test executable

* [AD-730] update readme

* [AD-730] upload Release folder as artifact

* our odbc needs more than just the ignite.odbc.dll to run properly

* [AD-730] update to upload artifacts for release build

* previously, I uploaded the Debug builds, but the Release build is the one that requires less dependencies.

* [AD-730] add back if statment

* add the if statement back in win-build.yml to ensure that the odbc driver performance artifact is only published when pushed to develop

* [AD-730] fix typo of performance test plan

Co-authored-by: affonsoBQ <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>

* [AD-735] large dataset crash issue (#23)

* first test

* fix performance test crash

* fix performance test crash

* fix whitespace issue

* rework based on comments

Co-authored-by: Andie Montoya <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: affonsoBQ <[email protected]>
Co-authored-by: RoyZhang2022 <[email protected]>

* [AD-649] Add missing documentation (#73)

* Initial user/developer documentation
Co-authored-by: andiem-bq <[email protected]>
Co-authored-by: Bruce Irschick <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>

Co-authored-by: affonsoBQ <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: Andie Montoya <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: RoyZhang2022 <[email protected]>
* SQLPrimaryKey using JNI

* odbc test failure fix

* add tests

* fix test failure

* using boost::optional<std::string> to replace std::string

* disable cppcheck

* test refine

* fix linux build failure

* rework based on comments

* fix a typo
…a params to JDBC (#27)

### Summary

<!--- General summary / title -->
make changes so getColumns/getTables tests pass nullptr to JDBC

### Description

<!--- Details of what you changed -->
Make getColumns pass nullptr to JDBC when ODBC receives nullptr as parameter.
### Related Issue

<!--- Link to issue where this is tracked -->
https://bitquill.atlassian.net/browse/AD-751


* [AD-751] adapt getColumns to pass nullptr to jni

* [AD-550] fix meta_queries_test to properly pass null ptr instead of empty strings

* NULL and empty strings have different meanings in SQLColumns ODBC implementation.
Passing catalog as null means disregard the catalog parameter, where as empty string would mean finding data without a catalog.
Passing schema as null means disregard the catalog parameter, where as empty string would mean finding data without a schema.
  [Reference](https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolumns-function?view=sql-server-ver15)

* [AD-751] move `const` out of `boost::optional< const std::string >`

* reason: `const boost::optional< std::string >` works better than `boost::optional< const std::string >`.

* [AD-751] add SQLColumns meta queries tests

* add test that passes non-existent catalog along with correct tables / columns. The ResultSet should still be empty.
* added test that passes empty string as catalog. The result should be the same as when catalog is passed as null.

* [AD-751] temporarily disable cppcheck in Windows Workflow

* [AD-751] adapt getTables to pass nullptr to jni when NULL is received

* added extra test case for TestGetDataWithTablesReturnsNone ( test that no result is returned with empty string schema)
* add function SqlStringToOptString
* refactors
* code documentation changes
* some tests would fail without changes in AD-751 PR

* [AD-751] add test case for TestGetDataWithColumnsReturnsNone

* tests passing empty string schemaName to SQLColumns returns no data
* this test would fail without the new JDBC changes

* [AD-751] replace NULL with nullptr in tests

* and some comment refactoring

* [AD-751] resolve code review comments

* remove unneeded variable typesArr

* [AD-751] resolve code review comments

* remove SqlStringToConstOptString function
* remove const keyword for optional strings in column_metadata_query.h because they are not needed

* [AD-751] update documentation

* [AD-751] fix build issue

* remove references of removed function `SqlStringToConstOptString`

* Updating JDBC version

* [AD-751] update tests

* update tests according to JDBC changes. In  SQLTables and SQLColumns, empty string parameters for table or column are not allowed, so replacing them with "%" or actual table / column names instead.

* [AD-751] make windows github workflow download JDBC 1.2.4

Co-authored-by: affonsov <[email protected]>
@github-actions
Copy link

MacOS Big Sur 11 Build Unit Test Results

    1 files  ±0    1 suites  ±0   20s ⏱️ +7s
170 tests ±0  76 ✔️ ±0  94 💤 ±0  0 ±0 
  76 runs  ±0  -18 ✔️ ±0  94 💤 ±0  0 ±0 

Results for commit 155d863. ± Comparison against base commit e391f42.

@github-actions
Copy link

Windows 2022 (x64) Build Unit Test Results

    1 files  ±0    1 suites  ±0   27s ⏱️ -2s
170 tests ±0  76 ✔️ ±0  94 💤 ±0  0 ±0 
  76 runs  ±0  -18 ✔️ ±0  94 💤 ±0  0 ±0 

Results for commit 155d863. ± Comparison against base commit e391f42.

@github-actions
Copy link

Ubuntu 20.04 Build Unit Test Results

    1 files  ±0    1 suites  ±0   6s ⏱️ +2s
170 tests ±0  72 ✔️ ±0  98 💤 ±0  0 ±0 
  72 runs  ±0  68 ✔️ ±0    4 💤 ±0  0 ±0 

Results for commit 155d863. ± Comparison against base commit e391f42.

@github-actions
Copy link

Windows 2022 (x32) Build Unit Test Results

    1 files  ±0    1 suites  ±0   22s ⏱️ -6s
170 tests ±0  76 ✔️ ±0  94 💤 ±0  0 ±0 
  76 runs  ±0  -18 ✔️ ±0  94 💤 ±0  0 ±0 

Results for commit 155d863. ± Comparison against base commit e391f42.

Copy link
Contributor

@alinaliBQ alinaliBQ left a comment

Choose a reason for hiding this comment

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

This PR is the same as the PR in the ODBC mirror repo

@alinaliBQ alinaliBQ merged commit d2eb15e into develop May 30, 2022
@affonsov affonsov deleted the alinaliBQ/AD-751/null-checks-for-funcs branch May 31, 2022 16:15
affonsov pushed a commit that referenced this pull request Nov 16, 2022
Rename files to remove ts_ and es_prefixes.
affonsov added a commit that referenced this pull request Nov 16, 2022
…a params to JDBC (#77)

* [AD-751] make getColumns/getTables pass nullptr for catalog and schema params to JDBC (#77)

### Summary

<!--- General summary / title -->
make changes so getColumns/getTables tests pass nullptr to JDBC

### Description

<!--- Details of what you changed -->
Make getColumns pass nullptr to JDBC when ODBC receives nullptr as parameter.
### Related Issue

<!--- Link to issue where this is tracked -->
https://bitquill.atlassian.net/browse/AD-751


* [AD-751] adapt getColumns to pass nullptr to jni

* [AD-550] fix meta_queries_test to properly pass null ptr instead of empty strings

* NULL and empty strings have different meanings in SQLColumns ODBC implementation.
Passing catalog as null means disregard the catalog parameter, where as empty string would mean finding data without a catalog.
Passing schema as null means disregard the catalog parameter, where as empty string would mean finding data without a schema.
  [Reference](https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolumns-function?view=sql-server-ver15)

* [AD-751] move `const` out of `boost::optional< const std::string >`

* reason: `const boost::optional< std::string >` works better than `boost::optional< const std::string >`.

* [AD-751] add SQLColumns meta queries tests

* add test that passes non-existent catalog along with correct tables / columns. The ResultSet should still be empty.
* added test that passes empty string as catalog. The result should be the same as when catalog is passed as null.

* [AD-751] temporarily disable cppcheck in Windows Workflow

* [AD-751] adapt getTables to pass nullptr to jni when NULL is received

* added extra test case for TestGetDataWithTablesReturnsNone ( test that no result is returned with empty string schema)
* add function SqlStringToOptString
* refactors
* code documentation changes
* some tests would fail without changes in AD-751 PR

* [AD-751] add test case for TestGetDataWithColumnsReturnsNone

* tests passing empty string schemaName to SQLColumns returns no data
* this test would fail without the new JDBC changes

* [AD-751] replace NULL with nullptr in tests

* and some comment refactoring

* [AD-751] resolve code review comments

* remove unneeded variable typesArr

* [AD-751] resolve code review comments

* remove SqlStringToConstOptString function
* remove const keyword for optional strings in column_metadata_query.h because they are not needed

* [AD-751] update documentation

* [AD-751] fix build issue

* remove references of removed function `SqlStringToConstOptString`

* Updating JDBC version

* [AD-751] update tests

* update tests according to JDBC changes. In  SQLTables and SQLColumns, empty string parameters for table or column are not allowed, so replacing them with "%" or actual table / column names instead.

* [AD-751] make windows github workflow download JDBC 1.2.4

Co-authored-by: affonsov <[email protected]>
affonsov pushed a commit that referenced this pull request Nov 17, 2022
Rename files to remove ts_ and es_prefixes.
affonsov added a commit that referenced this pull request Nov 17, 2022
…a params to JDBC (#77)

* [AD-751] make getColumns/getTables pass nullptr for catalog and schema params to JDBC (#77)

### Summary

<!--- General summary / title -->
make changes so getColumns/getTables tests pass nullptr to JDBC

### Description

<!--- Details of what you changed -->
Make getColumns pass nullptr to JDBC when ODBC receives nullptr as parameter.
### Related Issue

<!--- Link to issue where this is tracked -->
https://bitquill.atlassian.net/browse/AD-751


* [AD-751] adapt getColumns to pass nullptr to jni

* [AD-550] fix meta_queries_test to properly pass null ptr instead of empty strings

* NULL and empty strings have different meanings in SQLColumns ODBC implementation.
Passing catalog as null means disregard the catalog parameter, where as empty string would mean finding data without a catalog.
Passing schema as null means disregard the catalog parameter, where as empty string would mean finding data without a schema.
  [Reference](https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolumns-function?view=sql-server-ver15)

* [AD-751] move `const` out of `boost::optional< const std::string >`

* reason: `const boost::optional< std::string >` works better than `boost::optional< const std::string >`.

* [AD-751] add SQLColumns meta queries tests

* add test that passes non-existent catalog along with correct tables / columns. The ResultSet should still be empty.
* added test that passes empty string as catalog. The result should be the same as when catalog is passed as null.

* [AD-751] temporarily disable cppcheck in Windows Workflow

* [AD-751] adapt getTables to pass nullptr to jni when NULL is received

* added extra test case for TestGetDataWithTablesReturnsNone ( test that no result is returned with empty string schema)
* add function SqlStringToOptString
* refactors
* code documentation changes
* some tests would fail without changes in AD-751 PR

* [AD-751] add test case for TestGetDataWithColumnsReturnsNone

* tests passing empty string schemaName to SQLColumns returns no data
* this test would fail without the new JDBC changes

* [AD-751] replace NULL with nullptr in tests

* and some comment refactoring

* [AD-751] resolve code review comments

* remove unneeded variable typesArr

* [AD-751] resolve code review comments

* remove SqlStringToConstOptString function
* remove const keyword for optional strings in column_metadata_query.h because they are not needed

* [AD-751] update documentation

* [AD-751] fix build issue

* remove references of removed function `SqlStringToConstOptString`

* Updating JDBC version

* [AD-751] update tests

* update tests according to JDBC changes. In  SQLTables and SQLColumns, empty string parameters for table or column are not allowed, so replacing them with "%" or actual table / column names instead.

* [AD-751] make windows github workflow download JDBC 1.2.4

Co-authored-by: affonsov <[email protected]>
alexey-temnikov pushed a commit that referenced this pull request Jan 14, 2023
Rename files to remove ts_ and es_prefixes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants