mirror of
https://github.com/tstack/lnav.git
synced 2024-09-11 13:05:51 +03:00
[coverity] some more fixes
This commit is contained in:
parent
97f12cf4aa
commit
2610a8eac4
@ -51,13 +51,13 @@ snippet::from_content_with_offset(intern_string_t src,
|
||||
size_t offset,
|
||||
const std::string& errmsg)
|
||||
{
|
||||
auto content_sf = string_fragment::from_str(content.get_string());
|
||||
auto line_with_error = content_sf.find_boundaries_around(
|
||||
const auto content_sf = string_fragment::from_str(content.get_string());
|
||||
const auto line_with_error = content_sf.find_boundaries_around(
|
||||
offset, string_fragment::tag1{'\n'});
|
||||
auto line_with_context = content_sf.find_boundaries_around(
|
||||
const auto line_with_context = content_sf.find_boundaries_around(
|
||||
offset, string_fragment::tag1{'\n'}, 3);
|
||||
auto line_number = content_sf.sub_range(0, offset).count('\n');
|
||||
auto erroff_in_line = offset - line_with_error.sf_begin;
|
||||
const auto line_number = content_sf.sub_range(0, offset).count('\n');
|
||||
const auto erroff_in_line = offset - line_with_error.sf_begin;
|
||||
|
||||
attr_line_t pointer;
|
||||
|
||||
|
@ -94,6 +94,13 @@ struct user_message {
|
||||
|
||||
static user_message ok(const attr_line_t& al);
|
||||
|
||||
user_message() = default;
|
||||
user_message(user_message&&) = default;
|
||||
user_message(const user_message&) = default;
|
||||
|
||||
user_message& operator=(user_message&&) = default;
|
||||
user_message& operator=(const user_message&) = default;
|
||||
|
||||
user_message& with_reason(const attr_line_t& al)
|
||||
{
|
||||
this->um_reason = al;
|
||||
|
@ -65,7 +65,7 @@ connect(const char* hostname, const char* servname)
|
||||
return Err(fmt::format(FMT_STRING("unable to connect to {}:{} -- {}"),
|
||||
hostname,
|
||||
servname,
|
||||
strerror(rc)));
|
||||
strerror(errno)));
|
||||
}
|
||||
|
||||
return Ok(std::move(retval));
|
||||
|
@ -156,7 +156,7 @@ safe_read(const std::string& str, std::string::size_type index)
|
||||
}
|
||||
|
||||
void
|
||||
regex_highlighter(attr_line_t& al, int x, line_range sub)
|
||||
regex_highlighter(attr_line_t& al, std::optional<int> x, line_range sub)
|
||||
{
|
||||
static const char* brackets[] = {
|
||||
"[]",
|
||||
@ -336,7 +336,8 @@ regex_highlighter(attr_line_t& al, int x, line_range sub)
|
||||
}
|
||||
|
||||
for (int lpc = 0; brackets[lpc]; lpc++) {
|
||||
find_matching_bracket(al, x, sub, brackets[lpc][0], brackets[lpc][1]);
|
||||
find_matching_bracket(
|
||||
al, x.value_or(0), sub, brackets[lpc][0], brackets[lpc][1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
namespace lnav {
|
||||
namespace snippets {
|
||||
|
||||
void regex_highlighter(attr_line_t& al, int x, line_range sub);
|
||||
void regex_highlighter(attr_line_t& al, std::optional<int> x, line_range sub);
|
||||
|
||||
} // namespace snippets
|
||||
} // namespace lnav
|
||||
|
@ -385,7 +385,7 @@ field_overlay_source::build_field_lines(const listview_curses& lv,
|
||||
al.append(jget_str.in());
|
||||
hl_range.lr_end = al.get_string().length();
|
||||
}
|
||||
readline_sqlite_highlighter_int(al, -1, hl_range);
|
||||
readline_sqlite_highlighter_int(al, std::nullopt, hl_range);
|
||||
|
||||
al.append(" = ").append(scrub_ws(value_str.c_str()));
|
||||
|
||||
@ -420,7 +420,7 @@ field_overlay_source::build_field_lines(const listview_curses& lv,
|
||||
auto key_line = attr_line_t(" jget(log_raw_text, ")
|
||||
.append(qname.in())
|
||||
.append(")");
|
||||
readline_sqlite_highlighter(key_line, 0);
|
||||
readline_sqlite_highlighter(key_line, std::nullopt);
|
||||
auto key_size = key_line.length();
|
||||
key_line.append(" = ").append(scrub_ws(extra_pair.second));
|
||||
this->fos_lines.emplace_back(key_line);
|
||||
@ -433,7 +433,7 @@ field_overlay_source::build_field_lines(const listview_curses& lv,
|
||||
for (size_t lpc = 0; lpc < jpairs.size(); lpc++) {
|
||||
auto key_line = attr_line_t(" ").append(
|
||||
this->fos_log_helper.format_json_getter(jpairs_map.first, lpc));
|
||||
readline_sqlite_highlighter(key_line, 0);
|
||||
readline_sqlite_highlighter(key_line, std::nullopt);
|
||||
auto key_size = key_line.length();
|
||||
key_line.append(" = ").append(scrub_ws(jpairs[lpc].wt_value));
|
||||
this->fos_lines.emplace_back(key_line);
|
||||
@ -453,7 +453,7 @@ field_overlay_source::build_field_lines(const listview_curses& lv,
|
||||
this->fos_log_helper.ldh_file->get_format()->get_name().c_str(),
|
||||
qname.in());
|
||||
auto key_line = attr_line_t(" ").append(xp_call.in());
|
||||
readline_sqlite_highlighter(key_line, 0);
|
||||
readline_sqlite_highlighter(key_line, std::nullopt);
|
||||
auto key_size = key_line.length();
|
||||
key_line.append(" = ").append(scrub_ws(xml_pair.second));
|
||||
this->fos_lines.emplace_back(key_line);
|
||||
|
@ -42,7 +42,8 @@
|
||||
|
||||
using namespace lnav::roles::literals;
|
||||
|
||||
filter_sub_source::filter_sub_source(std::shared_ptr<readline_curses> editor)
|
||||
filter_sub_source::
|
||||
filter_sub_source(std::shared_ptr<readline_curses> editor)
|
||||
: fss_editor(editor)
|
||||
{
|
||||
this->fss_editor->set_x(25);
|
||||
@ -377,10 +378,10 @@ filter_sub_source::text_value_for_line(textview_curses& tc,
|
||||
attr_line_t content{tf->get_id()};
|
||||
switch (tf->get_lang()) {
|
||||
case filter_lang_t::REGEX:
|
||||
readline_regex_highlighter(content, content.length());
|
||||
readline_regex_highlighter(content, std::nullopt);
|
||||
break;
|
||||
case filter_lang_t::SQL:
|
||||
readline_sqlite_highlighter(content, content.length());
|
||||
readline_sqlite_highlighter(content, std::nullopt);
|
||||
break;
|
||||
case filter_lang_t::NONE:
|
||||
break;
|
||||
|
@ -593,7 +593,7 @@ format_example_text_for_term(const help_text& ht,
|
||||
case help_context_t::HC_SQL_TABLE_VALUED_FUNCTION:
|
||||
case help_context_t::HC_PRQL_TRANSFORM:
|
||||
case help_context_t::HC_PRQL_FUNCTION:
|
||||
readline_sqlite_highlighter(ex_line, 0);
|
||||
readline_sqlite_highlighter(ex_line, std::nullopt);
|
||||
prompt = ";";
|
||||
break;
|
||||
default:
|
||||
|
@ -1423,7 +1423,7 @@ line_buffer::enable_cache()
|
||||
auto guard = lnav::filesystem::file_lock::guard(&fl);
|
||||
|
||||
if (std::filesystem::exists(cached_done_path)) {
|
||||
log_info("%d:using existing cache file");
|
||||
log_info("%d:using existing cache file", this->lb_fd.get());
|
||||
auto open_res = lnav::filesystem::open_file(cached_file_path, O_RDWR);
|
||||
if (open_res.isOk()) {
|
||||
this->lb_cached_fd = open_res.unwrap();
|
||||
@ -1444,7 +1444,7 @@ line_buffer::enable_cache()
|
||||
auto write_fd = create_res.unwrap();
|
||||
auto done = false;
|
||||
|
||||
static const ssize_t FILL_LENGTH = 1024 * 1024;
|
||||
static constexpr ssize_t FILL_LENGTH = 1024 * 1024;
|
||||
auto off = file_off_t{0};
|
||||
while (!done) {
|
||||
log_debug("%d: caching file content at %d", this->lb_fd.get(), off);
|
||||
|
@ -101,7 +101,7 @@ struct subcmd_config_t {
|
||||
| lnav::itertools::fold(
|
||||
subcmd_reducer, attr_line_t{"the available operations are:"}));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t get_action(const subcmd_config_t&)
|
||||
@ -109,7 +109,7 @@ struct subcmd_config_t {
|
||||
auto config_str = dump_config();
|
||||
auto um = console::user_message::raw(config_str);
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t blame_action(const subcmd_config_t&)
|
||||
@ -125,7 +125,7 @@ struct subcmd_config_t {
|
||||
|
||||
auto um = console::user_message::raw(blame.rtrim());
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t file_options_action(const subcmd_config_t& sc)
|
||||
@ -137,7 +137,7 @@ struct subcmd_config_t {
|
||||
auto um = lnav::console::user_message::error(
|
||||
"Expecting a file path to check for options");
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
safe::ReadAccess<lnav::safe_file_options_hier> options_hier(
|
||||
@ -150,7 +150,7 @@ struct subcmd_config_t {
|
||||
.append(lnav::roles::file(sc.sc_path)))
|
||||
.with_reason(realpath_res.unwrapErr());
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
auto full_path = realpath_res.unwrap();
|
||||
auto file_opts = options_hier->match(full_path);
|
||||
@ -176,7 +176,7 @@ struct subcmd_config_t {
|
||||
" command to set the zone for messages in files "
|
||||
"that do not include a zone in the timestamp"));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
subcmd_config_t& set_action(action_t act)
|
||||
@ -339,7 +339,7 @@ struct subcmd_format_t {
|
||||
| lnav::itertools::fold(
|
||||
subcmd_reducer, attr_line_t{"the available operations are:"}));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t default_regex_action(const subcmd_format_t& sf)
|
||||
@ -359,7 +359,7 @@ struct subcmd_format_t {
|
||||
sf.sf_regex_app->get_subcommands({})
|
||||
| lnav::itertools::fold(subcmd_reducer, attr_line_t{})));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t get_action(const subcmd_format_t& sf)
|
||||
@ -378,7 +378,7 @@ struct subcmd_format_t {
|
||||
.append(": ")
|
||||
.append(on_blank(format->lf_description, "<no description>")));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t source_action(const subcmd_format_t& sf)
|
||||
@ -401,7 +401,7 @@ struct subcmd_format_t {
|
||||
auto um = console::user_message::raw(
|
||||
format->elf_format_source_order[0].string());
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t sources_action(const subcmd_format_t& sf)
|
||||
@ -426,7 +426,7 @@ struct subcmd_format_t {
|
||||
VC_ROLE.value(role_t::VCR_TEXT),
|
||||
"\n"));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t regex101_pull_action(const subcmd_format_t& sf)
|
||||
@ -557,7 +557,7 @@ struct subcmd_format_t {
|
||||
.string())));
|
||||
}
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -590,7 +590,7 @@ struct subcmd_format_t {
|
||||
sf.sf_regex101_app->get_subcommands({})
|
||||
| lnav::itertools::fold(subcmd_reducer, attr_line_t{})));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t regex101_push_action(const subcmd_format_t& sf)
|
||||
@ -769,7 +769,7 @@ struct subcmd_piper_t {
|
||||
| lnav::itertools::fold(
|
||||
subcmd_reducer, attr_line_t{"the available operations are:"}));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t list_action(const subcmd_piper_t&)
|
||||
@ -892,7 +892,7 @@ struct subcmd_piper_t {
|
||||
.append(lnav::roles::file(
|
||||
lnav::piper::storage_path().string())))
|
||||
.with_reason(ec.message());
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
if (items.empty()) {
|
||||
@ -909,7 +909,7 @@ struct subcmd_piper_t {
|
||||
.append(" or using the ")
|
||||
.append_quoted(lnav::roles::symbol(":sh"))
|
||||
.append(" command"));
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
return {};
|
||||
@ -1049,7 +1049,7 @@ struct subcmd_regex101_t {
|
||||
| lnav::itertools::fold(
|
||||
subcmd_reducer, attr_line_t{"the available operations are:"}));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t list_action(const subcmd_regex101_t&)
|
||||
@ -1081,7 +1081,7 @@ struct subcmd_regex101_t {
|
||||
entries.add_header("the following regex101 entries were found:\n")
|
||||
.with_default("no regex101 entries found"));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t import_action(const subcmd_regex101_t& sr)
|
||||
@ -1135,7 +1135,7 @@ struct subcmd_crash_t {
|
||||
| lnav::itertools::fold(
|
||||
subcmd_reducer, attr_line_t{"the available operations are:"}));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
static perform_result_t upload_action(const subcmd_crash_t&)
|
||||
@ -1150,11 +1150,11 @@ struct subcmd_crash_t {
|
||||
auto glob_rc = glob(path.c_str(), 0, nullptr, gl.inout());
|
||||
if (glob_rc == GLOB_NOMATCH) {
|
||||
auto um = console::user_message::info("no crash logs to upload");
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
if (glob_rc != 0) {
|
||||
auto um = console::user_message::error("unable to find crash logs");
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
}
|
||||
|
||||
for (size_t lpc = 0; lpc < gl->gl_pathc; lpc++) {
|
||||
@ -1462,7 +1462,7 @@ perform(std::shared_ptr<operations> opts)
|
||||
subcmd_reducer,
|
||||
attr_line_t{"the available operations are:"}));
|
||||
|
||||
return {um};
|
||||
return {std::move(um)};
|
||||
},
|
||||
[](const subcmd_config_t& sc) { return sc.sc_action(sc); },
|
||||
[](const subcmd_format_t& sf) { return sf.sf_action(sf); },
|
||||
|
@ -1059,7 +1059,7 @@ com_mark_expr(exec_context& ec,
|
||||
const char* errmsg = sqlite3_errmsg(lnav_data.ld_db);
|
||||
auto expr_al = attr_line_t(expr).with_attr_for_all(
|
||||
VC_ROLE.value(role_t::VCR_QUOTED_CODE));
|
||||
readline_sqlite_highlighter(expr_al, -1);
|
||||
readline_sqlite_highlighter(expr_al, std::nullopt);
|
||||
auto um
|
||||
= lnav::console::user_message::error(
|
||||
attr_line_t("invalid mark expression: ").append(expr_al))
|
||||
@ -2620,7 +2620,7 @@ com_filter_expr(exec_context& ec,
|
||||
const char* errmsg = sqlite3_errmsg(lnav_data.ld_db);
|
||||
auto expr_al = attr_line_t(expr).with_attr_for_all(
|
||||
VC_ROLE.value(role_t::VCR_QUOTED_CODE));
|
||||
readline_sqlite_highlighter(expr_al, -1);
|
||||
readline_sqlite_highlighter(expr_al, std::nullopt);
|
||||
auto um = lnav::console::user_message::error(
|
||||
attr_line_t("invalid filter expression: ")
|
||||
.append(expr_al))
|
||||
|
@ -466,7 +466,7 @@ install_extra_formats()
|
||||
}
|
||||
}
|
||||
if (yajl_complete_parse(jhandle) != yajl_status_ok) {
|
||||
auto* msg = yajl_get_error(jhandle, 1, buffer, rc);
|
||||
auto* msg = yajl_get_error(jhandle, 0, nullptr, 0);
|
||||
|
||||
fprintf(stderr, "Unable to parse remote-config.json -- %s", msg);
|
||||
yajl_free_error(jhandle, msg);
|
||||
|
@ -92,7 +92,7 @@ struct expressions : public lnav_config_listener {
|
||||
.with_attr_for_all(SA_PREFORMATTED.value())
|
||||
.with_attr_for_all(
|
||||
VC_ROLE.value(role_t::VCR_QUOTED_CODE));
|
||||
readline_sqlite_highlighter(sql_al, -1);
|
||||
readline_sqlite_highlighter(sql_al, std::nullopt);
|
||||
intern_string_t cond_expr_path = intern_string::lookup(
|
||||
fmt::format(FMT_STRING("/log/annotations/{}/condition"),
|
||||
pair.first));
|
||||
|
@ -81,7 +81,7 @@ struct expressions : public lnav_config_listener {
|
||||
.with_attr_for_all(SA_PREFORMATTED.value())
|
||||
.with_attr_for_all(
|
||||
VC_ROLE.value(role_t::VCR_QUOTED_CODE));
|
||||
readline_sqlite_highlighter(sql_al, -1);
|
||||
readline_sqlite_highlighter(sql_al, std::nullopt);
|
||||
intern_string_t watch_expr_path = intern_string::lookup(
|
||||
fmt::format(FMT_STRING("/log/watch-expressions/{}/expr"),
|
||||
pair.first));
|
||||
|
@ -2995,7 +2995,7 @@ external_log_format::build(std::vector<lnav::console::user_message>& errors)
|
||||
.with_attr_for_all(SA_PREFORMATTED.value())
|
||||
.with_attr_for_all(
|
||||
VC_ROLE.value(role_t::VCR_QUOTED_CODE));
|
||||
readline_sqlite_highlighter(sql_al, -1);
|
||||
readline_sqlite_highlighter(sql_al, std::nullopt);
|
||||
intern_string_t watch_expr_path = intern_string::lookup(
|
||||
fmt::format(FMT_STRING("/{}/converter/header/expr/{}"),
|
||||
this->elf_name,
|
||||
|
@ -1892,8 +1892,6 @@ logfile_sub_source::eval_sql_filter(sqlite3_stmt* stmt,
|
||||
default:
|
||||
return Err(sqlite3_error_to_user_message(sqlite3_db_handle(stmt)));
|
||||
}
|
||||
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -159,7 +159,7 @@ format_sql_example(const char* sql_example_fmt)
|
||||
const auto* format_name = lf->get_format()->get_name().get();
|
||||
|
||||
retval.with_ansi_string(sql_example_fmt, format_name, format_name);
|
||||
readline_sqlite_highlighter(retval, 0);
|
||||
readline_sqlite_highlighter(retval, std::nullopt);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
@ -44,7 +44,8 @@
|
||||
class attr_line_t;
|
||||
struct exec_context;
|
||||
|
||||
using readline_highlighter_t = void (*)(attr_line_t& line, int x);
|
||||
using readline_highlighter_t
|
||||
= void (*)(attr_line_t& line, std::optional<int> x);
|
||||
|
||||
/**
|
||||
* Container for information related to different readline contexts. Since
|
||||
|
@ -1472,6 +1472,8 @@ readline_curses::focus(int context,
|
||||
char cwd[MAXPATHLEN + 1024];
|
||||
char buffer[8 + sizeof(cwd)];
|
||||
|
||||
require(this->rc_contexts.count(context) > 0);
|
||||
|
||||
curs_set(1);
|
||||
|
||||
this->rc_active_context = context;
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include <exception>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@ -54,8 +53,6 @@
|
||||
|
||||
#include "base/auto_fd.hh"
|
||||
#include "base/enum_util.hh"
|
||||
#include "base/func_util.hh"
|
||||
#include "base/result.h"
|
||||
#include "help_text_formatter.hh"
|
||||
#include "log_format.hh"
|
||||
#include "pollable.hh"
|
||||
@ -100,7 +97,7 @@ public:
|
||||
|
||||
template<typename T,
|
||||
typename... Args,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void add_context(T context, Args&... args)
|
||||
{
|
||||
this->add_context(lnav::enums::to_underlying(context), args...);
|
||||
@ -161,7 +158,7 @@ public:
|
||||
|
||||
template<typename T,
|
||||
typename... Args,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void focus(T context, const Args&... args)
|
||||
{
|
||||
this->focus(lnav::enums::to_underlying(context), args...);
|
||||
@ -204,13 +201,13 @@ public:
|
||||
|
||||
template<typename T,
|
||||
typename... Args,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void add_prefix(T context, const Args&... args)
|
||||
{
|
||||
this->add_prefix(lnav::enums::to_underlying(context), args...);
|
||||
}
|
||||
|
||||
template<typename T, std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
template<typename T, std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void clear_prefixes(T context)
|
||||
{
|
||||
this->clear_prefixes(lnav::enums::to_underlying(context));
|
||||
@ -220,7 +217,7 @@ public:
|
||||
const std::string& type,
|
||||
const std::string& value);
|
||||
|
||||
void add_possibility(int context,
|
||||
void add_possibility(const int context,
|
||||
const std::string& type,
|
||||
const char* values[])
|
||||
{
|
||||
@ -229,7 +226,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void add_possibility(int context,
|
||||
void add_possibility(const int context,
|
||||
const std::string& type,
|
||||
const char** first,
|
||||
const char** last)
|
||||
@ -256,7 +253,7 @@ public:
|
||||
|
||||
template<typename T,
|
||||
typename... Args,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void add_possibility(T context, Args... args)
|
||||
{
|
||||
this->add_possibility(lnav::enums::to_underlying(context), args...);
|
||||
@ -264,7 +261,7 @@ public:
|
||||
|
||||
template<typename T,
|
||||
typename... Args,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void rem_possibility(T context, const Args&... args)
|
||||
{
|
||||
this->rem_possibility(lnav::enums::to_underlying(context), args...);
|
||||
@ -272,7 +269,7 @@ public:
|
||||
|
||||
template<typename T,
|
||||
typename... Args,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void clear_possibilities(T context, Args... args)
|
||||
{
|
||||
this->clear_possibilities(lnav::enums::to_underlying(context), args...);
|
||||
|
@ -57,7 +57,7 @@ static void
|
||||
find_matching_bracket(
|
||||
attr_line_t& al, int x, line_range sub, char left, char right)
|
||||
{
|
||||
bool is_lit = (left == 'Q');
|
||||
const auto is_lit = left == 'Q';
|
||||
attr_line_builder alb(al);
|
||||
const auto& line = al.get_string();
|
||||
int depth = 0;
|
||||
@ -132,14 +132,16 @@ find_matching_bracket(
|
||||
}
|
||||
|
||||
void
|
||||
readline_regex_highlighter(attr_line_t& al, int x)
|
||||
readline_regex_highlighter(attr_line_t& al, std::optional<int> x)
|
||||
{
|
||||
lnav::snippets::regex_highlighter(
|
||||
al, x, line_range{1, (int) al.get_string().size()});
|
||||
}
|
||||
|
||||
void
|
||||
readline_command_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
readline_command_highlighter_int(attr_line_t& al,
|
||||
std::optional<int> x,
|
||||
line_range sub)
|
||||
{
|
||||
static const auto RE_PREFIXES = lnav::pcre2pp::code::from_const(
|
||||
R"(^:(filter-in|filter-out|delete-filter|enable-filter|disable-filter|highlight|clear-highlight|create-search-table\s+[^\s]+\s+))");
|
||||
@ -209,7 +211,9 @@ readline_command_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
(int) start, (int) last
|
||||
};
|
||||
|
||||
if (lr.length() > 0 && !lr.contains(x) && !lr.contains(x - 1)) {
|
||||
if (x && lr.length() > 0 && !lr.contains(x.value())
|
||||
&& !lr.contains(x.value() - 1))
|
||||
{
|
||||
std::string value(lr.substr(line), lr.sublen(line));
|
||||
|
||||
if ((command == ":tag" || command == ":untag"
|
||||
@ -227,21 +231,21 @@ readline_command_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
}
|
||||
|
||||
void
|
||||
readline_command_highlighter(attr_line_t& al, int x)
|
||||
readline_command_highlighter(attr_line_t& al, std::optional<int> x)
|
||||
{
|
||||
readline_command_highlighter_int(
|
||||
al, x, line_range{0, (int) al.get_string().length()});
|
||||
}
|
||||
|
||||
void
|
||||
readline_sqlite_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
readline_sqlite_highlighter_int(attr_line_t& al,
|
||||
std::optional<int> x,
|
||||
line_range sub)
|
||||
{
|
||||
static const char* brackets[] = {
|
||||
"[]",
|
||||
"()",
|
||||
"{}",
|
||||
|
||||
nullptr,
|
||||
};
|
||||
|
||||
attr_line_builder alb(al);
|
||||
@ -265,7 +269,9 @@ readline_sqlite_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
} else if (attr.sa_type == &SQL_IDENTIFIER_ATTR
|
||||
|| attr.sa_type == &lnav::sql::PRQL_IDENTIFIER_ATTR)
|
||||
{
|
||||
if (!attr.sa_range.contains(x) && attr.sa_range.lr_end != x) {
|
||||
if (x && !attr.sa_range.contains(x.value())
|
||||
&& attr.sa_range.lr_end != x.value())
|
||||
{
|
||||
alb.overlay_attr(lr, VC_ROLE.value(role_t::VCR_IDENTIFIER));
|
||||
}
|
||||
} else if (attr.sa_type == &SQL_FUNCTION_ATTR) {
|
||||
@ -298,20 +304,23 @@ readline_sqlite_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
}
|
||||
}
|
||||
|
||||
for (int lpc = 0; brackets[lpc]; lpc++) {
|
||||
find_matching_bracket(al, x, sub, brackets[lpc][0], brackets[lpc][1]);
|
||||
for (const auto& bracket : brackets) {
|
||||
find_matching_bracket(
|
||||
al, x.value_or(al.length()), sub, bracket[0], bracket[1]);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
readline_sqlite_highlighter(attr_line_t& al, int x)
|
||||
readline_sqlite_highlighter(attr_line_t& al, std::optional<int> x)
|
||||
{
|
||||
readline_sqlite_highlighter_int(
|
||||
al, x, line_range{0, (int) al.get_string().length()});
|
||||
}
|
||||
|
||||
void
|
||||
readline_shlex_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
readline_shlex_highlighter_int(attr_line_t& al,
|
||||
std::optional<int> x,
|
||||
line_range sub)
|
||||
{
|
||||
attr_line_builder alb(al);
|
||||
const auto& str = al.get_string();
|
||||
@ -397,14 +406,16 @@ readline_shlex_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
}
|
||||
|
||||
void
|
||||
readline_shlex_highlighter(attr_line_t& al, int x)
|
||||
readline_shlex_highlighter(attr_line_t& al, std::optional<int> x)
|
||||
{
|
||||
readline_shlex_highlighter_int(
|
||||
al, x, line_range{0, (int) al.al_string.length()});
|
||||
}
|
||||
|
||||
static void
|
||||
readline_lnav_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
readline_lnav_highlighter_int(attr_line_t& al,
|
||||
std::optional<int> x,
|
||||
line_range sub)
|
||||
{
|
||||
switch (al.al_string[sub.lr_start]) {
|
||||
case ':':
|
||||
@ -432,7 +443,7 @@ readline_lnav_highlighter_int(attr_line_t& al, int x, line_range sub)
|
||||
}
|
||||
|
||||
void
|
||||
readline_lnav_highlighter(attr_line_t& al, int x)
|
||||
readline_lnav_highlighter(attr_line_t& al, std::optional<int> x)
|
||||
{
|
||||
static const auto COMMENT_RE = lnav::pcre2pp::code::from_const(R"(^\s*#)");
|
||||
|
||||
|
@ -34,16 +34,20 @@
|
||||
|
||||
#include "base/attr_line.hh"
|
||||
|
||||
void readline_regex_highlighter(attr_line_t& line, int x);
|
||||
void readline_regex_highlighter(attr_line_t& line, std::optional<int> x);
|
||||
|
||||
void readline_command_highlighter(attr_line_t& line, int x);
|
||||
void readline_command_highlighter(attr_line_t& line, std::optional<int> x);
|
||||
|
||||
void readline_sqlite_highlighter_int(attr_line_t& line, int x, line_range sub);
|
||||
void readline_sqlite_highlighter(attr_line_t& line, int x);
|
||||
void readline_sqlite_highlighter_int(attr_line_t& line,
|
||||
std::optional<int> x,
|
||||
line_range sub);
|
||||
void readline_sqlite_highlighter(attr_line_t& line, std::optional<int> x);
|
||||
|
||||
void readline_shlex_highlighter_int(attr_line_t& al, int x, line_range sub);
|
||||
void readline_shlex_highlighter(attr_line_t& line, int x);
|
||||
void readline_shlex_highlighter_int(attr_line_t& al,
|
||||
std::optional<int> x,
|
||||
line_range sub);
|
||||
void readline_shlex_highlighter(attr_line_t& line, std::optional<int> x);
|
||||
|
||||
void readline_lnav_highlighter(attr_line_t& line, int x);
|
||||
void readline_lnav_highlighter(attr_line_t& line, std::optional<int> x);
|
||||
|
||||
#endif
|
||||
|
@ -51,7 +51,7 @@ void add_view_text_possibilities(readline_curses* rlc,
|
||||
|
||||
template<typename T,
|
||||
typename... Args,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void
|
||||
add_view_text_possibilities(readline_curses* rlc, T context, Args... args)
|
||||
{
|
||||
@ -65,7 +65,7 @@ void add_filter_expr_possibilities(readline_curses* rlc,
|
||||
|
||||
template<typename T,
|
||||
typename... Args,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::enable_if_t<std::is_enum_v<T>, bool> = true>
|
||||
void
|
||||
add_filter_expr_possibilities(readline_curses* rlc, T context, Args... args)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ find_container_dir(std::filesystem::path file_path)
|
||||
static std::string
|
||||
replace_home_dir(std::string path)
|
||||
{
|
||||
auto home_dir_opt = getenv_opt("HOME");
|
||||
const auto home_dir_opt = getenv_opt("HOME");
|
||||
|
||||
if (!home_dir_opt) {
|
||||
return path;
|
||||
@ -280,7 +280,7 @@ SELECT content_id, format, time_offset FROM lnav_file
|
||||
continue;
|
||||
}
|
||||
|
||||
auto file_path_str = name_pair.first;
|
||||
const auto& file_path_str = name_pair.first;
|
||||
auto file_path = std::filesystem::path(file_path_str);
|
||||
auto container_path_opt = find_container_dir(file_path);
|
||||
if (container_path_opt) {
|
||||
|
@ -961,7 +961,7 @@ load_session()
|
||||
}
|
||||
session_data = complete_res.unwrap();
|
||||
|
||||
bool log_changes = false, text_changes = false;
|
||||
bool log_changes = false;
|
||||
|
||||
for (auto& lf : lnav_data.ld_active_files.fc_files) {
|
||||
auto iter = session_data.sd_file_states.find(lf->get_filename());
|
||||
@ -987,9 +987,6 @@ load_session()
|
||||
if (log_changes) {
|
||||
lnav_data.ld_log_source.text_filters_changed();
|
||||
}
|
||||
if (text_changes) {
|
||||
lnav_data.ld_text_source.text_filters_changed();
|
||||
}
|
||||
};
|
||||
|
||||
lnav::events::publish(lnav_data.ld_db.in(),
|
||||
|
@ -1277,7 +1277,7 @@ textfile_sub_source::adjacent_anchor(vis_line_t vl, text_anchors::direction dir)
|
||||
}
|
||||
|
||||
log_debug(" path for line: %s", fmt::to_string(path_for_line).c_str());
|
||||
auto last_key = path_for_line.back();
|
||||
const auto& last_key = path_for_line.back();
|
||||
path_for_line.pop_back();
|
||||
|
||||
auto parent_opt = lnav::document::hier_node::lookup_path(
|
||||
|
@ -881,11 +881,10 @@ update_hits(textview_curses* tc)
|
||||
lnav_data.ld_bottom_source.update_hits(tc);
|
||||
|
||||
if (lnav_data.ld_mode == ln_mode_t::SEARCH) {
|
||||
const auto MAX_MATCH_COUNT = 10_vl;
|
||||
constexpr auto MAX_MATCH_COUNT = 10_vl;
|
||||
const auto PREVIEW_SIZE = MAX_MATCH_COUNT + 1_vl;
|
||||
|
||||
int preview_count = 0;
|
||||
|
||||
auto& bm = tc->get_bookmarks();
|
||||
const auto& bv = bm[&textview_curses::BM_SEARCH];
|
||||
auto vl = tc->get_top();
|
||||
@ -917,9 +916,6 @@ update_hits(textview_curses* tc)
|
||||
attr_line_t al;
|
||||
|
||||
tc->textview_value_for_row(prev_vl.value(), al);
|
||||
if (preview_count > 0) {
|
||||
all_matches.append("\n");
|
||||
}
|
||||
snprintf(linebuf,
|
||||
sizeof(linebuf),
|
||||
"L%*d: ",
|
||||
|
@ -202,7 +202,7 @@ struct json_path_handler_base {
|
||||
struct enum_value_t {
|
||||
template<typename T>
|
||||
enum_value_t(const char* name, T value)
|
||||
: first(name), second((unsigned int) value)
|
||||
: first(name), second((int) value)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -329,14 +329,14 @@ struct json_path_handler : public json_path_handler_base {
|
||||
struct LastIsEnum<U T::*> {
|
||||
using value_type = U;
|
||||
|
||||
static constexpr bool value = std::is_enum<U>::value;
|
||||
static constexpr bool value = std::is_enum_v<U>;
|
||||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
struct LastIsEnum<std::optional<U> T::*> {
|
||||
using value_type = U;
|
||||
|
||||
static constexpr bool value = std::is_enum<U>::value;
|
||||
static constexpr bool value = std::is_enum_v<U>;
|
||||
};
|
||||
|
||||
template<typename T, typename... Args>
|
||||
@ -347,13 +347,13 @@ struct json_path_handler : public json_path_handler_base {
|
||||
template<typename T, typename U>
|
||||
struct LastIsInteger<U T::*> {
|
||||
static constexpr bool value
|
||||
= std::is_integral<U>::value && !std::is_same<U, bool>::value;
|
||||
= std::is_integral_v<U> && !std::is_same_v<U, bool>;
|
||||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
struct LastIsInteger<std::optional<U> T::*> {
|
||||
static constexpr bool value
|
||||
= std::is_integral<U>::value && !std::is_same<U, bool>::value;
|
||||
= std::is_integral_v<U> && !std::is_same_v<U, bool>;
|
||||
};
|
||||
|
||||
template<typename T, typename... Args>
|
||||
@ -363,12 +363,12 @@ struct json_path_handler : public json_path_handler_base {
|
||||
|
||||
template<typename T, typename U>
|
||||
struct LastIsFloat<U T::*> {
|
||||
static constexpr bool value = std::is_same<U, double>::value;
|
||||
static constexpr bool value = std::is_same_v<U, double>;
|
||||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
struct LastIsFloat<std::optional<U> T::*> {
|
||||
static constexpr bool value = std::is_same<U, double>::value;
|
||||
static constexpr bool value = std::is_same_v<U, double>;
|
||||
};
|
||||
|
||||
template<typename T, typename... Args>
|
||||
@ -405,7 +405,7 @@ struct json_path_handler : public json_path_handler_base {
|
||||
struct LastIsIntegerVector<std::vector<U> T::*> {
|
||||
using value_type = U;
|
||||
static constexpr bool value
|
||||
= std::is_integral<U>::value && !std::is_same<U, bool>::value;
|
||||
= std::is_integral_v<U> && !std::is_same_v<U, bool>;
|
||||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
@ -547,8 +547,8 @@ struct json_path_handler : public json_path_handler_base {
|
||||
template<typename... Args,
|
||||
std::enable_if_t<LastIsVector<Args...>::value, bool> = true,
|
||||
std::enable_if_t<
|
||||
!std::is_same<typename LastIsVector<Args...>::value_type,
|
||||
std::string>::value
|
||||
!std::is_same_v<typename LastIsVector<Args...>::value_type,
|
||||
std::string>
|
||||
&& !LastIsIntegerVector<Args...>::value,
|
||||
bool>
|
||||
= true>
|
||||
@ -675,13 +675,13 @@ struct json_path_handler : public json_path_handler_base {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename... Args,
|
||||
std::enable_if_t<LastIsMap<Args...>::value, bool> = true,
|
||||
std::enable_if_t<
|
||||
std::is_same<intern_string_t,
|
||||
typename LastIsMap<Args...>::key_type>::value,
|
||||
bool>
|
||||
= true>
|
||||
template<
|
||||
typename... Args,
|
||||
std::enable_if_t<LastIsMap<Args...>::value, bool> = true,
|
||||
std::enable_if_t<std::is_same_v<intern_string_t,
|
||||
typename LastIsMap<Args...>::key_type>,
|
||||
bool>
|
||||
= true>
|
||||
json_path_handler& for_field(Args... args)
|
||||
{
|
||||
this->jph_path_provider =
|
||||
@ -729,18 +729,15 @@ struct json_path_handler : public json_path_handler_base {
|
||||
typename... Args,
|
||||
std::enable_if_t<LastIsMap<Args...>::value, bool> = true,
|
||||
std::enable_if_t<
|
||||
std::is_same<std::string,
|
||||
typename LastIsMap<Args...>::key_type>::value,
|
||||
std::is_same_v<std::string, typename LastIsMap<Args...>::key_type>,
|
||||
bool>
|
||||
= true,
|
||||
std::enable_if_t<
|
||||
!std::is_same<json_any_t,
|
||||
typename LastIsMap<Args...>::value_type>::value
|
||||
&& !std::is_same<std::string,
|
||||
typename LastIsMap<Args...>::value_type>::value
|
||||
&& !std::is_same<
|
||||
std::optional<std::string>,
|
||||
typename LastIsMap<Args...>::value_type>::value,
|
||||
!std::is_same_v<json_any_t, typename LastIsMap<Args...>::value_type>
|
||||
&& !std::is_same_v<std::string,
|
||||
typename LastIsMap<Args...>::value_type>
|
||||
&& !std::is_same_v<std::optional<std::string>,
|
||||
typename LastIsMap<Args...>::value_type>,
|
||||
bool>
|
||||
= true>
|
||||
json_path_handler& for_field(Args... args)
|
||||
|
@ -1,4 +1,4 @@
|
||||
[1m[31m✘ error[0m: invalid filter expression: [37m[40m:sc_bytes[0m[37m[40m # [0m[37m[40mff[0m
|
||||
[1m[31m✘ error[0m: invalid filter expression: [37m[40m:sc_bytes # ff[0m
|
||||
[1m[31mreason[0m: unrecognized token: "#"
|
||||
[36m --> [0m[1mcommand-option[0m:1
|
||||
[36m | [0m[37m[40m:[0m[1m[36m[40mfilter-expr[0m[37m[40m [0m[37m[40m:sc_bytes[0m[37m[40m # [0m[37m[40mff[0m[37m[40m [0m
|
||||
|
@ -1933,7 +1933,7 @@ For support questions, email:
|
||||
|
||||
[4mExample[0m
|
||||
#1 To cast the value 1.23 as an integer:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[36m[40mCAST[0m[37m[40m([0m[1m[37m[40m1.23[0m[37m[40m [0m[1m[36m[40mAS[0m[37m[40m [0m[37m[40mINTEGER[0m[37m[40m) [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[36m[40mCAST[0m[37m[40m([0m[1m[37m[40m1.23[0m[37m[40m [0m[1m[36m[40mAS[0m[37m[40m INTEGER) [0m
|
||||
|
||||
|
||||
|
||||
@ -2125,12 +2125,12 @@ For support questions, email:
|
||||
[1mtotal()[0m
|
||||
[4mExamples[0m
|
||||
#1 To get the average of the column 'ex_duration' from the table 'lnav_example_log':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mavg[0m[37m[40m([0m[37m[40mex_duration[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mavg[0m[37m[40m(ex_duration) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log [0m
|
||||
|
||||
|
||||
#2 To get the average of the column 'ex_duration' from the table 'lnav_example_log'
|
||||
when grouped by 'ex_procname':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[37m[40mex_procname[0m[37m[40m, [0m[1m[37m[40mavg[0m[37m[40m([0m[37m[40mex_duration[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m[37m[40m [0m[1m[36m[40mGROUP[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m [0m[37m[40mex_procname[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m ex_procname, [0m[1m[37m[40mavg[0m[37m[40m(ex_duration) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log [0m[1m[36m[40mGROUP[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m ex_procname[0m
|
||||
|
||||
|
||||
|
||||
@ -2265,11 +2265,11 @@ For support questions, email:
|
||||
|
||||
[4mExamples[0m
|
||||
#1 To get the count of the non-NULL rows of 'lnav_example_log':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mcount[0m[37m[40m([0m[1m[37m[40m*[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mcount[0m[37m[40m([0m[1m[37m[40m*[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log [0m
|
||||
|
||||
|
||||
#2 To get the count of the non-NULL values of 'log_part' from 'lnav_example_log':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mcount[0m[37m[40m([0m[37m[40mlog_part[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mcount[0m[37m[40m(log_part) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log [0m
|
||||
|
||||
|
||||
|
||||
@ -2574,7 +2574,7 @@ For support questions, email:
|
||||
|
||||
[4mExample[0m
|
||||
#1 To read a file and raise an error if there is a problem:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mifnull[0m[37m[40m([0m[37m[40mdata[0m[37m[40m, [0m[1m[37m[40mraise_error[0m[37m[40m([0m[35m[40m'cannot read: '[0m[37m[40m [0m[1m[37m[40m||[0m[37m[40m [0m[37m[40mst_name[0m[37m[40m, [0m[37m[40merror[0m[37m[40m)) [0m[1m[36m[40mFROM[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mifnull[0m[37m[40m(data, [0m[1m[37m[40mraise_error[0m[37m[40m([0m[35m[40m'cannot read: '[0m[37m[40m [0m[1m[37m[40m||[0m[37m[40m st_name, error)) [0m[1m[36m[40mFROM[0m
|
||||
[37m[40m [0m[1m[37m[40mfstat[0m[37m[40m([0m[35m[40m'/non-existent'[0m[37m[40m)[0m
|
||||
|
||||
|
||||
@ -2592,15 +2592,15 @@ For support questions, email:
|
||||
|
||||
[4mExamples[0m
|
||||
#1 To generate the numbers in the range [10, 14]:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[37m[40mvalue[0m[37m[40m [0m[1m[36m[40mFROM[0m[37m[40m [0m[1m[37m[40mgenerate_series[0m[37m[40m([0m[1m[37m[40m10[0m[37m[40m, [0m[1m[37m[40m14[0m[37m[40m) [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m value [0m[1m[36m[40mFROM[0m[37m[40m [0m[1m[37m[40mgenerate_series[0m[37m[40m([0m[1m[37m[40m10[0m[37m[40m, [0m[1m[37m[40m14[0m[37m[40m) [0m
|
||||
|
||||
|
||||
#2 To generate every other number in the range [10, 14]:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[37m[40mvalue[0m[37m[40m [0m[1m[36m[40mFROM[0m[37m[40m [0m[1m[37m[40mgenerate_series[0m[37m[40m([0m[1m[37m[40m10[0m[37m[40m, [0m[1m[37m[40m14[0m[37m[40m, [0m[1m[37m[40m2[0m[37m[40m) [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m value [0m[1m[36m[40mFROM[0m[37m[40m [0m[1m[37m[40mgenerate_series[0m[37m[40m([0m[1m[37m[40m10[0m[37m[40m, [0m[1m[37m[40m14[0m[37m[40m, [0m[1m[37m[40m2[0m[37m[40m) [0m
|
||||
|
||||
|
||||
#3 To count down from five to 1:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[37m[40mvalue[0m[37m[40m [0m[1m[36m[40mFROM[0m[37m[40m [0m[1m[37m[40mgenerate_series[0m[37m[40m([0m[1m[37m[40m1[0m[37m[40m, [0m[1m[37m[40m5[0m[37m[40m, [0m[1m[37m[40m-1[0m[37m[40m) [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m value [0m[1m[36m[40mFROM[0m[37m[40m [0m[1m[37m[40mgenerate_series[0m[37m[40m([0m[1m[37m[40m1[0m[37m[40m, [0m[1m[37m[40m5[0m[37m[40m, [0m[1m[37m[40m-1[0m[37m[40m) [0m
|
||||
|
||||
|
||||
|
||||
@ -2663,16 +2663,16 @@ For support questions, email:
|
||||
[4mExamples[0m
|
||||
#1 To concatenate the values of the column 'ex_procname' from the table
|
||||
'lnav_example_log':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mgroup_concat[0m[37m[40m([0m[37m[40mex_procname[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mgroup_concat[0m[37m[40m(ex_procname) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log[0m
|
||||
|
||||
|
||||
#2 To join the values of the column 'ex_procname' using the string ', ':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mgroup_concat[0m[37m[40m([0m[37m[40mex_procname[0m[37m[40m, [0m[35m[40m', '[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mgroup_concat[0m[37m[40m(ex_procname, [0m[35m[40m', '[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log[0m
|
||||
|
||||
|
||||
#3 To concatenate the distinct values of the column 'ex_procname' from the table
|
||||
'lnav_example_log':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mgroup_concat[0m[37m[40m([0m[1m[36m[40mDISTINCT[0m[37m[40m [0m[37m[40mex_procname[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mgroup_concat[0m[37m[40m([0m[1m[36m[40mDISTINCT[0m[37m[40m ex_procname) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log[0m
|
||||
|
||||
|
||||
|
||||
@ -2693,7 +2693,7 @@ For support questions, email:
|
||||
[1municode()[0m, [1munparse_url()[0m, [1mupper()[0m, [1mxpath()[0m
|
||||
[4mExample[0m
|
||||
#1 To produce a hash of all of the values of 'column1':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mgroup_spooky_hash[0m[37m[40m([0m[37m[40mcolumn1[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m ([0m[1m[36m[40mVALUES[0m[37m[40m ([0m[35m[40m'abc'[0m[37m[40m), ([0m[35m[40m'123'[0m[37m[40m))[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mgroup_spooky_hash[0m[37m[40m(column1) [0m[1m[36m[40mFROM[0m[37m[40m ([0m[1m[36m[40mVALUES[0m[37m[40m ([0m[35m[40m'abc'[0m[37m[40m), ([0m[35m[40m'123'[0m[37m[40m))[0m
|
||||
|
||||
|
||||
|
||||
@ -3084,7 +3084,7 @@ For support questions, email:
|
||||
|
||||
|
||||
#2 To create an array from a column of values:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mjson_group_array[0m[37m[40m([0m[37m[40mcolumn1[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m ([0m[1m[36m[40mVALUES[0m[37m[40m ([0m[1m[37m[40m1[0m[37m[40m), ([0m[1m[37m[40m2[0m[37m[40m), ([0m[1m[37m[40m3[0m[37m[40m))[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mjson_group_array[0m[37m[40m(column1) [0m[1m[36m[40mFROM[0m[37m[40m ([0m[1m[36m[40mVALUES[0m[37m[40m ([0m[1m[37m[40m1[0m[37m[40m), ([0m[1m[37m[40m2[0m[37m[40m), ([0m[1m[37m[40m3[0m[37m[40m))[0m
|
||||
|
||||
|
||||
|
||||
@ -3106,7 +3106,7 @@ For support questions, email:
|
||||
|
||||
|
||||
#2 To create an object from a pair of columns:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mjson_group_object[0m[37m[40m([0m[37m[40mcolumn1[0m[37m[40m, [0m[37m[40mcolumn2[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m ([0m[1m[36m[40mVALUES[0m[37m[40m ([0m[35m[40m'a'[0m[37m[40m, [0m[1m[37m[40m1[0m[37m[40m), ([0m[35m[40m'b'[0m[37m[40m, [0m[1m[37m[40m2[0m[37m[40m))[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mjson_group_object[0m[37m[40m(column1, column2) [0m[1m[36m[40mFROM[0m[37m[40m ([0m[1m[36m[40mVALUES[0m[37m[40m ([0m[35m[40m'a'[0m[37m[40m, [0m[1m[37m[40m1[0m[37m[40m), ([0m[35m[40m'b'[0m[37m[40m, [0m[1m[37m[40m2[0m[37m[40m))[0m
|
||||
|
||||
|
||||
|
||||
@ -3282,7 +3282,7 @@ For support questions, email:
|
||||
[1myaml_to_json()[0m
|
||||
[4mExample[0m
|
||||
#1 To iterate over an array:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[36m[40mkey[0m[37m[40m,[0m[37m[40mvalue[0m[37m[40m,[0m[37m[40mtype[0m[37m[40m,[0m[37m[40matom[0m[37m[40m,[0m[37m[40mfullkey[0m[37m[40m,[0m[37m[40mpath[0m[37m[40m [0m[1m[36m[40mFROM[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[36m[40mkey[0m[37m[40m,value,type,atom,fullkey,path [0m[1m[36m[40mFROM[0m
|
||||
[37m[40m [0m[1m[37m[40mjson_tree[0m[37m[40m([0m[35m[40m'[null,1,"two",{"three":4.5}]'[0m[37m[40m)[0m
|
||||
|
||||
|
||||
@ -3647,7 +3647,7 @@ For support questions, email:
|
||||
|
||||
|
||||
#2 To get the largest value from an aggregate:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mmax[0m[37m[40m([0m[37m[40mstatus[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mhttp_status_codes[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mmax[0m[37m[40m(status) [0m[1m[36m[40mFROM[0m[37m[40m http_status_codes [0m
|
||||
|
||||
|
||||
|
||||
@ -3669,7 +3669,7 @@ For support questions, email:
|
||||
|
||||
|
||||
#2 To get the smallest value from an aggregate:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mmin[0m[37m[40m([0m[37m[40mstatus[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mhttp_status_codes[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mmin[0m[37m[40m(status) [0m[1m[36m[40mFROM[0m[37m[40m http_status_codes [0m
|
||||
|
||||
|
||||
|
||||
@ -3985,7 +3985,7 @@ For support questions, email:
|
||||
|
||||
[4mExample[0m
|
||||
#1 To raise an error if a variable is not set:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mifnull[0m[37m[40m([0m[37m[40m$val[0m[37m[40m, [0m[1m[37m[40mraise_error[0m[37m[40m([0m[35m[40m'please set $val'[0m[37m[40m, [0m[35m[40m'because'[0m[37m[40m))[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mifnull[0m[37m[40m($val, [0m[1m[37m[40mraise_error[0m[37m[40m([0m[35m[40m'please set $val'[0m[37m[40m, [0m[35m[40m'because'[0m[37m[40m))[0m
|
||||
|
||||
|
||||
|
||||
@ -4308,8 +4308,8 @@ For support questions, email:
|
||||
[1mnth_value()[0m, [1mntile()[0m, [1mpercent_rank()[0m, [1mrank()[0m
|
||||
[4mExample[0m
|
||||
#1 To number messages from a process:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mrow_number[0m[37m[40m() [0m[1m[36m[40mOVER[0m[37m[40m ([0m[1m[36m[40mPARTITION[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m [0m[37m[40mex_procname[0m[37m[40m [0m[1m[36m[40mORDER[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m [0m[37m[40mlog_line[0m[37m[40m) [0m[1m[36m[40mAS[0m[37m[40m [0m[37m[40mmsg_num[0m[37m[40m,[0m
|
||||
[37m[40m [0m[37m[40mex_procname[0m[37m[40m, [0m[37m[40mlog_body[0m[37m[40m [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mrow_number[0m[37m[40m() [0m[1m[36m[40mOVER[0m[37m[40m ([0m[1m[36m[40mPARTITION[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m ex_procname [0m[1m[36m[40mORDER[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m log_line) [0m[1m[36m[40mAS[0m[37m[40m msg_num,[0m
|
||||
[37m[40m [0m[37m[40mex_procname, log_body [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log[0m
|
||||
|
||||
|
||||
|
||||
@ -4405,7 +4405,7 @@ For support questions, email:
|
||||
|
||||
|
||||
#2 To chart the values in a JSON array:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40msparkline[0m[37m[40m([0m[37m[40mvalue[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[1m[37m[40mjson_each[0m[37m[40m([0m[35m[40m'[0, 1, 2, 3, 4, 5, 6, 7, 8]'[0m[37m[40m)[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40msparkline[0m[37m[40m(value) [0m[1m[36m[40mFROM[0m[37m[40m [0m[1m[37m[40mjson_each[0m[37m[40m([0m[35m[40m'[0, 1, 2, 3, 4, 5, 6, 7, 8]'[0m[37m[40m)[0m
|
||||
|
||||
|
||||
|
||||
@ -4628,7 +4628,7 @@ For support questions, email:
|
||||
[4mExample[0m
|
||||
#1 To sum all of the values in the column 'ex_duration' from the table
|
||||
'lnav_example_log':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40msum[0m[37m[40m([0m[37m[40mex_duration[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40msum[0m[37m[40m(ex_duration) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log [0m
|
||||
|
||||
|
||||
|
||||
@ -4691,13 +4691,13 @@ For support questions, email:
|
||||
|
||||
|
||||
#2 To group log messages into five minute buckets and count them:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mtimeslice[0m[37m[40m([0m[37m[40mlog_time_msecs[0m[37m[40m, [0m[35m[40m'5m'[0m[37m[40m) [0m[1m[36m[40mAS[0m[37m[40m [0m[37m[40mslice[0m[37m[40m, [0m[1m[37m[40mcount[0m[37m[40m([0m[1m[37m[40m1[0m[37m[40m)[0m
|
||||
[37m[40m [0m[37m[40m [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m[37m[40m [0m[1m[36m[40mGROUP[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m [0m[37m[40mslice[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mtimeslice[0m[37m[40m(log_time_msecs, [0m[35m[40m'5m'[0m[37m[40m) [0m[1m[36m[40mAS[0m[37m[40m slice, [0m[1m[37m[40mcount[0m[37m[40m([0m[1m[37m[40m1[0m[37m[40m)[0m
|
||||
[37m[40m [0m[37m[40m [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log [0m[1m[36m[40mGROUP[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m slice[0m
|
||||
|
||||
|
||||
#3 To group log messages by those before 4:30am and after:
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mtimeslice[0m[37m[40m([0m[37m[40mlog_time_msecs[0m[37m[40m, [0m[35m[40m'before 4:30am'[0m[37m[40m) [0m[1m[36m[40mAS[0m[37m[40m [0m[37m[40mslice[0m[37m[40m, [0m[1m[37m[40mcount[0m[37m[40m([0m[1m[37m[40m1[0m[37m[40m) [0m[1m[36m[40mFROM[0m
|
||||
[37m[40m [0m[37m[40mlnav_example_log[0m[37m[40m [0m[1m[36m[40mGROUP[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m [0m[37m[40mslice[0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mtimeslice[0m[37m[40m(log_time_msecs, [0m[35m[40m'before 4:30am'[0m[37m[40m) [0m[1m[36m[40mAS[0m[37m[40m slice, [0m[1m[37m[40mcount[0m[37m[40m([0m[1m[37m[40m1[0m[37m[40m) [0m[1m[36m[40mFROM[0m
|
||||
[37m[40m [0m[37m[40mlnav_example_log [0m[1m[36m[40mGROUP[0m[37m[40m [0m[1m[36m[40mBY[0m[37m[40m slice[0m
|
||||
|
||||
|
||||
|
||||
@ -4738,7 +4738,7 @@ For support questions, email:
|
||||
[4mExample[0m
|
||||
#1 To total all of the values in the column 'ex_duration' from the table
|
||||
'lnav_example_log':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mtotal[0m[37m[40m([0m[37m[40mex_duration[0m[37m[40m) [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40mlnav_example_log[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mtotal[0m[37m[40m(ex_duration) [0m[1m[36m[40mFROM[0m[37m[40m lnav_example_log [0m
|
||||
|
||||
|
||||
|
||||
@ -4942,7 +4942,7 @@ For support questions, email:
|
||||
|
||||
[4mExample[0m
|
||||
#1 To attach the database file '/tmp/customers.db' with the name customers:
|
||||
[37m[40m;[0m[1m[36m[40mATTACH[0m[37m[40m [0m[1m[36m[40mDATABASE[0m[37m[40m [0m[35m[40m'/tmp/customers.db'[0m[37m[40m [0m[1m[36m[40mAS[0m[37m[40m [0m[37m[40mcustomers[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mATTACH[0m[37m[40m [0m[1m[36m[40mDATABASE[0m[37m[40m [0m[35m[40m'/tmp/customers.db'[0m[37m[40m [0m[1m[36m[40mAS[0m[37m[40m customers [0m
|
||||
|
||||
|
||||
|
||||
@ -4995,7 +4995,7 @@ For support questions, email:
|
||||
|
||||
[4mExample[0m
|
||||
#1 To detach the database named 'customers':
|
||||
[37m[40m;[0m[1m[36m[40mDETACH[0m[37m[40m [0m[1m[36m[40mDATABASE[0m[37m[40m [0m[37m[40mcustomers[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mDETACH[0m[37m[40m [0m[1m[36m[40mDATABASE[0m[37m[40m customers [0m
|
||||
|
||||
|
||||
|
||||
@ -5013,7 +5013,7 @@ For support questions, email:
|
||||
[4mExample[0m
|
||||
#1 To insert the pair containing 'MSG' and 'HELLO, WORLD!' into the
|
||||
'environ' table:
|
||||
[37m[40m;[0m[1m[36m[40mINSERT[0m[37m[40m [0m[1m[36m[40mINTO[0m[37m[40m [0m[37m[40menviron[0m[37m[40m [0m[1m[36m[40mVALUES[0m[37m[40m ([0m[35m[40m'MSG'[0m[37m[40m, [0m[35m[40m'HELLO, WORLD!'[0m[37m[40m)[0m
|
||||
[37m[40m;[0m[1m[36m[40mINSERT[0m[37m[40m [0m[1m[36m[40mINTO[0m[37m[40m environ [0m[1m[36m[40mVALUES[0m[37m[40m ([0m[35m[40m'MSG'[0m[37m[40m, [0m[35m[40m'HELLO, WORLD!'[0m[37m[40m)[0m
|
||||
|
||||
|
||||
|
||||
@ -5042,7 +5042,7 @@ For support questions, email:
|
||||
|
||||
[4mExample[0m
|
||||
#1 To select all of the columns from the table 'syslog_log':
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40m*[0m[37m[40m [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40msyslog_log[0m[37m[40m [0m
|
||||
[37m[40m;[0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40m*[0m[37m[40m [0m[1m[36m[40mFROM[0m[37m[40m syslog_log [0m
|
||||
|
||||
|
||||
|
||||
@ -5059,7 +5059,7 @@ For support questions, email:
|
||||
|
||||
[4mExample[0m
|
||||
#1 To mark the syslog message at line 40:
|
||||
[37m[40m;[0m[1m[36m[40mUPDATE[0m[37m[40m [0m[37m[40msyslog_log[0m[37m[40m [0m[1m[36m[40mSET[0m[37m[40m [0m[37m[40mlog_mark[0m[37m[40m [0m[1m[37m[40m=[0m[37m[40m [0m[1m[37m[40m1[0m[37m[40m [0m[1m[36m[40mWHERE[0m[37m[40m [0m[37m[40mlog_line[0m[37m[40m [0m[1m[37m[40m=[0m[37m[40m [0m[1m[37m[40m40[0m
|
||||
[37m[40m;[0m[1m[36m[40mUPDATE[0m[37m[40m syslog_log [0m[1m[36m[40mSET[0m[37m[40m log_mark [0m[1m[37m[40m=[0m[37m[40m [0m[1m[37m[40m1[0m[37m[40m [0m[1m[36m[40mWHERE[0m[37m[40m log_line [0m[1m[37m[40m=[0m[37m[40m [0m[1m[37m[40m40[0m
|
||||
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
[1m[31m✘ error[0m: invalid mark expression: [37m[40m:log_procname[0m[37m[40m [0m[37m[40mlik[0m
|
||||
[1m[31m✘ error[0m: invalid mark expression: [37m[40m:log_procname lik[0m
|
||||
[1m[31mreason[0m: near "lik": syntax error
|
||||
[36m --> [0m[1mcommand-option[0m:1
|
||||
[36m | [0m[37m[40m:[0m[1m[36m[40mmark-expr[0m[37m[40m [0m[37m[40m:log_procname[0m[37m[40m [0m[37m[40mlik[0m[37m[40m [0m
|
||||
|
@ -2,7 +2,7 @@
|
||||
[1m[31mreason[0m: SQL expression is invalid
|
||||
[1m[31m | [0m [1m[31mreason[0m: no such column: sc_status
|
||||
[1m[31m | [0m [36m --> [0m[1m/log/watch-expressions/http-errors/expr[0m
|
||||
[1m[31m | [0m [36m | [0m[37m[40msc_status[0m[37m[40m [0m[1m[37m[40m>[0m[1m[37m[40m=[0m[37m[40m [0m[1m[37m[40m400[0m[37m[40m [0m[1m[36m[40mAND[0m[37m[40m [0m[37m[40mbad[0m[37m[40m [0m
|
||||
[1m[31m | [0m [36m | [0m[37m[40msc_status [0m[1m[37m[40m>[0m[1m[37m[40m=[0m[37m[40m [0m[1m[37m[40m400[0m[37m[40m [0m[1m[36m[40mAND[0m[37m[40m bad [0m
|
||||
[36m --> [0m[1mcommand-option[0m:1
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/log/watch-expressions/http-errors/expr[0m [4m<SQL-expression>[0m
|
||||
|
@ -107,7 +107,7 @@
|
||||
[1m[31m✘ error[0m: SQL expression is invalid
|
||||
[1m[31mreason[0m: unrecognized token: "'foobar"
|
||||
[36m --> [0m[1m/bad_file_format1/converter/header/expr/default[0m
|
||||
[36m | [0m[37m[40m:header[0m[37m[40m [0m[1m[36m[40mREGEXP[0m[37m[40m [0m[1m[7m[31m[40m'[0m[37m[40mfoobar [0m
|
||||
[36m | [0m[37m[40m:header [0m[1m[36m[40mREGEXP[0m[37m[40m [0m[1m[7m[31m[40m'[0m[37m[40mfoobar [0m
|
||||
[1m[31m✘ error[0m: A command is required when a converter is defined
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-file-format/format.json[0m:3
|
||||
[36m =[0m [36mhelp[0m: The converter command transforms the file into a format that can be consumed by lnav
|
||||
|
@ -163,7 +163,6 @@ EOF
|
||||
|
||||
run_test ${lnav_test} -n \
|
||||
-c ";SELECT * FROM access_log LIMIT 0" \
|
||||
-c ':switch-to-view db' \
|
||||
${test_dir}/logfile_access_log.0
|
||||
|
||||
check_output "output generated for empty result set?" <<EOF
|
||||
|
Loading…
Reference in New Issue
Block a user