mirror of https://github.com/sysown/proxysql
docs/passthrough-auth-spec
feature/aws-rds-monitor
v3.0_fix_ci-mysqlx-cache-and-soak
GH-Actions
v3.0
v3.0_fix_codecov-coverage-path-prefix
issue-1288-load-mysql-variables-feedback
ci/fix-pgsql-socket-g1-cache-key
v3.0_fix_ci-mysqlx-fetch-depth
cleanup/drop-unreachable-port-defaults
feature/pgsql-native-backend-protocol
fix/pgsql-unix-socket
ci-pgsql-socket-g1
v3.0_fix_coverage-gcov-prefix-strip
fix/pgsql-omit-port-zero
aws-rds-bg
fix/jemalloc-page-size-auto-detect
feature/ci-codecov-tap-all-groups-callers
fix/run-tests-backtick-leak
ci/zstd-level-15
feature/ci-codecov-tap-all-groups-callees
v3.0_partition-fairness
feature/ci-codecov-tap-legacy-g2
v3.0_partition-gate
fix/ci-cache-restore-path
v3.0_fix-stale-pause-until
feature/perf-improvements-test2
fix/kill-proxysqlgenai-build-flag
feat/passthrough-auth
ci-trigger-tolerate-cleanup-401
fix/5790-mariadb-collation-255
fix/parsersql-1.0.3-pg-set-fixes
issue_5639
pgsql_dns_cache
fix/5755-followup-typecast-digest-fixtures
v3.0_merge-5776-5784
v3.0_latency_consistency_improvement
fix/galera-g5-cluster-start
fix/ghcr-pull-retry
v3.0_cap_violation_5767
ci-mariadb10-galera-GH-Actions
ci/fix-gr-g5-cluster-start
ci-mysql84-gr-g1-g9-GH-Actions
perf/pull-ci-base-from-ghcr
fix/split-test-groups
fix/rename-set-parser-workflow
gh-actions/add-set-parser-algorithm-3-g1
fix/4760-advertise-lenenc-auth-capability
feature/mysqlx-stack-consolidated
feature/mysqlx-asan-coverage-docker-isolation
fix/ci-unit-tests-tsan-project-name
feature/mysqlx-tsan-v3-companion
feature/ci-builds-add-tsan-matrix
ci-reduce-polling-interval
feature/mysqlx-tsan-workflow-only
feature/mysqlx-ci-validation-workflows
feature/mysqlx-test-leak-cleanup
feature/mysqlx-behavioural-tap
feature/mysqlx-parity-cleanup
ci-g5-enable-cluster
feature/mysqlx-tls-passthrough
feature/mysqlx-asymmetric-tls
feature/mysqlx-state-machines
feature/build-tsan-plumbing
feature/mysqlx-observability-p0
fix/mysqlx-review-findings
v3.0-test-ci
ci/fix-mysql-apt-key-expired-v2
ci/fix-mysql-apt-key-expired
mariadb-rpl-helper
fix-fc-parsing
ci/fix-upload-artifact-eacces
ci/fix-cache-prune-permissions
ci/shrink-test-cache
ci/fix-tap-build-target
ci/gh-actions-readme-pointer
ci/fix-mysql84-infradb-label
ci/add-missing-group-reusables
infra-mysql57-binlog
feature/pgbouncer-compat
v3.0_pgsql_sslkeylog_5281
fix/5554-resolution-family-limitation
fix/3p-ci-error-handling
v3.0-5493
v3.0-ci260322_cluster
copilot/extract-server-selection-algorithm
copilot/extract-health-state-logic
copilot/extract-query-rule-matching-logic
copilot/extract-connection-pool-logic
v3.0-set_parser_v3
feature/arm-builds
release-notes-3.0.6-4.0.6-draft
v3.0.6-add-tap-test_stats_table_check
v2.7.3-test260221
v4.0-mcp-stats
copilot/uninstall-amazon-linux-2023
fix-prometheus-labels-test
tap-mcp-client
agent-skill-tap-test
v4.0-tsdb1
v3.0-fix_5256
gh-pages
feature/modern-docs
v4.0
v4.0-fix-vec-search
v4.0_rag_sys_prompt
v4.0_rag_mcp
v4.0-tsdb
feature/v4-docs-init
otel_system_libs
otel_clean
v3.0-5288
otel
otel_2
fix/postgresql-cluster-sync
v3.0-releate_notes_scripts_fixes
test_gh-actions_triggers
postgresql-digest-testing-improvement
v3.0_select_auto_commit
v3.0-5218
fix-5221
fix/5186-proxysql-stop-admin-crash
v3.0-4951
add-claude-github-actions-1763877527835
fix-rpm
v3.0-DS_crash
add-claude-github-actions-1763663272333
add-claude-github-actions-1763663091346
add-claude-github-actions-1763663091411
add-claude-github-actions-1763476725261
add-claude-github-actions-1763476725489
v3.0_optimizations_and_stability
v2.7.3.1
v3.0.3-upgrade_json
v3.0.sonar-cli
v3.0.sonar-config
otel-tracepoint
v3.0.2-merge-upgrade_deps-add_new_distros
v3.0.2-upgrade_deps
v3.0.2-add_new_distros
v3.0-add_more_testing_groups
v3.0-upgrade_prometheus-cpp
v3.0-upgrade_json
v3.0-upgrade_sqlite3
v3.0-upgrade_libmicrohttpd
v3.0-upgrade_curl
v3.0-add_centos10_builds
v3.0-add_fedora42_builds
v3.0_PG_PrepStmt
v3.0-sliced_groups
v3.0_auth_negotiation
v2.7
v2.7-fix_run_name
v3.0_4799_4827
v3.0-3687
v2.7-pmm_runtime_servers_metrics
v2.7-4839
v2.7-4841
v2.7-bump_version_to_2.7.3
2.6.6-4841
v2.x_pg_PrepStmtBase_240714
v3.0-4803-4817
v3.0-4803
v2.7-minorBugs
v3.0-privates
v2.x-logging_mem_2
v2.7_fix
v2.7_amd64_build_fix
v2.7-fix_aux_threads_ssl_leaks
v2.7-fix_ssl_params_leak
v2.7-rm_malloc_conf_on_version
v2.7_compression
v2.7-actions-add-3p-tests-parameter
none
v2.7-fix_hang_on_resume
v2.x-logging_mem
v2.7_servers_defaults
v2.7-mariadb_column_metadata_integrity_check
ssl_optimization
v2.7_reg_test_4716_single_semicolon
v2.7_issue_4707_threshold_resultset_size
v2.7_reg_test_4723_query_cache_stores_empty_result
2.7_randomized_cache_ttl
v3.0_fix_multiple_builds
v3.0_servers_defaults
v2.7-update_actions_triggers_v2
v2.7-update_actions_triggers
v2.6
v2.6.x-update_triggers
v2.6-4646
v2.7.1-update_actions
v2.x
v2.6.x-testing-global-multiplexing-disabled
use-wrlock-in-dns-cache-empty
v2.6.x-fix-darwin
v2.x-admin_list_ciphers
v2.x-sqlite3_pass_exts
v2.x-tap_tests_opt_ssl
v2.6.0-update_to_libhttpserver_v0.19
v2.x_router_2ports
v2.6.0-update_to_openssl_v3.1.5
v2.x-2411025
v2.x-profiling_poc1
v2.x_sha2pass_draft2
v2.x-webui_fixes
v2.6.0-more-makefile-fixes
v2.x-20230914_test
v2.x-20230913_test
v2.5.5-branch
v2.5.5-branch_255_patches
v2.x-aurora_autodiscovery-refactor_cluster_mysql_servers-gr_bootstrap_mode_2
v2.x_mysql_connector_j_fixes
v2.6-deprecate_old_clickhouse
v2.x_refactor_cluster_mysql_servers
v2.x-aurora_autodiscovery
v2.x-zd70545
v2.x-aurora_autodiscovery_shunned_promotion
v2.x-tap20230609
v2.x-test20230530
v2.x_sha2pass_draft2-TEST
v2.x-session_track_system_variables_v2
v2.x-status-variables-for-set-stmts
v2.x-enable_session_state_trackers
v2.x-increase-logging-eof_fast_forward-t
v2.x-3863-special-query
v2.x-session_track_system_variables
v2.x_refactor_read_only_action
v2.x_sha2pass_draft1
v2.2.0-sqliteserver_read_only
v2.x-digest_umap_aux-comparison
v2.4.8
v2.x-4105_4114
v2.x-3583-server_closed_conn
v2.x-group_replication_rework-SHUNNED_promotion
v2.1.0-var-global-multiplex
v2.x-CI-hostname-tap-test-fixes
v2.x-limit-version-check
v2.x-fix_deprecate_eof_warning
v2.x-3698
v2.x_tidb_replica_read
v2.x-HostGroups_attributes
v2.0.18.221009
v2.x-ci_reg_test_3273_ssl_con
TAP_test_restapi
v2.x-tap_tests_groups
v2.x-tap_test_sqlite3_server-t
PRS_3888_3903_2
PRS_3888_3903
v2.x_code_refactor_2206
v2.x-multipacket_poc_1
v2.x-impr_hg_latency_obsv
v2.x-gcc-warnings
v2.x-hg_lock_session_id
v2.x-3768
v2.x-3371
v2.x-ci_verifications
v2.x-thread_local_qps_limit
v2.x-parser_table
v2.1.1-3207
v2.x-qps_limits
v2.x-3711
v2.x-3642
v2.x-3674
v2.x-ssl3_warnings
V2
v2.3.2
v2.3.2_3646_3647
v2.x-client_err_limit_conn_timeout
v2.x-keep_multiplexing_regression_fix
v2.3.2-3628
v2.2.2-to-v2.3.0-7
v2.2.2-to-v2.3.0-7_merge
v2.2.2-to-v2.3.0-6
v2.2.2-to-v2.3.0-6_merge
v2.2.2-to-v2.3.0-5
v2.2.2-to-v2.3.0-4
v2.2.2-to-v2.3.0-3
v2.2.2-to-v2.3.0-2
v2.2.2-to-v2.3.0-1
v2.3.1
v2.0.14-70226
v2.3.0
v2.x-client_err_limit-gr_replication_lag_action
v2.2.2
v2.2.1-3603
v2.2.1-centos7-ASAN
v2.2.1
v2.2.1-3601
v2.2.1-3599
v2.2.1-3597
v2.2.1-3595
v2.2.0-restapi_server_exc_log
v2.x-3574
v2.x-3558
v2.2.0-3546-centos-7-gcc-8
v2.x-3549
v2.x-cluster_large_mysql_users
v2.x-cov_ci_verification
v2.0.14-tb1
v2.0.14-tb1-3494
v2.0.14-tb1-3488
v2.0.14-tb1-3117
v2.0.14-tb1-2762
v2.0.14-2762
v1.4.13-arm
v2.1.1-3296
v2.2.0
v2.0.18
v2.1.1
v2.0.18-3342
v2.0.18-3182
v2.1.1-3184
v2.1.0-revert-da7fdfe14
v2.0.18-revert-da7fdfe14
v1.4.13-70160
v2.0.18-3354
v2.0.18-3350
v2.0.14-3339
1.4.13-70160
v2.0.18-3339
v2.1.1-3317
v2.1.1-3319
v2.0.18-3317
v2.1.2-LBalgo
v2.0.18-1574
v2.1.2-hgman
v2.0.17
v2.1.0
v2.0.17-3288
v2.0.17-3276
v2.0.17-3273
v2.0.16
v2.0.16-3267
v2.0.16-3265
v2.0.16-3262
v2.0.16-3261
v2.1.1-3252
v2.1.1-collation
v2.0.16-3252
v2.0.16-collation
v2.1.0-parser
v2.0.16-3219
v2.0.16-3216
v2.0.16-3201
v2.0.16-2330
revert-3191-v2.0.16-3190
v2.0.16-3204
v2.0.16-3177
v2.0.16-2619
v2.0.16-3190
v2.0.16-3187
v2.1.0-70118
v2.0.16-3133
v2.0.16-3133_ci_verification
v2.0.16-3150
v2.0.16-change_user
v2.0.15
v2.0.15_amd64_fix
v2.0.15_arm64_packages
v1.4.14-ssl
v2.0.15_arm64
v2.1.0-2820
v2.0.15-sslbug
v2.0.15-KillTrx
v2.0.14
v2.0.14-ch_build_fix
v2.0.14-focal
v2.0.14-valgrind20200904
v2.1.0-3042
v2.0.14-3035
v2.0.14-3036
v2.0.14-2955
v2.0.14-vars
v2.0.14-3005
v2.0.14-3003
v2.0.14_2970_2979
v2.0.14-NOTSOCK
v2.1.0'
v2.0.14-2958
v1.4.10-zd
v2.0.13
v2.0.13-autocommit_fix
v2.1.0-2892
v2.0.13-2711
v2.0.13-duplicated_variables
v2.0.13-duplicated_variables_for_2.1.0
v2.0.12-deprecate_eof
v2.1.0-1377
v2.1.0-admin_queries
v2.0.12-var-global-multiplex
v2.1.0-var-foreign-key
v2.0.12
v2.0.12-tab-small-log
v2.0.12-var-foreign-key
v2.0.12-var-long-query-time
v2.0.12-galera-shunned
v2.1.0-admin_queries_2
v2.1.0-tap-rm-config
v2.0.12-tap-rm-config-test
v2.1.0-QP_stmt_3
v2.0.11-fix-multi-2-ci
v2.0.11-fix-multi
v2.0.11-266_0-3
2.1.0
v2.0.11
v2.1.0-track-vars
v2.1.0-track-variables
v2.0.11-track-variables
v2.0.11-2526
v2.0.11-tap-tests
v2.0.13-2698-commit1
v2.0.10-galera-pxc-maint-mode
v2.0.11-track-vars
v2.0.10-2647
v2.0.11-track
v2.0.11-track-session-vars
v2.0.9-var-array-review
v2.0.11-stats
v2.0.10
v2.0.10-centos67
v1.4.14.2
1.4.14.2
v1.4.14-show-warnings
v2.0.9
v2.0.9-var-array_2
v2.0.9-var-array
v1.4.16
v2.0.8
val214-changing_charset
v2.0.6
v1.4.16-1922_2
v1.4.13.2
v2.0.4-charset248
v2.0.5
v1.4.10-67841
v2.0.4
v2.0.4-sqlite327
v2.0.3
v2.0.2
v1.4.15
v2.0.1
v1.4.14
v2.0.0
v1.4.14-ping_shun
v1.4.14-1828
v1.4.14-latency_awareness
v1.4.12
v1.4.13-admin_deadlock
v2.0.0-improve_speed
v1.4.13
v1.4.13-autocommit_revert
v1.4.11.2
v1.4.13-ps
v2.0.0_bionic_deb_fix
v2_962
v1.4.12-1640
v1.4.11-names_tz
v1.4.12-1693
master
v1.4.11
v1.4.10
v1.4.6
v1.3.10
jenkins_test
v2.0.0-cachegrind
v1.4.9
v2.0-lab
v149_1511
v149_1382
v1.4.7-f2
v1.4.7-f1
v149_1491
v1.4.5-kub
v1.4.8
v2.0-web2
v1.4.3
v1.4.7
bsd_install_update
v1.4.2
v1.4.1-ch2
v1.4.1
v1.3.9
v1.4.1-ch
v1.3.8
v1.3.8-dev
v1.3.7
v1.3.7-dev
v1.3.6-dev
v1.4.0-clickhouse
v1.4.0
v1.3.6
v1.3.5
v1.3.5-dev
v1.4.0-955
v1.3.4
v1.3.4-dev
v1.3.3
v1.3.3-dev
v1.3.2
v1.3.2-dev
v1.3.2-766
v1.3.0h
v1.3.1-utf8mb4
1.4.0-840
v1.3.1
v1.2.6
v1.3.0
v1.4.0-797
v1.2.5-715
v1.2.5
v1.2.4-lowmem
v1.3.1-dev-mem
v1.2.0
connleak
lab-1.2.0
v1.1.2
T107_add_proxysql_consul_requirements
T89_write_consul_integration_doc
T98_consul_multi_table_config
mongoose
evhttp
SQLiteServer
1.0
3.0.9
3.0.8
3.0.7
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
2.7.3
2.6.6.1
3.0.1
2.7.2
3.0.0
2.6.6
2.7.1
2.7.0
2.6.5
2.6.4
2.6.3
2.6.2
2.6.1
2.5.5
2.6.0
2.5.4
2.5.3
2.5.2
2.5.1
2.4.8
2.5.0
2.4.7
2.4.6
2.4.5
2.4.4
2.4.3
2.4.2
2.4.1
2.4.0
2.3.2
2.3.1
2.3.0
2.2.2
2.2.1
2.2.0
2.0.18
2.1.1
2.0.17
2.0.16
2.0.15
2.0.14
2.0.13
2.0.12
2.0.11
2.1.0
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
1.4.16
1.4.15
2.0.1
1.4.14
1.4.13
1.4.12
1.4.11
1.4.10
1.3.10
1.4.9
2.0.0
1.4.8
1.4.7
1.4.6
1.4.4
1.4.3
1.4.2
1.3.9
1.3.8
1.4.1
1.3.7
1.4.0
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0h
1.3.0g
1.3.0f
1.3.0e
1.3.0d
1.3.0c
v1.3.0b
1.4.5
v1.1.0
v1.1.0-rc
v1.1.1-beta
v1.1.1-beta.1
v1.1.1-beta.2
v1.1.1-beta.3
v1.1.1-beta.4
v1.1.1-beta.5
v1.1.1-beta.6
v1.1.2
v1.2.0a
v1.2.0b
v1.2.0c
v1.2.0d
v1.2.0e
v1.2.0f
v1.2.0g
v1.2.0h
v1.2.0i
v1.2.0j
v1.2.0k
v1.2.1
v1.2.2
v1.2.3
v1.2.4
v1.2.4.0923
v1.2.5
v1.2.6
v1.3.0
v1.3.0a
v1.3.0g
v1.3.0h
v1.3.1
v1.3.10
v1.3.2
v1.3.2-1
v1.3.3
v1.3.4
v1.3.5
v1.3.6
v1.3.7
v1.3.8
v1.3.9
v1.3.9-prev.1
v1.4.0
v1.4.1
v1.4.10
v1.4.11
v1.4.12
v1.4.13
v1.4.14
v1.4.15
v1.4.16
v1.4.2
v1.4.3
v1.4.4
v1.4.5
v1.4.6
v1.4.7
v1.4.8
v1.4.9
v2.0.0-beta.1
v2.0.0-rc1
v2.0.0-rc2
v2.0.1
v2.0.10
v2.0.11
v2.0.12
v2.0.13
v2.0.14
v2.0.15
v2.0.16
v2.0.17
v2.0.18
v2.0.2
v2.0.3
v2.0.4
v2.0.5
v2.0.6
v2.0.7
v2.0.8
v2.0.9
v2.1.0
v2.1.1
v2.2.0
v2.2.1
v2.2.2
v2.3.0
v2.3.1
v2.3.2
v2.4.0
v2.4.1
v2.4.2
v2.4.3
v2.4.4
v2.4.5
v2.4.6
v2.4.7
v2.4.8
v2.5.0
v2.5.1
v2.5.2
v2.5.3
v2.5.4
v2.5.5
v2.6.0
v2.6.1
v2.6.2
v2.6.3
v2.6.4
v2.6.5
v2.6.6
v2.7.0
v2.7.1
v2.7.2
v2.7.3
v3.0.0-alpha
v3.0.1
v3.0.2
v3.0.3
v3.0.4
v3.0.5
v3.0.6
v3.0.7
v3.0.8
v3.0.9
v3.1.6
v3.1.7
v3.1.8
v3.1.9
v4.0.6
v4.0.7
v4.0.8
${ noResults }
1124 Commits (v3.1.9)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
3e7b77456e
|
Merge branch 'v3.0' into v3.0_partition-gate
|
1 month ago |
|
|
b04caafef1 |
fix(coverage): unbreak lcov capture for {MySQL,PgSQL}_Session.cpp
Both lib/PgSQL_Session.cpp and lib/MySQL_Session.cpp contain a doxygen @note that *literally spells out* the strings `LCOV_EXCL_START` and `LCOV_EXCL_STOP` while documenting why those directives wrap the `assert(0)` block below the comment. lcov's geninfo scans every source line (comments included) for those tokens and treats them as real directives -- so the doc occurrence opens an exclude block, the real opener on the next assert opens it again, and geninfo aborts with: ERROR: <file>: overlapping exclude directives. Found LCOV_EXCL_START at line N - but no matching LCOV_EXCL_STOP for LCOV_EXCL_START at line M That error short-circuits the LCOV capture path in `test/infra/control/run-unit-tests-asan-coverage.bash` so `coverage/lcov.info` is never produced. The downstream "Upload coverage LCOV file" workflow step has been silently warning "No files found" for at least three runs (compare artifact listings of the three most recent CI-unit-tests-asan-coverage successes -- all zero artifacts), which in turn means the new Codecov upload step in #5817 also had nothing to send. Fix: rewrite the @note paragraph in both files so it describes what the directives do without literally containing the token strings, and explicitly call out that this is intentional. The wrapper directives around the actual `assert(0)` are unchanged. A clean lcov capture validates with `make ubuntu24-tap` followed by `docker compose run --rm --entrypoint bash ubuntu24_dbg_build -lc \ 'cd /opt/proxysql && test/infra/control/run-unit-tests-asan-coverage.bash'` which should produce a non-empty `coverage/lcov.info`. |
1 month ago |
|
|
1d52499791
|
Merge pull request #5808 from sysown/issue_5639
fix(session): avoid double-free of stmt_meta pkt in LargePacket (#5639) |
1 month ago |
|
|
af4aa17346
|
Merge pull request #5807 from sysown/fix/5790-mariadb-collation-255
fix(core): validate_charset must replace collation 255 on MariaDB backends (#5790) |
1 month ago |
|
|
81bcc802da |
fix(core): apply MariaDB / MySQL 9.x detection to sibling version checks
The same mental defect fixed in lib/MySQL_Variables.cpp:validate_charset()
(commit before this one) exists at four other call sites in core. All
four use a first-character or 3-byte string-prefix comparison against
server_version and consequently misclassify either MariaDB or MySQL 9.x
(or both). Two are latent (MariaDB happens to land on the still-working
branch); the two in MySQL_Monitor.cpp are an active break on MySQL 9.x
Galera/PXC, because `INFORMATION_SCHEMA.GLOBAL_STATUS` was removed in
MySQL 8.4 and MySQL 9.x falls into the else branch that targets it.
Audited sites and fixes:
lib/MySQL_Session.cpp:2607-2615 -- tx_isolation / tx_read_only
Pre-fix: `strncmp(sv,"8",1)==0` chose `transaction_isolation` /
`transaction_read_only`; everything else got `tx_isolation` /
`tx_read_only`. MySQL 9.x fell to the else branch, but `tx_isolation`
was removed in MySQL 8.4; on MySQL 9.x the SET fails. MariaDB also
fell to the else branch -- coincidentally correct, since MariaDB
keeps `tx_isolation` across all versions.
Post-fix: use the modern name only for non-MariaDB MySQL >= 8.0
(any major), so MySQL 8.0/8.4/9.x all get `transaction_isolation`
and MariaDB 10/11 keeps `tx_isolation`.
lib/MySQL_Monitor.cpp:749 (sync MON_GALERA setup)
lib/MySQL_Monitor.cpp:2297 (async MON_GALERA dispatch)
Pre-fix: `strncmp(sv,"5.7",3)==0 || strncmp(sv,"8",1)==0` picked
performance_schema.global_status; everything else used
INFORMATION_SCHEMA.GLOBAL_STATUS. MySQL 9.x fell to the else branch
and queries INFORMATION_SCHEMA.GLOBAL_STATUS, which was removed in
MySQL 8.4 -- monitor query fails on MySQL 9.x Galera/PXC. MariaDB
Galera correctly fell to the else branch and uses
information_schema, which is where MariaDB keeps GLOBAL_STATUS.
Post-fix: use performance_schema for non-MariaDB MySQL >= 5.7 (so
MySQL 5.7, 8.0, 8.4, 9.x all share that path); MariaDB Galera and
legacy MySQL/PXC < 5.7 retain the information_schema path.
Pattern used at all sites (matching the existing fix in
validate_charset):
const char *sv = ...->mysql->server_version;
bool is_mariadb = (sv != NULL && strstr(sv, "MariaDB") != NULL);
int sv_major = (sv != NULL) ? atoi(sv) : 0;
No dedicated test added for the Monitor / SET TRANSACTION paths in this
commit: the Monitor change is exercised by any mariadb10-galera or
mysql{8,9}x-* CI group with Galera/PXC backends, and the
transaction_isolation change by SET-isolation-level coverage in
existing TAP groups. The validate_charset regression test added in
the prior commit on this branch still covers the original #5790 path.
|
1 month ago |
|
|
b3f7d29d51 |
fix(session): avoid double-free of stmt_meta pkt in LargePacket (#5639)
When handler_WCD_SS_MCQ_qpo_LargePacket() is reached via the COM_STMT_EXECUTE path, MySQL_Protocol::get_binds_from_pkt() has already aliased stmt_meta->pkt to pkt->ptr (see the FIXME at MySQL_Protocol.cpp:2873). The subsequent RequestEnd() -> Query_Info::end() free()s stmt_meta->pkt (the fix introduced for bug #796 at MySQL_Session.cpp:455), and then LargePacket's own l_free(pkt->size, pkt->ptr) frees the same buffer a second time. With jemalloc this silently corrupts the arena and surfaces later as the SIGSEGV reported in #5639, with the crashing frame landing on the l_free call site (+0x10e into LargePacket). Under ASAN the double-free aborts deterministically with a backtrace whose two free() chains match the report exactly. Fix: capture whether CurrentQuery.stmt_meta aliases pkt before calling RequestEnd() (which clears stmt_meta), and skip the second free when the alias was present. For the COM_QUERY path through LargePacket, stmt_meta is always NULL, so the previous behaviour is preserved there. Also add reg_test_5639_stmt_execute_max_allowed_packet-t which exercises the STMT_EXECUTE > mysql-max_allowed_packet path and asserts the session and process survive. |
1 month ago |
|
|
5b5b9373e3 |
feat(pgsql,mysql): gate ProcessAllSessions_Partition by pool-acquire NULL ratio
ProcessAllSessions_Partition (Pass 1, the 3-way A/B/C session classification) is cheap and beneficial when block B (sessions waiting for a backend) is non-empty: it lets block A finish queries and release conns to block B waiters in the same outer iteration. When no sessions are contending for backends, partition is unnecessary work. Detect the contention state with a per-worker counter pair tracked at the get_MyConn_from_pool() call site: every call increments partition_pool_attempts; calls that returned NULL (couldn't acquire, session must wait) also increment partition_pool_nulls. At the top of each process_all_sessions outer iteration, the worker computes the NULL ratio and updates a hysteresis state machine: 3 consecutive iterations with ratio >= 5% flips partition_active to true; 3 consecutive iterations below the threshold flips it back. Mechanism: * Cheapest possible signal: 1 int increment per pool acquire, 1 branch per outer iteration. * Hysteresis (3 consecutive iterations either direction) filters transient bursts without needing min-sample / asymmetric-threshold tuning. * Single threshold 5% works in both directions by virtue of the streak filter -- the ratio has to be sustained near the boundary for flapping to occur, which doesn't match any realistic workload. Empirical verification at 1 worker thread, 500c clients, 4 KB rows, 50-conn backend pool, SSL on, 120 s: 20c (no contention): 1576 tps, 13 ms avg latency, gate stays OFF 100c (some): 1487 tps, 67 ms, gate stays ON 500c (heavy): 1487 tps, 336 ms, gate stays ON The gate transitions automatically; no admin variable to learn. Applied symmetrically to MySQL_Thread / MySQL_Session and PgSQL_Thread / PgSQL_Session. See #5791 for analysis. |
1 month ago |
|
|
960c8bcb73 |
fix(session): SET STATEMENT ... FOR detection tolerates any whitespace
PR #5708 added detection for MariaDB's `SET STATEMENT … FOR …` syntax to keep ProxySQL from invoking `unable_to_parse_set_statement()` and locking the session to a single hostgroup. The detection at `lib/MySQL_Session.cpp` was: if (strncasecmp(nq.c_str(), "SET STATEMENT ", 14) == 0 && strcasestr(nq.c_str(), " FOR ")) { return false; } `strcasestr(nq, " FOR ")` is a literal-substring search requiring a space BOTH before and after the FOR keyword. A customer report (see PR #5708 thread) reproduced the same error 9006 as before the fix by typing the statement across multiple lines at the mysql client prompt — the character after FOR is then a newline, not a space, so the detection misses, the code falls through to the regular SET parser, the parser doesn't know SET STATEMENT, and the hostgroup is locked to the user's default. The next non-default-hostgroup query fails with 9006. Verified with a standalone strcasestr probe: q1 (customer multi-line): strcasestr(" FOR ") matches ? NO q2 (existing TAP single-line): YES The fix uses `dig` (the digest text) for the detection instead of `nq` (the raw query). `dig` is whitespace-normalised by the digest builder, so " FOR " always has a space on both sides regardless of how the client formatted the query. This is consistent with the prefix check 35 lines above, which already uses `dig` for keyword detection. == Test coverage == `test/tap/tests/test_set_statement_for-t.cpp` previously had `plan(5)` and self-skipped on non-MariaDB backends via `skip_all()`. It was also registered ONLY in MySQL-family TAP groups (`legacy-g2`, `mysql84-g2`, etc.). The net effect was that the test self-skipped on every CI run since it was added — never actually executing an assertion in CI. The customer's bug regressed entirely unnoticed. This commit: 1. Removes the runtime MariaDB-detection helper and the `skip_all` call. A misregistered test should fail loudly, not silently skip; correct registration is enforced through the groups.json layer instead. 2. Moves the groups.json registration from the MySQL-only groups to `mariadb10-galera-g2`, which actually provides a MariaDB backend. 3. Adds four new test cases (assertions 6–13) covering the customer whitespace shapes that strcasestr (" FOR ") missed: newline, tab, CRLF, and multiple spaces between FOR and the inner statement. Each case verifies (a) the SET STATEMENT succeeds, and (b) a follow-up plain SELECT succeeds (i.e. no hostgroup lock persists — the customer's actual failure mode). Verified locally on TAP group mariadb10-galera-g2 against MariaDB 10.11.9: 13/13 ok, RC=0. A separate framework-cleanup follow-up should remove `skip_all()` from `test/tap/tap/tap.{h,cpp}` entirely and convert the other four callers (`test_mysqlx_e2e_*`, `test_mysqlx_route_drop_inflight-t`, `test_mysqlx_sigterm_inflight-t`) to either fail loudly or move to appropriately-gated TAP groups. |
1 month ago |
|
|
d0a1313e51 |
fix(core): handle MySQL errors 1210 and 1231 when setting variables on backend
ProxySQL now gracefully handles error 1210 (Incorrect arguments to SET) in addition to the previously handled 1231 (Variable can't be set to the value). Both errors occur when a tracked variable is SET on a backend that has the variable but rejects the value (e.g. wsrep_trx_fragment_size on MariaDB 10.11 with wsrep_provider=none). Instead of destroying the backend connection, ProxySQL marks the variable as absent on that connection and continues. Also fix test comparison logic: when the backend returns UNKNOWNVAR for a variable (backend doesn't have it) but ProxySQL's tracked value matches the expected CSV value, count it as a pass. This prevents false failures when test connections are routed to heterogeneous backends. |
2 months ago |
|
|
26a6d44a69 |
fix(core): handle MySQL error 1231 gracefully when setting variables on backend
When ProxySQL tries to SET a tracked variable on a backend that has the variable but rejects the value (error 1231: Variable can't be set to the value), it now marks the variable as absent on that connection and continues instead of destroying the connection. This matches existing handling for errors 1193 (unknown variable), 1064 (syntax error), and 1651 (query cache disabled). Fixes set_testing failures on MariaDB 10.11 with wsrep_provider=none, where wsrep_trx_fragment_size exists but all SET attempts fail with error 1231. |
2 months ago |
|
|
0f8e014a33 |
Merge branch v3.0 into issue-5686-galera-vars
Resolve groups.json conflict: keep test_set_statement_for-t from PR and set_parser_algorithm=3-g1 additions from v3.0. |
2 months ago |
|
|
c68f60f04b |
merge: merge v3.0 into feature/parsersql-integration
Resolve conflict in test/tap/tests/unit/Makefile: keep v3.0's refactored linking (WHOLE_LIBPROXYSQL to avoid double-link under ASAN) and add -lsqlparser for parsersql integration. |
2 months ago |
|
|
03f253800e |
fix: add missing include for parsersql_parse_set_mysql in MySQL_Session.cpp
MySQL_Session.cpp calls parsersql_parse_set_mysql() declared in Query_Processor_ParserSQL.h but never included it, causing a compilation failure in all CI jobs that rebuild from scratch. |
2 months ago |
|
|
6927682d08 |
fix: add null checks before deleting server_myds in backend reset and ping handlers
SonarCloud flagged potential double-free in mysql_backend.cpp (S3520). While the callers ensure single invocation, adding null checks and nullifying after delete is defensive. Applied same pattern to MySQL_Session and PgSQL_Session ping handlers for consistency. |
2 months ago |
|
|
222a5d1ec8
|
Merge branch 'v3.0' into feature/parsersql-integration
Signed-off-by: René Cannaò <rene@proxysql.com> |
2 months ago |
|
|
deb1c46173 |
fix: address code review findings C1-C3, I1, I3
C1: NODE_SET_CHARSET map key corrected to character_set_results C2: query_processor_parser==1 now also routes SET through ParserSQL C3: qp->digest initialized to 0 on parse failure I1: header docs corrected (tokenizer-based, not libinjection) I3: defensive NODE_SET_TRANSACTION case added to SET walker |
2 months ago |
|
|
dffa89de7a |
fix(ci): repair non-PROXYSQL40 dbg builds + genai unit-test linking
CI surfaced two separate build breakages that had been latent since
the carve-out steps but only became visible once they ran on the
right matrix variants.
# lib/MySQL_Session.cpp + lib/PgSQL_Session.cpp: chassis dispatch
# block needs PROXYSQL40 guard
The query-hook dispatch I added in Step 2.2 references chassis types
(`ProxySQL_PluginProtocol`, `ProxySQL_PluginQueryHookPayload`,
`ProxySQL_PluginQueryHookResult`, etc.) without an `#ifdef PROXYSQL40`
guard. Those types are only declared when ProxySQL_Plugin.h is
compiled with `-DPROXYSQL40` — v3.0/v3.1 dbg builds (debian12,-dbg
and ubuntu22,-tap on the CI matrix) define neither, so the lib step
fails:
MySQL_Session.cpp:4477:127: error: 'ProxySQL_PluginProtocol' has
not been declared
MySQL_Session.cpp:4477:85: error: 'proxysql_has_configured_plugin
_query_hook' was not declared
in this scope
[+ 7 more identical errors in PgSQL_Session.cpp]
Wrap both dispatch blocks (MySQL_Session.cpp:~4477-4509,
PgSQL_Session.cpp:~2414-2446) in `#ifdef PROXYSQL40`. The block was
only meaningful when the chassis is present anyway — the call to
`proxysql_has_configured_plugin_query_hook` short-circuits to false
when no plugin is loaded, but the SYMBOL doesn't exist at all in
non-chassis builds.
# test/tap/tests/unit/Makefile: PROXYSQLGENAI autodetect probe was
# defining the macro without a way to satisfy the resulting linker
# requirements
Pre-Step-7 the autodetect probed for `MCP_Tool_Handler` in
libproxysql.a; this symbol is plugin-side now, so the probe never
matches and PROXYSQLGENAI stays empty. My previous attempt to
"fix" the autodetect (probing `invoke_register_schemas_phase`) made
it match again — but that defines PROXYSQLGENAI for the WHOLE unit-
test build, including tests like `genai_llm_clients_unit-t` and
`genai_mcp_endpoint_unit-t` that pull in plugin headers AND
instantiate plugin classes. Those classes' definitions live in
plugin .cpp files that the unit-test build does NOT link, so the
result was:
genai_llm_clients_unit-t.cpp:201: undefined reference to
`LLM_WriteCallback(void*, unsigned long, ...)' [+5 more]
Solution: never auto-define PROXYSQLGENAI for the unit-test build.
Tests that legitimately exercise plugin internals
(`genai_plugin_anomaly_unit-t`, `genai_plugin_backend_client_unit-t`,
`genai_plugin_load_unit-t`, `genai_fts_string_unit-t`) declare a
new GENAI_PLUGIN_DEFINES variable on their dedicated rule and add
the specific plugin .cpp files they need to the link line. Every
other genai_*_unit-t test guards its body in `#ifdef PROXYSQLGENAI
... #else SKIP #endif`, so falling through to the SKIP path keeps
CI green. Coverage for those tests in non-genai builds was already
zero — the autodetect was never activating PROXYSQLGENAI for them in
practice (the probed symbol moved out in Step 6). This commit
documents that reality instead of pretending to maintain coverage
that didn't exist.
# test/tap/tests/unit/genai_fts_string_unit-t.cpp: stub for
# MySQL_Tool_Handler::execute_query
The new dedicated rule for genai_fts_string_unit-t compiles
plugins/genai/src/MySQL_FTS.cpp directly into the test binary.
MySQL_FTS::index_table calls MySQL_Tool_Handler::execute_query — but
this test only exercises the pure string helpers (sanitize_name /
escape_*) and never reaches index_table, so the call site is
unreachable at runtime. The linker still needs a body, so we
provide an empty stub directly in the test .cpp. The real
implementation lives in MySQL_Tool_Handler.cpp which we can't link
without dragging in the full plugin runtime stack.
|
2 months ago |
|
|
28cf4ceab8 |
feat(plugins/genai): Step 5 — move GenAI/LLM/AI surface into the plugin
Largest carve-out commit since 4.C: moves the GenAI / LLM / AI / RAG
surface (about 7K LOC) out of core into plugins/genai/. After this
commit, libproxysql.a no longer publishes any of GenAI_Threads_Handler,
LLM_Bridge, LLM_Clients, AI_Features_Manager, AI_Tool_Handler,
RAG_Tool_Handler, or the legacy GloGATH/GloAI globals.
Files moved (git mv preserves history)
Headers (include/ -> plugins/genai/include/)
GenAI_Thread.h
LLM_Bridge.h
AI_Features_Manager.h
AI_Tool_Handler.h
RAG_Tool_Handler.h (promoted from Step 6 — bidirectional
dep with AI_Features_Manager forced
the early move, same way MySQL_FTS.h
got promoted in 4.C)
Sources (lib/ -> plugins/genai/src/ or …/tool_handlers/)
GenAI_Thread.cpp
LLM_Bridge.cpp
LLM_Clients.cpp (.cpp without a header; class decls
live in LLM_Bridge.h)
AI_Features_Manager.cpp
AI_Tool_Handler.cpp -> tool_handlers/
RAG_Tool_Handler.cpp -> tool_handlers/
Plugin lifecycle takeover
plugins/genai/src/plugin_main.cpp:
- Defines plugin-local GloGATH and GloAI alongside the existing
GloMCPH (all three are .so-internal aliases for the contexts
genai_init constructs).
- genai_init now also constructs GenAI_Threads_Handler (calls
->init()) and AI_Features_Manager (calls ->init()), mirroring
the pre-Step-5 ProxySQL_Main_init_GenAI_module sequence.
- genai_stop tears them down in reverse order.
plugins/genai/src/ProxySQL_MCP_Server.cpp:
- AI / RAG endpoint registration re-enabled (was #if 0'd in 4.C
because the constructors weren't reachable from the plugin
then). /mcp/ai and /mcp/rag are once again live when the
operator has GloAI configured.
plugins/genai/src/Anomaly_Detector.cpp + plugin_main.cpp:
- get_query_embedding() now calls through a function-pointer
hook (genai_anomaly_embed_fn) that plugin_main installs in
genai_init and clears in genai_stop. This indirection lets
the test fixture (which compiles Anomaly_Detector.cpp directly
into a test binary, without GenAI_Thread.cpp) link cleanly —
the pointer stays null, the detector short-circuits to empty
embedding, and the existing nullptr-guard in
check_embedding_similarity does the rest.
Core neutralization
src/main.cpp:
- Drops the GloGATH / GloAI globals, ProxySQL_Main_init_GenAI_module
definition + call, the shutdown branch, and the
`if (GloGATH) init_genai_variables()` call.
lib/Admin_Bootstrap.cpp / Admin_FlushVariables.cpp / Admin_Handler.cpp /
ProxySQL_Admin.cpp / MySQL_Session.cpp / ProxySQL_Admin_Stats.cpp:
- Drop the corresponding `#include` and `extern` declarations.
- flush_genai_variables___* stubbed (mirrors the 4.C MCP pattern;
original bodies preserved in `#if 0` for the upcoming
LOAD/SAVE GENAI verbs port).
lib/Admin_Handler.cpp:
- Loose-prefix accept for `genai-*` in is_valid_global_variable
(mirrors the 4.F mcp-* fix), so SET genai-X=Y still reaches
main.global_variables; runtime push happens via the plugin's
LOAD GENAI VARIABLES TO RUNTIME (registered in a follow-up).
include/cpp.h, include/proxysql.h:
- Removed the AI_Features_Manager.h / LLM_Bridge.h / GenAI_Thread.h
/ AI_Tool_Handler.h / RAG_Tool_Handler.h includes that no
longer resolve from core's -I path.
test/tap/test_helpers/test_globals.cpp:
- Drops the matching `#include`s and stub globals.
Test fixture
test/tap/tests/unit/Makefile:
- PROXYSQLGENAI auto-detect probe switched from `GenAI_Thread`
(now plugin-only) to `AI_Vector_Storage` (still in core for
Step 6). After Step 6 the probe will switch again, and
Step 7 deletes the auto-detect entirely.
All three plugin unit tests pass:
- genai_plugin_load_unit-t : 25/25
- genai_plugin_anomaly_unit-t : 6/6
- genai_plugin_backend_client : 27/27
Carve-out scoreboard:
Step 0-2 : infrastructure
Step 3 : ~1.1 K LOC (Anomaly_Detector)
Step 4.B : ~0.5 K LOC (backend_client)
Step 4.C : ~13 K LOC (MCP subsystem)
Step 4.F : runtime-reconfig admin SQL routed through plugin commands
Step 4.G : MCP admin / config / stats tables registered via plugin ABI
Step 5 : ~7 K LOC (GenAI/LLM/AI/RAG)
Pending: Step 6 (AI_Vector_Storage, MySQL_Catalog, Discovery_Schema,
Static_Harvester, PgSQL_Static_Harvester) and Step 7 (delete the
PROXYSQLGENAI macro entirely).
|
2 months ago |
|
|
2b781ffbfd |
feat(session): Step 4.A — remove the GENAI:/LLM: query-prefix escape hatches
Per decision Q2 in the GenAI plugin carve-out design doc, the in-line
MySQL-protocol prefixes that bypassed routing, ACLs, and the query
processor are removed. Users reach GenAI features through MCP, admin
SQL, or the REST endpoint -- as the rest of the carve-out finishes,
nothing else needs the in-core GENAI:/LLM: handlers.
Removals:
lib/MySQL_Session.cpp (-933 lines)
- handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY___genai
- handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY___llm
- handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___genai_send_async
- handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___handle_genai_response
- genai_cleanup_request
- check_genai_events
- The COM_QUERY prefix-detection block that dispatched to those
handlers
- The check_genai_events poll-loop hook in WAITING_CLIENT_DATA
include/MySQL_Session.h (-67 lines)
- All matching method declarations, with their doxygen
include/Base_Session.h (-15 lines)
- GenAI_PendingRequest struct
- pending_genai_requests_ map
- next_genai_request_id_ counter
- genai_epoll_fd_ per-session epoll fd
lib/Base_Session.cpp (-9 lines)
- The init block that created the per-session genai_epoll_fd_
LLM: was deleted alongside GENAI: even though only GENAI: is named in
the design. They share the same `#ifdef PROXYSQLGENAI` gate, the same
async-genai socketpair plumbing, and the same rationale. Leaving LLM:
behind would have left a half-block referencing functions that no
longer exist; if we want LLM: back later the plugin can re-implement
it (or a more general request-multiplexer ABI extension can land).
The async-genai socketpair protocol (GenAI_RequestHeader /
GenAI_ResponseHeader, defined in include/GenAI_Thread.h) is now
unreferenced from outside lib/GenAI_Thread.cpp itself; those structs
disappear when GenAI_Thread moves to plugins/genai/ in Step 5.
Verified:
- clean rebuild of libproxysql.a + proxysql + ProxySQL_GenAI_Plugin.so
- all 60 unit-test binaries pass
- smoke test: daemon starts, SELECT through admin works, SIGTERM
shuts down cleanly
Net diff: -1010 / +28 lines. Largest deletion of the carve-out so far.
|
2 months ago |
|
|
f1c0ea2dbc |
feat(genai): Step 3 — carve Anomaly_Detector out of core into plugins/genai/
Per docs/superpowers/specs/2026-04-16-genai-plugin-carveout-design.md
"Migration sequence — Step 3", this is the first step that actually
moves GenAI surface out of libproxysql.a. The Anomaly_Detector now
lives entirely inside the genai plugin and is exercised through the
plugin query-hook ABI added in Step 2; core has zero references to it.
Files moved (git mv preserves history):
include/Anomaly_Detector.h -> plugins/genai/include/Anomaly_Detector.h
lib/Anomaly_Detector.cpp -> plugins/genai/src/Anomaly_Detector.cpp
Plugin-side adjustments:
- Drop the `#ifdef PROXYSQLGENAI` guard from both files (the file only
compiles inside the plugin now; the macro remains a core build flag
but the carve-out gates these files by *location*, not by macro).
- Update the json-include relative path to the new depth.
- Replace `Anomaly_Detector::get_query_embedding` with a stub that
returns an empty vector. The previous implementation called
`GloGATH->embed_documents`, but `GloGATH` (the GenAI_Threads_Handler)
is still a core symbol at this point in the carve-out. The
embedding-similarity stage was already nullptr-guarded on
`vector_db`, so an empty embedding short-circuits cleanly to
"no anomaly". Step 5 reattaches the embedding back-end when
GenAI_Thread moves into the plugin.
Plugin lifecycle wiring (plugins/genai/src/plugin_main.cpp):
- `genai_init` now: registers two Prometheus counters
(`proxysql_genai_detected_anomalies_total`,
`proxysql_genai_blocked_queries_total`) against the shared registry
exposed by Step 2.3, registers the query hook for both MySQL and
PgSQL protocols, and constructs the Anomaly_Detector.
- `genai_start`: flips the started flag (the detector has no separate
start phase).
- `genai_stop`: closes and deletes the detector; counters stay
registered (prometheus-cpp has no Unregister).
Plugin query-hook adapter (plugins/genai/src/plugin_hooks.cpp, NEW):
- Bridges ProxySQL_PluginQueryHookPayload to Anomaly_Detector::analyze.
- Increments the appropriate Prometheus counter on detection / block.
- Translates AnomalyResult into ALLOW or DENY(message) per the ABI.
Core removals (the symmetric carve-out):
- lib/MySQL_Session.cpp: delete the in-core `#ifdef PROXYSQLGENAI`
anomaly-detection block in COM_QUERY (lines around 5370-5377 pre-edit)
and the `handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_detect_ai_anomaly`
method. Same logic now runs inside the plugin via the query hook
added in Step 2.2.
- include/MySQL_Session.h: drop the matching method declaration.
- lib/AI_Features_Manager.{cpp,h}: remove the anomaly_detector field,
init_anomaly_detector(), close_anomaly_detector(),
get_anomaly_detector(), and the corresponding init() / shutdown()
call sites. AI_Features_Manager now owns only the LLM bridge and
vector_db (LLM_Bridge moves in Step 5; vector_db in Step 6).
- lib/AI_Tool_Handler.{cpp,h}: drop the anomaly_detector field and
the constructor parameter that fed it -- the field was stored but
never read, dead code that was awkward to keep alive across the
carve-out.
- lib/ProxySQL_MCP_Server.cpp: update the AI_Tool_Handler ctor call
site accordingly (one less argument).
- include/MySQL_Thread.h: remove `st_var_ai_detected_anomalies` /
`st_var_ai_blocked_queries` from `enum status_variable_id` and
`ai_detected_anomalies` / `ai_blocked_queries` from
`enum p_th_counter`. The plugin's Prometheus counters replace
these (the old ones were per-thread integer increments surfaced
by the legacy stats path; the plugin uses Prometheus directly).
- lib/MySQL_Thread.cpp: drop the matching entries from
MySQL_Thread_status_variables_counter_array and from
th_metrics_map (the prometheus registration table).
- include/proxysql.h, include/cpp.h: drop the now-stale
`#include "Anomaly_Detector.h"` lines.
- lib/Makefile: drop Anomaly_Detector.oo from the libproxysql object
list.
Tests:
- Delete the in-core TAP tests that linked against the removed symbols:
anomaly_detection-t, anomaly_detection_integration-t,
anomaly_detector_unit-t (Docker-dependent, won't link), plus the
unit test genai_anomaly_unit-t (linked against libproxysql's copy).
- Add test/tap/tests/unit/genai_plugin_anomaly_unit-t.cpp: replaces
the deleted unit test by compiling the plugin's
Anomaly_Detector.cpp directly into the test binary. The
friend-class helper pattern (Anomaly_Detector_TestHelper) is
preserved so private methods (normalize_query,
check_sql_injection) remain testable. Six assertions cover the
same surface plus a regression test that analyze() now runs
cleanly without a vector_db.
Plugin Makefile changes:
- Add Anomaly_Detector.cpp + plugin_hooks.cpp to SRCS.
- Pull in the include paths Anomaly_Detector.cpp's transitively-
included headers need (mariadb client for mysql.h, libev, libscram,
libusual, postgresql, jemalloc, microhttpd, libhttpserver, curl,
re2, pcre, zstd, libconfig, libdaemon, ssl). These mirror the
set already used by test/tap/tests/unit -- the test harness pulls
the same headers in transitively from libproxysql.a's headers.
Doxygen documentation added for every new function and for the new
header structures (GenAIPluginContext fields, genai_query_hook,
register_prometheus_counters, all three lifecycle callbacks, plus
file-level @brief blocks for plugin_main.cpp, plugin_hooks.cpp,
genai_plugin.h, and the moved Anomaly_Detector.{h,cpp}).
Verified end-to-end:
- Full clean rebuild of libproxysql.a + proxysql + ProxySQL_GenAI_Plugin.so.
- All 60 unit-test binaries pass (genai_anomaly_unit-t replaced by
genai_plugin_anomaly_unit-t; net same).
- Smoke test: launching proxysql with
plugins=("...ProxySQL_GenAI_Plugin.so") shows
"Anomaly: Initializing Anomaly Detector v0.1.0" /
"Anomaly Detector initialized with 11 injection patterns" in the
log on startup, and "Anomaly Detector closed" on SIGTERM -- the
plugin's lifecycle owns the detector cleanly.
Carve-out scoreboard so far (lines of GenAI surface moved out of core):
Step 0-2 : 0 (infrastructure prep only)
Step 3 : ~1100 (Anomaly_Detector.{h,cpp}) + counter/handler removals
|
2 months ago |
|
|
1c84a376fe |
feat(session): Step 2.2 — call plugin query hook on the COM_QUERY hot path
Wires the Step 2.1 plugin query-hook ABI into the actual session hot
paths. Both MySQL_Session and PgSQL_Session now consult any plugin-
registered query hook just before the query dispatches to a backend,
and short-circuit with an error to the client if the hook returns
DENY.
Hot-path discipline:
- Gate is proxysql_has_configured_plugin_query_hook(proto), a lock-free
atomic load + one pointer-sized read. When no plugin has registered
a hook for the protocol (the overwhelmingly common case), the only
cost is that single load + branch.
- The dispatch helper takes the plugin-manager mutex; that path is only
entered after the gate says "maybe". The gate is documented as
spurious-true-tolerant: a concurrent unload can null the manager
between the gate and the dispatch, in which case the dispatch helper
re-checks under the lock and returns false.
- Payload assembly uses the pointers already on hand in the session
(client_myds->{addr.addr, myconn->userinfo->{username,schemaname}}).
No allocation, no copy.
Placement:
- MySQL_Session.cpp: same block as the existing PROXYSQLGENAI in-core
anomaly detector check. The two coexist during the carve-out
transition; the in-core detector goes away in Step 3 once
Anomaly_Detector lives inside the plugin and consumes the hook.
- PgSQL_Session.cpp: parallel block right after the existing SQLi
detector check, the equivalent location for pgsql.
Error response on DENY:
- MySQL: ER 1313 / SQLSTATE HY000 with the plugin's message
(or "Query blocked by plugin" if the plugin returned an empty
message), via generate_pkt_ERR + RequestEnd, matching the existing
in-core anomaly-detector blocking style.
- PgSQL: ERRCODE_INSUFFICIENT_PRIVILEGE via generate_error_packet +
RequestEnd.
End-to-end smoke verified: with the genai skeleton plugin loaded (no
hook registered yet), an admin SELECT 1+1 returns the right answer --
the no-hook fast path is invisible. All 59 unit-test binaries pass.
Note: hot-path tests with a real registered hook live in
plugin_query_hook_unit-t (Step 2.1). An end-to-end TAP test that
exercises the call site through a real backend is deferred to the
group-tests work; not in scope for Step 2.
|
2 months ago |
|
|
146a977c26 |
feat: wire ParserSQL adapter into query processor and sessions
|
2 months ago |
|
|
0c832e5ced |
feat: add support for MariaDB SET STATEMENT ... FOR passthrough
ProxySQL now recognizes MariaDB's SET STATEMENT ... FOR syntax and forwards it to the backend without locking the hostgroup. Previously, this syntax was unrecognized and triggered unable_to_parse_set_statement(), which locked the session to a single hostgroup. This caused error 9006 on subsequent queries targeting different hostgroups. The implementation is a minimal passthrough: ProxySQL detects the "SET STATEMENT <vars> FOR <query>" pattern, forwards the query as-is to the backend, and does not lock the hostgroup. Variable tracking is not needed since SET STATEMENT variables are temporary (scoped to the single statement execution). Changes: - Add SET STATEMENT ... FOR detection in MySQL_Session.cpp before the SET parser, returning false without lock_hostgroup - Add new TAP test (test_set_statement_for-t.cpp) that verifies: - Basic SET STATEMENT ... FOR succeeds - Multi-variable SET STATEMENT ... FOR succeeds - No hostgroup lock persists after execution - Case-insensitive matching works - Register test in groups.json (legacy-g2, mysql84-g2, etc.) Ref: sub-issue 2 of #5686 |
2 months ago |
|
|
a5714d56f3 |
feat: add wsrep_trx_fragment_size and wsrep_trx_fragment_unit session variable tracking
Add support for two additional Galera wsrep session-level variables that can be set by clients through ProxySQL: - wsrep_trx_fragment_size (numeric): controls transaction fragmentation size - wsrep_trx_fragment_unit (string): controls fragmentation unit (BYTES/ROWS/STATEMENTS) These follow the same tracking pattern as the existing wsrep_sync_wait variable. ProxySQL intercepts SET statements for these variables, tracks them per-session, and synchronizes them to backend connections when needed. Changes: - Add SQL_WSREP_TRX_FRAGMENT_SIZE and SQL_WSREP_TRX_FRAGMENT_UNIT to mysql_variable_name enum in proxysql_structs.h - Add metadata entries in mysql_tracked_variables[] array - Add to classification sets (mysql_variables_numeric and mysql_variables_strings) in MySQL_Session.cpp - Update test infrastructure: filtered_set_statements test, set_testing-t.csv, generate_set_session_csv.cpp, and possible_unknown_variables in set_testing headers Ref: sub-issue 1 of #5686 |
2 months ago |
|
|
6d8dff2939 |
docs(chassis): mark query-hook ABI scaffold-state explicit + add TODO markers
The chassis ABI 2 query-hook surface (ProxySQL_PluginQueryHookPayload /
Result / Action plus register_query_hook / dispatch_configured_plugin_
query_hook) is wired through ProxySQL_PluginManager and exercised end-
to-end by unit tests. But the production data plane never calls
proxysql_dispatch_configured_plugin_query_hook — neither MySQL_Session
nor PgSQL_Session has the integration point.
Net effect today: a plugin can register a query hook successfully and
unit tests can drive dispatch through it, but a real client query
arriving over MySQL or PgSQL will never consult the hook. The DENY
contract from the public ABI ("DENY prevents a query from dispatching")
is currently a promise the production path doesn't keep.
# Why scaffold-state instead of immediate full integration
Wiring the dispatch into MySQL_Session::handler___status_WAITING_
CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpo (and the COM_STMT_
PREPARE / COM_STMT_EXECUTE entries that share the qpo machinery) is
mechanical but touches a 95k-LOC hot-path file. A bug in the
integration would manifest as a query-blocking regression that's hard
to debug and easy to ship.
Same for PgSQL_Session. The integration deserves its own focused PR
with TAP coverage that exercises both ALLOW and DENY paths against a
fake plugin — not a side-quest in this PR which is already large.
# What this commit does
1. Updates the ABI doc block in include/ProxySQL_Plugin.h to call out
the scaffold state explicitly. A plugin author reading the header
today would reasonably assume the hook fires in production; that
assumption is wrong, and the doc block now says so. References the
precise grep target ("TODO(plugin-query-hook)") that points at the
missing injection sites.
2. Adds two TODO(plugin-query-hook) markers to MySQL_Session.cpp:
- line ~3387 (COM_STMT_PREPARE → COM_QUERY shared codepath)
- line ~5403 (the main COM_QUERY execution path)
Each immediately follows the GloMyQPro->process_query call, where
CurrentQuery is populated and the dispatch payload would be ready.
3. Adds one TODO(plugin-query-hook) marker to PgSQL_Session.cpp at
line ~2387, following the GloPgQPro->process_query call.
# What this commit deliberately does NOT do
The actual dispatch wiring. The next person picking this up has:
- A precise injection site (3 in MySQL, 1+ in PgSQL).
- Pre-built ABI surface (proxysql_has_configured_plugin_query_hook
for the lock-free fast-path probe; proxysql_dispatch_configured_
plugin_query_hook for the actual hook invocation under shared lock).
- Existing test_helpers/fake_plugin.cpp with a HOOK_DENY env toggle
that exercises the dispatch path under unit test today — extensible
to TAP integration tests once the production wiring lands.
Caught by an external review pass, finding #5. Filing as a deferred
fix with explicit scaffold acknowledgement rather than rushing the
integration.
|
2 months ago |
|
|
8a6143c63c |
session_track_variables: add observability for misconfiguration and runtime backoff
Context ------- PR #5166 introduced a three-mode 'mysql-session_track_variables' variable (DISABLED / OPTIONAL / ENFORCED) whose behavior silently depends on two other MySQL capability toggles and on the capabilities of each backend: * In OPTIONAL mode the feature is a no-op when 'mysql-enable_server_deprecate_eof=false' or when the backend does not advertise CLIENT_DEPRECATE_EOF / CLIENT_SESSION_TRACKING. The operator sees the variable set to 1, but 'PROXYSQL INTERNAL SESSION' shows no tracked variables and there is no indication why. * In ENFORCED mode ProxySQL forces CLIENT_DEPRECATE_EOF on both the client and server sides of the protocol even if the operator explicitly set 'mysql-enable_client_deprecate_eof=false' / 'mysql-enable_server_deprecate_eof=false'. This is a protocol-visible behavior change for clients that did not negotiate CLIENT_DEPRECATE_EOF, and it was previously silent. * In ENFORCED mode backends that cannot honor tracking (missing CLIENT_SESSION_TRACKING or CLIENT_DEPRECATE_EOF) are placed in a 30-second selection backoff via 'MySrvC::session_track_backoff_until'. The server is NOT shunned and no connect-error counter is incremented, so in a mixed-version hostgroup an incompatible backend sits idle indefinitely with no log trail. Changes ------- * lib/Admin_FlushVariables.cpp: add a cross-variable validator at the tail of 'ProxySQL_Admin::flush_mysql_variables___database_to_runtime()', right next to the existing 'mysql-use_tcp_keepalive' warning. It runs once per 'LOAD MYSQL VARIABLES TO RUNTIME' and only when the feature is actually requested (mode != DISABLED). Emitted warnings: - ENFORCED + !enable_client_deprecate_eof -> "will force CLIENT_DEPRECATE_EOF on frontend connections; older clients may be affected" - ENFORCED + !enable_server_deprecate_eof -> equivalent for backends - OPTIONAL + !enable_server_deprecate_eof -> "has no effect while mysql-enable_server_deprecate_eof=false; backend session tracking will be skipped" The checks use the global 'GloMTH->get_variable_int()' view (same pattern as the TCP keepalive warning above it), and deliberately do not name any backend -- this is a global-configuration warning; per-backend capability mismatches are handled separately below. * lib/MySQL_Session.cpp: in 'handle_session_track_capabilities()', at the point where the code stores a new 'session_track_backoff_until' deadline for an incompatible backend, add a 'proxy_warning' naming the backend's address:port and the reason. Because this path only runs on new connection establishment -- and is itself gated by the 30-second backoff on the selection path -- the warning is naturally rate-limited to at most once per 30 seconds per backend. In a mixed fleet that rate is just enough for an operator to notice the incompatible server without drowning the log. Behaviour --------- * DISABLED mode (the default): no new log output; validator is skipped entirely. The hot selection path was already skipping the atomic read in the previous commit, so DISABLED remains free of new work. * OPTIONAL / ENFORCED: at most three warnings at 'LOAD MYSQL VARIABLES TO RUNTIME' time (cross-variable validator) plus one periodic warning per incompatible backend (ENFORCED path only). No per-query log output. |
2 months ago |
|
|
f815b77812 |
fix: make server_backoff_time atomic
Signed-off-by: Wazir Ahmed <wazir@proxysql.com> |
2 months ago |
|
|
a76be53785 |
fix: skip session variable handling when tracking is disabled
Signed-off-by: Wazir Ahmed <wazir@proxysql.com> |
2 months ago |
|
|
885712c679 |
Merge branch 'v3.0' into session-track-system-variable
|
2 months ago |
|
|
9757835a5f |
Merge branch 'v3.0' into fix-fc-parsing
|
3 months ago |
|
|
76251a78dc |
fix: resolve invalidFunctionArg in get_current_query - use size_t cast
|
3 months ago |
|
|
d5ffcba695 |
fix: cppcheck deeper analysis - invalidLifetime and arrayIndexOutOfBounds
- Fix invalidLifetime: look up pointer from map after insertion, not before - Fix arrayIndexOutOfBounds: add bounds check before array access |
3 months ago |
|
|
bf9030ecb7 |
fix: remaining cppcheck printf and null pointer issues
- Fix wrongPrintfScanfArgNum: remove extra args in 4 sprintf calls - Fix nullPointer: add GloMTH check, add null checks for strdup args - All high-risk cppcheck warnings now resolved |
3 months ago |
|
|
5ccb715e57 |
fix: cppcheck fixes - printf formats, null checks, copy operators
- Fix invalidPrintfArgType: %d->%u for hid, %u->%d for use_ssl - Fix nullPointerRedundantCheck: replace assert with continue - Add deleted copy ctor/operator= to KillArgs and MySQL_Session - Fix invalidFunctionArg: add query_len > 3 check before memcpy |
3 months ago |
|
|
b5617c0c18 |
fix: initialize all members in Query_Info constructor
|
3 months ago |
|
|
0e5fd66d46 |
Preserve prepared statement `min_gtid` in `first_comment_parsing` mode
Issue
---
When `first_comment` parsing runs before query rule processing, query rules can
strip the `min_gtid` annotation during `STMT_PREPARE`. As a result, `STMT_EXECUTE`
can run without the original `min_gtid` constraint.
Refs
---
- Commit -
|
3 months ago |
|
|
3659ba85fb
|
Merge branch 'v3.0' into advisory/com-stmt-send-long-data-fix-1
Signed-off-by: René Cannaò <rene@proxysql.com> |
3 months ago |
|
|
151169da9b |
Fix COM_STMT_SEND_LONG_DATA short packet handling
|
3 months ago |
|
|
419cd7608b
|
Merge commit from fork
Fix COM_STMT_CLOSE short packet handling |
3 months ago |
|
|
b2f4b4f9a0 |
Fix crash when COM_BINLOG_DUMP received with idle backends from other hostgroups (#5556)
When a session has backend connections to multiple hostgroups and receives COM_BINLOG_DUMP, GPFC_Replication_SwitchToFastForward() transitions the session to FAST_FORWARD mode but only manages the active backend. Idle backends from other hostgroups remain in the session's mybes array with async_state_machine==ASYNC_IDLE. If MySQL's wait_timeout closes one of these idle connections, the resulting POLLIN event causes handler() to be called with ASYNC_IDLE, which has no case in the switch and hits assert(0). Fix: Clean up idle backends from other hostgroups during the FAST_FORWARD transition in GPFC_Replication_SwitchToFastForward(). These connections will never be used again, so they are destroyed immediately. Includes a regression test (test_binlog_dump_multi_backend_crash-t) that: - Sets up two hostgroups with query rules routing SELECTs to reader HG - Creates backend connections to both hostgroups on one session - Sends COM_BINLOG_DUMP to enter FAST_FORWARD mode - Waits for wait_timeout to close the idle backend - Verifies ProxySQL does not crash |
3 months ago |
|
|
9450bf52e2 |
Fix COM_STMT_CLOSE short packet handling
|
3 months ago |
|
|
6b46b26931 |
chore: implement PR review feedback for release tier system
- Makefile: normalized GIT_VERSION by stripping 'v' prefix before arithmetic. - Makefile: corrected .PHONY declaration for build_deps_debug_default. - Admin Handler: properly guarded TSDB commands to return error when disabled. - REST API: removed redundant nested guards inside tsdb_resource class. - Statistics: implemented rigorous input validation for set_variable. - Statistics: added return value checks and rollback logic for TSDB migrations. - Statistics: implemented bounded concurrency (batching) for backend probes. - FFTO: implemented cumulative buffer limit enforcement in MySQL and PgSQL. - FFTO: ensured initial packet capture in PgSQL_Session by early initialization. - FFTO: improved reassembly buffer compaction logic. - Headers: default-initialized ffto_bypassed to false. - Code cleanup: merged redundant PROXYSQLFFTO guards. |
4 months ago |
|
|
c2f678a9de |
feat: implement release tiers and feature guards for v3.0, v3.1, and v4.0
This commit introduces a structured release tier system controlled by
environment variables, allowing three distinct ProxySQL versions to be
built from the same codebase while maintaining a clear upgrade path.
Key Changes:
- Tier 1 (v3.0.x Stable): Default build including bug fixes and core enhancements.
- Tier 2 (v3.1.x Innovative): Enabled via PROXYSQL31=1. Adds FFTO and TSDB.
- Tier 3 (v4.0.x AI/MCP): Enabled via PROXYSQLGENAI=1. Adds the AI stack.
Implementation Details:
- Makefile: Implemented dynamic versioning logic that increments the minor
version for v3.1 and the major version for v4.0. Added tier documentation.
- Feature Guards: Introduced PROXYSQLFFTO and PROXYSQLTSDB guards across
ProxySQL_Admin, ProxySQL_Statistics, REST API, and HTTP server.
- FFTO: Guarded Fast Forward Traffic Observer in MySQL and PgSQL sessions,
including thread-local variables and configuration parameters.
- TSDB: Guarded the entire Time Series Database subsystem, including SQLite
table definitions, background loops, and REST API endpoints.
- Build Fixes:
* Fixed 'proxy_debug_func' linkage by adding extern "C" and moving the
definition outside of DEBUG guards to ensure non-debug builds link correctly.
* Corrected misplaced/nested DEBUG and PROXYSQLFFTO guards.
* Verified build stability for all tiers (unset, PROXYSQL31=1, PROXYSQLGENAI=1).
|
4 months ago |
|
|
80f9c1a079
|
Merge branch 'v3.0' into session-track-system-variable
Signed-off-by: René Cannaò <rene@proxysql.com> |
4 months ago |
|
|
e53d2c76f9 |
Address PR #5410 review findings across FFTO, sessions, TAP, and docs
Apply actionable bot review feedback from PR #5410 without behavior drift:\n- fix MySQL/PgSQL FFTO digest normalization and max-length hashing\n- add early FFTO packet/message size guards for bypass safety\n- restore MySQL session GTID reset and harden GenAI async error ownership\n- add null-check for stripped KILL query normalization path\n- call FFTO on_close() before observer reset/bypass in session flows\n- fix processlist query-options default pagination limit semantics\n- fix TAP noise_failures locking race and noise-aware plan count\n- extend wait_get_enpoint_ready with optional basic-auth passthrough\n- update MCP architecture docs from observe->stats naming\n- clean corrupted character in pgsql query-cache test comment\n\nValidation run:\n- git diff --check\n- make -C test/tap/tap tap.o utils_mariadb.o utils_mysql57.o utils_mysql8.o -j4\n- make -C lib obj/MySQLFFTO.oo obj/PgSQLFFTO.oo obj/MySQL_Session.oo obj/PgSQL_Session.oo obj/Query_Processor.oo -j4 |
4 months ago |
|
|
79c0b383e8 |
integration: fix pre-CI issues in unified branch
|
4 months ago |
|
|
90462f6d5a |
ffto: harden MySQL/PgSQL observer state handling and align tests/docs
Address outstanding review findings for FFTO on v3.0-ff_inspect and tighten
protocol-state correctness for both engines.
MySQL FFTO
- Restrict on_close() reporting to true in-flight states and always clear query
tracking state after close.
- Add explicit active-query cleanup helpers and invoke them on state transitions
to IDLE.
- Preserve accounting on mid-resultset server ERR packets by reporting current
query in READING_COLUMNS/READING_ROWS before reset.
- Keep prepared-statement lifecycle cleanup robust (pending prepare cleared on
prepare completion paths).
MySQL session integration
- Extract duplicated FAST_FORWARD client FFTO feed logic into
observe_ffto_client_packet() and reuse it from all call sites.
PostgreSQL FFTO
- Replace regex-based CommandComplete parsing with lightweight token parsing,
including NUL/whitespace trimming and strict numeric validation.
- Add queued tracking for pipelined extended-protocol executes so query text and
response attribution stay aligned under Parse/Bind/Execute pipelining.
- Distinguish finalize semantics (execute-finalize on CommandComplete vs
sync-finalize on ReadyForQuery) and centralize finalize/activation helpers.
- Add frontend Close ('C') handling to evict statement/portal mappings.
- Harden client/server message parsing with additional length checks.
- Extend affected-row command tag coverage to COPY and MERGE.
TAP tests
- Stabilize test plans for failure paths by replacing early returns with a
fail-and-skip-remaining flow and shared cleanup labels.
- Ensure both MySQL and PgSQL FFTO tests preserve planned assertion counts under
setup/prepare/execute failures.
Documentation
- Align FFT0 design doc state/response descriptions with current implementation
(ReadyForQuery handling, pipelined queueing, supported PG command tags).
- Fix wording/typo issues in protocol section.
Validation performed
- make -C lib -j4
- make -C test/tap/tests test_ffto_mysql-t test_ffto_pgsql-t -j4
Runtime execution of the two TAP binaries remains environment-dependent (admin
endpoint connectivity required).
|
4 months ago |
|
|
1258a1f2f2 |
Address PR reviews: improve performance, safety, and robustness of FFTO
|
4 months ago |
|
|
db04a54c92 |
Fix memory corruption and stack overflow in FFTO due to large queries
|
4 months ago |
|
|
3a3be5a559 |
Implement Fast Forward Traffic Observer (FFTO) for MySQL and PostgreSQL
- Added TrafficObserver base interface - Implemented MySQLFFTO and PgSQLFFTO classes for protocol-aware observation - Integrated FFTO hooks into MySQL and PostgreSQL session handlers in FAST_FORWARD state - Added configuration variables: mysql-ffto_enabled, mysql-ffto_max_buffer_size, pgsql-ffto_enabled, pgsql-ffto_max_buffer_size - Implemented query digest extraction and reporting parity with internal stats - Added session-level bypass when packet size exceeds buffer threshold - Included architectural documentation in doc/ffto_design.md |
4 months ago |