[CONC-75] load data local fails with "load data local infile forbidden" Created: 2014-02-06  Updated: 2014-02-07  Resolved: 2014-02-07

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Sudhindra Bhat Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

rev116


Issue Links:
Relates
relates to CONC-74 crash while executing load data local... Closed

 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;
}



 Comments   
Comment by Georg Richter [ 2014-02-07 ]

fixed in rev. 117

Generated at Thu Feb 08 03:02:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.