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

fix: TOOLS-2962 Handle boolean values on JSON bin value #33

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

a-spiker
Copy link
Contributor

Verified:

Test 1:

aql> INSERT INTO test.myset (PK, foo, bar) VALUES ('key1',true,JSON('{"a":false,"b": [1, 2, 3]}'))
OK, 1 record affected.
aql> select * from test.myset
+--------+------+-----------------------------------+
| PK     | foo  | bar                               |
+--------+------+-----------------------------------+
| "key1" | true | MAP('{"a":false, "b":[1, 2, 3]}') |
+--------+------+-----------------------------------+
1 row in set (0.009 secs)

OK

Test 2:

aql> INSERT INTO test.myset (PK, foo, bar) VALUES ('key1',true,JSON('{"a":true,"b": [1, 2, 3]}'))
OK, 1 record affected.
aql> select * from test.myset
+--------+------+----------------------------------+
| PK     | foo  | bar                              |
+--------+------+----------------------------------+
| "key1" | true | MAP('{"a":true, "b":[1, 2, 3]}') |
+--------+------+----------------------------------+
1 row in set (0.012 secs)

OK

Copy link
Contributor

@jdogmcsteezy jdogmcsteezy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also update the help text output to use a nested boolean value

@jdogmcsteezy
Copy link
Contributor

Should we also test with MAP and LIST ?

@a-spiker
Copy link
Contributor Author

Test 3:

aql> INSERT INTO test.demo (PK, foo, bar, baz) VALUES ('key1', CAST('123' AS INT), LIST('[true, false, true]'), BOOL(1))
OK, 1 record affected.

aql> select * from test.demo;
+--------+-----+-----------------------------+------+
| PK     | foo | bar                         | baz  |
+--------+-----+-----------------------------+------+
| "key1" | 123 | LIST('[true, false, true]') | true |
+--------+-----+-----------------------------+------+
1 row in set (0.010 secs)

OK

Test 4:

aql> INSERT INTO test.myset (PK, foo, bar) VALUES ('key1',true,MAP('{"a":true,"b": [1, 2, true]}'))
OK, 1 record affected.

aql> select * from test.myset;
+--------+------+-------------------------------------+
| PK     | foo  | bar                                 |
+--------+------+-------------------------------------+
| "key1" | true | MAP('{"a":true, "b":[1, 2, true]}') |
+--------+------+-------------------------------------+
1 row in set (0.014 secs)

OK

Copy link
Member

@sunilvirus sunilvirus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good. Long back the server was not supporting boolean values and that support was added later. Looks like we did not update our aql to catchup with that and hence the problem.

@a-spiker a-spiker merged commit 92314db into main Sep 17, 2024
4 checks passed
@a-spiker a-spiker deleted the tools-2962 branch September 17, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants