mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
fix warnings, update baselines, handle rotation
This commit is contained in:
parent
747ba68030
commit
6392acecd2
7 changed files with 83 additions and 52 deletions
|
@ -150,7 +150,7 @@ bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields,
|
|||
string create = "CREATE TABLE IF NOT EXISTS "+dbname+" (\n";
|
||||
//"id SERIAL UNIQUE NOT NULL"; // SQLite has rowids, we do not need a counter here.
|
||||
|
||||
for ( int i = 0; i < num_fields; ++i )
|
||||
for ( unsigned int i = 0; i < num_fields; ++i )
|
||||
{
|
||||
const Field* field = fields[i];
|
||||
|
||||
|
@ -195,7 +195,7 @@ bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields,
|
|||
string insert = "VALUES (";
|
||||
string names = "INSERT INTO "+dbname+" ( ";
|
||||
|
||||
for ( int i = 0; i < num_fields; i++ )
|
||||
for ( unsigned int i = 0; i < num_fields; i++ )
|
||||
{
|
||||
bool ac = true;
|
||||
|
||||
|
@ -252,7 +252,7 @@ int SQLite::AddParams(Value* val, int pos)
|
|||
|
||||
switch ( val->type ) {
|
||||
case TYPE_BOOL:
|
||||
return sqlite3_bind_int(st, pos, val->val.int_val ? 1 : 0 );
|
||||
return sqlite3_bind_int(st, pos, val->val.int_val != 0 ? 1 : 0 );
|
||||
|
||||
case TYPE_INT:
|
||||
return sqlite3_bind_int(st, pos, val->val.int_val);
|
||||
|
@ -377,4 +377,16 @@ bool SQLite::DoWrite(int num_fields, const Field* const * fields, Value** vals)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool SQLite::DoRotate(const char* rotated_path, double open, double close, bool terminating)
|
||||
{
|
||||
if ( ! FinishedRotation("/dev/null", Info().path, open, close, terminating))
|
||||
{
|
||||
Error(Fmt("error rotating %s", Info().path));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* USE_SQLITE */
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ protected:
|
|||
threading::Value** vals);
|
||||
virtual bool DoSetBuf(bool enabled) { return true; }
|
||||
virtual bool DoRotate(const char* rotated_path, double open,
|
||||
double close, bool terminating) { return true; }
|
||||
double close, bool terminating);
|
||||
virtual bool DoFlush(double network_time) { return true; }
|
||||
virtual bool DoFinish(double network_time) { return true; }
|
||||
virtual bool DoHeartbeat(double network_time, double current_time) { return true; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue