~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/os/os0file.cc

  • Committer: Lee Bieber
  • Date: 2011-03-31 14:40:56 UTC
  • mfrom: (2242.1.133 drizzle-xtrabackup)
  • Revision ID: kalebral@gmail.com-20110331144056-hdhp6cj0zo1keuc9
Merge Stewart - xtrabackup port to drizzle

Show diffs side-by-side

added added

removed removed

Lines of Context:
652
652
        const char*     name)   /*!< in: file name */
653
653
{
654
654
        struct flock lk;
 
655
 
 
656
        if (srv_read_only)
 
657
          return 0;
 
658
 
655
659
        lk.l_type = F_WRLCK;
656
660
        lk.l_whence = SEEK_SET;
657
661
        lk.l_start = lk.l_len = 0;
1495
1499
        if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
1496
1500
            || create_mode == OS_FILE_OPEN_RETRY) {
1497
1501
                mode_str = "OPEN";
1498
 
                create_flag = O_RDWR;
 
1502
                if (srv_read_only)
 
1503
                  create_flag = O_RDONLY;
 
1504
                else
 
1505
                  create_flag = O_RDWR;
1499
1506
        } else if (create_mode == OS_FILE_CREATE) {
1500
1507
                mode_str = "CREATE";
1501
1508
                create_flag = O_RDWR | O_CREAT | O_EXCL;
2291
2298
                }
2292
2299
        }
2293
2300
 
 
2301
        if (srv_fake_write)
 
2302
          return(TRUE);
 
2303
 
2294
2304
        os_n_file_writes++;
2295
2305
 
2296
2306
#if defined(HAVE_PWRITE) && !defined(HAVE_BROKEN_PREAD)
2673
2683
        ut_a((offset & 0xFFFFFFFFUL) == offset);
2674
2684
        ut_a((n & 0xFFFFFFFFUL) == n);
2675
2685
 
 
2686
        if (srv_fake_write)
 
2687
          return(TRUE);
 
2688
 
2676
2689
        os_n_file_writes++;
2677
2690
 
2678
2691
        ut_ad(file);