summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2010-04-28 14:52:24 +0200
committerunknown <knielsen@knielsen-hq.org>2010-04-28 14:52:24 +0200
commitb1e00b6be81c80b09d11085d77d86978e26df988 (patch)
treebb1fdd7363fbf2580572ac9a56dbd4c933cc4c0d /mysys
parent1f683a7270e63abfadce20c6f51370621ff065e1 (diff)
parentc9cfd2df5f2f58c2cdf716999ebea252c307333f (diff)
downloadmariadb-git-b1e00b6be81c80b09d11085d77d86978e26df988.tar.gz
Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/charset.c8
-rw-r--r--mysys/default.c8
-rw-r--r--mysys/mf_pack.c3
-rw-r--r--mysys/my_init.c1
4 files changed, 16 insertions, 4 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index dd27cb45a5f..8d2f68b7bbf 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -245,6 +245,8 @@ static int add_collation(CHARSET_INFO *cs)
if (cs_copy_data(all_charsets[cs->number],cs))
return MY_XML_ERROR;
+ newcs->caseup_multiply= newcs->casedn_multiply= 1;
+
if (!strcmp(cs->csname,"ucs2") )
{
#if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS)
@@ -403,6 +405,7 @@ static void *cs_alloc(size_t size)
static my_pthread_once_t charsets_initialized= MY_PTHREAD_ONCE_INIT;
+static my_pthread_once_t charsets_template= MY_PTHREAD_ONCE_INIT;
static void init_available_charsets(void)
{
@@ -430,6 +433,11 @@ static void init_available_charsets(void)
}
+void free_charsets(void)
+{
+ charsets_initialized= charsets_template;
+}
+
uint get_collation_number(const char *name)
{
my_pthread_once(&charsets_initialized, init_available_charsets);
diff --git a/mysys/default.c b/mysys/default.c
index 4e9d4faae91..63f9445dbdc 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -995,10 +995,10 @@ void print_defaults(const char *conf_file, const char **groups)
}
}
puts("\nThe following options may be given as the first argument:\n\
---print-defaults Print the program argument list and exit\n\
---no-defaults Don't read default options from any options file\n\
---defaults-file=# Only read default options from the given file #\n\
---defaults-extra-file=# Read this file after the global files are read");
+--print-defaults Print the program argument list and exit.\n\
+--no-defaults Don't read default options from any option file.\n\
+--defaults-file=# Only read default options from the given file #.\n\
+--defaults-extra-file=# Read this file after the global files are read.");
}
#include <help_end.h>
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index c13a5581b80..4f7cd90e8aa 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -311,6 +311,9 @@ size_t normalize_dirname(char *to, const char *from)
#endif
buff[length - 1] != FN_LIBCHAR && buff[length - 1] != '/')
{
+ /* we need reserve 2 bytes for the trailing slash and the zero */
+ if (length >= sizeof (buff) - 1)
+ length= sizeof (buff) - 2;
buff[length]= FN_LIBCHAR;
buff[length + 1]= '\0';
}
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 0f6bb80fe95..e7ab9ba7a1f 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -166,6 +166,7 @@ void my_end(int infoflag)
my_print_open_files();
}
}
+ free_charsets();
my_error_unregister_all();
my_once_free();
#ifdef THREAD