Below is the list of changes that have just been committed into a local
maria repository of guilhem. When guilhem does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-02-20 16:58:43+01:00, guilhem@stripped +3 -0
Fixes for bugs (my_atomic and Maria log handler) observed on
Solaris 10 Sparc 64bit.
include/my_atomic.h@stripped, 2008-02-20 16:58:38+01:00, guilhem@stripped +5 -5
Prototypes in the non-inline (extern) case were wrong: they were
missing "U_a" i.e. "volatile *". Caused a segfault in my_atomic-t
on Solaris10 Sparc 64.
storage/maria/ma_loghandler.c@stripped, 2008-02-20 16:58:38+01:00, guilhem@stripped +5 -2
Move "buffer" array up in the struct, to get it aligned on long-boundary
so that page cache can use bmove512() (it was not aligned and bmove512()
was used, causing SIGBUS on Solaris10 Sparc 64).
storage/maria/unittest/ma_pagecache_consist.c@stripped, 2008-02-20 16:58:38+01:00, guilhem@stripped +20 -13
doing *(uint*)(charbuff)=something is not ok on sparc machines, we must
use int4store/uint4korr. Fixes a SIGBUS on Solaris10 Sparc 64.
diff -Nrup a/include/my_atomic.h b/include/my_atomic.h
--- a/include/my_atomic.h 2008-01-10 13:19:46 +01:00
+++ b/include/my_atomic.h 2008-02-20 16:58:38 +01:00
@@ -184,19 +184,19 @@ STATIC_INLINE void my_atomic_store ## S(
#else /* no inline functions */
#define make_atomic_add(S) \
-extern int ## S my_atomic_add ## S(Uv_ ## S, U_ ## S);
+extern int ## S my_atomic_add ## S(Uv_ ## S U_a, U_ ## S U_v);
#define make_atomic_fas(S) \
-extern int ## S my_atomic_fas ## S(Uv_ ## S, U_ ## S);
+extern int ## S my_atomic_fas ## S(Uv_ ## S U_a, U_ ## S U_v);
#define make_atomic_cas(S) \
-extern int my_atomic_cas ## S(Uv_ ## S, Uv_ ## S, U_ ## S);
+extern int my_atomic_cas ## S(Uv_ ## S U_a, Uv_ ## S U_cmp, U_ ## S U_set);
#define make_atomic_load(S) \
-extern int ## S my_atomic_load ## S(Uv_ ## S);
+extern int ## S my_atomic_load ## S(Uv_ ## S U_a);
#define make_atomic_store(S) \
-extern void my_atomic_store ## S(Uv_ ## S, U_ ## S);
+extern void my_atomic_store ## S(Uv_ ## S U_a, U_ ## S U_v);
#endif
diff -Nrup a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
--- a/storage/maria/ma_loghandler.c 2008-02-13 18:25:52 +01:00
+++ b/storage/maria/ma_loghandler.c 2008-02-20 16:58:38 +01:00
@@ -84,6 +84,11 @@ typedef struct st_translog_file
/* log write buffer descriptor */
struct st_translog_buffer
{
+ /*
+ Cache for current log. Comes first to be aligned for bmove512() in
+ pagecache_inject()
+ */
+ uchar buffer[TRANSLOG_WRITE_BUFFER];
LSN last_lsn;
/* This buffer offset in the file */
TRANSLOG_ADDRESS offset;
@@ -148,8 +153,6 @@ struct st_translog_buffer
With file and offset it allow detect buffer changes
*/
uint8 ver;
- /* Cache for current log. */
- uchar buffer[TRANSLOG_WRITE_BUFFER];
};
diff -Nrup a/storage/maria/unittest/ma_pagecache_consist.c b/storage/maria/unittest/ma_pagecache_consist.c
--- a/storage/maria/unittest/ma_pagecache_consist.c 2008-02-13 20:27:06 +01:00
+++ b/storage/maria/unittest/ma_pagecache_consist.c 2008-02-20 16:58:38 +01:00
@@ -102,20 +102,26 @@ static uint get_len(uint limit)
}
-/* check page consistency */
+/*
+ Check page's consistency: layout is
+ 4 bytes: number 'num' of records in this page, then num occurences of
+ { 4 bytes: record's length 'len'; then 4 bytes unchecked ('tag') then
+ 'len' bytes each equal to the record's sequential number in this page,
+ modulo 256 }, then zeroes.
+ */
uint check_page(uchar *buff, ulong offset, int page_locked, int page_no,
int tag)
{
uint end= sizeof(uint);
- uint num= *((uint *)buff);
+ uint num= uint4korr(buff);
uint i;
DBUG_ENTER("check_page");
for (i= 0; i < num; i++)
{
- uint len= *((uint *)(buff + end));
+ uint len= uint4korr(buff + end);
uint j;
- end+= sizeof(uint) + sizeof(uint);
+ end+= 4 + 4;
if (len + end > TEST_PAGE_SIZE)
{
diag("incorrect field header #%u by offset %lu\n", i, offset + end);
@@ -169,17 +175,18 @@ err:
void put_rec(uchar *buff, uint end, uint len, uint tag)
{
uint i;
- uint num= *((uint *)buff);
+ uint num;
+ num= uint4korr(buff);
if (!len)
len= 1;
- if (end + sizeof(uint)*2 + len > TEST_PAGE_SIZE)
+ if (end + 4*2 + len > TEST_PAGE_SIZE)
return;
- *((uint *)(buff + end))= len;
- end+= sizeof(uint);
- *((uint *)(buff + end))= tag;
- end+= sizeof(uint);
+ int4store(buff + end, len);
+ end+= 4;
+ int4store(buff + end, tag);
+ end+= 4;
num++;
- *((uint *)buff)= num;
+ int4store(buff, num);
for (i= end; i < (len + end); i++)
{
buff[i]= (uchar) num % 256;
@@ -276,7 +283,7 @@ static void *test_thread_reader(void *ar
DBUG_PRINT("info", ("Thread %s ended\n", my_thread_name()));
pthread_mutex_lock(&LOCK_thread_count);
- ok(1, "reader%d: done\n", param);
+ ok(1, "reader%d: done", param);
thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
@@ -297,7 +304,7 @@ static void *test_thread_writer(void *ar
DBUG_PRINT("info", ("Thread %s ended\n", my_thread_name()));
pthread_mutex_lock(&LOCK_thread_count);
- ok(1, "writer%d: done\n", param);
+ ok(1, "writer%d: done", param);
thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
| Thread |
|---|
| • bk commit into maria tree (guilhem:1.2600) | Guilhem Bichot | 20 Feb |