Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: reduce number of SQL queries in GET_TASKS #2135

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
88c2bff
Change: Check trash target references before accessing
mattmundell Jan 2, 2024
decd117
Move variables to where they are used
mattmundell Jan 8, 2024
4d55aa0
Combine CREDENTIAL_ITERATOR_COLUMNS and CREDENTIAL_ITERATOR_TRASH_COL…
mattmundell Jan 8, 2024
15661bf
Make credential_iterator_format_available variable use more obvious
mattmundell Jan 9, 2024
222f9aa
Note credential iterator field use
mattmundell Jan 9, 2024
fc8765d
Change: Use fewer queries in credential iterator when possible
mattmundell Jan 9, 2024
f0d4458
Declare variables where they are used
mattmundell Feb 7, 2024
2da21a6
Move get_task_schedule_xml into branches
mattmundell Feb 7, 2024
9fdaaa0
Move task_target into branch that uses it
mattmundell Feb 7, 2024
fb8882d
Move get_iterator_resource into branches
mattmundell Feb 7, 2024
e09e764
Move schedules_only case out to function
mattmundell Feb 7, 2024
65f515f
Use send instead of sendf for simple string
mattmundell Feb 7, 2024
2ff4aeb
Use new function sendf_to_client instead of obscure macro
mattmundell Feb 7, 2024
ef27916
Make sendf_to_client more convenient
mattmundell Feb 8, 2024
7487ae0
Make send_find_error_to_client more convenient
mattmundell Feb 8, 2024
b442180
Make send_to_client more convenient
mattmundell Feb 8, 2024
23590d7
Move sending of task out to function
mattmundell Feb 8, 2024
df91d62
Merge branch 'main' into faster-trash-tasks
mattmundell Feb 12, 2024
9fc89cf
Get get_tasks_send_task working
mattmundell Feb 12, 2024
f345791
Fix indent of large string
mattmundell Feb 12, 2024
9e8fbde
Make large string more manageable
mattmundell Feb 12, 2024
3bf8b72
Neaten start of get_tasks_send_task
mattmundell Feb 12, 2024
e97ac39
Move current_report setup out to function
mattmundell Feb 12, 2024
1f88070
Move last_report setup out to function
mattmundell Feb 12, 2024
230ed1c
Move sending of observers out to function
mattmundell Feb 12, 2024
bf71f23
Move sending of alerts out to function
mattmundell Feb 12, 2024
45edb72
Move sending of preferences out to function
mattmundell Feb 12, 2024
c2e368c
Define variables after declarations
mattmundell Feb 12, 2024
79e3085
Group more declarations
mattmundell Feb 12, 2024
b38ea71
Merge branch 'main' into faster-trash-tasks
mattmundell Feb 12, 2024
7b76bd9
Clang format
mattmundell Feb 12, 2024
d1e1689
Move task end tag back to get_tasks_send_task
mattmundell Feb 13, 2024
7e34dca
Use new function task_info to save queries in get_tasks_send_task
mattmundell Feb 13, 2024
483b923
Fix stray commas
mattmundell Feb 13, 2024
9977548
Move config_in_trash SQL into task_info
mattmundell Feb 19, 2024
88b02d4
Fix missing else
mattmundell Feb 19, 2024
9c02e89
Use WITH for config_in_trash
mattmundell Feb 19, 2024
c808fd9
Combine task_info SQL into single statement
mattmundell Feb 19, 2024
6f3f98a
Move second_last_report_id into task_info
mattmundell Feb 19, 2024
3e5716b
Move scanner_in_trash to task_info
mattmundell Feb 19, 2024
7b6e8c7
Move other scanner queries to task_info
mattmundell Feb 19, 2024
225b279
Fix: check if trash when getting scanner info in GET_TASKS
mattmundell Feb 19, 2024
14b1da6
Call scanner SQL directly in task_info
mattmundell Feb 20, 2024
a5f76b5
Move scanner SQL into main statement in task_info
mattmundell Feb 20, 2024
9f1322c
Actually set second_last_report_id in task_info
mattmundell Feb 20, 2024
70576f3
Merge branch 'main' into faster-trash-tasks-2
mattmundell Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Actually set second_last_report_id in task_info
mattmundell committed Feb 20, 2024
commit 9f1322c1dc91677b68d04f35d6fc03ffa9fc3ddf
5 changes: 4 additions & 1 deletion src/manage_sql.c
Original file line number Diff line number Diff line change
@@ -17881,7 +17881,7 @@ task_info (task_t task, scanner_t scanner)
task);
if (next (&rows))
{
const char *config_name, *config_uuid;
const char *config_name, *config_uuid, *report_id;

info->config_in_trash = iterator_int (&rows, 0);

@@ -17891,6 +17891,9 @@ task_info (task_t task, scanner_t scanner)
config_uuid = iterator_string (&rows, 2);
info->config_uuid = config_uuid ? g_strdup (config_uuid) : NULL;

report_id = iterator_string (&rows, 3);
info->second_last_report_id = report_id ? g_strdup (report_id) : NULL;

if (scanner)
{
const char *scanner_name, *scanner_uuid, *str;