docs/superpowers/plans/2026-08-10-processlist-idle-boolean-fix.md
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Make textual true enable idle MySQL sessions in stats_mysql_processlist after LOAD MYSQL VARIABLES TO RUNTIME, with an end-to-end TAP regression test.
Architecture: Preserve the existing processlist_config_t boundary. Correct the MySQL admin-side processlist copy when the special variable callback receives boolean text, then exercise the complete admin/config/session/processlist path through TAP.
Tech Stack: C++17, ProxySQL admin variable loading, MariaDB client TAP tests, groups.json CI registration.
true value and LOAD MYSQL VARIABLES TO RUNTIME.Files:
test/tap/tests/reg_test_processlist_idle_boolean-t.cpptest/tap/groups/groups.jsonInterfaces:
Consumes: CommandLine, TAP helpers, MariaDB client API, ProxySQL admin SET/LOAD commands, and stats_mysql_processlist.
Produces: A registered TAP binary named reg_test_processlist_idle_boolean-t that fails on the current atoi("true") implementation.
Step 1: Write the test source before changing production code
Implement one test that:
mysql-session_idle_ms=1 and mysql-session_idle_show_processlist=false, then loads MySQL variables to runtime.mysql_thread_id() without issuing another query.SELECT COUNT(*) FROM stats_mysql_processlist WHERE SessionID=<id> and asserts zero rows while the flag is false.SET mysql-session_idle_show_processlist=true followed by LOAD MYSQL VARIABLES TO RUNTIME.true.mysql-session_idle_show_processlist=true and mysql-session_idle_ms=1 through a final load.The test must use TAP plan()/ok() assertions, free every stored result, and report query failures with diag() before returning a nonzero exit status.
Step 2: Register the test in every standard MySQL g1 group
Add the test name to the same group list used by kill_connection3-t:
"reg_test_processlist_idle_boolean-t" : [ "legacy-g1","mariadb10-galera-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql93-g1","mysql93-gr-g1","mysql95-g1","mysql95-gr-g1" ]
Step 3: Build and run only the new test to verify the expected failure
Run:
make -C test/tap/tests reg_test_processlist_idle_boolean-t
./test/tap/tests/reg_test_processlist_idle_boolean-t
Expected: compilation succeeds when TAP dependencies are available, and the enabled assertion fails against the current implementation because atoi("true") leaves the admin-side flag disabled. If infrastructure or generated dependencies are unavailable, capture that exact limitation and use the source-level red/green validation below.
Files:
lib/Admin_FlushVariables.cpp:498-500Interfaces:
Consumes: varvalue supplied by flush_GENERIC_variables__process__database_to_runtime() after GloMTH->set_variable() validates the MySQL variable.
Produces: Correct GloAdmin->variables.mysql_processlist.show_idle_session values for true, false, 1, and 0.
Step 1: Replace the numeric-only conversion
Change the MySQL callback assignment from:
GloAdmin->variables.mysql_processlist.show_idle_session = atoi(varvalue);
to a boolean conversion equivalent to:
GloAdmin->variables.mysql_processlist.show_idle_session =
strcasecmp(varvalue, "true") == 0 || strcasecmp(varvalue, "1") == 0;
Keep the callback in the existing special-value list and do not alter the PostgreSQL processlist path in this focused fix.
Step 2: Rebuild and rerun the regression test
Run:
make -C lib -j2
make -C src -j2
make -C test/tap/tests reg_test_processlist_idle_boolean-t
./test/tap/tests/reg_test_processlist_idle_boolean-t
Expected: the disabled assertion remains zero and the textual-true assertion reports the idle session.
Files:
Validate: lib/Admin_FlushVariables.cpp, test/tap/tests/reg_test_processlist_idle_boolean-t.cpp, test/tap/groups/groups.json
Step 1: Run TAP registration and formatting checks
python3 test/tap/groups/lint_groups_json.py
python3 test/tap/groups/check_groups.py --source
git diff --check
Step 2: Inspect the final diff and status
git diff --stat
git diff -- lib/Admin_FlushVariables.cpp test/tap/tests/reg_test_processlist_idle_boolean-t.cpp test/tap/groups/groups.json
git status --short --branch
Confirm only the intended production file, TAP test, group registration, and implementation documents are present.
Step 3: Commit the implementation
git add lib/Admin_FlushVariables.cpp test/tap/tests/reg_test_processlist_idle_boolean-t.cpp test/tap/groups/groups.json
git commit -m "fix: parse idle processlist boolean values"
Step 4: Run the final available verification commands
Repeat the targeted test/build commands that are supported by the environment and record any dependency or infrastructure limitation explicitly before requesting review and opening the PR.