summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 18f848f3cd3..9cb93d35f81 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -405,12 +405,16 @@ static int item_value_type(struct st_mysql_value *value)
static const char *item_val_str(struct st_mysql_value *value,
char *buffer, int *length)
{
- String str(buffer, *length, system_charset_info), *res;
+ size_t org_length= *length;
+ String str(buffer, org_length, system_charset_info), *res;
if (!(res= ((st_item_value_holder*)value)->item->val_str(&str)))
return NULL;
*length= res->length();
- if (res->c_ptr_quick() == buffer)
+ if (res->ptr() == buffer && res->length() < org_length)
+ {
+ buffer[res->length()]= 0;
return buffer;
+ }
/*
Lets be nice and create a temporary string since the
@@ -1721,7 +1725,8 @@ int plugin_init(int *argc, char **argv, int flags)
{
char path[FN_REFLEN + 1];
build_table_filename(path, sizeof(path) - 1, "mysql", "plugin", reg_ext, 0);
- Table_type ttype= dd_frm_type(0, path, &plugin_table_engine_name);
+ Table_type ttype= dd_frm_type(0, path, &plugin_table_engine_name,
+ NULL, NULL);
if (ttype != TABLE_TYPE_NORMAL)
plugin_table_engine_name=empty_clex_str;
}
@@ -1955,7 +1960,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
list= NULL; /* terminate the loop */
/* fall through */
case ';':
-#ifndef __WIN__
+#ifndef _WIN32
case ':': /* can't use this as delimiter as it may be drive letter */
#endif
p[-1]= 0;