3428 Mayank Prasad 2012-02-05
WL#5767: Performance Schema, Statements Digest
Details:
- probable fix for failing test case on PB2.
- A little Code cleanup.
modified:
storage/perfschema/pfs_digest.cc
storage/perfschema/pfs_digest.h
3427 Mayank Prasad 2012-02-03
WL#5767 : Performance Schema, Statements Digest
Detials:
- Removed digest_end completely.
- Moved processing of digest_end to end_statement.
- Removed unwanted function yyLength_PS (added
earlier by me only).
- Modified token PASS_TOKEN_TO_PS.
modified:
include/mysql/psi/mysql_statement.h
include/mysql/psi/psi.h
include/mysql/psi/psi_abi_v1.h.pp
mysys/psi_noop.c
sql/sql_lex.cc
sql/sql_lex.h
sql/sql_parse.cc
storage/perfschema/pfs.cc
storage/perfschema/pfs_digest.cc
storage/perfschema/pfs_digest.h
=== modified file 'storage/perfschema/pfs_digest.cc'
--- a/storage/perfschema/pfs_digest.cc 2012-02-03 16:00:30 +0000
+++ b/storage/perfschema/pfs_digest.cc 2012-02-04 19:02:49 +0000
@@ -440,7 +440,7 @@ PSI_digest_locker* pfs_digest_add_token_
/*
If digest storage record is full, do nothing.
*/
- return locker;
+ return NULL;
}
/*
=== modified file 'storage/perfschema/pfs_digest.h'
--- a/storage/perfschema/pfs_digest.h 2012-02-03 16:00:30 +0000
+++ b/storage/perfschema/pfs_digest.h 2012-02-04 19:02:49 +0000
@@ -104,9 +104,16 @@ PSI_digest_locker* pfs_digest_add_token_
inline void read_token(uint *dest, int *index, char *src)
{
unsigned short sh;
- sh= ((0x00ff & src[*index + 1])<<8) | (0x00ff & src[*index]);
- *dest= (uint)(sh);
- *index= *index + PFS_SIZE_OF_A_TOKEN;
+ int remaining_bytes= PFS_MAX_DIGEST_STORAGE_SIZE - *index;
+ DBUG_ASSERT(remaining_bytes >= 0);
+
+ /* Make sure we have enough space to read a token. */
+ if(remaining_bytes >= PFS_SIZE_OF_A_TOKEN)
+ {
+ sh= ((0x00ff & src[*index + 1])<<8) | (0x00ff & src[*index]);
+ *dest= (uint)(sh);
+ *index= *index + PFS_SIZE_OF_A_TOKEN;
+ }
}
/**
@@ -117,11 +124,17 @@ inline void store_token(PFS_digest_stora
char* dest= digest_storage->m_token_array;
int* index= &digest_storage->m_byte_count;
unsigned short sh= (unsigned short)token;
+ int remaining_bytes= PFS_MAX_DIGEST_STORAGE_SIZE - *index;
+ DBUG_ASSERT(remaining_bytes >= 0);
- dest[*index]= (sh) & 0xff;
- *index= *index + 1;
- dest[*index]= (sh>>8) & 0xff;
- *index= *index + 1;
+ /* Make sure we have enough space to store a token. */
+ if(remaining_bytes >= PFS_SIZE_OF_A_TOKEN)
+ {
+ dest[*index]= (sh) & 0xff;
+ *index= *index + 1;
+ dest[*index]= (sh>>8) & 0xff;
+ *index= *index + 1;
+ }
}
/**
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3427 to 3428) WL#5767 | Mayank Prasad | 6 Feb |