Skip to content

Invalid SQL statements with Xcode 10.2 #888

Closed
@tanzolone

Description

@tanzolone

Build Information

  • SQLite iOS Version 0.11.4 (however it's likely to impact all the targets)
  • Xcode 10.2 beta 4
  • manual integration in our project

General guidelines

In Xcode 10.2 beta 4 the macro#functionshows a different behaviour. As SQLite.swift relies on #function in different subroutines for the composition of SQLite queries, several bugs linked to invalid SQLite statements seem to be introduced.

I have just run the SQLite.swift tests with Xcode 10.2 beta 4 and there are several failures linked to this issue.

An example as follows:

In the following helper function (Helpers.swift line 107):

func wrap<T>(_ expression: Expressible, function: String = #function) -> Expression<T> {
    return function.wrap(expression)
}

when called from

static func count(_ star: Star) -> Expression<UnderlyingType>

the value of function when running in Xcode 10.2 beta 4 is count(_:) instead of count. This leads to invalid SQLite statements of the type SELECT count(_:)(*) myTable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions