Bug description
After upgrading from Prisma 7.4.2 to 7.5.0, our production MariaDB instance started hitting max_prepared_stmt_count limits, causing query failures under load.
Root cause
PR #29285 switched adapter-mariadb to use the binary MySQL protocol to fix lossy number conversions. This change appears to bypass the statement_cache_size=0 connection string parameter that previously prevented prepared statement accumulation.
With statement_cache_size=0 in our connection URL, we expect prepared statements to not be cached. After the 7.5.0 upgrade, prepared statements accumulate on the server until the global max_prepared_stmt_count limit is reached.
How to reproduce
- Use
@prisma/adapter-mariadb with Prisma 7.5.0
- Set
statement_cache_size=0 in the MySQL connection URL
- Run the application under production-level traffic
- Monitor
SHOW GLOBAL STATUS LIKE 'Prepared_stmt_count'
- Observe prepared statements accumulating beyond what
statement_cache_size=0 should allow
Note: This does not reproduce under low traffic (e.g., staging) because the global max_prepared_stmt_count limit (default 16382) is never reached.
Expected behavior
statement_cache_size=0 should disable prepared statement caching, matching the behavior in 7.4.2.
Actual behavior
Prepared statements accumulate unboundedly, eventually hitting max_prepared_stmt_count and causing errors.
Environment
Bug description
After upgrading from Prisma 7.4.2 to 7.5.0, our production MariaDB instance started hitting
max_prepared_stmt_countlimits, causing query failures under load.Root cause
PR #29285 switched
adapter-mariadbto use the binary MySQL protocol to fix lossy number conversions. This change appears to bypass thestatement_cache_size=0connection string parameter that previously prevented prepared statement accumulation.With
statement_cache_size=0in our connection URL, we expect prepared statements to not be cached. After the 7.5.0 upgrade, prepared statements accumulate on the server until the globalmax_prepared_stmt_countlimit is reached.How to reproduce
@prisma/adapter-mariadbwith Prisma 7.5.0statement_cache_size=0in the MySQL connection URLSHOW GLOBAL STATUS LIKE 'Prepared_stmt_count'statement_cache_size=0should allowNote: This does not reproduce under low traffic (e.g., staging) because the global
max_prepared_stmt_countlimit (default 16382) is never reached.Expected behavior
statement_cache_size=0should disable prepared statement caching, matching the behavior in 7.4.2.Actual behavior
Prepared statements accumulate unboundedly, eventually hitting
max_prepared_stmt_countand causing errors.Environment
@prisma/adapter-mariadb)statement_cache_size=0in connection URL