{"action":"created","issue":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4341","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4341/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4341/comments","events_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4341/events","html_url":"https://github.com/jOOQ/jOOQ/issues/4341","id":83550131,"number":4341,"title":"No Results are fetched from SQL Server procedures that contain update counts","user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20DB:%20SQL%20Server","name":"C: DB: SQL Server","color":"0000aa"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20Functionality","name":"C: Functionality","color":"0000aa"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/P:%20High","name":"P: High","color":"ff6666"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/R:%20Fixed","name":"R: Fixed","color":"55ff55"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/T:%20Defect","name":"T: Defect","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/111","html_url":"https://github.com/jOOQ/jOOQ/milestones/Version%203.7.0","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/111/labels","id":900413,"number":111,"title":"Version 3.7.0","description":"","creator":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"open_issues":280,"closed_issues":75,"state":"open","created_at":"2014-12-11T12:56:14Z","updated_at":"2015-06-01T15:22:54Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-06-01T15:06:49Z","updated_at":"2015-06-01T15:30:19Z","closed_at":"2015-06-01T15:22:54Z","body":"The following procedure produces both update counts and result sets:\r\n\r\n```sql\r\nCREATE PROCEDURE p_results_and_row_counts(\r\n  @p_result_sets INT\r\n)\r\nAS\r\nBEGIN\r\n  CREATE TABLE #t (v INT);\r\n  \r\n  IF @p_result_sets = 1 BEGIN\r\n    SELECT 1 a;\r\n    \r\n    INSERT INTO #t VALUES (1);  \r\n  END\r\n  ELSE IF @p_result_sets = 2 BEGIN\r\n    SELECT 1 a;\r\n    SELECT 1 b UNION SELECT 2 b;\r\n    \r\n    INSERT INTO #t VALUES (1), (2);  \r\n  END\r\n  ELSE IF @p_result_sets = 3 BEGIN\r\n    SELECT 1 a;\r\n    SELECT 1 b UNION SELECT 2 b;\r\n    SELECT 1 c UNION SELECT 2 c UNION SELECT 3 c;\r\n    \r\n    INSERT INTO #t VALUES (1), (2), (3);  \r\n  END;\r\nEND;\r\n```\r\n\r\nUnfortunately, jOOQ doesn't correctly deserialise these `ResultSets` in the presence of update counts, and thus doesn't return any results at all when calling the above, e.g. via\r\n\r\n```java\r\n\r\nPResultsAndRowCounts r4 = new PResultsAndRowCounts();\r\nr4.setPResultSets(3);\r\nr4.execute(create().configuration());\r\nassertEquals(3, r4.getResults().size());\r\nassertEquals(asList(1), r4.getResults().get(0).getValues(0, int.class));\r\nassertEquals(asList(1, 2), r4.getResults().get(1).getValues(0, int.class));\r\nassertEquals(asList(1, 2, 3), r4.getResults().get(2).getValues(0, int.class));\r\n```"},"comment":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/comments/107584986","html_url":"https://github.com/jOOQ/jOOQ/issues/4341#issuecomment-107584986","issue_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4341","id":107584986,"user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T15:30:19Z","updated_at":"2015-06-01T15:30:19Z","body":"This is due to an incorrect / incomplete implementation of #3681"}}