{"action":"created","comment":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/129654689","pull_request_review_id":52450956,"id":129654689,"diff_hunk":"@@ -422,10 +428,10 @@ else if (sCommentEnd != null) {\n                 }\n             } else {\n                 // Outside of a quoted string - watch for the next separator, quote or comment.\n-                if( matchToken(bufStr, iCur, \"case\") ) {\n+                if( matchToken(sqlNoComments, iCur, \"case\") ) {\n                     inCase++;\n                     iCur += 4;\n-                } else if ( matchToken(bufStr, iCur, \"begin\") ) {\n+                } else if ( matchToken(sqlNoComments, iCur, \"begin\") ) {","path":"src/frontend/org/voltdb/parser/SQLLexer.java","position":46,"original_position":46,"commit_id":"838796f155c1a99fb64c696e95e85c2a853431de","original_commit_id":"838796f155c1a99fb64c696e95e85c2a853431de","user":{"login":"BillWhite","id":924098,"avatar_url":"https://avatars0.githubusercontent.com/u/924098?v=4","gravatar_id":"","url":"https://api.github.com/users/BillWhite","html_url":"https://github.com/BillWhite","followers_url":"https://api.github.com/users/BillWhite/followers","following_url":"https://api.github.com/users/BillWhite/following{/other_user}","gists_url":"https://api.github.com/users/BillWhite/gists{/gist_id}","starred_url":"https://api.github.com/users/BillWhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BillWhite/subscriptions","organizations_url":"https://api.github.com/users/BillWhite/orgs","repos_url":"https://api.github.com/users/BillWhite/repos","events_url":"https://api.github.com/users/BillWhite/events{/privacy}","received_events_url":"https://api.github.com/users/BillWhite/received_events","type":"User","site_admin":false},"body":"What if the procedure is 'create procedure f as select begin.begin from begin'  You are never inBegin in this case.  I think you can only match the begin at the beginning, so to speak.\r\n\r\nIt might help to write a grammar.  Maybe something as simple as:\r\n```\r\nSTMT ::= MULTIPLE_STMT | SINGLE_STMT;\r\nSINGLE_STMT ::= (^('begin' | 'case'))* (( 'case' SINGLE_STMT 'end' ) ('^'case')*)* '(^'case')*;\r\nMULTIPLE_STMT ::= 'begin' SINGLE_STMT (';' SINGLE_STMT )* 'end' ';'\r\n```\r\nBy this I mean something like:\r\n\r\n1. A STMT is SINGLE_STMT or a MULTIPLE_STMT.\r\n2. A SINGLE_STMT is a sequence of tokens not equal to 'begin' or 'case', followed by a balanced 'case'/'end' sequence followed by some tokens which are not 'case'.  Maybe semicolon needs to be put in there somehow.\r\n3. A MULTIPLE_STMT is 'begin' followed by a sequence of semicolon separated SINGLE_STMTs followed by 'end.\r\n\r\nThis kind of a grammar might help organize our thinking.  It doesn't have to be 100% accurate to be useful.","created_at":"2017-07-26T18:17:49Z","updated_at":"2017-07-26T18:59:34Z","html_url":"https://github.com/VoltDB/voltdb/pull/4705#discussion_r129654689","pull_request_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4705","_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/129654689"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/4705#discussion_r129654689"},"pull_request":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4705"}}},"pull_request":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4705","id":130939670,"html_url":"https://github.com/VoltDB/voltdb/pull/4705","diff_url":"https://github.com/VoltDB/voltdb/pull/4705.diff","patch_url":"https://github.com/VoltDB/voltdb/pull/4705.patch","issue_url":"https://api.github.com/repos/VoltDB/voltdb/issues/4705","number":4705,"state":"open","locked":false,"title":"Eng 12846 sqlcmd multi stmt sp","user":{"login":"dm89","id":1905179,"avatar_url":"https://avatars0.githubusercontent.com/u/1905179?v=4","gravatar_id":"","url":"https://api.github.com/users/dm89","html_url":"https://github.com/dm89","followers_url":"https://api.github.com/users/dm89/followers","following_url":"https://api.github.com/users/dm89/following{/other_user}","gists_url":"https://api.github.com/users/dm89/gists{/gist_id}","starred_url":"https://api.github.com/users/dm89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dm89/subscriptions","organizations_url":"https://api.github.com/users/dm89/orgs","repos_url":"https://api.github.com/users/dm89/repos","events_url":"https://api.github.com/users/dm89/events{/privacy}","received_events_url":"https://api.github.com/users/dm89/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-17T20:07:11Z","updated_at":"2017-07-26T18:59:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30f17e114a4ef93860f4dad3eb09c1d2e9664f3c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4705/commits","review_comments_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4705/comments","review_comment_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/issues/4705/comments","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/838796f155c1a99fb64c696e95e85c2a853431de","head":{"label":"VoltDB:ENG-12846-sqlcmd-multi-stmt-sp","ref":"ENG-12846-sqlcmd-multi-stmt-sp","sha":"838796f155c1a99fb64c696e95e85c2a853431de","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars3.githubusercontent.com/u/703910?v=4","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars3.githubusercontent.com/u/703910?v=4","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","deployments_url":"https://api.github.com/repos/VoltDB/voltdb/deployments","created_at":"2011-09-23T18:46:12Z","updated_at":"2017-07-21T20:03:01Z","pushed_at":"2017-07-26T18:58:25Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":518529,"stargazers_count":1006,"watchers_count":1006,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":300,"mirror_url":null,"open_issues_count":75,"forks":300,"open_issues":75,"watchers":1006,"default_branch":"master"}},"base":{"label":"VoltDB:multistatement-sp","ref":"multistatement-sp","sha":"3b0418dfa3beac49298e3742d5cf6c9070699e9f","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars3.githubusercontent.com/u/703910?v=4","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars3.githubusercontent.com/u/703910?v=4","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","deployments_url":"https://api.github.com/repos/VoltDB/voltdb/deployments","created_at":"2011-09-23T18:46:12Z","updated_at":"2017-07-21T20:03:01Z","pushed_at":"2017-07-26T18:58:25Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":518529,"stargazers_count":1006,"watchers_count":1006,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":300,"mirror_url":null,"open_issues_count":75,"forks":300,"open_issues":75,"watchers":1006,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4705"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/4705"},"issue":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/4705"},"comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/4705/comments"},"review_comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4705/comments"},"review_comment":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4705/commits"},"statuses":{"href":"https://api.github.com/repos/VoltDB/voltdb/statuses/838796f155c1a99fb64c696e95e85c2a853431de"}}}}
{"actor":{"display_login":"BillWhite"}}