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

crash while executing load data local infile

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      rev 114

      Description

      sample call stack:

       	00000000()	
      >	mariadb_test.exe!mysql_handle_local_infile(st_mysql * conn, const char * filename)  Line 298 + 0x11 bytes	C
       	mariadb_test.exe!mthd_my_read_query_result(st_mysql * mysql)  Line 2264 + 0xd bytes	C
       	mariadb_test.exe!mysql_real_query(st_mysql * mysql, const char * query, unsigned long length)  Line 2303 + 0x25 bytes	C

      sample test case:

      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
       
       
       // the crash is due to local_infile_end function pointer being NULL
       // options.client_flag = 0 at the case where it crashes
       // mysql_set_local_infile_default is not called before line 242 in mysql_handle_local_infile()
       //check for all callback functions exist MUST happen before a CALL
       
       
        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

              Assignee:
              georg Georg Richter
              Reporter:
              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.