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

mariadb_stmt_execute_direct: mysql_error returns error from execute instead of prepare

    XMLWordPrintable

Details

    Description

      While mysql_stmt_error() returns the correct result from failing mysql_stmt_prepare(), mysql_error() returns the error from mysql_stmt_execute()

      static int test_execute_direct_error(MYSQL *mysql)
      {
        MYSQL_STMT *stmt= mysql_stmt_init(mysql);
        int rc;
       
        rc= mariadb_stmt_execute_direct(stmt, SL("SELECT SYNTAX_ERROR"));
        diag("stmt_error: %s", mysql_stmt_error(stmt))
        diag("mysql_error: %s", mysql_error(mysql))
        FAIL_IF(!rc, "Error expected")
       
        mysql_stmt_close(stmt);
        return OK;
      }
      

      Output:

      # stmt_error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CALL P1()' at line 1
      # mysql_error: Unknown prepared statement handler (4294967295) given to mysqld_stmt_execute
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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