diff --git a/data/db/boolean.db b/data/db/boolean.db new file mode 100644 index 0000000..4c6231a Binary files /dev/null and b/data/db/boolean.db differ diff --git a/src/sqlite_utils.cpp b/src/sqlite_utils.cpp index 5eaa9d3..58e1269 100644 --- a/src/sqlite_utils.cpp +++ b/src/sqlite_utils.cpp @@ -63,6 +63,12 @@ LogicalType SQLiteUtils::TypeToLogicalType(const string &sqlite_type) { if (StringUtil::Contains(sqlite_type, "int")) { return LogicalType::BIGINT; } + + // boolean + if (StringUtil::Contains(sqlite_type, "bool")) { + return LogicalType::BIGINT; + } + // If the declared type of the column contains any of the strings "CHAR", // "CLOB", or "TEXT" then that column has TEXT affinity. Notice that the type // VARCHAR contains the string "CHAR" and is thus assigned TEXT affinity. @@ -89,7 +95,6 @@ LogicalType SQLiteUtils::TypeToLogicalType(const string &sqlite_type) { // classes. // ... // we add some more extra rules to try to be somewhat sane - if (sqlite_type == "date") { return LogicalType::DATE; } diff --git a/test/sql/storage/issue53.test b/test/sql/storage/issue53.test new file mode 100644 index 0000000..0bf122c --- /dev/null +++ b/test/sql/storage/issue53.test @@ -0,0 +1,20 @@ +# name: test/sql/storage/issue53.test +# description: Test issue #53 - BOOLEAN data type is not supported +# group: [sqlite_scanner] + +require sqlite_scanner + +statement ok +ATTACH 'data/db/boolean.db' AS sqlite (TYPE SQLITE) + +query I +SELECT name, type FROM pragma_table_info('sqlite.entry') +---- +id BIGINT +is_active BIGINT + +query II +SELECT * FROM sqlite.entry +---- +44 0 +55 0