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

mysql_errno(NULL) and mysql_error(NULL) always returns zero

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Some library functions like mysql_library_init() or mysql_init() may fail and on error they do not return MYSQL* structure. To detect their error code and message it was possible to call mysql_errno(NULL) and mysql_error(NULL) to retrieve them. This is working fine since MySQL version 5.0.60 (for 5.0 series) and globally since 5.1.24 (for 5.1 and new series). But MariaDB 10.2 stopped using MySQL client implementation (where it worked fine) and started to use MariaDB Connector/C which does not provide meaningful value from mysql_errno(NULL) and mysql_error(NULL) calls. It always returns 0 and empty string. So when mysql_library_init() or mysql_init() fails, caller does not why. Since MariaDB 10.2 started using MariaDB Connector/C there is no way to retrieve error code or message for these functions. So please fix mysql_errno(NULL) and mysql_error(NULL) functions to return real error code/messages for last mysql_* function call.

      Attachments

        Activity

          People

            georg Georg Richter
            pali Pali
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.