Commit b58e2dd0 authored by Pavel Vainerman's avatar Pavel Vainerman

(SQLiteInterface): исправил ошибку обработку "пустых" ответов.

parent e7297ea8
...@@ -252,7 +252,14 @@ SQLiteResult::SQLiteResult( sqlite3_stmt* s, bool finalize ) ...@@ -252,7 +252,14 @@ SQLiteResult::SQLiteResult( sqlite3_stmt* s, bool finalize )
do do
{ {
int n = sqlite3_data_count(s); int n = sqlite3_data_count(s);
COL c; if( n<=0 )
{
if( finalize )
sqlite3_finalize(s);
return;
}
COL c;
for( unsigned int i=0; i<n; i++ ) for( unsigned int i=0; i<n; i++ )
{ {
......
...@@ -157,7 +157,7 @@ int num_cols( SQLiteResult::iterator& ); ...@@ -157,7 +157,7 @@ int num_cols( SQLiteResult::iterator& );
// ROW // ROW
int as_int( SQLiteResult::iterator&, int col ); int as_int( SQLiteResult::iterator&, int col );
double as_double( SQLiteResult::iterator&, int col ); double as_double( SQLiteResult::iterator&, int col );
std::string as_text( SQLiteResult::iterator&, int col ); std::string as_string( SQLiteResult::iterator&, int col );
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// COL // COL
int as_int( SQLiteResult::COL::iterator& ); int as_int( SQLiteResult::COL::iterator& );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment