Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support alias to accessor such as _key
- Loading branch information
Showing
5 changed files
with
234 additions
and
63 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
33 changes: 33 additions & 0 deletions
33
test/command/suite/select/filter/alias/accessor_full.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,33 @@ | ||
| config_set alias.column Aliases.real_name | ||
| [[0,0.0,0.0],true] | ||
| table_create Aliases TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Aliases real_name COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Memos TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga"} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Memos --filter 'caption == "Groonga"' | ||
| [ | ||
| [ | ||
| [ | ||
| -63, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| "Syntax error: <caption| |== \"Groonga\">: [expr][parse] unknown identifier: <caption>" | ||
| ] | ||
| ] | ||
| #|e| [expr][parse] unknown identifier: <caption> | ||
| #|e| Syntax error: <caption| |== "Groonga">: Syntax error: <caption| |== "Groonga">: [expr][parse] unknown identifier: <caption> | ||
| load --table Aliases | ||
| [ | ||
| {"_key": "Memos.caption", "real_name": "Memos._key"} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Memos --filter 'caption == "Groonga"' | ||
| [[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"Groonga"]]]] |
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,20 @@ | ||
| config_set alias.column Aliases.real_name | ||
|
|
||
| table_create Aliases TABLE_HASH_KEY ShortText | ||
| column_create Aliases real_name COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Memos TABLE_HASH_KEY ShortText | ||
|
|
||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga"} | ||
| ] | ||
|
|
||
| select Memos --filter 'caption == "Groonga"' | ||
|
|
||
| load --table Aliases | ||
| [ | ||
| {"_key": "Memos.caption", "real_name": "Memos._key"} | ||
| ] | ||
|
|
||
| select Memos --filter 'caption == "Groonga"' |
33 changes: 33 additions & 0 deletions
33
test/command/suite/select/filter/alias/accessor_local.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,33 @@ | ||
| config_set alias.column Aliases.real_name | ||
| [[0,0.0,0.0],true] | ||
| table_create Aliases TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Aliases real_name COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Memos TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga"} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Memos --filter 'caption == "Groonga"' | ||
| [ | ||
| [ | ||
| [ | ||
| -63, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| "Syntax error: <caption| |== \"Groonga\">: [expr][parse] unknown identifier: <caption>" | ||
| ] | ||
| ] | ||
| #|e| [expr][parse] unknown identifier: <caption> | ||
| #|e| Syntax error: <caption| |== "Groonga">: Syntax error: <caption| |== "Groonga">: [expr][parse] unknown identifier: <caption> | ||
| load --table Aliases | ||
| [ | ||
| {"_key": "Memos.caption", "real_name": "_key"} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Memos --filter 'caption == "Groonga"' | ||
| [[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"Groonga"]]]] |
20 changes: 20 additions & 0 deletions
20
test/command/suite/select/filter/alias/accessor_local.test
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,20 @@ | ||
| config_set alias.column Aliases.real_name | ||
|
|
||
| table_create Aliases TABLE_HASH_KEY ShortText | ||
| column_create Aliases real_name COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Memos TABLE_HASH_KEY ShortText | ||
|
|
||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga"} | ||
| ] | ||
|
|
||
| select Memos --filter 'caption == "Groonga"' | ||
|
|
||
| load --table Aliases | ||
| [ | ||
| {"_key": "Memos.caption", "real_name": "_key"} | ||
| ] | ||
|
|
||
| select Memos --filter 'caption == "Groonga"' |