diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2008-01-03 09:45:46 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2008-01-03 09:45:46 +0200 |
commit | c719e1fd335f20bc068e3174cea097101ab4cf2a (patch) | |
tree | 5f706a3316f1cd3eee945fc5c444d6ba2039428b /mysys/my_init.c | |
parent | f8b3e118ba6511c9c20993ccf5604a6890daffd6 (diff) | |
download | mariadb-git-c719e1fd335f20bc068e3174cea097101ab4cf2a.tar.gz |
Added wrapper for chmod(): my_chmod()
Automaticly disable ma_test_recovery if not compiled with debugging. This fixes that make test works in Maria.
Fixed wrong merge of ma_init.c from 5.1
Portability fixes:
- Use my_chmod() instead of my_chmod()
- Use my_access() instead of my_stat() to test if file exists
- Don't test result value of pthread_mutex_lock() and pthread_mutex_unlock() as this is not portable
- No reason to test if file exists before we delete it
include/my_sys.h:
Added my_chmod
include/mysys_err.h:
Added error for my_chmod
mysys/Makefile.am:
Added my_chmod
mysys/errors.c:
Added error for my_chmod
mysys/my_init.c:
Syncronize with 5.1 to fix setting of QueryPerformanceFrequency()
storage/maria/ma_test1.c:
Changed short option of --skip-delete and --skip-update to be more logical
storage/maria/ma_test_recovery.expected:
Updated results after adding more tests
storage/maria/ma_test_recovery:
Abort test nicely if we are runnning without debugging
Added more tests
Changed temporary file names so that one can run maria_chk on them
Removed some old comments
storage/maria/maria_read_log.c:
Added note if maria_read_log will not be able to create byte-to-byte identical tables compared to normal execution
storage/maria/unittest/ma_pagecache_consist.c:
Removed wrong setting of buff that caused memory overwrite
Use my_chmod() instead of chmod()
Don't test result value of pthread_mutex_lock() and pthread_mutex_unlock() as this is not portable
storage/maria/unittest/ma_pagecache_single.c:
Use my_chmod() instead of chmod()
Don't test result value of pthread_mutex_lock() and pthread_mutex_unlock() as this is not portable
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
No reason to test if file exists before we delete it
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Don't test result value of pthread_mutex_lock() and pthread_mutex_unlock() as this is not portable
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
No reason to test if file exists before we delete it
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
Use my_access() instead of my_stat() to test if file exists
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
No reason to test if file exists before we delete it
chmod -> my_chmod
mysys/my_chmod.c:
Added wrapper for chmod()
Diffstat (limited to 'mysys/my_init.c')
-rw-r--r-- | mysys/my_init.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c index 145a435b4b6..a153275f87e 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -356,6 +356,30 @@ static void my_win_init(void) _tzset(); + /* The following is used by time functions */ +#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10) +#define MS 10000000 + { + FILETIME ft; + LARGE_INTEGER li, t_cnt; + DBUG_ASSERT(sizeof(LARGE_INTEGER) == sizeof(query_performance_frequency)); + if (QueryPerformanceFrequency((LARGE_INTEGER *)&query_performance_frequency) == 0) + query_performance_frequency= 0; + else + { + GetSystemTimeAsFileTime(&ft); + li.LowPart= ft.dwLowDateTime; + li.HighPart= ft.dwHighDateTime; + query_performance_offset= li.QuadPart-OFFSET_TO_EPOC; + QueryPerformanceCounter(&t_cnt); + query_performance_offset-= (t_cnt.QuadPart / + query_performance_frequency * MS + + t_cnt.QuadPart % + query_performance_frequency * MS / + query_performance_frequency); + } + } + /* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,(LPCTSTR)targetKey,0, KEY_READ,&hSoftMysql) != ERROR_SUCCESS) @@ -393,27 +417,6 @@ static void my_win_init(void) /* chiude la chiave */ RegCloseKey(hSoftMysql) ; - /* The following is used by time functions */ -#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10) -#define MS 10000000 - { - FILETIME ft; - LARGE_INTEGER li, t_cnt; - DBUG_ASSERT(sizeof(LARGE_INTEGER) == sizeof(query_performance_frequency)); - if (QueryPerformanceFrequency((LARGE_INTEGER *)&query_performance_frequency)) - query_performance_frequency= 0; - else - { - GetSystemTimeAsFileTime(&ft); - li.LowPart= ft.dwLowDateTime; - li.HighPart= ft.dwHighDateTime; - query_performance_offset= li.QuadPart-OFFSET_TO_EPOC; - QueryPerformanceCounter(&t_cnt); - query_performance_offset-= (t_cnt.QuadPart / query_performance_frequency * MS + - t_cnt.QuadPart % query_performance_frequency * MS / - query_performance_frequency); - } - } DBUG_VOID_RETURN ; } |