Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
3.4.7
-
None
Description
The current parameter binding implementation (responsible for populating the request buffer during standard and bulk execution) was originally adapted from PHP’s mysqlnd extension. It requires refactoring to address the following issues:
- Correct pack_len for Temporal Types: Ensure the pack_len for Date and Time types is correctly set to the size of the internal C structure (e.g., sizeof(MYSQL_TIME)).
- Eliminate Redundant Reallocations: Optimize buffer management to avoid frequent and unnecessary memory reallocations during the binding process.
- Deterministic Memory Allocation: Implement logic to calculate the exact required memory size for parameters upfront, ensuring a more efficient "allocate-once" strategy.
- Support for Missing Types: Identify and implement handling for MariaDB-specific parameter types that were previously ignored due to limitations in PHP’s type system.
Update: For bulk execution this approach is counterproductive: parameter callbacks would need to be executed twice, increasing overhead and potentially reducing performance.