{"action":"created","comment":{"url":"https://api.github.com/repos/groupon/tdsql/pulls/comments/146583374","pull_request_review_id":71545477,"id":146583374,"diff_hunk":"@@ -389,11 +389,23 @@ my $db = TDSQL->new($HOSTNAME, $USERNAME, $PASSWORD);\n    $db->output($OUTPUT) if has_value($OUTPUT);\n    $db->format($FORMAT) if has_value($FORMAT);\n if($SQL) {\n-    eval { $db->run_query($SQL, @ARGS) };\n-    if(my $errstr = $@) {\n-        $db->finish;\n-        chomp $errstr;\n-        die \"$ME: $errstr\\n\";\n+    my $counter = 1 ;\n+    my @sql_statements = split(/;/,$SQL);\n+    foreach my $statement(@sql_statements) {\n+      $statement =~ s/^\\s*//g;\n+      $statement =~ s/\\s*$//g;","path":"bin/tdsql","position":13,"original_position":13,"commit_id":"5edcebbfcf302ed8e2628429545c6cbbfacc668c","original_commit_id":"5edcebbfcf302ed8e2628429545c6cbbfacc668c","user":{"login":"dbushong","id":97162,"avatar_url":"https://avatars1.githubusercontent.com/u/97162?v=4","gravatar_id":"","url":"https://api.github.com/users/dbushong","html_url":"https://github.com/dbushong","followers_url":"https://api.github.com/users/dbushong/followers","following_url":"https://api.github.com/users/dbushong/following{/other_user}","gists_url":"https://api.github.com/users/dbushong/gists{/gist_id}","starred_url":"https://api.github.com/users/dbushong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbushong/subscriptions","organizations_url":"https://api.github.com/users/dbushong/orgs","repos_url":"https://api.github.com/users/dbushong/repos","events_url":"https://api.github.com/users/dbushong/events{/privacy}","received_events_url":"https://api.github.com/users/dbushong/received_events","type":"User","site_admin":false},"body":"simpler:\r\n```perl\r\nmy @sql_statements = split(/\\s*;\\s*/, $SQL);\r\nfor my $statement (@sql_statements) {\r\n```","created_at":"2017-10-24T14:42:37Z","updated_at":"2017-10-24T14:44:18Z","html_url":"https://github.com/groupon/tdsql/pull/19#discussion_r146583374","pull_request_url":"https://api.github.com/repos/groupon/tdsql/pulls/19","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/groupon/tdsql/pulls/comments/146583374"},"html":{"href":"https://github.com/groupon/tdsql/pull/19#discussion_r146583374"},"pull_request":{"href":"https://api.github.com/repos/groupon/tdsql/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/groupon/tdsql/pulls/19","id":148291848,"html_url":"https://github.com/groupon/tdsql/pull/19","diff_url":"https://github.com/groupon/tdsql/pull/19.diff","patch_url":"https://github.com/groupon/tdsql/pull/19.patch","issue_url":"https://api.github.com/repos/groupon/tdsql/issues/19","number":19,"state":"open","locked":false,"title":"Support multi-command sql statements","user":{"login":"mckennagene","id":32983356,"avatar_url":"https://avatars2.githubusercontent.com/u/32983356?v=4","gravatar_id":"","url":"https://api.github.com/users/mckennagene","html_url":"https://github.com/mckennagene","followers_url":"https://api.github.com/users/mckennagene/followers","following_url":"https://api.github.com/users/mckennagene/following{/other_user}","gists_url":"https://api.github.com/users/mckennagene/gists{/gist_id}","starred_url":"https://api.github.com/users/mckennagene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mckennagene/subscriptions","organizations_url":"https://api.github.com/users/mckennagene/orgs","repos_url":"https://api.github.com/users/mckennagene/repos","events_url":"https://api.github.com/users/mckennagene/events{/privacy}","received_events_url":"https://api.github.com/users/mckennagene/received_events","type":"User","site_admin":false},"body":"split the input sql statement on \";\" and execute each statement in order.","created_at":"2017-10-24T03:54:36Z","updated_at":"2017-10-24T14:44:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c097ebd12e6929f88c19155fe7cb74f80aea3baf","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/groupon/tdsql/pulls/19/commits","review_comments_url":"https://api.github.com/repos/groupon/tdsql/pulls/19/comments","review_comment_url":"https://api.github.com/repos/groupon/tdsql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/groupon/tdsql/issues/19/comments","statuses_url":"https://api.github.com/repos/groupon/tdsql/statuses/5edcebbfcf302ed8e2628429545c6cbbfacc668c","head":{"label":"mckennagene:patch-1","ref":"patch-1","sha":"5edcebbfcf302ed8e2628429545c6cbbfacc668c","user":{"login":"mckennagene","id":32983356,"avatar_url":"https://avatars2.githubusercontent.com/u/32983356?v=4","gravatar_id":"","url":"https://api.github.com/users/mckennagene","html_url":"https://github.com/mckennagene","followers_url":"https://api.github.com/users/mckennagene/followers","following_url":"https://api.github.com/users/mckennagene/following{/other_user}","gists_url":"https://api.github.com/users/mckennagene/gists{/gist_id}","starred_url":"https://api.github.com/users/mckennagene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mckennagene/subscriptions","organizations_url":"https://api.github.com/users/mckennagene/orgs","repos_url":"https://api.github.com/users/mckennagene/repos","events_url":"https://api.github.com/users/mckennagene/events{/privacy}","received_events_url":"https://api.github.com/users/mckennagene/received_events","type":"User","site_admin":false},"repo":{"id":108073818,"name":"tdsql","full_name":"mckennagene/tdsql","owner":{"login":"mckennagene","id":32983356,"avatar_url":"https://avatars2.githubusercontent.com/u/32983356?v=4","gravatar_id":"","url":"https://api.github.com/users/mckennagene","html_url":"https://github.com/mckennagene","followers_url":"https://api.github.com/users/mckennagene/followers","following_url":"https://api.github.com/users/mckennagene/following{/other_user}","gists_url":"https://api.github.com/users/mckennagene/gists{/gist_id}","starred_url":"https://api.github.com/users/mckennagene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mckennagene/subscriptions","organizations_url":"https://api.github.com/users/mckennagene/orgs","repos_url":"https://api.github.com/users/mckennagene/repos","events_url":"https://api.github.com/users/mckennagene/events{/privacy}","received_events_url":"https://api.github.com/users/mckennagene/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mckennagene/tdsql","description":"Run SQL queries against a Teradata data warehouse server","fork":true,"url":"https://api.github.com/repos/mckennagene/tdsql","forks_url":"https://api.github.com/repos/mckennagene/tdsql/forks","keys_url":"https://api.github.com/repos/mckennagene/tdsql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mckennagene/tdsql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mckennagene/tdsql/teams","hooks_url":"https://api.github.com/repos/mckennagene/tdsql/hooks","issue_events_url":"https://api.github.com/repos/mckennagene/tdsql/issues/events{/number}","events_url":"https://api.github.com/repos/mckennagene/tdsql/events","assignees_url":"https://api.github.com/repos/mckennagene/tdsql/assignees{/user}","branches_url":"https://api.github.com/repos/mckennagene/tdsql/branches{/branch}","tags_url":"https://api.github.com/repos/mckennagene/tdsql/tags","blobs_url":"https://api.github.com/repos/mckennagene/tdsql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mckennagene/tdsql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mckennagene/tdsql/git/refs{/sha}","trees_url":"https://api.github.com/repos/mckennagene/tdsql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mckennagene/tdsql/statuses/{sha}","languages_url":"https://api.github.com/repos/mckennagene/tdsql/languages","stargazers_url":"https://api.github.com/repos/mckennagene/tdsql/stargazers","contributors_url":"https://api.github.com/repos/mckennagene/tdsql/contributors","subscribers_url":"https://api.github.com/repos/mckennagene/tdsql/subscribers","subscription_url":"https://api.github.com/repos/mckennagene/tdsql/subscription","commits_url":"https://api.github.com/repos/mckennagene/tdsql/commits{/sha}","git_commits_url":"https://api.github.com/repos/mckennagene/tdsql/git/commits{/sha}","comments_url":"https://api.github.com/repos/mckennagene/tdsql/comments{/number}","issue_comment_url":"https://api.github.com/repos/mckennagene/tdsql/issues/comments{/number}","contents_url":"https://api.github.com/repos/mckennagene/tdsql/contents/{+path}","compare_url":"https://api.github.com/repos/mckennagene/tdsql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mckennagene/tdsql/merges","archive_url":"https://api.github.com/repos/mckennagene/tdsql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mckennagene/tdsql/downloads","issues_url":"https://api.github.com/repos/mckennagene/tdsql/issues{/number}","pulls_url":"https://api.github.com/repos/mckennagene/tdsql/pulls{/number}","milestones_url":"https://api.github.com/repos/mckennagene/tdsql/milestones{/number}","notifications_url":"https://api.github.com/repos/mckennagene/tdsql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mckennagene/tdsql/labels{/name}","releases_url":"https://api.github.com/repos/mckennagene/tdsql/releases{/id}","deployments_url":"https://api.github.com/repos/mckennagene/tdsql/deployments","created_at":"2017-10-24T03:48:52Z","updated_at":"2017-10-24T03:48:54Z","pushed_at":"2017-10-24T03:53:58Z","git_url":"git://github.com/mckennagene/tdsql.git","ssh_url":"git@github.com:mckennagene/tdsql.git","clone_url":"https://github.com/mckennagene/tdsql.git","svn_url":"https://github.com/mckennagene/tdsql","homepage":null,"size":49,"stargazers_count":0,"watchers_count":0,"language":"Perl","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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"groupon:master","ref":"master","sha":"4624266cc7e6e110a264f415ed3bc98fc8e26f5e","user":{"login":"groupon","id":206233,"avatar_url":"https://avatars2.githubusercontent.com/u/206233?v=4","gravatar_id":"","url":"https://api.github.com/users/groupon","html_url":"https://github.com/groupon","followers_url":"https://api.github.com/users/groupon/followers","following_url":"https://api.github.com/users/groupon/following{/other_user}","gists_url":"https://api.github.com/users/groupon/gists{/gist_id}","starred_url":"https://api.github.com/users/groupon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupon/subscriptions","organizations_url":"https://api.github.com/users/groupon/orgs","repos_url":"https://api.github.com/users/groupon/repos","events_url":"https://api.github.com/users/groupon/events{/privacy}","received_events_url":"https://api.github.com/users/groupon/received_events","type":"Organization","site_admin":false},"repo":{"id":5269406,"name":"tdsql","full_name":"groupon/tdsql","owner":{"login":"groupon","id":206233,"avatar_url":"https://avatars2.githubusercontent.com/u/206233?v=4","gravatar_id":"","url":"https://api.github.com/users/groupon","html_url":"https://github.com/groupon","followers_url":"https://api.github.com/users/groupon/followers","following_url":"https://api.github.com/users/groupon/following{/other_user}","gists_url":"https://api.github.com/users/groupon/gists{/gist_id}","starred_url":"https://api.github.com/users/groupon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupon/subscriptions","organizations_url":"https://api.github.com/users/groupon/orgs","repos_url":"https://api.github.com/users/groupon/repos","events_url":"https://api.github.com/users/groupon/events{/privacy}","received_events_url":"https://api.github.com/users/groupon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groupon/tdsql","description":"Run SQL queries against a Teradata data warehouse server","fork":false,"url":"https://api.github.com/repos/groupon/tdsql","forks_url":"https://api.github.com/repos/groupon/tdsql/forks","keys_url":"https://api.github.com/repos/groupon/tdsql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groupon/tdsql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groupon/tdsql/teams","hooks_url":"https://api.github.com/repos/groupon/tdsql/hooks","issue_events_url":"https://api.github.com/repos/groupon/tdsql/issues/events{/number}","events_url":"https://api.github.com/repos/groupon/tdsql/events","assignees_url":"https://api.github.com/repos/groupon/tdsql/assignees{/user}","branches_url":"https://api.github.com/repos/groupon/tdsql/branches{/branch}","tags_url":"https://api.github.com/repos/groupon/tdsql/tags","blobs_url":"https://api.github.com/repos/groupon/tdsql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groupon/tdsql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groupon/tdsql/git/refs{/sha}","trees_url":"https://api.github.com/repos/groupon/tdsql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groupon/tdsql/statuses/{sha}","languages_url":"https://api.github.com/repos/groupon/tdsql/languages","stargazers_url":"https://api.github.com/repos/groupon/tdsql/stargazers","contributors_url":"https://api.github.com/repos/groupon/tdsql/contributors","subscribers_url":"https://api.github.com/repos/groupon/tdsql/subscribers","subscription_url":"https://api.github.com/repos/groupon/tdsql/subscription","commits_url":"https://api.github.com/repos/groupon/tdsql/commits{/sha}","git_commits_url":"https://api.github.com/repos/groupon/tdsql/git/commits{/sha}","comments_url":"https://api.github.com/repos/groupon/tdsql/comments{/number}","issue_comment_url":"https://api.github.com/repos/groupon/tdsql/issues/comments{/number}","contents_url":"https://api.github.com/repos/groupon/tdsql/contents/{+path}","compare_url":"https://api.github.com/repos/groupon/tdsql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groupon/tdsql/merges","archive_url":"https://api.github.com/repos/groupon/tdsql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groupon/tdsql/downloads","issues_url":"https://api.github.com/repos/groupon/tdsql/issues{/number}","pulls_url":"https://api.github.com/repos/groupon/tdsql/pulls{/number}","milestones_url":"https://api.github.com/repos/groupon/tdsql/milestones{/number}","notifications_url":"https://api.github.com/repos/groupon/tdsql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groupon/tdsql/labels{/name}","releases_url":"https://api.github.com/repos/groupon/tdsql/releases{/id}","deployments_url":"https://api.github.com/repos/groupon/tdsql/deployments","created_at":"2012-08-02T07:05:03Z","updated_at":"2017-07-27T06:29:02Z","pushed_at":"2017-10-24T03:54:36Z","git_url":"git://github.com/groupon/tdsql.git","ssh_url":"git@github.com:groupon/tdsql.git","clone_url":"https://github.com/groupon/tdsql.git","svn_url":"https://github.com/groupon/tdsql","homepage":null,"size":240,"stargazers_count":25,"watchers_count":25,"language":"Perl","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":4,"forks":12,"open_issues":4,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/groupon/tdsql/pulls/19"},"html":{"href":"https://github.com/groupon/tdsql/pull/19"},"issue":{"href":"https://api.github.com/repos/groupon/tdsql/issues/19"},"comments":{"href":"https://api.github.com/repos/groupon/tdsql/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/groupon/tdsql/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/groupon/tdsql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/groupon/tdsql/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/groupon/tdsql/statuses/5edcebbfcf302ed8e2628429545c6cbbfacc668c"}},"author_association":"NONE"}}
{"actor":{"display_login":"dbushong"}}