2 Commits

Author SHA1 Message Date
Nathan Wallace
b1e9500c1b Fix #4812: Add size limits to autocomplete suggestions maps (rebased) (#4888)
* Add test for #4812: Autocomplete suggestions should have size limits

This test verifies that autocomplete suggestion maps enforce size limits
to prevent unbounded memory growth. The test calls setTablesForSchema()
and setQueriesForMod() methods that should enforce:
- Maximum 100 schemas in tablesBySchema
- Maximum 500 tables per schema
- Maximum 100 mods in queriesByMod
- Maximum 500 queries per mod

This test will fail until the size limiting implementation is added.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix #4812: Add size limits to autocomplete suggestions maps

Implements bounded size for autocomplete suggestion maps to prevent
unbounded memory growth with large schemas:

- Added constants for max schemas (100) and max tables per schema (500)
- Created setTablesForSchema() and setQueriesForMod() methods that enforce
  limits using LRU-style eviction when limits are exceeded
- Updated interactive_client_autocomplete.go to use the new bounded setter

This prevents excessive memory consumption when dealing with databases
that have hundreds of connections with many tables each.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-15 11:10:22 -05:00
Nathan Wallace
2e5f3fda97 Add comprehensive passing tests from bug hunting initiative (#4864) 2025-11-13 09:26:46 +08:00