Skip to content

Commit fb3c5a1

Browse files
jhawthornDinah Shi
andcommitted
Fix explain test on sqlite 3.36.0
Explain output changed in 3.36.0 https://www.sqlite.org/releaselog/3_36_0.html Co-authored-by: Dinah Shi <[email protected]>
1 parent 8be6e7a commit fb3c5a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

activerecord/test/cases/adapters/sqlite3/explain_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ class SQLite3ExplainTest < ActiveRecord::SQLite3TestCase
1010
def test_explain_for_one_query
1111
explain = Author.where(id: 1).explain
1212
assert_match %r(EXPLAIN for: SELECT "authors"\.\* FROM "authors" WHERE "authors"\."id" = (?:\? \[\["id", 1\]\]|1)), explain
13-
assert_match(/(SEARCH )?TABLE authors USING (INTEGER )?PRIMARY KEY/, explain)
13+
assert_match(/(SEARCH )?(TABLE )?authors USING (INTEGER )?PRIMARY KEY/, explain)
1414
end
1515

1616
def test_explain_with_eager_loading
1717
explain = Author.where(id: 1).includes(:posts).explain
1818
assert_match %r(EXPLAIN for: SELECT "authors"\.\* FROM "authors" WHERE "authors"\."id" = (?:\? \[\["id", 1\]\]|1)), explain
19-
assert_match(/(SEARCH )?TABLE authors USING (INTEGER )?PRIMARY KEY/, explain)
19+
assert_match(/(SEARCH )?(TABLE )?authors USING (INTEGER )?PRIMARY KEY/, explain)
2020
assert_match %r(EXPLAIN for: SELECT "posts"\.\* FROM "posts" WHERE "posts"\."author_id" = (?:\? \[\["author_id", 1\]\]|1)), explain
21-
assert_match(/(SCAN )?TABLE posts/, explain)
21+
assert_match(/(SEARCH |(SCAN )?(TABLE ))posts/, explain)
2222
end
2323
end

0 commit comments

Comments
 (0)