{"action":"created","issue":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/4886","repository_url":"https://api.github.com/repos/bcit-ci/CodeIgniter","labels_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/4886/labels{/name}","comments_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/4886/comments","events_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/4886/events","html_url":"https://github.com/bcit-ci/CodeIgniter/pull/4886","id":185897794,"number":4886,"title":"Match both single and double quote in DB_driver","user":{"login":"tianhe1986","id":19562319,"avatar_url":"https://avatars.githubusercontent.com/u/19562319?v=3","gravatar_id":"","url":"https://api.github.com/users/tianhe1986","html_url":"https://github.com/tianhe1986","followers_url":"https://api.github.com/users/tianhe1986/followers","following_url":"https://api.github.com/users/tianhe1986/following{/other_user}","gists_url":"https://api.github.com/users/tianhe1986/gists{/gist_id}","starred_url":"https://api.github.com/users/tianhe1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tianhe1986/subscriptions","organizations_url":"https://api.github.com/users/tianhe1986/orgs","repos_url":"https://api.github.com/users/tianhe1986/repos","events_url":"https://api.github.com/users/tianhe1986/events{/privacy}","received_events_url":"https://api.github.com/users/tianhe1986/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-28T11:12:45Z","updated_at":"2016-10-28T11:28:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/pulls/4886","html_url":"https://github.com/bcit-ci/CodeIgniter/pull/4886","diff_url":"https://github.com/bcit-ci/CodeIgniter/pull/4886.diff","patch_url":"https://github.com/bcit-ci/CodeIgniter/pull/4886.patch"},"body":"I use the following code in controller.\r\n\r\n```\r\n$this->load->database();\r\n$sql = 'select * from reader where reader_id = ? and level = ? and tag = \"1?2\"';\r\n$binds = ['3456', '888'];\r\n$compiled_sql = $this->db->compile_binds($sql, $binds);\r\necho $compiled_sql;\r\n```\r\n\r\nThe expected output should be\r\n`select * from reader where reader_id = '3456' and level = '888' and tag = \"1?2\"`\r\n\r\nHowever,  get\r\n`select * from reader where reader_id = ? and level = ? and tag = \"1?2\"`\r\n\r\nIt is because that double quote does not be matched in `compile_binds()`.\r\n\r\nAnd the same with `is_write_type()`."},"comment":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/comments/256897829","html_url":"https://github.com/bcit-ci/CodeIgniter/pull/4886#issuecomment-256897829","issue_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/4886","id":256897829,"user":{"login":"narfbg","id":1058011,"avatar_url":"https://avatars.githubusercontent.com/u/1058011?v=3","gravatar_id":"","url":"https://api.github.com/users/narfbg","html_url":"https://github.com/narfbg","followers_url":"https://api.github.com/users/narfbg/followers","following_url":"https://api.github.com/users/narfbg/following{/other_user}","gists_url":"https://api.github.com/users/narfbg/gists{/gist_id}","starred_url":"https://api.github.com/users/narfbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narfbg/subscriptions","organizations_url":"https://api.github.com/users/narfbg/orgs","repos_url":"https://api.github.com/users/narfbg/repos","events_url":"https://api.github.com/users/narfbg/events{/privacy}","received_events_url":"https://api.github.com/users/narfbg/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T11:28:58Z","updated_at":"2016-10-28T11:28:58Z","body":"The double quote doesn't necessarily mean a literal string - this doesn't appear to matter for your patch, but you should have it in mind. EVERY major database platform except MySQL uses it as the escape character for identifiers."}}
{"actor":{"display_login":"narfbg"}}