~ubuntu-branches/ubuntu/karmic/mysql-dfsg-5.1/karmic

« back to all changes in this revision

Viewing changes to sql/slave.cc

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (0.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20090625125545-v27uqh8rlsj8uh2y
Tags: upstream-5.1.34
ImportĀ upstreamĀ versionĀ 5.1.34

Show diffs side-by-side

added added

removed removed

Lines of Context:
2632
2632
  DBUG_RETURN(0);                               // Can't return anything here
2633
2633
}
2634
2634
 
 
2635
/*
 
2636
  Check the temporary directory used by commands like
 
2637
  LOAD DATA INFILE.
 
2638
 */
 
2639
static 
 
2640
int check_temp_dir(char* tmp_dir, char *tmp_file)
 
2641
{
 
2642
  int fd;
 
2643
  MY_DIR *dirp;
 
2644
 
 
2645
  DBUG_ENTER("check_temp_dir");
 
2646
 
 
2647
  /*
 
2648
    Check if the directory exists.
 
2649
   */
 
2650
  if (!(dirp=my_dir(tmp_dir,MYF(MY_WME))))
 
2651
    DBUG_RETURN(1);
 
2652
  my_dirend(dirp);
 
2653
 
 
2654
  /*
 
2655
    Check permissions to create a file.
 
2656
   */
 
2657
  if ((fd= my_create(tmp_file, CREATE_MODE,
 
2658
                     O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW,
 
2659
                     MYF(MY_WME))) < 0)
 
2660
  DBUG_RETURN(1);
 
2661
 
 
2662
  /*
 
2663
    Clean up.
 
2664
   */
 
2665
  my_close(fd, MYF(0));
 
2666
  my_delete(tmp_file, MYF(0));
 
2667
 
 
2668
  DBUG_RETURN(0);
 
2669
}
2635
2670
 
2636
2671
/**
2637
2672
  Slave SQL thread entry point.
2763
2798
                    llstr(rli->group_master_log_pos,llbuff),rli->group_relay_log_name,
2764
2799
                    llstr(rli->group_relay_log_pos,llbuff1));
2765
2800
 
 
2801
  if (check_temp_dir(slave_load_tmpdir, rli->slave_patternload_file))
 
2802
  {
 
2803
    rli->report(ERROR_LEVEL, thd->main_da.sql_errno(), 
 
2804
                "Unable to use slave's temporary directory %s - %s", 
 
2805
                slave_load_tmpdir, thd->main_da.message());
 
2806
    goto err;
 
2807
  }
 
2808
 
2766
2809
  /* execute init_slave variable */
2767
2810
  if (sys_init_slave.value_length)
2768
2811
  {