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

Use descriptors for column binding information #302

Merged
merged 17 commits into from
Jul 9, 2020

Conversation

traceon
Copy link
Collaborator

@traceon traceon commented Jun 21, 2020

Use descriptors for column binding information.
Fix column-wise vs row-wise binding for parameters and implement it for columns.
Implement array bindings for columns.

Closes #235
Closes #296
Doc modification reflects findings in #293
Doc modification reflects versioning issues mentioned in #289
Should help with #299
Should help with #295

Fix/rework column vs row based binding of parameters
Implement column vs row based binding of columns
Handle SQL_DESC_ARRAY_SIZE properly
Fix record count management when it comes to unbind parameters or columns
Other small fixes/clarifications
Add binding offset testing
Reduce cases
* master:
  Rollback to Nullable(Nothing) for unbound params
  Actualize the comment
  Update test/deploy_and_run_clickhouse_macos.sh
  Fix Null parameter format
  Switch to ClickHouse version 20.3 as a baseline
  Fixing Decimal tests and removing them as known fails.
  Fixes to match known fails.
  Fixing issue with description formatting.
  First changes to support TestFlows 1.6
@traceon traceon requested a review from Enmk June 24, 2020 15:09
@traceon traceon marked this pull request as ready for review June 24, 2020 15:09
@traceon traceon closed this Jun 24, 2020
@traceon traceon reopened this Jun 24, 2020
@traceon traceon closed this Jun 25, 2020
@traceon traceon reopened this Jun 25, 2020
Copy link
Collaborator

@Enmk Enmk left a comment

Choose a reason for hiding this comment

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

Looks Ok, however, some comments are missing here and there, please fix it at it would be Ok to merge.

SQLBindCol(
hstmt,
1,
getCTypeFor<std::decay_t<decltype(col1[0])>>(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks somewhat error prone here, why not just getCTypeFor(col1[0]) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The current getCTypeFor definition will cause the code to fail at compilation, so it is safe. Ugly here, but safe everywhere.

driver/test/column_bindings_it.cpp Show resolved Hide resolved
driver/test/column_bindings_it.cpp Show resolved Hide resolved
@@ -1813,6 +1813,9 @@ namespace value_manip {
template <typename SourceType>
struct from_value {
static inline SQLRETURN convert(const SourceType & src, BindingInfo & dest) {
if (dest.indicator && dest.indicator != dest.value_size)
*dest.indicator = 0; // Value is not null here...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not quite sure what indicator means here, could you please add some comments to BindingInfo? Please also specify what does it mean when indicator value is 0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Modified the comments.

driver/test/column_bindings_it.cpp Outdated Show resolved Hide resolved
Reduce row set sizes to reduce test running time
Copy link
Collaborator

@Enmk Enmk left a comment

Choose a reason for hiding this comment

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

Ok

@traceon traceon closed this Jul 9, 2020
@traceon traceon reopened this Jul 9, 2020
@traceon traceon closed this Jul 9, 2020
@traceon traceon reopened this Jul 9, 2020
@traceon traceon merged commit fbec658 into ClickHouse:master Jul 9, 2020
@traceon traceon deleted the bind-using-descriptors branch July 9, 2020 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants