Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --query_flags option to select command
By this change, GRN_EXPR_ALLOW_UPDATE can be enabled in query syntax by `select --query_flags ALLOW_COLUMN|ALLOW_UPDATE ...`.
- Loading branch information
Showing
5 changed files
with
200 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
test/function/suite/select/query_flags/allow_update.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| table_create Users TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Users age COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| load --table Users | ||
| [ | ||
| {"_key": "alice", "age": 18}, | ||
| {"_key": "bob", "age": 20} | ||
| ] | ||
| [[0,0.0,0.0],2] | ||
| select Users --query "age:=19" --query_flags "ALLOW_COLUMN|ALLOW_UPDATE" | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 2 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "age", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| 1, | ||
| "alice", | ||
| 19 | ||
| ], | ||
| [ | ||
| 2, | ||
| "bob", | ||
| 19 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| select Users | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 2 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "age", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| 1, | ||
| "alice", | ||
| 19 | ||
| ], | ||
| [ | ||
| 2, | ||
| "bob", | ||
| 19 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| table_create Users TABLE_HASH_KEY ShortText | ||
| column_create Users age COLUMN_SCALAR UInt32 | ||
|
|
||
| load --table Users | ||
| [ | ||
| {"_key": "alice", "age": 18}, | ||
| {"_key": "bob", "age": 20} | ||
| ] | ||
|
|
||
| select Users \ | ||
| --query "age:=19" \ | ||
| --query_flags "ALLOW_COLUMN|ALLOW_UPDATE" | ||
|
|
||
| select Users |