Pass test for Database.tableExists() and temporary table

This commit is contained in:
Gwendal Roué committed 2016-09-07 13:33:31 +02:00
1 parent 0620fc9f17
commit 8a89be6999
2 files changed
+8 -1

No files matched your search

+7
View File
@@ -1,6 +1,13 @@
Release Notes
=============
## Next Version
**Fixed**
- `Database.tableExists()` learned about temporary tables
## 0.79.4
Released August 17, 2016
+1 -1
View File
@@ -795,7 +795,7 @@ extension Database {
// SQlite identifiers are case-insensitive, case-preserving (http://www.alberton.info/dbms_identifiers_and_case_sensitivity.html)
return Row.fetchOne(self,
"SELECT sql FROM sqlite_master WHERE type = 'table' AND LOWER(name) = ?",
"SELECT * FROM (SELECT sql, type, name FROM sqlite_master UNION SELECT sql, type, name FROM sqlite_temp_master) WHERE type = 'table' AND LOWER(name) = ?",
arguments: [tableName.lowercaseString]) != nil
}