Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ module.exports = function(chai, util) {

function fullscan(records, tables, every) {
const re = new RegExp(
`^SCAN TABLE (${(tables || []).join('|') || '\\w+'})`
`^SCAN(?: TABLE)? (${(tables || []).join('|') || '\\w+'})`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SCAN {テーブル名}でもSCAN TABLE{テーブル名}でも検知するようにしました。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

理由

SCAN TABLE {テーブル名}ではなく、SCAN {テーブル名}のフォーマットで出力されます。

EXPLAIN QUERY PLANの結果

不正解時

id parent notused detail
2 0 0 SCAN sports

正解時

id parent notused detail
3 0 0 SEARCH sports USING INDEX sports_name_idx (name=?)

確認可能なコンテンツ

スポーツ検索システムのデータベース構築をせよ SQL編 で確認可能です。
TCM
https://new.tracks.dev/app/01GGP9MCKKDADZ4HQATZG3FXM3/materials?statuses=2&shipStatuses=shipped&keyword=sql-design-sport&selectedId=2-4990

Copy link
Contributor Author

Choose a reason for hiding this comment

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

備考

SCAN {テーブル名}になる原因も調査してみましたが、別名テーブルサブクエリを使用しているとなるようです。
しかし、そのような箇所はないはずなので、原因としては不明なままです。

);
return records[every ? 'every' : 'some'](record => re.test(record.detail));
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "track-db-test-library",
"version": "2.6.0-rc6",
"version": "2.6.0-rc7",
"description": "Test utility for Track database challenges",
"main": "index.js",
"scripts": {
Expand Down
Loading