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

Create From Selection when with long JSON fields are not save properly #278

Closed
micodls opened this issue Jun 21, 2019 · 1 comment

Comments

2 participants
@micodls
Copy link

commented Jun 21, 2019

JSON format not saved properly
When the query has a JSON string that is long, the query is not bookmarked properly.

To Reproduce
Steps to reproduce the behavior:

  1. Create a query to be saved example:
    INSERT INTO myTable ( creds, flags ) VALUES ( '{"test1":{"id":"jgsquA^00#*YQmsNDVsFuzTyJZCQBgB5","secret":"nCFeeMg9UvhIv49Azn#&CmtBj2Yr@p3u$2z2XKkkI8HoxfhM!8fz1H@3W^!7SEn4FivAxNB%OK1hvdns5WEbH5SoE3s@A2L5"},"test2":{"id":"qSF48t#w7I","secret":"LsqM$cPV$4S9#QxGh55xz3FhXca#!@xQ"},"test3":{"id":"E$2CYHVwu$$T7TgvGTr!rCtAboJ8Zp^UE*6KrDWSJ@l*lQQ3EMp&0Dv2DutLjGA5a%wHb9j7F1DlC3fWUH#EzOx5K^JO#y@J"},"test4":{"secret":"g3ZJ32DVxIL*REApWgpl&5P7qN^OCuZzj"},"test5":{"id":"test","secret":"R8t3WQeh%u%F$A3noO#VY!2eoWMAd!ad"}}', '{"activity1": 1, "activity2": 1}', );
  2. SQLTools Bookmarks: Create From Selection
  3. Save the query
  4. Edit saved query in bookmarks
  5. See error

Expected behavior
The query is the same.

Actual behavior
The query is not saved properly. One of the brackets are removed from the long JSON field and placed after the semicolon at the end of the query.

`-- @block Bookmarked query
-- @name Ungrouped
-- @group test

INSERT INTO
myTable (
creds,
flags
)
VALUES
(
'{"test1":{"id":"jgsquA^00#YQmsNDVsFuzTyJZCQBgB5","secret":"nCFeeMg9UvhIv49Azn#&CmtBj2Yr@p3uz2XKkkI8HoxfhM!8fz1H@3W^!7SEn4FivAxNB%OK1hvdns5WEbH5SoE3s@A2L5","test2":{"id":"qSF48t#w7I","secret":"LsqMS9#QxGh55xz3FhXca#!@xq"},"test3":{"id":"ECYHVwu$!rCtAboJ8Zp^UE6KrDWSJ@llQQ3EMp&0Dv2DutLjGA5a%wHb9j7F1DlC3fWUH#EzOx5K^JO#y@J"},"test4":{"secret":"g3ZJ32DVxILREApWgpl&5P7qN^OCuZzj"},"test5":{"id":"test","secret":"R8t3WQeh%u%F#VY!2eoWMAd!ad"}}',
'{"program": 1, "activity": 1}',
);}
`

Desktop (please complete the following information):

  • SQLTools Version 0.19.5
  • VSCode Version: 1.35.1
  • Dialect Used: MySQL
  • OS: Linux

@micodls micodls added the bug label Jun 21, 2019

@project-bot project-bot bot added this to To do in Kanban Jun 21, 2019

@mtxr mtxr closed this in 214fe2c Jun 26, 2019

mtxr added a commit that referenced this issue Jun 26, 2019

Kanban automation moved this from To do to To be released Jun 26, 2019

@mtxr

This comment has been minimized.

Copy link
Owner

commented Jun 26, 2019

FIxed. Will be released tomorrow.

Thanks @micodls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.