{"action":"created","issue":{"url":"https://api.github.com/repos/pymssql/pymssql/issues/300","repository_url":"https://api.github.com/repos/pymssql/pymssql","labels_url":"https://api.github.com/repos/pymssql/pymssql/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/pymssql/pymssql/issues/300/comments","events_url":"https://api.github.com/repos/pymssql/pymssql/issues/300/events","html_url":"https://github.com/pymssql/pymssql/issues/300","id":55981769,"number":300,"title":"8 digits unicode char cause unclosed quotation error in _mssql","user":{"login":"gestapolur","id":1104224,"avatar_url":"https://avatars.githubusercontent.com/u/1104224?v=3","gravatar_id":"","url":"https://api.github.com/users/gestapolur","html_url":"https://github.com/gestapolur","followers_url":"https://api.github.com/users/gestapolur/followers","following_url":"https://api.github.com/users/gestapolur/following{/other_user}","gists_url":"https://api.github.com/users/gestapolur/gists{/gist_id}","starred_url":"https://api.github.com/users/gestapolur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gestapolur/subscriptions","organizations_url":"https://api.github.com/users/gestapolur/orgs","repos_url":"https://api.github.com/users/gestapolur/repos","events_url":"https://api.github.com/users/gestapolur/events{/privacy}","received_events_url":"https://api.github.com/users/gestapolur/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pymssql/pymssql/labels/Blocked:%20FreeTDS","name":"Blocked: FreeTDS","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/pymssql/pymssql/milestones/5","html_url":"https://github.com/pymssql/pymssql/milestones/Unknown","labels_url":"https://api.github.com/repos/pymssql/pymssql/milestones/5/labels","id":839817,"number":5,"title":"Unknown","description":"","creator":{"login":"rsyring","id":109467,"avatar_url":"https://avatars.githubusercontent.com/u/109467?v=3","gravatar_id":"","url":"https://api.github.com/users/rsyring","html_url":"https://github.com/rsyring","followers_url":"https://api.github.com/users/rsyring/followers","following_url":"https://api.github.com/users/rsyring/following{/other_user}","gists_url":"https://api.github.com/users/rsyring/gists{/gist_id}","starred_url":"https://api.github.com/users/rsyring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsyring/subscriptions","organizations_url":"https://api.github.com/users/rsyring/orgs","repos_url":"https://api.github.com/users/rsyring/repos","events_url":"https://api.github.com/users/rsyring/events{/privacy}","received_events_url":"https://api.github.com/users/rsyring/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":5,"state":"open","created_at":"2014-10-25T05:48:33Z","updated_at":"2016-06-22T23:22:09Z","due_on":"2020-12-31T08:00:00Z","closed_at":null},"comments":4,"created_at":"2015-01-30T01:10:28Z","updated_at":"2016-06-24T15:40:38Z","closed_at":null,"body":"Get `Unclosed quotation mark after the character string` error message when insert emoji unicode into nvarchar using _mssql.execute_non_query() method, \r\n\r\n```python\r\nimport _mssql\r\nconn = _mssql.connect(server='<server>', user='<user>', password='<pwd>', database='db')\r\ncreate_tb = (\"CREATE TABLE test (\"\r\n             \"name NVARCHAR(MAX)\"\r\n             \")\")\r\nconn.execute_non_query(create_tb)\r\nconn.execute_non_query(\"insert into TEST (name) values (%s);\", u\"\\U0001f33a\")\r\n```\r\nit raises\r\n```python\r\n---------------------------------------------------------------------------\r\nMSSQLDatabaseException                    Traceback (most recent call last)\r\n<ipython-input-140-2be171d6688c> in <module>()\r\n----> 1 get_ipython().run_cell_magic(u'time', u'', u'name = [u\"\\\\U0001f33a\"]\\n\\nconn.execute_non_query(\"insert into TEST (name) values (%s);\", u\"\\\\U0001f33a\")')\r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_cell_magic(self, magic_name, line, cell)\r\n   2160             magic_arg_s = self.var_expand(line, stack_depth)\r\n   2161             with self.builtin_trap:\r\n-> 2162                 result = fn(magic_arg_s, cell)\r\n   2163             return result\r\n   2164 \r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)\r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)\r\n    191     # but it's overkill for just that one bit of state.\r\n    192     def magic_deco(arg):\r\n--> 193         call = lambda f, *a, **k: f(*a, **k)\r\n    194 \r\n    195         if callable(arg):\r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)\r\n   1127         else:\r\n   1128             st = clock2()\r\n-> 1129             exec(code, glob, local_ns)\r\n   1130             end = clock2()\r\n   1131             out = None\r\n\r\n<timed exec> in <module>()\r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/_mssql.so in _mssql.MSSQLConnection.execute_non_query (_mssql.c:9875)()\r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/_mssql.so in _mssql.MSSQLConnection.execute_non_query (_mssql.c:9700)()\r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/_mssql.so in _mssql.MSSQLConnection.format_and_run_query (_mssql.c:11121)()\r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/_mssql.so in _mssql.check_cancel_and_raise (_mssql.c:14752)()\r\n\r\n/home/mitsukeru/.virtualenvs/yasaka/lib/python2.7/site-packages/_mssql.so in _mssql.maybe_raise_MSSQLDatabaseException (_mssql.c:15338)()\r\n\r\nMSSQLDatabaseException: (105, \"Unclosed quotation mark after the character string ''.DB-Lib error message 105, severity 15:\\nGeneral SQL Server error: Check messages from the SQL Server\\nDB-Lib error message 102, severity 15:\\nGeneral SQL Server error: Check messages from the SQL Server\\n\")\r\n```\r\nWhen i insert unicode chars, its ok. Only unicodes start with '\\U' may cause exception.\r\nu\"\\U0001f33a\" looks like this :hibiscus:\r\n"},"comment":{"url":"https://api.github.com/repos/pymssql/pymssql/issues/comments/228380056","html_url":"https://github.com/pymssql/pymssql/issues/300#issuecomment-228380056","issue_url":"https://api.github.com/repos/pymssql/pymssql/issues/300","id":228380056,"user":{"login":"ramiro","id":40661,"avatar_url":"https://avatars.githubusercontent.com/u/40661?v=3","gravatar_id":"","url":"https://api.github.com/users/ramiro","html_url":"https://github.com/ramiro","followers_url":"https://api.github.com/users/ramiro/followers","following_url":"https://api.github.com/users/ramiro/following{/other_user}","gists_url":"https://api.github.com/users/ramiro/gists{/gist_id}","starred_url":"https://api.github.com/users/ramiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramiro/subscriptions","organizations_url":"https://api.github.com/users/ramiro/orgs","repos_url":"https://api.github.com/users/ramiro/repos","events_url":"https://api.github.com/users/ramiro/events{/privacy}","received_events_url":"https://api.github.com/users/ramiro/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T15:40:38Z","updated_at":"2016-06-24T15:40:38Z","body":"> I can't find any PR in the freetds project that looks like it might affect this issue. Are we sure it's a FreeTDS problem?\r\n\r\nIf you are in need of this and/or looking at the issue, why don't you test it and post your results here?\r\n\r\n"}}
{"actor":{"display_login":"ramiro"}}