{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/msphpsql/pulls/comments/241820782","pull_request_review_id":185195461,"id":241820782,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTgyMDc4Mg==","diff_hunk":"@@ -0,0 +1,81 @@\n+--TEST--\r\n+GitHub issue 900 - output parameter displays data from memory when not finalized\r\n+--DESCRIPTION--\r\n+This test verifies that when there is an active resultset and output parameter not finalized, it should not show any data from client memory. This test does not work with AlwaysEncrypted because\r\n+the output param is not assigned in the stored procedure.\r\n+--ENV--\r\n+PHPT_EXEC=true\r\n+--SKIPIF--\r\n+<?php require('skipif_versions_old.inc'); ?>\r\n+--FILE--\r\n+<?php\r\n+require_once('MsCommon.inc');\r\n+\r\n+$size = 30;\r\n+\r\n+function getOutputParam($conn, $storedProcName, $inout, $isVarchar, $isMax)\r\n+{\r\n+    global $size;\r\n+    \r\n+    $output = null;\r\n+    $dir = ($inout)? SQLSRV_PARAM_INOUT : SQLSRV_PARAM_OUT;\r\n+    $dataType = ($isVarchar)? \"SQLSRV_SQLTYPE_VARCHAR\" : \"SQLSRV_SQLTYPE_NVARCHAR\";\r\n+    $sqlType = ($isMax)? call_user_func($dataType, 'max') : call_user_func($dataType, $size);\r\n+\r\n+    $stmt = sqlsrv_prepare($conn, \"$storedProcName @OUTPUT = ?\", array(array(&$output, $dir, null, $sqlType)));\r\n+    if (!$stmt) {\r\n+        fatalError(\"getOutputParam: failed when preparing to call $storedProcName\");\r\n+    }\r\n+    if (!sqlsrv_execute($stmt)) {\r\n+        fatalError(\"getOutputParam: failed to execute procedure $storedProcName\");\r\n+    }\r\n+\r\n+    // The output param should be doubled in size for wide characters;\r\n+    // for max fields it should be the maximum anticipated size 8000.\r\n+    // However, it should not contain any data so after trimming it\r\n+    // should be merely an empty string\r\n+    $len = strlen($output);\r\n+    $expectedLen = ($isMax)? 8000 :  ($size * 2);\r","path":"test/functional/sqlsrv/sqlsrv_900_output_param_memory_data.phpt","position":38,"original_position":38,"commit_id":"3ed709e9ba7968dae3a6762fa9657bfca81c0c36","original_commit_id":"3ed709e9ba7968dae3a6762fa9657bfca81c0c36","user":{"login":"yitam","id":21340756,"node_id":"MDQ6VXNlcjIxMzQwNzU2","avatar_url":"https://avatars1.githubusercontent.com/u/21340756?v=4","gravatar_id":"","url":"https://api.github.com/users/yitam","html_url":"https://github.com/yitam","followers_url":"https://api.github.com/users/yitam/followers","following_url":"https://api.github.com/users/yitam/following{/other_user}","gists_url":"https://api.github.com/users/yitam/gists{/gist_id}","starred_url":"https://api.github.com/users/yitam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yitam/subscriptions","organizations_url":"https://api.github.com/users/yitam/orgs","repos_url":"https://api.github.com/users/yitam/repos","events_url":"https://api.github.com/users/yitam/events{/privacy}","received_events_url":"https://api.github.com/users/yitam/received_events","type":"User","site_admin":false},"body":"good point! I should redesign the sqlsrv test to fix the size like the pdo test","created_at":"2018-12-14T16:53:27Z","updated_at":"2018-12-14T16:53:27Z","html_url":"https://github.com/Microsoft/msphpsql/pull/907#discussion_r241820782","pull_request_url":"https://api.github.com/repos/Microsoft/msphpsql/pulls/907","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/msphpsql/pulls/comments/241820782"},"html":{"href":"https://github.com/Microsoft/msphpsql/pull/907#discussion_r241820782"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/msphpsql/pulls/907"}},"in_reply_to_id":241616075},"pull_request":{"url":"https://api.github.com/repos/Microsoft/msphpsql/pulls/907","id":237809456,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3ODA5NDU2","html_url":"https://github.com/Microsoft/msphpsql/pull/907","diff_url":"https://github.com/Microsoft/msphpsql/pull/907.diff","patch_url":"https://github.com/Microsoft/msphpsql/pull/907.patch","issue_url":"https://api.github.com/repos/Microsoft/msphpsql/issues/907","number":907,"state":"open","locked":false,"title":"Initialize output param buffer when allocating extra space","user":{"login":"yitam","id":21340756,"node_id":"MDQ6VXNlcjIxMzQwNzU2","avatar_url":"https://avatars1.githubusercontent.com/u/21340756?v=4","gravatar_id":"","url":"https://api.github.com/users/yitam","html_url":"https://github.com/yitam","followers_url":"https://api.github.com/users/yitam/followers","following_url":"https://api.github.com/users/yitam/following{/other_user}","gists_url":"https://api.github.com/users/yitam/gists{/gist_id}","starred_url":"https://api.github.com/users/yitam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yitam/subscriptions","organizations_url":"https://api.github.com/users/yitam/orgs","repos_url":"https://api.github.com/users/yitam/repos","events_url":"https://api.github.com/users/yitam/events{/privacy}","received_events_url":"https://api.github.com/users/yitam/received_events","type":"User","site_admin":false},"body":"See related issue #900 ","created_at":"2018-12-11T20:01:36Z","updated_at":"2018-12-14T16:53:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"838854d3320aa5d04935fbce84675ab22a35d62b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/msphpsql/pulls/907/commits","review_comments_url":"https://api.github.com/repos/Microsoft/msphpsql/pulls/907/comments","review_comment_url":"https://api.github.com/repos/Microsoft/msphpsql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/msphpsql/issues/907/comments","statuses_url":"https://api.github.com/repos/Microsoft/msphpsql/statuses/3ed709e9ba7968dae3a6762fa9657bfca81c0c36","head":{"label":"yitam:issue900","ref":"issue900","sha":"3ed709e9ba7968dae3a6762fa9657bfca81c0c36","user":{"login":"yitam","id":21340756,"node_id":"MDQ6VXNlcjIxMzQwNzU2","avatar_url":"https://avatars1.githubusercontent.com/u/21340756?v=4","gravatar_id":"","url":"https://api.github.com/users/yitam","html_url":"https://github.com/yitam","followers_url":"https://api.github.com/users/yitam/followers","following_url":"https://api.github.com/users/yitam/following{/other_user}","gists_url":"https://api.github.com/users/yitam/gists{/gist_id}","starred_url":"https://api.github.com/users/yitam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yitam/subscriptions","organizations_url":"https://api.github.com/users/yitam/orgs","repos_url":"https://api.github.com/users/yitam/repos","events_url":"https://api.github.com/users/yitam/events{/privacy}","received_events_url":"https://api.github.com/users/yitam/received_events","type":"User","site_admin":false},"repo":{"id":75887875,"node_id":"MDEwOlJlcG9zaXRvcnk3NTg4Nzg3NQ==","name":"msphpsql","full_name":"yitam/msphpsql","private":false,"owner":{"login":"yitam","id":21340756,"node_id":"MDQ6VXNlcjIxMzQwNzU2","avatar_url":"https://avatars1.githubusercontent.com/u/21340756?v=4","gravatar_id":"","url":"https://api.github.com/users/yitam","html_url":"https://github.com/yitam","followers_url":"https://api.github.com/users/yitam/followers","following_url":"https://api.github.com/users/yitam/following{/other_user}","gists_url":"https://api.github.com/users/yitam/gists{/gist_id}","starred_url":"https://api.github.com/users/yitam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yitam/subscriptions","organizations_url":"https://api.github.com/users/yitam/orgs","repos_url":"https://api.github.com/users/yitam/repos","events_url":"https://api.github.com/users/yitam/events{/privacy}","received_events_url":"https://api.github.com/users/yitam/received_events","type":"User","site_admin":false},"html_url":"https://github.com/yitam/msphpsql","description":"Microsoft PHP drivers for SQL Server","fork":true,"url":"https://api.github.com/repos/yitam/msphpsql","forks_url":"https://api.github.com/repos/yitam/msphpsql/forks","keys_url":"https://api.github.com/repos/yitam/msphpsql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yitam/msphpsql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yitam/msphpsql/teams","hooks_url":"https://api.github.com/repos/yitam/msphpsql/hooks","issue_events_url":"https://api.github.com/repos/yitam/msphpsql/issues/events{/number}","events_url":"https://api.github.com/repos/yitam/msphpsql/events","assignees_url":"https://api.github.com/repos/yitam/msphpsql/assignees{/user}","branches_url":"https://api.github.com/repos/yitam/msphpsql/branches{/branch}","tags_url":"https://api.github.com/repos/yitam/msphpsql/tags","blobs_url":"https://api.github.com/repos/yitam/msphpsql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yitam/msphpsql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yitam/msphpsql/git/refs{/sha}","trees_url":"https://api.github.com/repos/yitam/msphpsql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yitam/msphpsql/statuses/{sha}","languages_url":"https://api.github.com/repos/yitam/msphpsql/languages","stargazers_url":"https://api.github.com/repos/yitam/msphpsql/stargazers","contributors_url":"https://api.github.com/repos/yitam/msphpsql/contributors","subscribers_url":"https://api.github.com/repos/yitam/msphpsql/subscribers","subscription_url":"https://api.github.com/repos/yitam/msphpsql/subscription","commits_url":"https://api.github.com/repos/yitam/msphpsql/commits{/sha}","git_commits_url":"https://api.github.com/repos/yitam/msphpsql/git/commits{/sha}","comments_url":"https://api.github.com/repos/yitam/msphpsql/comments{/number}","issue_comment_url":"https://api.github.com/repos/yitam/msphpsql/issues/comments{/number}","contents_url":"https://api.github.com/repos/yitam/msphpsql/contents/{+path}","compare_url":"https://api.github.com/repos/yitam/msphpsql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yitam/msphpsql/merges","archive_url":"https://api.github.com/repos/yitam/msphpsql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yitam/msphpsql/downloads","issues_url":"https://api.github.com/repos/yitam/msphpsql/issues{/number}","pulls_url":"https://api.github.com/repos/yitam/msphpsql/pulls{/number}","milestones_url":"https://api.github.com/repos/yitam/msphpsql/milestones{/number}","notifications_url":"https://api.github.com/repos/yitam/msphpsql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yitam/msphpsql/labels{/name}","releases_url":"https://api.github.com/repos/yitam/msphpsql/releases{/id}","deployments_url":"https://api.github.com/repos/yitam/msphpsql/deployments","created_at":"2016-12-08T00:35:07Z","updated_at":"2018-12-07T22:20:07Z","pushed_at":"2018-12-11T19:56:36Z","git_url":"git://github.com/yitam/msphpsql.git","ssh_url":"git@github.com:yitam/msphpsql.git","clone_url":"https://github.com/yitam/msphpsql.git","svn_url":"https://github.com/yitam/msphpsql","homepage":"","size":86843,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:dev","ref":"dev","sha":"e30ebfabe8ae99b39be4ddde32fc20f1cd112b05","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":19043988,"node_id":"MDEwOlJlcG9zaXRvcnkxOTA0Mzk4OA==","name":"msphpsql","full_name":"Microsoft/msphpsql","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/msphpsql","description":"Microsoft Drivers for PHP for SQL Server","fork":false,"url":"https://api.github.com/repos/Microsoft/msphpsql","forks_url":"https://api.github.com/repos/Microsoft/msphpsql/forks","keys_url":"https://api.github.com/repos/Microsoft/msphpsql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/msphpsql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/msphpsql/teams","hooks_url":"https://api.github.com/repos/Microsoft/msphpsql/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/msphpsql/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/msphpsql/events","assignees_url":"https://api.github.com/repos/Microsoft/msphpsql/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/msphpsql/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/msphpsql/tags","blobs_url":"https://api.github.com/repos/Microsoft/msphpsql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/msphpsql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/msphpsql/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/msphpsql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/msphpsql/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/msphpsql/languages","stargazers_url":"https://api.github.com/repos/Microsoft/msphpsql/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/msphpsql/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/msphpsql/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/msphpsql/subscription","commits_url":"https://api.github.com/repos/Microsoft/msphpsql/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/msphpsql/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/msphpsql/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/msphpsql/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/msphpsql/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/msphpsql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/msphpsql/merges","archive_url":"https://api.github.com/repos/Microsoft/msphpsql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/msphpsql/downloads","issues_url":"https://api.github.com/repos/Microsoft/msphpsql/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/msphpsql/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/msphpsql/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/msphpsql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/msphpsql/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/msphpsql/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/msphpsql/deployments","created_at":"2014-04-22T19:54:12Z","updated_at":"2018-12-12T03:11:41Z","pushed_at":"2018-12-11T20:01:37Z","git_url":"git://github.com/Microsoft/msphpsql.git","ssh_url":"git@github.com:Microsoft/msphpsql.git","clone_url":"https://github.com/Microsoft/msphpsql.git","svn_url":"https://github.com/Microsoft/msphpsql","homepage":"","size":87022,"stargazers_count":1056,"watchers_count":1056,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":220,"mirror_url":null,"archived":false,"open_issues_count":41,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":220,"open_issues":41,"watchers":1056,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/msphpsql/pulls/907"},"html":{"href":"https://github.com/Microsoft/msphpsql/pull/907"},"issue":{"href":"https://api.github.com/repos/Microsoft/msphpsql/issues/907"},"comments":{"href":"https://api.github.com/repos/Microsoft/msphpsql/issues/907/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/msphpsql/pulls/907/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/msphpsql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/msphpsql/pulls/907/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/msphpsql/statuses/3ed709e9ba7968dae3a6762fa9657bfca81c0c36"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"yitam"}}