1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

A cleanup for MDEV-10914 ROW data type for stored routine variables

Changing datatypes for:
- Item_spvar_args::m_table
- sp_rcontext::m_var_table
- return value of create_virtual_tmp_table()
from TABLE* to Virtual_tmp_table*

Advantages:
- Stricter data type control
- Removing the duplicate code (a loop with free_blobs)
  from destructors ~sp_rcontext() and ~Item_spvar_args(),
  using "delete m_(var_)table" in both instead.
- Using Virtual_tmp_table::delete makes the code call Field::delete,
  which calls TRASH() for the freed fields,
  which is good for valgrind test runs.
This commit is contained in:
Alexander Barkov
2017-10-03 07:54:22 +04:00
parent 8ae8cd6348
commit fcf631eafb
4 changed files with 19 additions and 14 deletions

View File

@ -2013,7 +2013,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
class Virtual_tmp_table: public TABLE
{
/**
Destruct collected fields. This method is called on errors only,
Destruct collected fields. This method can be called on errors,
when we could not make the virtual temporary table completely,
e.g. when some of the fields could not be created or added.
@ -2024,7 +2024,10 @@ class Virtual_tmp_table: public TABLE
void destruct_fields()
{
for (uint i= 0; i < s->fields; i++)
{
field[i]->free();
delete field[i]; // to invoke the field destructor
}
s->fields= 0; // safety
}
@ -2144,7 +2147,7 @@ public:
TABLE object ready for read and write in case of success
*/
inline TABLE *
inline Virtual_tmp_table *
create_virtual_tmp_table(THD *thd, List<Spvar_definition> &field_list)
{
Virtual_tmp_table *table;