mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
Fix reading from SQLite
This commit is contained in:
parent
b17417f39c
commit
8242cb63ce
@ -44,10 +44,17 @@ Block SQLiteBlockInputStream::readImpl()
|
||||
{
|
||||
int status = sqlite3_step(compiled_statement.get());
|
||||
|
||||
Poco::Logger * log = &(Poco::Logger::get("SQLiteBlockInputStream"));
|
||||
|
||||
LOG_INFO(log, "Trying to do something here, num = {}, status = {}", num_rows, status);
|
||||
|
||||
if (status == SQLITE_BUSY)
|
||||
continue;
|
||||
else if (status == SQLITE_DONE)
|
||||
{
|
||||
compiled_statement.reset();
|
||||
break;
|
||||
}
|
||||
else if (status != SQLITE_ROW)
|
||||
throw Exception(status, sqlite3_errstr(status), sqlite3_errmsg(connection.get()));
|
||||
|
||||
@ -59,8 +66,6 @@ Block SQLiteBlockInputStream::readImpl()
|
||||
|
||||
int column_type = sqlite3_column_type(compiled_statement.get(), idx);
|
||||
|
||||
Poco::Logger * log = &(Poco::Logger::get("SQLiteBlockInputStream"));
|
||||
|
||||
switch (column_type)
|
||||
{
|
||||
case SQLITE_INTEGER:
|
||||
@ -84,9 +89,9 @@ Block SQLiteBlockInputStream::readImpl()
|
||||
sample.type->getName(),
|
||||
len,
|
||||
(data ? data : "NO"));
|
||||
// if (!data) {
|
||||
// (*columns[idx]).insertFrom(*sample.column, 0); break;
|
||||
// }
|
||||
if (!data) {
|
||||
(*columns[idx]).insertFrom(*sample.column, 0); break;
|
||||
}
|
||||
assert_cast<ColumnString &>(*columns[idx]).insertData(data, len);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user