~maria-captains/maria/mysql-6.0-backup

« back to all changes in this revision

Viewing changes to storage/perfschema/unittest/pfs-t.cc

  • Committer: Thava Alagu
  • Date: 2010-03-11 19:18:17 UTC
  • mfrom: (3719.14.62 mysql-6.0-codebase)
  • Revision ID: thavamuni.alagu@sun.com-20100311191817-5nigmq884xo9fuut
Merge from mysql-6.0-codebase

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
  uint i;
38
38
  PFS_file *pfs;
39
39
  uint len= strlen(name);
 
40
  size_t dirlen;
 
41
  const char *filename;
 
42
  uint filename_length;;
40
43
 
41
44
  for (i= 0; i < file_max; i++)
42
45
  {
43
46
    pfs= & file_array[i];
44
47
    if (pfs->m_lock.is_populated())
45
48
    {
46
 
      if ((len == pfs->m_filename_length) &&
47
 
          (strncmp(name, pfs->m_filename, pfs->m_filename_length) == 0))
 
49
      /*
 
50
        When a file "foo" is instrumented, the name is normalized
 
51
        to "/path/to/current/directory/foo", so we remove the
 
52
        directory name here to find it back.
 
53
      */
 
54
      dirlen= dirname_length(pfs->m_filename);
 
55
      filename= pfs->m_filename + dirlen;
 
56
      filename_length= pfs->m_filename_length - dirlen;
 
57
      if ((len == filename_length) &&
 
58
          (strncmp(name, filename, filename_length) == 0))
48
59
        return pfs;
49
60
    }
50
61
  }