1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-19599 Change db_name, table_name to LEX_CSTRING in Item_ident and Send_field

This commit is contained in:
Alexander Barkov
2019-05-26 06:17:35 +04:00
parent ac93d7d674
commit 9f23f8e598
31 changed files with 319 additions and 317 deletions

View File

@@ -5397,8 +5397,7 @@ LEX::wrap_unit_into_derived(SELECT_LEX_UNIT *unit)
/* add SELECT list*/
{
Item *item= new (thd->mem_root)
Item_field(thd, context, NULL, NULL, &star_clex_str);
Item *item= new (thd->mem_root) Item_field(thd, context, star_clex_str);
if (item == NULL)
goto err;
if (add_item_to_list(thd, item))
@@ -5460,8 +5459,7 @@ SELECT_LEX *LEX::wrap_select_chain_into_derived(SELECT_LEX *sel)
/* add SELECT list*/
{
Item *item= new (thd->mem_root)
Item_field(thd, context, NULL, NULL, &star_clex_str);
Item *item= new (thd->mem_root) Item_field(thd, context, star_clex_str);
if (item == NULL)
goto err;
if (add_item_to_list(thd, item))
@@ -6005,7 +6003,7 @@ bool LEX::sp_for_loop_implicit_cursor_statement(THD *thd,
SELECT rec.a, rec.b;
END FOR;
*/
if (!(item= new (thd->mem_root) Item_field(thd, NULL, NullS, NullS, &name)))
if (!(item= new (thd->mem_root) Item_field(thd, NULL, name)))
return true;
bounds->m_index->set_item_and_free_list(item, NULL);
if (thd->lex->sphead->restore_lex(thd))
@@ -6158,7 +6156,7 @@ bool LEX::sp_for_loop_cursor_declarations(THD *thd,
name= item_splocal->m_name;
else if ((item_field= item->type() == Item::FIELD_ITEM ?
static_cast<Item_field *>(item) : NULL) &&
item_field->table_name == NULL)
item_field->table_name.str == NULL)
name= item_field->field_name;
else if (item->type() == Item::FUNC_ITEM &&
static_cast<Item_func*>(item)->functype() == Item_func::FUNC_SP &&
@@ -7014,7 +7012,7 @@ Item *LEX::create_and_link_Item_trigger_field(THD *thd,
new_row ?
Item_trigger_field::NEW_ROW:
Item_trigger_field::OLD_ROW,
name, SELECT_ACL, tmp_read_only);
*name, SELECT_ACL, tmp_read_only);
/*
Let us add this item to list of all Item_trigger_field objects
in trigger.
@@ -7163,7 +7161,7 @@ Item *LEX::create_item_for_loop_bound(THD *thd,
Pass NULL as the name resolution context.
This is OK, fix_fields() won't be called for this Item_field.
*/
return new (thd->mem_root) Item_field(thd, NULL, a->str, b->str, c);
return new (thd->mem_root) Item_field(thd, NULL, *a, *b, *c);
}
@@ -7201,7 +7199,7 @@ Item *LEX::create_item_ident_nospvar(THD *thd,
if (current_select->parsing_place == FOR_LOOP_BOUND)
return create_item_for_loop_bound(thd, &null_clex_str, a, b);
return create_item_ident_field(thd, NullS, a->str, b);
return create_item_ident_field(thd, Lex_ident_sys(), *a, *b);
}
@@ -7393,9 +7391,8 @@ Item *LEX::create_item_ident(THD *thd,
const Lex_ident_sys_st *b,
const Lex_ident_sys_st *c)
{
const char *schema= (thd->client_capabilities & CLIENT_NO_SCHEMA ?
NullS : a->str);
Lex_ident_sys_st schema= thd->client_capabilities & CLIENT_NO_SCHEMA ?
Lex_ident_sys() : *a;
if ((thd->variables.sql_mode & MODE_ORACLE) && c->length == 7)
{
if (!my_strnncoll(system_charset_info,
@@ -7417,7 +7414,7 @@ Item *LEX::create_item_ident(THD *thd,
if (current_select->parsing_place == FOR_LOOP_BOUND)
return create_item_for_loop_bound(thd, &null_clex_str, b, c);
return create_item_ident_field(thd, schema, b->str, c);
return create_item_ident_field(thd, schema, *b, *c);
}
@@ -7503,11 +7500,12 @@ bool LEX::set_user_variable(THD *thd, const LEX_CSTRING *name, Item *val)
}
Item *LEX::create_item_ident_field(THD *thd, const char *db,
const char *table,
const Lex_ident_sys_st *name)
Item *LEX::create_item_ident_field(THD *thd,
const Lex_ident_sys_st &db,
const Lex_ident_sys_st &table,
const Lex_ident_sys_st &name)
{
if (check_expr_allows_fields_or_error(thd, name->str))
if (check_expr_allows_fields_or_error(thd, name.str))
return NULL;
if (current_select->parsing_place != IN_HAVING ||
@@ -8487,9 +8485,9 @@ bool SELECT_LEX::vers_push_field(THD *thd, TABLE_LIST *table,
{
DBUG_ASSERT(field_name.str);
Item_field *fld= new (thd->mem_root) Item_field(thd, &context,
table->db.str,
table->alias.str,
&field_name);
table->db,
table->alias,
field_name);
if (unlikely(!fld) || unlikely(item_list.push_back(fld)))
return true;
@@ -8607,8 +8605,8 @@ Item *LEX::create_item_qualified_asterisk(THD *thd,
{
Item *item;
if (!(item= new (thd->mem_root) Item_field(thd, current_context(),
NullS, name->str,
&star_clex_str)))
null_clex_str, *name,
star_clex_str)))
return NULL;
current_select->with_wild++;
return item;
@@ -8620,11 +8618,10 @@ Item *LEX::create_item_qualified_asterisk(THD *thd,
const Lex_ident_sys_st *b)
{
Item *item;
const char* schema= thd->client_capabilities & CLIENT_NO_SCHEMA ?
NullS : a->str;
Lex_ident_sys_st schema= thd->client_capabilities & CLIENT_NO_SCHEMA ?
Lex_ident_sys() : *a;
if (!(item= new (thd->mem_root) Item_field(thd, current_context(),
schema, b->str,
&star_clex_str)))
schema, *b, star_clex_str)))
return NULL;
current_select->with_wild++;
return item;