mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
Add support for long long int/BIGINT as a column type
This commit is contained in:
parent
eef4d31a93
commit
7876d56219
@ -61,6 +61,7 @@ const std::string
|
||||
"{{col.name}} \
|
||||
{% if col.type == "std::string" %}VARCHAR{% endif %}\
|
||||
{% if col.type == "int" %}INTEGER{% endif %}\
|
||||
{% if col.type == "long long int" %}BIGINT{% endif %}\
|
||||
{% if not loop.last %}, {% endif %}"
|
||||
{% endfor %}\
|
||||
")";
|
||||
@ -109,6 +110,12 @@ int {{table_name_cc}}Column(
|
||||
ctx,
|
||||
(int)pVtab->pContent->{{col.name}}[pCur->row]
|
||||
);
|
||||
{% endif %}\
|
||||
{% if col.type == "long long int" %}\
|
||||
sqlite3_result_int64(
|
||||
ctx,
|
||||
(long long int)pVtab->pContent->{{col.name}}[pCur->row]
|
||||
);
|
||||
{% endif %}\
|
||||
break;
|
||||
{% endfor %}\
|
||||
@ -151,6 +158,15 @@ int {{table_name_cc}}Filter(
|
||||
pVtab->pContent->{{col.name}}.push_back(-1);
|
||||
}
|
||||
{% endif %}\
|
||||
{% if col.type == "long long int" %}\
|
||||
try {
|
||||
pVtab->pContent->{{col.name}}\
|
||||
.push_back(boost::lexical_cast<long long>(row["{{col.name}}"]));
|
||||
} catch (const boost::bad_lexical_cast& e) {
|
||||
LOG(WARNING) << "Error casting " << row["{{col.name}}"] << " to long long int";
|
||||
pVtab->pContent->{{col.name}}.push_back(-1);
|
||||
}
|
||||
{% endif %}\
|
||||
{% endfor %}\
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user