Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
query-log show-condition: (maybe) fix a crash bug
We need to check scan_info that doesn't have corresponding expr_code.
- Loading branch information
Showing
3 changed files
with
141 additions
and
3 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
91 changes: 91 additions & 0 deletions
91
test/command/suite/select/function/sub_filter/and_or.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,91 @@ | ||
| table_create Files TABLE_PAT_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Files revision COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Packages TABLE_PAT_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Packages files COLUMN_VECTOR Files | ||
| [[0,0.0,0.0],true] | ||
| column_create Files packages_files_index COLUMN_INDEX Packages files | ||
| [[0,0.0,0.0],true] | ||
| table_create Revisions TABLE_PAT_KEY UInt32 | ||
| [[0,0.0,0.0],true] | ||
| column_create Revisions files_revision_index COLUMN_INDEX Files revision | ||
| [[0,0.0,0.0],true] | ||
| table_create Names TABLE_PAT_KEY ShortText --default_tokenizer TokenBigramSplitSymbolAlpha | ||
| [[0,0.0,0.0],true] | ||
| column_create Names packages_key_index COLUMN_INDEX|WITH_POSITION Packages _key | ||
| [[0,0.0,0.0],true] | ||
| load --table Files | ||
| [ | ||
| {"_key": "include/groonga.h", "revision": 100}, | ||
| {"_key": "src/groonga.c", "revision": 29}, | ||
| {"_key": "lib/groonga.rb", "revision": 12}, | ||
| {"_key": "README.textile", "revision": 24}, | ||
| {"_key": "ha_mroonga.cc", "revision": 40}, | ||
| {"_key": "ha_mroonga.hpp", "revision": 6} | ||
| ] | ||
| [[0,0.0,0.0],6] | ||
| load --table Packages | ||
| [ | ||
| {"_key": "groonga", "files": ["include/groonga.h", "src/groonga.c"]}, | ||
| {"_key": "rroonga", "files": ["lib/groonga.rb", "README.textile"]}, | ||
| {"_key": "mroonga", "files": ["ha_mroonga.cc", "ha_mroonga.hpp"]} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| select Packages --filter 'sub_filter(files, "revision >= 10 && (_key @^ \\\"ha\\\" || _key @^ \\\"include/\\\")") && (_key == "groonga" || _key == "rroonga")' --output_columns '_key, _score, files, files.revision' | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_score", | ||
| "Int32" | ||
| ], | ||
| [ | ||
| "files", | ||
| "Files" | ||
| ], | ||
| [ | ||
| "files.revision", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| "groonga", | ||
| 3, | ||
| [ | ||
| "include/groonga.h", | ||
| "src/groonga.c" | ||
| ], | ||
| [ | ||
| 100, | ||
| 29 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| #>select --filter "sub_filter(files, \"revision >= 10 && (_key @^ \\\"ha\\\" || _key @^ \\\"include/\\\")\") && (_key == \"groonga\" || _key == \"rroonga\")" --output_columns "_key, _score, files, files.revision" --table "Packages" | ||
| #:000000000000000 filter(1): #<accessor _key(Packages)> equal "groonga" | ||
| #:000000000000000 filter(2): #<accessor _key(Packages)> equal "rroonga" | ||
| #:000000000000000 filter(0): #<accessor _key(Files)> "ha" prefix | ||
| #:000000000000000 filter(1): #<accessor _key(Files)> "include/" prefix | ||
| #:000000000000000 filter(1): Files.revision greater_equal 10 | ||
| #:000000000000000 filter(1): nop: and | ||
| #:000000000000000 filter(1): sub_filter(Packages.files, "revision >= 10 && (_key @^ \"ha\" || _key @^ \"include/\")") | ||
| #:000000000000000 select(1) | ||
| #:000000000000000 output(1) | ||
| #<000000000000000 rc=0 |
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,41 @@ | ||
| table_create Files TABLE_PAT_KEY ShortText | ||
| column_create Files revision COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Packages TABLE_PAT_KEY ShortText | ||
| column_create Packages files COLUMN_VECTOR Files | ||
|
|
||
| column_create Files packages_files_index COLUMN_INDEX Packages files | ||
|
|
||
| table_create Revisions TABLE_PAT_KEY UInt32 | ||
| column_create Revisions files_revision_index COLUMN_INDEX Files revision | ||
|
|
||
| table_create Names TABLE_PAT_KEY ShortText \ | ||
| --default_tokenizer TokenBigramSplitSymbolAlpha | ||
| column_create Names packages_key_index COLUMN_INDEX|WITH_POSITION Packages _key | ||
|
|
||
| load --table Files | ||
| [ | ||
| {"_key": "include/groonga.h", "revision": 100}, | ||
| {"_key": "src/groonga.c", "revision": 29}, | ||
| {"_key": "lib/groonga.rb", "revision": 12}, | ||
| {"_key": "README.textile", "revision": 24}, | ||
| {"_key": "ha_mroonga.cc", "revision": 40}, | ||
| {"_key": "ha_mroonga.hpp", "revision": 6} | ||
| ] | ||
|
|
||
| load --table Packages | ||
| [ | ||
| {"_key": "groonga", "files": ["include/groonga.h", "src/groonga.c"]}, | ||
| {"_key": "rroonga", "files": ["lib/groonga.rb", "README.textile"]}, | ||
| {"_key": "mroonga", "files": ["ha_mroonga.cc", "ha_mroonga.hpp"]} | ||
| ] | ||
|
|
||
| #$GRN_QUERY_LOG_SHOW_CONDITION=yes | ||
| #@collect-query-log true | ||
| select Packages \ | ||
| --filter 'sub_filter(files, \ | ||
| "revision >= 10 && \ | ||
| (_key @^ \\\"ha\\\" || _key @^ \\\"include/\\\")") && \ | ||
| (_key == "groonga" || _key == "rroonga")' \ | ||
| --output_columns '_key, _score, files, files.revision' | ||
| #@collect-query-log false |