Skip to content

Commit

Permalink
We don't really care about useless LEFT JOINs
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Jun 29, 2019
1 parent 3e4c6fd commit 2b401fe
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions Tests/GRDBTests/AssociationPrefetchingSQLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,9 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
_ = try Row.fetchAll(db, request)

let selectQueries = sqlQueries.filter { $0.contains("SELECT") }
#warning("TODO: remove the harmless but useless LEFT JOIN in the first query")
// LEFT JOIN in the first query are useless but harmless.
// And SQLite may well optimize them out.
// So don't bother removing them.
XCTAssertEqual(selectQueries, [
"""
SELECT "b".* \
Expand Down Expand Up @@ -1293,7 +1295,9 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
_ = try Row.fetchAll(db, request)

let selectQueries = sqlQueries.filter { $0.contains("SELECT") }
#warning("TODO: remove the harmless but useless LEFT JOIN in the first query")
// LEFT JOIN in the first query are useless but harmless.
// And SQLite may well optimize them out.
// So don't bother removing them.
XCTAssertEqual(selectQueries, [
"""
SELECT "b".* \
Expand Down Expand Up @@ -1352,7 +1356,9 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
_ = try Row.fetchAll(db, request)

let selectQueries = sqlQueries.filter { $0.contains("SELECT") }
#warning("TODO: remove the harmless but useless LEFT JOIN in the first query")
// LEFT JOIN in the first query are useless but harmless.
// And SQLite may well optimize them out.
// So don't bother removing them.
XCTAssertEqual(selectQueries, [
"""
SELECT "a".* \
Expand Down Expand Up @@ -1405,7 +1411,9 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
_ = try Row.fetchAll(db, request)

let selectQueries = sqlQueries.filter { $0.contains("SELECT") }
#warning("TODO: remove the harmless but useless LEFT JOIN in the first query")
// LEFT JOIN in the first query are useless but harmless.
// And SQLite may well optimize them out.
// So don't bother removing them.
XCTAssertEqual(selectQueries, [
"""
SELECT "a".* \
Expand Down Expand Up @@ -1466,7 +1474,9 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
_ = try Row.fetchAll(db, request)

let selectQueries = sqlQueries.filter { $0.contains("SELECT") }
#warning("TODO: remove the harmless but useless LEFT JOIN in the first query")
// LEFT JOIN in the first query are useless but harmless.
// And SQLite may well optimize them out.
// So don't bother removing them.
XCTAssertEqual(selectQueries, [
"""
SELECT "d".* \
Expand Down Expand Up @@ -1505,7 +1515,9 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
_ = try Row.fetchAll(db, request)

let selectQueries = sqlQueries.filter { $0.contains("SELECT") }
#warning("TODO: remove the harmless but useless LEFT JOIN in the first query")
// LEFT JOIN in the first query are useless but harmless.
// And SQLite may well optimize them out.
// So don't bother removing them.
XCTAssertEqual(selectQueries, [
"""
SELECT "d".* \
Expand Down

0 comments on commit 2b401fe

Please sign in to comment.