mirror of
https://github.com/tstack/lnav
synced 2024-11-01 21:40:34 +00:00
[sql] missed checking for null in graphable columns
This commit is contained in:
parent
62075fb340
commit
5a718bc0ec
@ -39,8 +39,8 @@ AC_PROG_CXX
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -D_ISOC99_SOURCE -D__STDC_LIMIT_MACROS"
|
||||
|
||||
CFLAGS=`echo $CFLAGS | sed 's/-O2//g'`
|
||||
CXXFLAGS=`echo $CXXFLAGS | sed 's/-O2//g'`
|
||||
# CFLAGS=`echo $CFLAGS | sed 's/-O2//g'`
|
||||
# CXXFLAGS=`echo $CXXFLAGS | sed 's/-O2//g'`
|
||||
|
||||
AC_ARG_VAR(SFTP_TEST_URL)
|
||||
|
||||
|
@ -425,14 +425,14 @@ int sql_callback(sqlite3_stmt *stmt)
|
||||
double num_value = 0.0;
|
||||
|
||||
dls.push_column(value);
|
||||
if (dls.dls_headers[lpc] == "log_line") {
|
||||
if (value != NULL && dls.dls_headers[lpc] == "log_line") {
|
||||
int line_number = -1;
|
||||
|
||||
if (sscanf(value, "%d", &line_number) == 1) {
|
||||
lss.text_mark(&BM_QUERY, line_number, true);
|
||||
}
|
||||
}
|
||||
if (dls.dls_headers_to_graph[lpc]) {
|
||||
if (value != NULL && dls.dls_headers_to_graph[lpc]) {
|
||||
if (sscanf(value, "%lf", &num_value) != 1) {
|
||||
num_value = 0.0;
|
||||
}
|
||||
|
@ -714,7 +714,6 @@ string log_vtab_manager::unregister_vtab(intern_string_t name)
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
require(rc == SQLITE_OK);
|
||||
|
||||
this->vm_impls.erase(name);
|
||||
}
|
||||
|
@ -626,3 +626,21 @@ run_test ${lnav_test} -n \
|
||||
check_error_output "able to create table with a bad regex?" <<EOF
|
||||
error: unable to compile regex -- bad(
|
||||
EOF
|
||||
|
||||
NULL_GRAPH_SELECT_1=$(cat <<EOF
|
||||
;SELECT value FROM (
|
||||
SELECT 10 as value
|
||||
UNION ALL SELECT null as value)
|
||||
EOF
|
||||
)
|
||||
|
||||
run_test ${lnav_test} -n \
|
||||
-c "$NULL_GRAPH_SELECT_1" \
|
||||
-c ":write-csv-to -" \
|
||||
${test_dir}/logfile_multiline.0
|
||||
|
||||
check_output "number column with null does not work?" <<EOF
|
||||
value
|
||||
10
|
||||
<NULL>
|
||||
EOF
|
||||
|
Loading…
Reference in New Issue
Block a user