summaryrefslogtreecommitdiff
path: root/mysys/my_init.c
diff options
context:
space:
mode:
authorunknown <jani@hynda.mysql.fi>2007-11-08 13:23:08 +0200
committerunknown <jani@hynda.mysql.fi>2007-11-08 13:23:08 +0200
commit0eec2d63d5fbe531e48ac507b8889194a358bd33 (patch)
treef89923a1746fb2b7c68c99a57d7bc4f89de2d0ff /mysys/my_init.c
parentaf48b26ed8b369e80968df581cf395c572d35be2 (diff)
parent21c1f460d71e392b905b17c86f8414a62ba284e0 (diff)
downloadmariadb-git-0eec2d63d5fbe531e48ac507b8889194a358bd33.tar.gz
Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into hynda.mysql.fi:/home/my/mysql-5.1-marvel BitKeeper/etc/ignore: auto-union client/mysql_upgrade.c: Auto merged client/mysqlcheck.c: Auto merged client/mysqldump.c: Auto merged client/mysqlimport.c: Auto merged client/mysqlshow.c: Auto merged client/mysqlslap.c: Auto merged client/mysqltest.c: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged mysys/mf_keycache.c: Auto merged mysys/my_init.c: Auto merged mysys/safemalloc.c: Auto merged sql/ha_partition.cc: Auto merged sql/handler.cc: Auto merged sql/item_func.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/unireg.cc: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/mi_write.c: Auto merged sql/sql_yacc.yy: Merged with 5.1 main tree.
Diffstat (limited to 'mysys/my_init.c')
-rw-r--r--mysys/my_init.c47
1 files changed, 26 insertions, 21 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 6d1b9ec04be..eaa8e36e39c 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -43,6 +43,7 @@ static void netware_init();
my_bool my_init_done= 0;
uint mysys_usage_id= 0; /* Incremented for each my_init() */
+ulong my_thread_stack_size= 65536;
static ulong atoi_octal(const char *str)
{
@@ -76,6 +77,7 @@ my_bool my_init(void)
mysys_usage_id++;
my_umask= 0660; /* Default umask for new files */
my_umask_dir= 0700; /* Default umask for new directories */
+ init_glob_errs();
#if defined(THREAD) && defined(SAFE_MUTEX)
safe_mutex_global_init(); /* Must be called early */
#endif
@@ -343,6 +345,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)
@@ -380,27 +406,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 ;
}