Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hang on json field parsing #3753

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Hang on json field parsing #3753

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2015-07-06 15:04:44 +0200
From: Vladimir Radushevskiy <>
To: SQL devs <>
Version: 11.19.15 (Oct2014-SP4)
CC: @mlkersten, @njnes

Last updated: 2015-08-28 13:41:55 +0200

Comment 20964

Date: 2015-07-06 15:04:44 +0200
From: Vladimir Radushevskiy <>

sql>SELECT json.isvalid('[0,1]');
+----------------------+
| isvalid_single_value |
+======================+
| true |
+----------------------+
1 tuple (0.224ms)

sql>SELECT json.isvalid('[0,,1]');

Not response in current session and 100% CPU usage on one core аnd eats memory.

Comment 20965

Date: 2015-07-06 15:30:44 +0200
From: Vladimir Radushevskiy <>

Error in json parser:

SELECT json.isValid(null); => false

All this variants must be FALSE (json valid structures only {} and [])
SELECT json.isValid(''); => false
SELECT json.isValid('null'); => TRUE, must be false
SELECT json.isValid('"'); => false
SELECT json.isValid('""'); => false
SELECT json.isValid('"""'); => TRUE, must be false
SELECT json.isValid('"""'); => TRUE, must be false
SELECT json.isValid('""""'); => false
SELECT json.isValid('""""'); => false

Array:
SELECT json.isValid('[]'); => true
SELECT json.isValid('[null]'); => true
SELECT json.isValid('[""]'); => FALSE, must be true
SELECT json.isValid('["""]'); => TRUE, must be false
SELECT json.isValid('["""]'); => true
SELECT json.isValid('[""""]'); => false
SELECT json.isValid('[""""]'); => FALSE, must be true

Object:
SELECT json.isValid('{}'); => true
SELECT json.isValid('{"test":null}'); => true
SELECT json.isValid('{"test":""}'); => FALSE, must be true
SELECT json.isValid('{"test":"""}'); => TRUE, must be false
SELECT json.isValid('{"test":"""}'); => true
SELECT json.isValid('{"test":""""}'); => false
SELECT json.isValid('{"test":""""}'); => FALSE, must be true

Comment 20966

Date: 2015-07-06 17:17:36 +0200
From: Vladimir Radushevskiy <>

SELECT json.isValid('{"test":"""}'); => TRUE, must be false

Comment 20967

Date: 2015-07-06 23:06:06 +0200
From: @mlkersten

Correct observation. Test has been added to the test suite the Jul2015 branch.
The errors will be fixed soon. Thx for this minitest.

Comment 20971

Date: 2015-07-08 16:21:44 +0200
From: @njnes

fixed in jul2015 branch, added more restrictive parsing

Comment 21194

Date: 2015-08-28 13:41:55 +0200
From: @sjoerdmullender

Jul2015 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant