Skip to content

Commit 2367654

Browse files
authored
Merge pull request rails#42641 from jhawthorn/sqlite3_explain_fix
Fix explain test on sqlite 3.36.0
2 parents 8be6e7a + fb3c5a1 commit 2367654

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)