List:Commits« Previous MessageNext Message »
From:Marc Alff Date:March 7 2010 5:30pm
Subject:bzr push into mysql-next-mr-bugfixing branch (marc.alff:3123)
View as plain text  
 3123 Marc Alff	2010-03-07 [merge]
      local merge

    added:
      mysql-test/include/ctype_utf8mb4.inc
      mysql-test/r/ctype_utf8mb4_heap.result
      mysql-test/r/ctype_utf8mb4_innodb.result
      mysql-test/r/ctype_utf8mb4_myisam.result
      mysql-test/r/ctype_utf8mb4_ndb.result
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/suite/perfschema/t/pfs_upgrade.test
      mysql-test/suite/sys_vars/r/log_error_func.result
      mysql-test/suite/sys_vars/r/log_error_func2.result
      mysql-test/suite/sys_vars/r/log_error_func3.result
      mysql-test/suite/sys_vars/t/log_error_func.cnf
      mysql-test/suite/sys_vars/t/log_error_func.test
      mysql-test/suite/sys_vars/t/log_error_func2.cnf
      mysql-test/suite/sys_vars/t/log_error_func2.test
      mysql-test/suite/sys_vars/t/log_error_func3.test
      mysql-test/t/ctype_utf8mb4_heap.test
      mysql-test/t/ctype_utf8mb4_innodb.test
      mysql-test/t/ctype_utf8mb4_myisam.test
      mysql-test/t/ctype_utf8mb4_ndb.test
    modified:
      COPYING
      README
      configure.in
      include/m_ctype.h
      mysql-test/collections/default.experimental
      mysql-test/lib/v1/mysql-test-run.pl
      mysql-test/r/ctype_utf8mb4.result
      mysql-test/t/ctype_utf8mb4.test
      scripts/mysql_system_tables.sql
      sql-common/client.c
      sql/mysql_priv.h
      sql/mysqld.cc
      sql/sys_vars.cc
      strings/ctype-uca.c
      strings/ctype-ucs2.c
      strings/ctype-utf8.c
=== modified file 'storage/perfschema/pfs_instr.cc'
--- a/storage/perfschema/pfs_instr.cc	2010-03-02 00:10:01 +0000
+++ b/storage/perfschema/pfs_instr.cc	2010-03-05 01:36:54 +0000
@@ -746,6 +746,26 @@ find_or_create_file(PFS_thread *thread,
     }
   }
 
+  char safe_buffer[FN_REFLEN];
+  const char *safe_filename;
+
+  if (len >= FN_REFLEN)
+  {
+    /*
+      The instrumented code uses file names that exceeds FN_REFLEN.
+      This could be legal for instrumentation on non mysys APIs,
+      so we support it.
+      Truncate the file name so that:
+      - it fits into pfs->m_filename
+      - it is safe to use mysys apis to normalize the file name.
+    */
+    memcpy(safe_buffer, filename, FN_REFLEN - 2);
+    safe_buffer[FN_REFLEN - 1]= 0;
+    safe_filename= safe_buffer;
+  }
+  else
+    safe_filename= filename;
+
   /*
     Normalize the file name to avoid duplicates when using aliases:
     - absolute or relative paths
@@ -759,7 +779,7 @@ find_or_create_file(PFS_thread *thread,
     Ignore errors, the file may not exist.
     my_realpath always provide a best effort result in buffer.
   */
-  (void) my_realpath(buffer, filename, MYF(0));
+  (void) my_realpath(buffer, safe_filename, MYF(0));
 
   normalized_filename= buffer;
   normalized_length= strlen(normalized_filename);


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100307172159-d3ihpafu62c6lb2x.bundle
Thread
bzr push into mysql-next-mr-bugfixing branch (marc.alff:3123) Marc Alff7 Mar