diff options
Diffstat (limited to 'sql/sys_vars.ic')
-rw-r--r-- | sql/sys_vars.ic | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic index 780450b484b..a157538d528 100644 --- a/sql/sys_vars.ic +++ b/sql/sys_vars.ic @@ -364,9 +364,9 @@ public: { var->save_result.ulonglong_value= option.def_value; } uchar *valptr(THD *thd, ulong val) { return (uchar*)typelib.type_names[val]; } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, session_var(thd, ulong)); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, global_var(ulong)); } uchar *default_value_ptr(THD *thd) { return valptr(thd, option.def_value); } @@ -619,7 +619,7 @@ public: DBUG_ASSERT(res == 0); } } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(thd != NULL); size_t len= sysvartrack_value_len(thd); @@ -669,7 +669,7 @@ public: void global_save_default(THD *thd, set_var *var) { DBUG_ASSERT(FALSE); } protected: - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return thd->security_ctx->proxy_user[0] ? (uchar *) &(thd->security_ctx->proxy_user[0]) : NULL; @@ -685,7 +685,7 @@ public: {} protected: - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return (uchar*)thd->security_ctx->external_user; } @@ -725,7 +725,7 @@ public: bool global_update(THD *thd, set_var *var); protected: - uchar *global_value_ptr(THD *thd, const LEX_STRING *base); + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base); bool set_filter_value(const char *value, Master_info *mi); }; @@ -736,7 +736,7 @@ protected: Class specific constructor arguments: enum charset_enum is_os_charset_arg - Backing store: LEX_STRING + Backing store: LEX_CSTRING @note Behaves exactly as Sys_var_charptr, only the backing store is different. @@ -757,22 +757,22 @@ public: getopt, is_os_charset_arg, def_val, lock, binlog_status_arg, on_check_func, on_update_func, substitute) { - global_var(LEX_STRING).length= strlen(def_val); - SYSVAR_ASSERT(size == sizeof(LEX_STRING)); + global_var(LEX_CSTRING).length= strlen(def_val); + SYSVAR_ASSERT(size == sizeof(LEX_CSTRING)); *const_cast<SHOW_TYPE*>(&show_val_type)= SHOW_LEX_STRING; } bool global_update(THD *thd, set_var *var) { if (Sys_var_charptr::global_update(thd, var)) return true; - global_var(LEX_STRING).length= var->save_result.string_value.length; + global_var(LEX_CSTRING).length= var->save_result.string_value.length; return false; } }; /* - A LEX_STRING stored only in thd->variables + A LEX_CSTRING stored only in thd->variables Only to be used for small buffers */ @@ -822,10 +822,10 @@ public: } bool session_update(THD *thd, set_var *var) { - LEX_STRING *tmp= &session_var(thd, LEX_STRING); + LEX_CSTRING *tmp= &session_var(thd, LEX_CSTRING); tmp->length= var->save_result.string_value.length; /* Store as \0 terminated string (just to be safe) */ - strmake(tmp->str, var->save_result.string_value.str, tmp->length); + strmake((char*) tmp->str, var->save_result.string_value.str, tmp->length); return false; } bool global_update(THD *thd, set_var *var) @@ -843,7 +843,7 @@ public: { DBUG_ASSERT(FALSE); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(FALSE); return NULL; @@ -913,13 +913,13 @@ public: char *ptr= (char*)(intptr)option.def_value; var->save_result.string_value.str= ptr; } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { char buf[256]; DBUG_EXPLAIN(buf, sizeof(buf)); return (uchar*) thd->strdup(buf); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { char buf[256]; DBUG_EXPLAIN_INITIAL(buf, sizeof(buf)); @@ -974,7 +974,7 @@ public: bool global_update(THD *thd, set_var *var) { ulonglong new_value= var->save_result.ulonglong_value; - LEX_STRING *base_name= &var->base; + LEX_CSTRING *base_name= &var->base; KEY_CACHE *key_cache; /* If no basename, assume it's for the key cache named 'default' */ @@ -1001,7 +1001,7 @@ public: return keycache_update(thd, key_cache, offset, new_value); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { KEY_CACHE *key_cache= get_key_cache(base); if (!key_cache) @@ -1186,7 +1186,7 @@ public: lock, binlog_status_arg, on_check_func, on_update_func, substitute) { } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { if (thd->user_connect && thd->user_connect->user_resources.user_conn) return (uchar*) &(thd->user_connect->user_resources.user_conn); @@ -1300,9 +1300,9 @@ public: { var->save_result.ulonglong_value= option.def_value; } uchar *valptr(THD *thd, ulonglong val) { return (uchar*)flagset_to_string(thd, 0, val, typelib.type_names); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, session_var(thd, ulonglong)); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, global_var(ulonglong)); } uchar *default_value_ptr(THD *thd) { return valptr(thd, option.def_value); } @@ -1399,9 +1399,9 @@ public: { var->save_result.ulonglong_value= option.def_value; } uchar *valptr(THD *thd, ulonglong val) { return (uchar*)set_to_string(thd, 0, val, typelib.type_names); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, session_var(thd, ulonglong)); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, global_var(ulonglong)); } uchar *default_value_ptr(THD *thd) { return valptr(thd, option.def_value); } @@ -1450,7 +1450,7 @@ public: var->save_result.plugin= NULL; else { - const LEX_STRING pname= { const_cast<char*>(res->ptr()), res->length() }; + const LEX_CSTRING pname= { const_cast<char*>(res->ptr()), res->length() }; plugin_ref plugin; // special code for storage engines (e.g. to handle historical aliases) @@ -1504,7 +1504,7 @@ public: if (!default_value) return 0; - LEX_STRING pname= { default_value, strlen(pname.str) }; + LEX_CSTRING pname= { default_value, strlen(default_value) }; plugin_ref plugin; if (plugin_type == MYSQL_STORAGE_ENGINE_PLUGIN) @@ -1525,9 +1525,9 @@ public: return (uchar*)(plugin ? thd->strmake(plugin_name(plugin)->str, plugin_name(plugin)->length) : 0); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, session_var(thd, plugin_ref)); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, global_var(plugin_ref)); } uchar *default_value_ptr(THD *thd) { return valptr(thd, get_default(thd)); } @@ -1593,11 +1593,11 @@ public: { DBUG_ASSERT(FALSE); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return debug_sync_value_ptr(thd); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(FALSE); return 0; @@ -1680,9 +1680,9 @@ public: thd->sys_var_tmp.my_bool_value= reverse_semantics ^ ((val & bitmask) != 0); return (uchar*) &thd->sys_var_tmp.my_bool_value; } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, session_var(thd, ulonglong)); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, global_var(ulonglong)); } uchar *default_value_ptr(THD *thd) { @@ -1743,12 +1743,12 @@ public: { var->value= 0; } void global_save_default(THD *thd, set_var *var) { DBUG_ASSERT(FALSE); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { thd->sys_var_tmp.ulonglong_value= read_func(thd); return (uchar*) &thd->sys_var_tmp.ulonglong_value; } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(FALSE); return 0; @@ -1808,13 +1808,13 @@ public: { var->value= 0; } void global_save_default(THD *thd, set_var *var) { DBUG_ASSERT(FALSE); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { thd->sys_var_tmp.double_value= thd->start_time + thd->start_time_sec_part/(double)TIME_SECOND_PART_FACTOR; return (uchar*) &thd->sys_var_tmp.double_value; } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(FALSE); return 0; @@ -1878,12 +1878,12 @@ public: } void session_save_default(THD *thd, set_var *var) { } void global_save_default(THD *thd, set_var *var) { } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(FALSE); return 0; } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return (uchar*)show_comp_option_name[global_var(enum SHOW_COMP_OPTION)]; } @@ -1955,9 +1955,9 @@ public: } uchar *valptr(THD *thd, uchar *val) { return val ? *(uchar**)(val+name_offset) : 0; } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, session_var(thd, uchar*)); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, global_var(uchar*)); } uchar *default_value_ptr(THD *thd) { return valptr(thd, *(uchar**)option.def_value); } @@ -2031,7 +2031,7 @@ public: } uchar *valptr(THD *thd, Time_zone *val) { return (uchar *)(val->get_name()->ptr()); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { /* This is an ugly fix for replication: we don't replicate properly queries @@ -2044,7 +2044,7 @@ public: thd->time_zone_used= 1; return valptr(thd, session_var(thd, Time_zone *)); } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return valptr(thd, global_var(Time_zone*)); } uchar *default_value_ptr(THD *thd) { return valptr(thd, *(Time_zone**)option.def_value); } @@ -2215,7 +2215,7 @@ public: /* Use value given in variable declaration */ global_save_default(thd, var); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { ulonglong *tmp, res; tmp= (ulonglong*) (((uchar*)&(thd->variables)) + offset); @@ -2223,7 +2223,7 @@ public: *tmp= res; return (uchar*) tmp; } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { return session_value_ptr(thd, base); } @@ -2275,12 +2275,12 @@ public: { DBUG_ASSERT(false); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(false); return NULL; } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base); + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base); }; @@ -2324,12 +2324,12 @@ public: { DBUG_ASSERT(false); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(false); return NULL; } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base); + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base); }; @@ -2364,12 +2364,12 @@ public: /* Record the attempt to use default so we can error. */ var->value= 0; } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(false); return NULL; } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base); + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base); uchar *default_value_ptr(THD *thd) { return 0; } }; @@ -2406,12 +2406,12 @@ public: /* Record the attempt to use default so we can error. */ var->value= 0; } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(false); return NULL; } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base); + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base); uchar *default_value_ptr(THD *thd) { return 0; } }; @@ -2456,8 +2456,8 @@ public: { DBUG_ASSERT(false); } - uchar *session_value_ptr(THD *thd, const LEX_STRING *base); - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) + uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base); + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) { DBUG_ASSERT(false); return NULL; @@ -2483,5 +2483,5 @@ public: SYSVAR_ASSERT(scope() == GLOBAL); } bool global_update(THD *thd, set_var *var); - uchar *global_value_ptr(THD *thd, const LEX_STRING *base); + uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base); }; |