summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-11-11 00:36:18 +0200
committerunknown <monty@mysql.com>2004-11-11 00:36:18 +0200
commitbbacfb8534c9f4e8f6996878af702073368341c9 (patch)
tree2e577ec9ae86cb235409c15a5e91c554f2225479 /mysys
parent1f9db1ff4ead0ecfdc108dabd988faef2c806d9f (diff)
downloadmariadb-git-bbacfb8534c9f4e8f6996878af702073368341c9.tar.gz
Added possibility to detect if libmysqld is restarted
(Needed to check if memory allocated with mysql_once_init() has been freed) include/my_sys.h: Added possibility to detect if libmysqld is restarted mysys/my_init.c: Added possibility to detect if libmysqld is restarted sql/handler.cc: Detect if libmysqld is restarted Simple optimization of ha_known_exts()
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_init.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 0ef938b434c..e9a61b1833c 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -42,8 +42,8 @@ static void netware_init();
#define netware_init()
#endif
-
-my_bool my_init_done=0;
+my_bool my_init_done= 0;
+uint mysys_usage_id= 0; /* Incremented for each my_init() */
static ulong atoi_octal(const char *str)
{
@@ -51,7 +51,7 @@ static ulong atoi_octal(const char *str)
while (*str && my_isspace(&my_charset_latin1, *str))
str++;
str2int(str,
- (*str == '0' ? 8 : 10), /* Octalt or decimalt */
+ (*str == '0' ? 8 : 10), /* Octalt or decimalt */
0, INT_MAX, &tmp);
return (ulong) tmp;
}
@@ -74,6 +74,7 @@ my_bool my_init(void)
if (my_init_done)
return 0;
my_init_done=1;
+ mysys_usage_id++;
#if defined(THREAD) && defined(SAFE_MUTEX)
safe_mutex_global_init(); /* Must be called early */
#endif