Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
3.4.5
-
None
-
None
-
32-bit version of libmariadb.dll (Windows)
Description
When calling a stored procedure (that has no parameters but produces a non-empty result set) from FireDAC-based Delphi application the FireDAC library builds a prepared statement that goes like this:
CALL `dbname`.`procname`()
The order of API calls performed by such a program (32-bit with 32-bit libmariadb.dll) is this:
- mysql_stmt_init
- mysql_stmt_prepare
- mysql_stmt_param_count
- mysql_stmt_field_count
- mysql_stmt_attr_set(…, 0, …)
- mysql_stmt_attr_set(…, 2, …)
- mysql_stmt_execute
- mysql_stmt_field_count [returns valid field count]
- mysql_info
- mysql_stmt_affected_rows
- mysql_stmt_insert_id
- mysql_stmt_store_result
- mysql_stmt_result_metadata [returns non-zero pointer]
- mysql_more_results
- mysql_num_fields [returns valid field count, same as mysql_stmt_field_count before]
- mysql_fetch_field_direct (× number of fields)
- mysql_stmt_bind_result [returns 0x30300000]
- mysql_stmt_fetch [returns 0x64]
- mysql_stmt_next_result [returns 0]
- mysql_stmt_field_count [returns 0]
- mysql_stmt_insert_id
- mysql_free_result [returns 1]
- mysql_stmt_result_metadata [returns NULL]
- mysql_stmt_free_result [returns 1]
- mysql_stmt_errno [returns 0x13a1 = 5025]
- mysql_stmt_error [returns "Statement has no result set"]
- mysql_stmt_sqlstate
- mysql_stmt_close [returns 0]
The line in bold is the place where the behaviors of 32- and 64-bit versions differ: 64-bit version returns 0 here. The value returned by 32-bit version of libmariadb.dll looks like garbage to me (0x30300000), and it supposedly causes FireDAC to think that result fetching failed. There’s no problem with 64-bit version of the connector for the same database and stored procedure.
P.S. If that somehow matters, the program connects to MySQL 8.0.20.