{"action":"created","issue":{"url":"https://api.github.com/repos/pljson/pljson/issues/37","repository_url":"https://api.github.com/repos/pljson/pljson","labels_url":"https://api.github.com/repos/pljson/pljson/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/pljson/pljson/issues/37/comments","events_url":"https://api.github.com/repos/pljson/pljson/issues/37/events","html_url":"https://github.com/pljson/pljson/issues/37","id":145892875,"number":37,"title":"JSON_PARSER.next_char2 return value will duplicate first character as second character,when strlen=4000,8000...","user":{"login":"larkin88","id":5002717,"avatar_url":"https://avatars.githubusercontent.com/u/5002717?v=3","gravatar_id":"","url":"https://api.github.com/users/larkin88","html_url":"https://github.com/larkin88","followers_url":"https://api.github.com/users/larkin88/followers","following_url":"https://api.github.com/users/larkin88/following{/other_user}","gists_url":"https://api.github.com/users/larkin88/gists{/gist_id}","starred_url":"https://api.github.com/users/larkin88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larkin88/subscriptions","organizations_url":"https://api.github.com/users/larkin88/orgs","repos_url":"https://api.github.com/users/larkin88/repos","events_url":"https://api.github.com/users/larkin88/events{/privacy}","received_events_url":"https://api.github.com/users/larkin88/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-04-05T05:40:08Z","updated_at":"2016-04-12T13:50:11Z","closed_at":null,"body":"for some time offset coming from 0, when string length equeue 4000,8000,substr(xxx,0, len) and substr(xxx,1, len) will occur , so JSON_PARSER.next_char2 return first character is error.  \r\n\r\nbug fix sample:\r\n```\r\n--------------------------------------\r\n  --2016-04-05 for conviect to test bug,defince variable instead 4000,\r\n  -- you can change to small number, etc. 10 to test \r\n  gn_load_cnt Number :=4000;\r\n \r\n\r\n /*type axe_sql_src is record (len number, offset number, src varchar2(10), s_clob clob); */\r\n  FUNCTION next_char(indx NUMBER,\r\n                     s    IN OUT NOCOPY axe_sql_src) RETURN VARCHAR2 AS\r\n  BEGIN\r\n    IF (indx > s.len)\r\n    THEN\r\n      RETURN NULL;\r\n    END IF;\r\n    --right offset?\r\n    \r\n    --IF (indx > 4000 + s.offset OR indx < s.offset)\r\n    --fix bug by larkin88 at 2016-04-05\r\n    IF (indx >= gn_load_cnt + s.offset OR indx < s.offset)\r\n    THEN\r\n      --load right offset\r\n      --s.offset := indx - (indx MOD 4000);\r\n      s.offset := indx - (indx MOD gn_load_cnt);\r\n      \r\n      --s.src    := dbms_lob.substr(s.s_clob, 4000, s.offset + 1);\r\n      --fix bug by larkin88 at 2016-04-05\r\n      s.src    := dbms_lob.substr(s.s_clob, gn_load_cnt, s.offset );\r\n      \r\n    END IF;\r\n    --read from s.src\r\n    \r\n    --RETURN substr(s.src, indx - s.offset, 1);\r\n     --fix bug by larkin88 at 2016-04-05\r\n    RETURN substr(s.src, indx - s.offset + 1, 1);\r\n    \r\n  END;\r\n    \r\n  \r\n  \r\n  FUNCTION prepareclob(buf CLOB) RETURN axe_sql_src AS\r\n    temp axe_sql_src;\r\n  BEGIN\r\n    temp.s_clob := buf;\r\n    --temp.offset := 0; fix bug by larkin88 at 2016-04-05\r\n    temp.offset := 1;\r\n    --temp.src    := dbms_lob.substr(buf, 4000, temp.offset + 1); fix bug by larkin88 at 2016-04-05\r\n    temp.src    := dbms_lob.substr(buf, gn_load_cnt, temp.offset);\r\n    temp.len    := dbms_lob.getlength(buf);\r\n    RETURN temp;\r\n  END;\r\n\r\n  FUNCTION preparevarchar2(buf VARCHAR2) RETURN axe_sql_src AS\r\n    temp axe_sql_src;\r\n  BEGIN\r\n    temp.s_clob := buf;\r\n    --temp.offset := 0; fix bug by larkin88 at 2016-04-05\r\n    temp.offset := 1;\r\n    --temp.src    := substr(buf, 1, 4000);\r\n    temp.src    := substr(buf, 1, gn_load_cnt);\r\n\r\n    temp.len    := length(buf);\r\n    RETURN temp;\r\n  END;\r\n ```"},"comment":{"url":"https://api.github.com/repos/pljson/pljson/issues/comments/208915774","html_url":"https://github.com/pljson/pljson/issues/37#issuecomment-208915774","issue_url":"https://api.github.com/repos/pljson/pljson/issues/37","id":208915774,"user":{"login":"dsnz","id":9822496,"avatar_url":"https://avatars.githubusercontent.com/u/9822496?v=3","gravatar_id":"","url":"https://api.github.com/users/dsnz","html_url":"https://github.com/dsnz","followers_url":"https://api.github.com/users/dsnz/followers","following_url":"https://api.github.com/users/dsnz/following{/other_user}","gists_url":"https://api.github.com/users/dsnz/gists{/gist_id}","starred_url":"https://api.github.com/users/dsnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsnz/subscriptions","organizations_url":"https://api.github.com/users/dsnz/orgs","repos_url":"https://api.github.com/users/dsnz/repos","events_url":"https://api.github.com/users/dsnz/events{/privacy}","received_events_url":"https://api.github.com/users/dsnz/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T13:50:11Z","updated_at":"2016-04-12T13:50:11Z","body":"@jsummers I understand the rationale of this but since until now all changes are on the master branch\r\nI could first pull the just the fix for this issue and then the 12c update, shall we do it this way ?"}}