cleanup: lex_string_set3()
This commit is contained in:
parent
32e6f8ff2e
commit
ae59127158
@ -242,12 +242,6 @@ static inline void lex_string_set(LEX_CSTRING *lex_str, const char *c_str)
|
|||||||
lex_str->str= c_str;
|
lex_str->str= c_str;
|
||||||
lex_str->length= strlen(c_str);
|
lex_str->length= strlen(c_str);
|
||||||
}
|
}
|
||||||
static inline void lex_string_set3(LEX_CSTRING *lex_str, const char *c_str,
|
|
||||||
size_t len)
|
|
||||||
{
|
|
||||||
lex_str->str= c_str;
|
|
||||||
lex_str->length= len;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Copies a string.
|
Copies a string.
|
||||||
|
@ -2212,8 +2212,7 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
|
|||||||
|
|
||||||
mysql_mutex_unlock(&LOCK_gdl);
|
mysql_mutex_unlock(&LOCK_gdl);
|
||||||
save_db= thd->db;
|
save_db= thd->db;
|
||||||
lex_string_set3(&thd->db, recovery_state.db.ptr(),
|
thd->db= recovery_state.db.to_lex_cstring();
|
||||||
recovery_state.db.length());
|
|
||||||
(void) thd->binlog_query(THD::STMT_QUERY_TYPE,
|
(void) thd->binlog_query(THD::STMT_QUERY_TYPE,
|
||||||
recovery_state.query.ptr(),
|
recovery_state.query.ptr(),
|
||||||
recovery_state.query.length(),
|
recovery_state.query.length(),
|
||||||
|
@ -144,9 +144,9 @@ int ha_partition::notify_tabledef_changed(LEX_CSTRING *db,
|
|||||||
if (create_partition_name(from_buff, sizeof(from_buff), from_path,
|
if (create_partition_name(from_buff, sizeof(from_buff), from_path,
|
||||||
name_buffer_ptr, NORMAL_PART_NAME, FALSE))
|
name_buffer_ptr, NORMAL_PART_NAME, FALSE))
|
||||||
res=1;
|
res=1;
|
||||||
table_name_ptr= from_buff + dirname_length(from_buff);
|
|
||||||
|
|
||||||
lex_string_set3(&table_name, table_name_ptr, strlen(table_name_ptr));
|
table_name_ptr= from_buff + dirname_length(from_buff);
|
||||||
|
lex_string_set(&table_name, table_name_ptr);
|
||||||
|
|
||||||
if (((*file)->ht)->notify_tabledef_changed((*file)->ht, db, &table_name,
|
if (((*file)->ht)->notify_tabledef_changed((*file)->ht, db, &table_name,
|
||||||
frm, version, *file))
|
frm, version, *file))
|
||||||
|
@ -1062,19 +1062,19 @@ int Json_table_column::On_response::print(const char *name, String *str) const
|
|||||||
switch (m_response)
|
switch (m_response)
|
||||||
{
|
{
|
||||||
case Json_table_column::RESPONSE_NULL:
|
case Json_table_column::RESPONSE_NULL:
|
||||||
lex_string_set3(&resp, STRING_WITH_LEN("NULL"));
|
resp= { STRING_WITH_LEN("NULL") };
|
||||||
break;
|
break;
|
||||||
case Json_table_column::RESPONSE_ERROR:
|
case Json_table_column::RESPONSE_ERROR:
|
||||||
lex_string_set3(&resp, STRING_WITH_LEN("ERROR"));
|
resp= { STRING_WITH_LEN("ERROR") };
|
||||||
break;
|
break;
|
||||||
case Json_table_column::RESPONSE_DEFAULT:
|
case Json_table_column::RESPONSE_DEFAULT:
|
||||||
{
|
{
|
||||||
lex_string_set3(&resp, STRING_WITH_LEN("DEFAULT"));
|
resp= { STRING_WITH_LEN("DEFAULT") };
|
||||||
ds= m_default->val_str(&val);
|
ds= m_default->val_str(&val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
lex_string_set3(&resp, "", 0);
|
resp= { "", 0 };
|
||||||
DBUG_ASSERT(FALSE); /* should never happen. */
|
DBUG_ASSERT(FALSE); /* should never happen. */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1477,5 +1477,3 @@ table_map add_table_function_dependencies(List<TABLE_LIST> *join_list,
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16823,17 +16823,17 @@ const char *dbug_print_sel_arg(SEL_ARG *sel_arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sel_arg->min_flag & NEAR_MIN)
|
if (sel_arg->min_flag & NEAR_MIN)
|
||||||
lex_string_set3(&tmp, "<", 1);
|
tmp = { STRING_WITH_LEN("<") };
|
||||||
else
|
else
|
||||||
lex_string_set3(&tmp, "<=", 2);
|
tmp = { STRING_WITH_LEN("<=") };
|
||||||
out.append(&tmp);
|
out.append(&tmp);
|
||||||
|
|
||||||
out.append(sel_arg->field->field_name);
|
out.append(sel_arg->field->field_name);
|
||||||
|
|
||||||
if (sel_arg->min_flag & NEAR_MAX)
|
if (sel_arg->min_flag & NEAR_MAX)
|
||||||
lex_string_set3(&tmp, "<", 1);
|
tmp = { STRING_WITH_LEN("<") };
|
||||||
else
|
else
|
||||||
lex_string_set3(&tmp, "<=", 2);
|
tmp = { STRING_WITH_LEN("<=") };
|
||||||
out.append(&tmp);
|
out.append(&tmp);
|
||||||
|
|
||||||
if (sel_arg->max_flag & NO_MAX_RANGE)
|
if (sel_arg->max_flag & NO_MAX_RANGE)
|
||||||
|
@ -540,21 +540,20 @@ uint Explain_union::make_union_table_name(char *buf)
|
|||||||
switch (operation)
|
switch (operation)
|
||||||
{
|
{
|
||||||
case OP_MIX:
|
case OP_MIX:
|
||||||
lex_string_set3(&type, STRING_WITH_LEN("<unit"));
|
type= { STRING_WITH_LEN("<unit") };
|
||||||
break;
|
break;
|
||||||
case OP_UNION:
|
case OP_UNION:
|
||||||
lex_string_set3(&type, STRING_WITH_LEN("<union"));
|
type= { STRING_WITH_LEN("<union") };
|
||||||
break;
|
break;
|
||||||
case OP_INTERSECT:
|
case OP_INTERSECT:
|
||||||
lex_string_set3(&type, STRING_WITH_LEN("<intersect"));
|
type= { STRING_WITH_LEN("<intersect") };
|
||||||
break;
|
break;
|
||||||
case OP_EXCEPT:
|
case OP_EXCEPT:
|
||||||
lex_string_set3(&type, STRING_WITH_LEN("<except"));
|
type= { STRING_WITH_LEN("<except") };
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(0);
|
DBUG_ASSERT(0);
|
||||||
type.str= NULL;
|
type= { NULL, 0 };
|
||||||
type.length= 0;
|
|
||||||
}
|
}
|
||||||
memcpy(buf, type.str, (len= (uint)type.length));
|
memcpy(buf, type.str, (len= (uint)type.length));
|
||||||
|
|
||||||
|
@ -4711,7 +4711,6 @@ int mysql_create_table_no_lock(THD *thd,
|
|||||||
int res;
|
int res;
|
||||||
uint path_length;
|
uint path_length;
|
||||||
char path[FN_REFLEN + 1];
|
char path[FN_REFLEN + 1];
|
||||||
LEX_CSTRING cpath;
|
|
||||||
const Lex_ident_db *db= &table_list->db;
|
const Lex_ident_db *db= &table_list->db;
|
||||||
const Lex_ident_table *table_name= &table_list->table_name;
|
const Lex_ident_table *table_name= &table_list->table_name;
|
||||||
LEX_CUSTRING frm= {0,0};
|
LEX_CUSTRING frm= {0,0};
|
||||||
@ -4734,8 +4733,8 @@ int mysql_create_table_no_lock(THD *thd,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lex_string_set3(&cpath, path, path_length);
|
|
||||||
|
|
||||||
|
LEX_CSTRING cpath= { path, path_length };
|
||||||
res= create_table_impl(thd, ddl_log_state_create, ddl_log_state_rm, *db,
|
res= create_table_impl(thd, ddl_log_state_create, ddl_log_state_rm, *db,
|
||||||
*table_name, *db, *table_name, cpath, *create_info,
|
*table_name, *db, *table_name, cpath, *create_info,
|
||||||
create_info, alter_info, create_table_mode,
|
create_info, alter_info, create_table_mode,
|
||||||
|
@ -1383,7 +1383,7 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables,
|
|||||||
if (stmt_query)
|
if (stmt_query)
|
||||||
{
|
{
|
||||||
/* This code is executed in case of DROP TRIGGER */
|
/* This code is executed in case of DROP TRIGGER */
|
||||||
lex_string_set3(&query, thd->query(), thd->query_length());
|
query = { thd->query(), thd->query_length() };
|
||||||
}
|
}
|
||||||
if (ddl_log_drop_trigger(ddl_log_state, &tables->db, &tables->table_name,
|
if (ddl_log_drop_trigger(ddl_log_state, &tables->db, &tables->table_name,
|
||||||
sp_name, &query))
|
sp_name, &query))
|
||||||
|
@ -1945,12 +1945,10 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
|
|||||||
|
|
||||||
for (view= views; view; view= view->next_local)
|
for (view= views; view; view= view->next_local)
|
||||||
{
|
{
|
||||||
LEX_CSTRING cpath;
|
|
||||||
bool not_exist;
|
bool not_exist;
|
||||||
size_t length;
|
size_t length= build_table_filename(path, sizeof(path) - 1, view->db.str,
|
||||||
length= build_table_filename(path, sizeof(path) - 1,
|
view->table_name.str, reg_ext, 0);
|
||||||
view->db.str, view->table_name.str, reg_ext, 0);
|
LEX_CSTRING cpath= { path, length };
|
||||||
lex_string_set3(&cpath, path, length);
|
|
||||||
|
|
||||||
if ((not_exist= my_access(path, F_OK)) || !dd_frm_is_view(thd, path))
|
if ((not_exist= my_access(path, F_OK)) || !dd_frm_is_view(thd, path))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user