Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-779

32-bit connector v3.4.5.0 mysql_stmt_bind_result return value differs from 64-bit version

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 3.4.5
    • None
    • API, Prepared Statements
    • 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:

      1. mysql_stmt_init
      2. mysql_stmt_prepare
      3. mysql_stmt_param_count
      4. mysql_stmt_field_count
      5. mysql_stmt_attr_set(…, 0, …)
      6. mysql_stmt_attr_set(…, 2, …)
      7. mysql_stmt_execute
      8. mysql_stmt_field_count [returns valid field count]
      9. mysql_info
      10. mysql_stmt_affected_rows
      11. mysql_stmt_insert_id
      12. mysql_stmt_store_result
      13. mysql_stmt_result_metadata [returns non-zero pointer]
      14. mysql_more_results
      15. mysql_num_fields [returns valid field count, same as mysql_stmt_field_count before]
      16. mysql_fetch_field_direct (× number of fields)
      17. mysql_stmt_bind_result [returns 0x30300000]
      18. mysql_stmt_fetch [returns 0x64]
      19. mysql_stmt_next_result [returns 0]
      20. mysql_stmt_field_count [returns 0]
      21. mysql_stmt_insert_id
      22. mysql_free_result [returns 1]
      23. mysql_stmt_result_metadata [returns NULL]
      24. mysql_stmt_free_result [returns 1]
      25. mysql_stmt_errno [returns 0x13a1 = 5025]
      26. mysql_stmt_error [returns "Statement has no result set"]
      27. mysql_stmt_sqlstate
      28. 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.

      Attachments

        Activity

          People

            georg Georg Richter
            Dmitry Onoshko Dmitry Onoshko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.