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

load data local fails with "load data local infile forbidden"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • rev116

    Description

      Consider the same test case I provided for conc74:
      As I had mentioned options.client_flag = 0 in the test case which introduced a crash. The crash was fixed by making sure all the callback functions were initialized before call. But mysql->options is malformed and options.client_flag = 0 for the rest of the session. Please restart the server after a successful mysql_real_connect(). The subsequent load data local fails with "load data local infile forbidden" .

      static int test_conc71edited(MYSQL *my)
      {
        int rc;
        MYSQL_RES *res;
        MYSQL_ROW row;
        char *query;
        MYSQL *mysql;
        /* uncomment if you want to test manually */
        //return SKIP;
       
        mysql= mysql_init(NULL);
       
        mysql_options(mysql, MYSQL_OPT_RECONNECT,(const char *)"true");
        mysql_options(mysql, MYSQL_SET_CHARSET_NAME, "utf8");
        mysql_options(mysql, MYSQL_OPT_COMPRESS, 0);
        mysql_options(mysql, MYSQL_INIT_COMMAND, "/*!40101 SET SQL_MODE='' */");
        mysql_options(mysql, MYSQL_INIT_COMMAND, "/*!40101 set @@session.wait_timeout=28800 */");
       
       
        mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, 0| CLIENT_MULTI_RESULTS | CLIENT_REMEMBER_OPTIONS);
        //diag("kill server");
        //sleep(20);
       // restarting the server here after mysql_real_connect
       
       
        rc= mysql_query(mysql, "load data local infile 'C:\\Users\\abc\\Desktop\\nonexistingfile.csv' into table `test`.`a` (`a`)");
        puts(mysql_error(mysql));
        rc= mysql_query(mysql, "load data local infile 'C:\\Users\\abc\\Desktop\\nonexistingfile.csv' into table `test`.`a` (`a`)");
        puts(mysql_error(mysql));
        rc= mysql_query(mysql, "load data local infile 'C:\\Users\\abc\\Desktop\\nonexistingfile.csv' into table `test`.`a` (`a`)");
        puts(mysql_error(mysql));
        //rc= mysql_query(mysql, "SELECT 'foo' FROM DUAL");
        //check_mysql_rc(rc, mysql);
       
        mysql_close(mysql);
        return OK;
      }

      Attachments

        Issue Links

          Activity

            People

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