{"action":"created","issue":{"url":"https://api.github.com/repos/humanmade/backupwordpress/issues/659","labels_url":"https://api.github.com/repos/humanmade/backupwordpress/issues/659/labels{/name}","comments_url":"https://api.github.com/repos/humanmade/backupwordpress/issues/659/comments","events_url":"https://api.github.com/repos/humanmade/backupwordpress/issues/659/events","html_url":"https://github.com/humanmade/backupwordpress/issues/659","id":53073539,"number":659,"title":"Null characters in SQL script","user":{"login":"hdeadman","id":1556777,"avatar_url":"https://avatars.githubusercontent.com/u/1556777?v=3","gravatar_id":"","url":"https://api.github.com/users/hdeadman","html_url":"https://github.com/hdeadman","followers_url":"https://api.github.com/users/hdeadman/followers","following_url":"https://api.github.com/users/hdeadman/following{/other_user}","gists_url":"https://api.github.com/users/hdeadman/gists{/gist_id}","starred_url":"https://api.github.com/users/hdeadman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdeadman/subscriptions","organizations_url":"https://api.github.com/users/hdeadman/orgs","repos_url":"https://api.github.com/users/hdeadman/repos","events_url":"https://api.github.com/users/hdeadman/events{/privacy}","received_events_url":"https://api.github.com/users/hdeadman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/humanmade/backupwordpress/milestones/4","labels_url":"https://api.github.com/repos/humanmade/backupwordpress/milestones/4/labels","id":52672,"number":4,"title":"Awaiting Review","description":"This is the home for new tickets which have not yet been reviewed.\r\n\r\nOnce reviewed they will be placed in an appropriate milestone for resolution","creator":{"login":"willmot","id":308507,"avatar_url":"https://avatars.githubusercontent.com/u/308507?v=3","gravatar_id":"","url":"https://api.github.com/users/willmot","html_url":"https://github.com/willmot","followers_url":"https://api.github.com/users/willmot/followers","following_url":"https://api.github.com/users/willmot/following{/other_user}","gists_url":"https://api.github.com/users/willmot/gists{/gist_id}","starred_url":"https://api.github.com/users/willmot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmot/subscriptions","organizations_url":"https://api.github.com/users/willmot/orgs","repos_url":"https://api.github.com/users/willmot/repos","events_url":"https://api.github.com/users/willmot/events{/privacy}","received_events_url":"https://api.github.com/users/willmot/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":33,"state":"open","created_at":"2011-11-04T10:39:32Z","updated_at":"2015-01-01T17:31:47Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2014-12-29T21:33:16Z","updated_at":"2015-01-02T00:06:20Z","closed_at":null,"body":"I am using a Google Calendar plugin that puts data in the wp_options table. One of the values contained two  null characters (which each showed up as \"00\" when viewed with a hex editor). These caused the script to fail when it was run and it caused the file to be stop loading at the first null character when opened in certain text editors. I think it would be safe to strip out (remove) any of those characters that managed to work their way into the data. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/humanmade/backupwordpress/issues/comments/68503039","html_url":"https://github.com/humanmade/backupwordpress/issues/659#issuecomment-68503039","issue_url":"https://api.github.com/repos/humanmade/backupwordpress/issues/659","id":68503039,"user":{"login":"hdeadman","id":1556777,"avatar_url":"https://avatars.githubusercontent.com/u/1556777?v=3","gravatar_id":"","url":"https://api.github.com/users/hdeadman","html_url":"https://github.com/hdeadman","followers_url":"https://api.github.com/users/hdeadman/followers","following_url":"https://api.github.com/users/hdeadman/following{/other_user}","gists_url":"https://api.github.com/users/hdeadman/gists{/gist_id}","starred_url":"https://api.github.com/users/hdeadman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdeadman/subscriptions","organizations_url":"https://api.github.com/users/hdeadman/orgs","repos_url":"https://api.github.com/users/hdeadman/repos","events_url":"https://api.github.com/users/hdeadman/events{/privacy}","received_events_url":"https://api.github.com/users/hdeadman/received_events","type":"User","site_admin":false},"created_at":"2015-01-02T00:06:20Z","updated_at":"2015-01-02T00:06:20Z","body":"I don't think null characters have any legitamate use in a text column. They are illegal in XML and they mess up lots of editors and text processing code. This person was having problems with them and his solution was just to remove them:\r\nhttp://blogs.visigo.com/chriscoulson/removing-null-characters-0x00-from-values-in-sql-server/\r\nHere is another post of someone having problems with them:\r\nhttp://bi-logger.blogspot.com/2011/07/sql-server-identifying-control.html\r\nI can't find any way to escape them in a sql script so I would say it's safe to remove them from text data. As-is the script isn't going to work if it contains hexa-decimal null 0x00.\r\n\r\nThe plugin I am using is the following: \r\nhttps://wordpress.org/plugins/google-calendar-events/\r\n\r\nI extracted the portion of the SQL script that contained the null characters and uploaded it here:\r\nhttps://gist.github.com/hdeadman/18dfc16bc4fe6624055c\r\nNote the nulls didn't actually make it in there, they don't survive a copy and paste.  \r\n\r\n![image](https://cloud.githubusercontent.com/assets/1556777/5593593/c193e7f0-91e6-11e4-9b89-7a7c1b1ae0c1.png)"}}