{"action":"created","issue":{"url":"https://api.github.com/repos/CUBRID/cubrid-manager/issues/41","repository_url":"https://api.github.com/repos/CUBRID/cubrid-manager","labels_url":"https://api.github.com/repos/CUBRID/cubrid-manager/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/CUBRID/cubrid-manager/issues/41/comments","events_url":"https://api.github.com/repos/CUBRID/cubrid-manager/issues/41/events","html_url":"https://github.com/CUBRID/cubrid-manager/pull/41","id":197574189,"number":41,"title":"cannot execute a query that it has a sqlmap syntax tags","user":{"login":"newpcraft","id":1791415,"avatar_url":"https://avatars.githubusercontent.com/u/1791415?v=3","gravatar_id":"","url":"https://api.github.com/users/newpcraft","html_url":"https://github.com/newpcraft","followers_url":"https://api.github.com/users/newpcraft/followers","following_url":"https://api.github.com/users/newpcraft/following{/other_user}","gists_url":"https://api.github.com/users/newpcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/newpcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newpcraft/subscriptions","organizations_url":"https://api.github.com/users/newpcraft/orgs","repos_url":"https://api.github.com/users/newpcraft/repos","events_url":"https://api.github.com/users/newpcraft/events{/privacy}","received_events_url":"https://api.github.com/users/newpcraft/received_events","type":"User","site_admin":false},"labels":[{"id":334832026,"url":"https://api.github.com/repos/CUBRID/cubrid-manager/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"newpcraft","id":1791415,"avatar_url":"https://avatars.githubusercontent.com/u/1791415?v=3","gravatar_id":"","url":"https://api.github.com/users/newpcraft","html_url":"https://github.com/newpcraft","followers_url":"https://api.github.com/users/newpcraft/followers","following_url":"https://api.github.com/users/newpcraft/following{/other_user}","gists_url":"https://api.github.com/users/newpcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/newpcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newpcraft/subscriptions","organizations_url":"https://api.github.com/users/newpcraft/orgs","repos_url":"https://api.github.com/users/newpcraft/repos","events_url":"https://api.github.com/users/newpcraft/events{/privacy}","received_events_url":"https://api.github.com/users/newpcraft/received_events","type":"User","site_admin":false},"assignees":[{"login":"newpcraft","id":1791415,"avatar_url":"https://avatars.githubusercontent.com/u/1791415?v=3","gravatar_id":"","url":"https://api.github.com/users/newpcraft","html_url":"https://github.com/newpcraft","followers_url":"https://api.github.com/users/newpcraft/followers","following_url":"https://api.github.com/users/newpcraft/following{/other_user}","gists_url":"https://api.github.com/users/newpcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/newpcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newpcraft/subscriptions","organizations_url":"https://api.github.com/users/newpcraft/orgs","repos_url":"https://api.github.com/users/newpcraft/repos","events_url":"https://api.github.com/users/newpcraft/events{/privacy}","received_events_url":"https://api.github.com/users/newpcraft/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/CUBRID/cubrid-manager/milestones/4","html_url":"https://github.com/CUBRID/cubrid-manager/milestone/4","labels_url":"https://api.github.com/repos/CUBRID/cubrid-manager/milestones/4/labels","id":2215442,"number":4,"title":"release 2016.12","description":"","creator":{"login":"newpcraft","id":1791415,"avatar_url":"https://avatars.githubusercontent.com/u/1791415?v=3","gravatar_id":"","url":"https://api.github.com/users/newpcraft","html_url":"https://github.com/newpcraft","followers_url":"https://api.github.com/users/newpcraft/followers","following_url":"https://api.github.com/users/newpcraft/following{/other_user}","gists_url":"https://api.github.com/users/newpcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/newpcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newpcraft/subscriptions","organizations_url":"https://api.github.com/users/newpcraft/orgs","repos_url":"https://api.github.com/users/newpcraft/repos","events_url":"https://api.github.com/users/newpcraft/events{/privacy}","received_events_url":"https://api.github.com/users/newpcraft/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":15,"state":"open","created_at":"2016-12-26T06:46:25Z","updated_at":"2016-12-26T10:59:11Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-12-26T10:46:10Z","updated_at":"2016-12-27T04:24:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CUBRID/cubrid-manager/pulls/41","html_url":"https://github.com/CUBRID/cubrid-manager/pull/41","diff_url":"https://github.com/CUBRID/cubrid-manager/pull/41.diff","patch_url":"https://github.com/CUBRID/cubrid-manager/pull/41.patch"},"body":"When the query has sqlmap tags such as `<select>`, `<update>`, `<insert>`,\r\n`<delete>`, cubrid manager expects to parse as well as transform that\r\nquery to a normal query which allows to be executed in the query editor\r\nthrough parameter binding step.\r\n\r\nHowever, some query might possible to have such tags in conditions. In\r\nthis condition, when you run a query, it couldn't execute because\r\ncubrid manager handles that query as a sqlmap rather than a normal\r\nquery. So, it is always failed.\r\n\r\nFor example, you cannot run the following query:\r\n\r\n```\r\nSELECT * FROM code WHERE s_name='<select></select>'\r\n```\r\n\r\nFor this reason, we should have to provide sqlmap parsing function with\r\nan extra action rather than a query run action. Because even if it has\r\na function to distinguish between a normal and a sqlmap query in the\r\nquery editor, but it is not enough with such simple logic.\r\n\r\nIn this patch, I added a new menu item in the context menu of the query\r\neditor as `Parse this sqlmap query` which located under the `Run this\r\nquery` menu item. When you click this menu, it will parse the query as\r\nthe sqlmap and make it open the Sqlmap pane on the right side of the\r\nquery editor due to binding parameters.\r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE sqlMap PUBLIC \"-//iBATIS.com/DTD SQL Map 2.0//EN\" \"http://ibatis.apache.org/dtd/sql-map-2.dtd\">\r\n<sqlMap namespace=\"namespace1\">\r\n\r\n<select id=\"t1\" parameterClass=\"map\">\r\nSELECT * FROM code WHERE s_name=#s_name#;\r\n</select>\r\n\r\n</sqlMap>\r\n```\r\n\r\nClick the `Parse this sqlmap query` menu on selected query:\r\n\r\n![2016-12-26 7 42 21](https://cloud.githubusercontent.com/assets/1791415/21480820/4f38ac5a-cba4-11e6-8413-d07dfb5265a7.png)\r\n\r\n\r\nIt will show this panel to bind parameters and paste normal query to the new query editor tab:\r\n\r\n![2016-12-26 7 42 59](https://cloud.githubusercontent.com/assets/1791415/21480824/50c480b2-cba4-11e6-9821-7929c5adba11.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/CUBRID/cubrid-manager/issues/comments/269267828","html_url":"https://github.com/CUBRID/cubrid-manager/pull/41#issuecomment-269267828","issue_url":"https://api.github.com/repos/CUBRID/cubrid-manager/issues/41","id":269267828,"user":{"login":"newpcraft","id":1791415,"avatar_url":"https://avatars.githubusercontent.com/u/1791415?v=3","gravatar_id":"","url":"https://api.github.com/users/newpcraft","html_url":"https://github.com/newpcraft","followers_url":"https://api.github.com/users/newpcraft/followers","following_url":"https://api.github.com/users/newpcraft/following{/other_user}","gists_url":"https://api.github.com/users/newpcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/newpcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newpcraft/subscriptions","organizations_url":"https://api.github.com/users/newpcraft/orgs","repos_url":"https://api.github.com/users/newpcraft/repos","events_url":"https://api.github.com/users/newpcraft/events{/privacy}","received_events_url":"https://api.github.com/users/newpcraft/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T04:24:41Z","updated_at":"2016-12-27T04:24:41Z","body":"@seunghun-kim Would you please check it again?"}}
{"actor":{"display_login":"newpcraft"}}