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

Remove the limitation of getting binary as strings as INOUT param #759

Merged
merged 2 commits into from
May 1, 2018
Merged

Remove the limitation of getting binary as strings as INOUT param #759

merged 2 commits into from
May 1, 2018

Conversation

yitam
Copy link
Contributor

@yitam yitam commented Apr 25, 2018

This change is Reviewable

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 73.273% when pulling 3033a26 on yitam:vso2829 into 16e0b89 on Microsoft:dev.

@codecov-io
Copy link

Codecov Report

Merging #759 into dev will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #759      +/-   ##
==========================================
+ Coverage   78.85%   78.86%   +<.01%     
==========================================
  Files          25       25              
  Lines        7157     7160       +3     
==========================================
+ Hits         5644     5647       +3     
  Misses       1513     1513
Impacted Files Coverage Δ
...php/x86/php-7.1.16-src/ext/pdo_sqlsrv/pdo_stmt.cpp 85.68% <0%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16e0b89...3033a26. Read the comment docs.

@@ -1180,9 +1180,10 @@ int pdo_sqlsrv_stmt_param_hook( _Inout_ pdo_stmt_t *stmt,
}
// if the parameter is output or input/output, translate the type between the PDO::PARAM_* constant
// and the SQLSRV_PHPTYPE_* constant
int pdo_type = param->param_type;
// vso 2829: derive the pdo_type for input/output parameter as well
int pdo_type = (direction == SQL_PARAM_OUTPUT) ? param->param_type : param->param_type & ~PDO_PARAM_INPUT_OUTPUT;
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the syntax & ~ do here?

Copy link
Contributor Author

@yitam yitam May 1, 2018

Choose a reason for hiding this comment

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

It's deriving the pdo param type (see original line 1185) using bitwise operators because for inout params the param type is "bitwise ORed". For example, PDO::PARAM_STR | PDO::PARAM_INPUT_OUTPUT

@yitam yitam merged commit 440636a into microsoft:dev May 1, 2018
@yitam yitam deleted the vso2829 branch May 1, 2018 18:00
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