Skip to content

Commit 5fecdfa

Browse files
author
Steinar H. Gunderson
committed
Bug #26030132: REMOVE SQL_ALLOC
Finally remove Sql_alloc, now that 8.0 has been branched off. This is a no-op change for all existing code; there is no code that does new Foo() inheriting from Sql_alloc, since that overload doesn't exist, and similarly no code that deletes such objects, since operator delete is private. After this, it is possible to write such code, and it will do the obvious thing (allocate on the regular heap, and destroy similarly). As usual, code that wants to allocate on a MEM_ROOT must say so explicitly by use of overloaded new. Change-Id: I2e98b39daa06d6dfd8b8c5b1d45a85b1ddc02b3b
1 parent 2edcf88 commit 5fecdfa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+305
-486
lines changed

sql/abstract_query_plan.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#include "my_dbug.h"
2424
#include "sql/item_cmpfunc.h" // Item_equal_iterator
25-
#include "sql/sql_alloc.h"
2625

2726
class Item;
2827
class Item_field;
@@ -65,7 +64,7 @@ namespace AQP
6564
sequence of n table access operations that will execute as a nested loop
6665
join.
6766
*/
68-
class Join_plan : public Sql_alloc
67+
class Join_plan
6968
{
7069
friend class Equal_set_iterator;
7170
friend class Table_access;
@@ -105,7 +104,7 @@ namespace AQP
105104
SELECT * FROM T1, T2, T3 WHERE T1.b = T2.a AND T2.a = T3.a
106105
then there would be such a set of {T1.b, T2.a, T3.a}.
107106
*/
108-
class Equal_set_iterator : public Sql_alloc
107+
class Equal_set_iterator
109108
{
110109
public:
111110
explicit Equal_set_iterator(Item_equal& item_equal)
@@ -173,7 +172,7 @@ namespace AQP
173172
owned by a Join_plan object, such that the life time of the Table_access
174173
object ends when the life time of the owning Join_plan object ends.
175174
*/
176-
class Table_access : public Sql_alloc
175+
class Table_access
177176
{
178177
friend class Join_plan;
179178
friend inline bool equal(const Table_access*, const Table_access*);

sql/aggregate_check.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ VE2 are NULL then VE3 must be NULL, which makes the dependency NULL-friendly.
457457
#include "sql/item_cmpfunc.h" // Item_func_any_value
458458
#include "sql/item_sum.h" // Item_sum
459459
#include "sql/mem_root_array.h" // Mem_root_array
460-
#include "sql/sql_alloc.h" // Sql_alloc
461460
#include "sql/sql_lex.h"
462461

463462
class Opt_trace_context;
@@ -537,7 +536,7 @@ class Item_tree_walker
537536
/**
538537
Checks for queries which have DISTINCT.
539538
*/
540-
class Distinct_check: public Item_tree_walker, public Sql_alloc
539+
class Distinct_check: public Item_tree_walker
541540
{
542541
public:
543542

@@ -571,7 +570,7 @@ class Distinct_check: public Item_tree_walker, public Sql_alloc
571570
/**
572571
Checks for queries which have GROUP BY or aggregate functions.
573572
*/
574-
class Group_check: public Item_tree_walker, public Sql_alloc
573+
class Group_check: public Item_tree_walker
575574
{
576575
public:
577576

sql/auth/sql_auth_cache.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include "mysql_time.h" // MYSQL_TIME
4343
#include "sql/auth/auth_common.h"
4444
#include "sql/auth/auth_internal.h" // List_of_authid, Authid
45-
#include "sql/sql_alloc.h" // Sql_alloc
4645
#include "sql/sql_connect.h" // USER_RESOURCES
4746
#include "violite.h" // SSL_type
4847

@@ -257,7 +256,7 @@ class acl_entry
257256
};
258257

259258

260-
class GRANT_COLUMN :public Sql_alloc
259+
class GRANT_COLUMN
261260
{
262261
public:
263262
ulong rights;
@@ -266,7 +265,7 @@ class GRANT_COLUMN :public Sql_alloc
266265
};
267266

268267

269-
class GRANT_NAME :public Sql_alloc
268+
class GRANT_NAME
270269
{
271270
public:
272271
ACL_HOST_AND_IP host;
@@ -432,7 +431,7 @@ typedef std::unordered_map<std::string, Role_vertex_descriptor >
432431
Role_index_map;
433432

434433
/** Container for global, schema, table/view and routine ACL maps */
435-
class Acl_map : public Sql_alloc
434+
class Acl_map
436435
{
437436
public:
438437
Acl_map(Security_context *sctx, uint64 ver);

sql/discrete_interval.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
0 <= k <= (auto_inc_interval_values-1) }
2828
Where "increment" is maintained separately by the user of this class (and is
2929
currently only thd->variables.auto_increment_increment).
30-
It mustn't derive from Sql_alloc, because SET INSERT_ID needs to
30+
It mustn't be allocated on a MEM_ROOT, because SET INSERT_ID needs to
3131
allocate memory which must stay allocated for use by the next statement.
3232
*/
3333
class Discrete_interval {

sql/event_data_objects.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "sql/log.h"
4545
#include "sql/psi_memory_key.h"
4646
#include "sql/sp_head.h"
47-
#include "sql/sql_alloc.h"
4847
#include "sql/sql_class.h"
4948
#include "sql/sql_const.h"
5049
#include "sql/sql_digest_stream.h"
@@ -117,8 +116,7 @@ static inline LEX_CSTRING make_lex_cstring(MEM_ROOT *mem_root,
117116
Event_creation_ctx -- creation context of events.
118117
*/
119118

120-
class Event_creation_ctx :public Stored_program_creation_ctx,
121-
public Sql_alloc
119+
class Event_creation_ctx :public Stored_program_creation_ctx
122120
{
123121
public:
124122
static bool create_event_creation_ctx(const dd::Event &event_obj,

sql/event_parse_data.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "my_dbug.h"
2424
#include "my_inttypes.h"
2525
#include "my_time.h" // interval_type
26-
#include "sql/sql_alloc.h" // Sql_alloc
2726

2827
class Item;
2928
class THD;
@@ -34,7 +33,7 @@ class sp_name;
3433
#define EVEX_MICROSECOND_UNSUP -6
3534
#define EVEX_MAX_INTERVAL_VALUE 1000000000L
3635

37-
class Event_parse_data : public Sql_alloc
36+
class Event_parse_data
3837
{
3938
public:
4039
/*

sql/field.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "mysqld_error.h" // ER_*
4444
#include "nullable.h"
4545
#include "sql/gis/srid.h"
46-
#include "sql/sql_alloc.h"
4746
#include "sql/sql_bitmap.h"
4847
#include "sql/sql_const.h"
4948
#include "sql/sql_error.h" // Sql_condition
@@ -619,7 +618,7 @@ void copy_integer(uchar *to, size_t to_length,
619618
If one field contains such an object, it means the field
620619
is a genereated one.
621620
*/
622-
class Generated_column: public Sql_alloc
621+
class Generated_column
623622
{
624623
public:
625624
/**
@@ -724,7 +723,7 @@ class Proto_field
724723
virtual bool send_text(Protocol *protocol)= 0;
725724
};
726725

727-
class Field: public Proto_field, public Sql_alloc
726+
class Field: public Proto_field
728727
{
729728
Field(const Item &); /* Prevent use of these */
730729
void operator=(Field &);
@@ -4624,7 +4623,7 @@ class Field_bit_as_char: public Field_bit {
46244623
Create field class for CREATE TABLE
46254624
*/
46264625

4627-
class Create_field :public Sql_alloc
4626+
class Create_field
46284627
{
46294628
public:
46304629
const char *field_name;
@@ -4775,7 +4774,8 @@ class Create_field :public Sql_alloc
47754774
A class for sending info to the client
47764775
*/
47774776

4778-
class Send_field :public Sql_alloc {
4777+
class Send_field
4778+
{
47794779
public:
47804780
const char *db_name;
47814781
const char *table_name,*org_table_name;
@@ -4797,7 +4797,8 @@ class Send_field :public Sql_alloc {
47974797
A class for quick copying data to fields
47984798
*/
47994799

4800-
class Copy_field :public Sql_alloc {
4800+
class Copy_field
4801+
{
48014802
/**
48024803
Convenience definition of a copy function returned by
48034804
get_copy_func.

sql/filesort.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "my_base.h" /* ha_rows */
2323
#include "my_dbug.h"
2424
#include "my_inttypes.h"
25-
#include "sql/sql_alloc.h" /* Sql_alloc */
2625

2726
class Addon_fields;
2827
class Field;
@@ -37,7 +36,7 @@ enum class Addon_fields_status;
3736
/**
3837
Sorting related info.
3938
*/
40-
class Filesort: public Sql_alloc
39+
class Filesort
4140
{
4241
public:
4342
/// The QEP entry for the table to be sorted

sql/ha_ndb_ddl_fk.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ typedef NdbDictionary::ForeignKey NDBFK;
4848
Unlike indexes, no references to global dictionary are kept.
4949
*/
5050

51-
struct Ndb_fk_item : Sql_alloc
51+
struct Ndb_fk_item
5252
{
5353
FOREIGN_KEY_INFO f_key_info;
5454
int update_action; // NDBFK::FkAction
@@ -57,7 +57,7 @@ struct Ndb_fk_item : Sql_alloc
5757
bool is_parent;
5858
};
5959

60-
struct Ndb_fk_data : Sql_alloc
60+
struct Ndb_fk_data
6161
{
6262
List<Ndb_fk_item> list;
6363
uint cnt_child;

sql/ha_ndbcluster_cond.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static const negated_function_mapping neg_map[]=
116116
Ndb_item with type == NDB_END_COND.
117117
NOT items represent negated conditions and generate NAND/NOR groups.
118118
*/
119-
class Ndb_item : public Sql_alloc
119+
class Ndb_item
120120
{
121121
public:
122122
Ndb_item(NDB_ITEM_TYPE item_type) : type(item_type) {}
@@ -313,7 +313,7 @@ class Ndb_item : public Sql_alloc
313313
This class implements a linked list used for storing a
314314
serialization of the Item tree for condition pushdown.
315315
*/
316-
class Ndb_cond : public Sql_alloc
316+
class Ndb_cond
317317
{
318318
public:
319319
Ndb_cond() : ndb_item(NULL), next(NULL), prev(NULL) {}
@@ -348,7 +348,7 @@ class Ndb_cond : public Sql_alloc
348348
prepared for handling several (C1 AND C2 ...) if the logic for
349349
pushing conditions is extended in sql_select.
350350
*/
351-
class Ndb_cond_stack : public Sql_alloc
351+
class Ndb_cond_stack
352352
{
353353
public:
354354
Ndb_cond_stack() : ndb_cond(NULL), next(NULL) {}
@@ -373,7 +373,7 @@ class Ndb_cond_stack : public Sql_alloc
373373
to check specific order (currently used for detecting support for
374374
<field> LIKE <string>|<func>, but not <string>|<func> LIKE <field>).
375375
*/
376-
class Ndb_expect_stack : public Sql_alloc
376+
class Ndb_expect_stack
377377
{
378378
static const uint MAX_EXPECT_ITEMS = Item::VIEW_FIXER_ITEM + 1;
379379
static const uint MAX_EXPECT_FIELD_TYPES = MYSQL_TYPE_GEOMETRY + 1;
@@ -557,7 +557,7 @@ Ndb_expect_stack(): collation(NULL), length(0), max_length(0), next(NULL)
557557
Ndb_expect_stack* next;
558558
};
559559

560-
class Ndb_rewrite_context : public Sql_alloc
560+
class Ndb_rewrite_context
561561
{
562562
public:
563563
Ndb_rewrite_context(Item_func *func)
@@ -579,7 +579,7 @@ class Ndb_rewrite_context : public Sql_alloc
579579
if the condition found is supported, and information what is
580580
expected next in the tree inorder for the condition to be supported.
581581
*/
582-
class Ndb_cond_traverse_context : public Sql_alloc
582+
class Ndb_cond_traverse_context
583583
{
584584
public:
585585
Ndb_cond_traverse_context(TABLE *tab, const NdbDictionary::Table *ndb_tab,

sql/handler.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "sql/dd/string_type.h"
4949
#include "sql/discrete_interval.h" // Discrete_interval
5050
#include "sql/key.h"
51-
#include "sql/sql_alloc.h"
5251
#include "sql/sql_const.h" // SHOW_COMP_OPTION
5352
#include "sql/sql_list.h" // SQL_I_List
5453
#include "sql/sql_plugin_ref.h" // plugin_ref
@@ -2225,12 +2224,11 @@ struct KEY_PAIR
22252224
as early as during check_if_supported_inplace_alter().
22262225
22272226
The SQL layer is responsible for destroying the object.
2228-
The class extends Sql_alloc so the memory will be mem root allocated.
22292227
22302228
@see Alter_inplace_info
22312229
*/
22322230

2233-
class inplace_alter_handler_ctx : public Sql_alloc
2231+
class inplace_alter_handler_ctx
22342232
{
22352233
public:
22362234
inplace_alter_handler_ctx() {}
@@ -3006,7 +3004,7 @@ class Handler_share
30063004
Wrapper for struct ft_hints.
30073005
*/
30083006

3009-
class Ft_hints: public Sql_alloc
3007+
class Ft_hints
30103008
{
30113009
private:
30123010
struct ft_hints hints;
@@ -3497,7 +3495,7 @@ class Ft_hints: public Sql_alloc
34973495
get_partition_handler()
34983496
*/
34993497

3500-
class handler :public Sql_alloc
3498+
class handler
35013499
{
35023500
friend class Partition_handler;
35033501
public:

sql/histograms/histogram.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "my_base.h" // ha_rows
4646
#include "sql/histograms/value_map_type.h"
4747
#include "sql/memroot_allocator.h" // Memroot_allocator
48-
#include "sql/sql_alloc.h" // Sql_alloc
4948
#include "sql/stateless_allocator.h" // Stateless_allocator
5049

5150
class Item;
@@ -131,7 +130,7 @@ enum class enum_operator
131130
/**
132131
Histogram base class.
133132
*/
134-
class Histogram : public Sql_alloc
133+
class Histogram
135134
{
136135
public:
137136
/// All supported histogram types in MySQL.

sql/item.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "sql/mem_root_array.h"
4646
#include "sql/my_decimal.h" // my_decimal
4747
#include "sql/parse_tree_node_base.h" // Parse_tree_node
48-
#include "sql/sql_alloc.h"
4948
#include "sql/sql_array.h" // Bounds_checked_array
5049
#include "sql/sql_const.h"
5150
#include "sql/table.h"
@@ -414,7 +413,7 @@ class Item_name_string: public Name_string
414413
structure before and after INSERT/CREATE and its SELECT to make correct
415414
field name resolution.
416415
*/
417-
struct Name_resolution_context: Sql_alloc
416+
struct Name_resolution_context
418417
{
419418
/*
420419
The name resolution context to search in when an Item cannot be
@@ -5378,7 +5377,7 @@ class Item_cache;
53785377
It caches a value, which is representative of the group, and can compare it
53795378
to another row, and update its value when entering a new group.
53805379
*/
5381-
class Cached_item :public Sql_alloc
5380+
class Cached_item
53825381
{
53835382
protected:
53845383
Item *item; ///< The item whose value to cache.

0 commit comments

Comments
 (0)