Skip to content

Commit 45a5c76

Browse files
author
Alexander Barkov
committed
Fixing naming convension:
SimpleCString -> Simple_cstring NameString -> Name_string ItemNameString -> Item_name_string
1 parent d9797bd commit 45a5c76

File tree

10 files changed

+82
-82
lines changed

10 files changed

+82
-82
lines changed

sql/item.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -959,10 +959,10 @@ bool Item::check_cols(uint c)
959959
}
960960

961961

962-
const NameString null_name_string(NULL, 0);
962+
const Name_string null_name_string(NULL, 0);
963963

964964

965-
void NameString::copy(const char *str, size_t length, const CHARSET_INFO *cs)
965+
void Name_string::copy(const char *str, size_t length, const CHARSET_INFO *cs)
966966
{
967967
if (!length)
968968
{
@@ -998,9 +998,9 @@ void NameString::copy(const char *str, size_t length, const CHARSET_INFO *cs)
998998
}
999999

10001000

1001-
void ItemNameString::copy(const char *str_arg, size_t length_arg,
1002-
const CHARSET_INFO *cs_arg,
1003-
bool is_autogenerated_arg)
1001+
void Item_name_string::copy(const char *str_arg, size_t length_arg,
1002+
const CHARSET_INFO *cs_arg,
1003+
bool is_autogenerated_arg)
10041004
{
10051005
m_is_autogenerated= is_autogenerated_arg;
10061006
copy(str_arg, length_arg, cs_arg);
@@ -1509,7 +1509,7 @@ bool Item::is_blob_field() const
15091509
Item_sp_variable methods
15101510
*****************************************************************************/
15111511

1512-
Item_sp_variable::Item_sp_variable(const NameString sp_var_name)
1512+
Item_sp_variable::Item_sp_variable(const Name_string sp_var_name)
15131513
:m_thd(0), m_name(sp_var_name)
15141514
#ifndef DBUG_OFF
15151515
, m_sp(0)
@@ -1629,7 +1629,7 @@ bool Item_sp_variable::is_null()
16291629
Item_splocal methods
16301630
*****************************************************************************/
16311631

1632-
Item_splocal::Item_splocal(const NameString sp_var_name,
1632+
Item_splocal::Item_splocal(const Name_string sp_var_name,
16331633
uint sp_var_idx,
16341634
enum_field_types sp_var_type,
16351635
uint pos_in_q, uint len_in_q)
@@ -1693,7 +1693,7 @@ bool Item_splocal::set_value(THD *thd, sp_rcontext *ctx, Item **it)
16931693
*****************************************************************************/
16941694

16951695
Item_case_expr::Item_case_expr(uint case_expr_id)
1696-
:Item_sp_variable(NameString(C_STRING_WITH_LEN("case_expr"))),
1696+
:Item_sp_variable(Name_string(C_STRING_WITH_LEN("case_expr"))),
16971697
m_case_expr_id(case_expr_id)
16981698
{
16991699
}
@@ -3052,7 +3052,7 @@ Item_decimal::Item_decimal(double val, int precision, int scale)
30523052
}
30533053

30543054

3055-
Item_decimal::Item_decimal(const NameString &name_arg,
3055+
Item_decimal::Item_decimal(const Name_string &name_arg,
30563056
const my_decimal *val_arg,
30573057
uint decimal_par, uint length)
30583058
{

sql/item.h

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ class DTCollation {
146146

147147
/**
148148
Storage for name strings.
149-
Enpowers SimpleCString with allocation routines from the sql_strmake family.
149+
Enpowers Simple_cstring with allocation routines from the sql_strmake family.
150150
151151
This class must stay as small as possible as we often
152152
pass it into functions using call-by-value evaluation.
153153
154154
Don't add new members or virual methods into this class!
155155
*/
156-
class NameString: public SimpleCString
156+
class Name_string: public Simple_cstring
157157
{
158158
private:
159159
void set_or_copy(const char *str, size_t length, bool is_null_terminated)
@@ -164,22 +164,22 @@ class NameString: public SimpleCString
164164
copy(str, length);
165165
}
166166
public:
167-
NameString(): SimpleCString() {}
167+
Name_string(): Simple_cstring() {}
168168
/*
169-
Please do NOT add constructor NameString(const char *str) !
169+
Please do NOT add constructor Name_string(const char *str) !
170170
It will involve hidden strlen() call, which can affect
171-
performance negatively. Use NameString(str, len) instead.
171+
performance negatively. Use Name_string(str, len) instead.
172172
*/
173-
NameString(const char *str, size_t length):
174-
SimpleCString(str, length) {}
175-
NameString(const LEX_STRING str): SimpleCString(str) {}
176-
NameString(const char *str, size_t length, bool is_null_terminated):
177-
SimpleCString()
173+
Name_string(const char *str, size_t length):
174+
Simple_cstring(str, length) {}
175+
Name_string(const LEX_STRING str): Simple_cstring(str) {}
176+
Name_string(const char *str, size_t length, bool is_null_terminated):
177+
Simple_cstring()
178178
{
179179
set_or_copy(str, length, is_null_terminated);
180180
}
181-
NameString(const LEX_STRING str, bool is_null_terminated):
182-
SimpleCString()
181+
Name_string(const LEX_STRING str, bool is_null_terminated):
182+
Simple_cstring()
183183
{
184184
set_or_copy(str.str, str.length, is_null_terminated);
185185
}
@@ -206,7 +206,7 @@ class NameString: public SimpleCString
206206
{
207207
copy(lex->str, lex->length);
208208
}
209-
void copy(const NameString str)
209+
void copy(const Name_string str)
210210
{
211211
copy(str.ptr(), str.length());
212212
}
@@ -223,39 +223,39 @@ class NameString: public SimpleCString
223223
return is_set() && str && eq(str);
224224
}
225225
/**
226-
Compare name to another name in NameString, case insensitively.
226+
Compare name to another name in Name_string, case insensitively.
227227
*/
228-
bool eq(const NameString name) const
228+
bool eq(const Name_string name) const
229229
{
230230
return eq(name.ptr());
231231
}
232-
bool eq_safe(const NameString name) const
232+
bool eq_safe(const Name_string name) const
233233
{
234234
return is_set() && name.is_set() && eq(name);
235235
}
236236
};
237237

238238

239-
#define NAME_STRING(x) NameString(C_STRING_WITH_LEN(x))
239+
#define NAME_STRING(x) Name_string(C_STRING_WITH_LEN(x))
240240

241241

242-
extern const NameString null_name_string;
242+
extern const Name_string null_name_string;
243243

244244

245245
/**
246246
Storage for Item names.
247-
Adds "autogenerated" flag and warning functionality to NameString.
247+
Adds "autogenerated" flag and warning functionality to Name_string.
248248
*/
249-
class ItemNameString: public NameString
249+
class Item_name_string: public Name_string
250250
{
251251
private:
252252
bool m_is_autogenerated; /* indicates if name of this Item
253253
was autogenerated or set by user */
254254
public:
255-
ItemNameString(): NameString(), m_is_autogenerated(true)
255+
Item_name_string(): Name_string(), m_is_autogenerated(true)
256256
{ }
257-
ItemNameString(const NameString name)
258-
:NameString(name), m_is_autogenerated(true)
257+
Item_name_string(const Name_string name)
258+
:Name_string(name), m_is_autogenerated(true)
259259
{ }
260260
/**
261261
Set m_is_autogenerated flag to the given value.
@@ -268,7 +268,7 @@ class ItemNameString: public NameString
268268
Return the auto-generated flag.
269269
*/
270270
bool is_autogenerated() const { return m_is_autogenerated; }
271-
using NameString::copy;
271+
using Name_string::copy;
272272
/**
273273
Copy name together with autogenerated flag.
274274
Produce a warning if name was cut.
@@ -680,8 +680,8 @@ class Item
680680
*/
681681
String str_value;
682682

683-
ItemNameString item_name; /* Name from select */
684-
ItemNameString orig_name; /* Original item name (if it was renamed)*/
683+
Item_name_string item_name; /* Name from select */
684+
Item_name_string orig_name; /* Original item name (if it was renamed)*/
685685

686686
/**
687687
Intrusive list pointer for free list. If not null, points to the next
@@ -1713,7 +1713,7 @@ class Item_sp_variable :public Item
17131713
THD *m_thd;
17141714

17151715
public:
1716-
NameString m_name;
1716+
Name_string m_name;
17171717

17181718
public:
17191719
#ifndef DBUG_OFF
@@ -1725,7 +1725,7 @@ class Item_sp_variable :public Item
17251725
#endif
17261726

17271727
public:
1728-
Item_sp_variable(const NameString sp_var_name);
1728+
Item_sp_variable(const Name_string sp_var_name);
17291729

17301730
public:
17311731
bool fix_fields(THD *thd, Item **);
@@ -1809,7 +1809,7 @@ class Item_splocal :public Item_sp_variable,
18091809
*/
18101810
uint len_in_query;
18111811

1812-
Item_splocal(const NameString sp_var_name, uint sp_var_idx,
1812+
Item_splocal(const Name_string sp_var_name, uint sp_var_idx,
18131813
enum_field_types sp_var_type,
18141814
uint pos_in_q= 0, uint len_in_q= 0);
18151815

@@ -2265,7 +2265,7 @@ class Item_null :public Item_basic_constant
22652265
init();
22662266
item_name= NAME_STRING("NULL");
22672267
}
2268-
Item_null(const NameString &name_par)
2268+
Item_null(const Name_string &name_par)
22692269
{
22702270
init();
22712271
item_name= name_par;
@@ -2500,7 +2500,7 @@ class Item_int :public Item_num
25002500
max_length= item_arg->max_length;
25012501
fixed= 1;
25022502
}
2503-
Item_int(const NameString &name_arg, longlong i, uint length) :value(i)
2503+
Item_int(const Name_string &name_arg, longlong i, uint length) :value(i)
25042504
{
25052505
max_length= length;
25062506
item_name= name_arg;
@@ -2563,7 +2563,7 @@ class Item_temporal :public Item_int
25632563
{
25642564
DBUG_ASSERT(is_temporal_type(field_type_arg));
25652565
}
2566-
Item_temporal(enum_field_types field_type_arg, const NameString &name_arg,
2566+
Item_temporal(enum_field_types field_type_arg, const Name_string &name_arg,
25672567
longlong i, uint length): Item_int(i),
25682568
cached_field_type(field_type_arg)
25692569
{
@@ -2599,7 +2599,7 @@ class Item_uint :public Item_int
25992599
Item_uint(const char *str_arg, uint length)
26002600
:Item_int(str_arg, length) { unsigned_flag= 1; }
26012601
Item_uint(ulonglong i) :Item_int((ulonglong) i, 10) {}
2602-
Item_uint(const NameString &name_arg, longlong i, uint length)
2602+
Item_uint(const Name_string &name_arg, longlong i, uint length)
26032603
:Item_int(name_arg, i, length) { unsigned_flag= 1; }
26042604
double val_real()
26052605
{ DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); }
@@ -2621,7 +2621,7 @@ class Item_decimal :public Item_num
26212621
my_decimal decimal_value;
26222622
public:
26232623
Item_decimal(const char *str_arg, uint length, const CHARSET_INFO *charset);
2624-
Item_decimal(const NameString &name_arg,
2624+
Item_decimal(const Name_string &name_arg,
26252625
const my_decimal *val_arg, uint decimal_par, uint length);
26262626
Item_decimal(my_decimal *value_par);
26272627
Item_decimal(longlong val, bool unsig);
@@ -2665,12 +2665,12 @@ class Item_decimal :public Item_num
26652665

26662666
class Item_float :public Item_num
26672667
{
2668-
NameString presentation;
2668+
Name_string presentation;
26692669
public:
26702670
double value;
26712671
// Item_real() :value(0) {}
26722672
Item_float(const char *str_arg, uint length);
2673-
Item_float(const NameString name_arg,
2673+
Item_float(const Name_string name_arg,
26742674
double val_arg, uint decimal_par, uint length)
26752675
:value(val_arg)
26762676
{
@@ -2723,9 +2723,9 @@ class Item_float :public Item_num
27232723

27242724
class Item_static_float_func :public Item_float
27252725
{
2726-
const NameString func_name;
2726+
const Name_string func_name;
27272727
public:
2728-
Item_static_float_func(const NameString &name_arg,
2728+
Item_static_float_func(const Name_string &name_arg,
27292729
double val_arg, uint decimal_par, uint length)
27302730
:Item_float(null_name_string,
27312731
val_arg, decimal_par, length), func_name(name_arg)
@@ -2774,7 +2774,7 @@ class Item_string :public Item_basic_constant
27742774
fixed= 1;
27752775
}
27762776
/* Create from the given name and string. */
2777-
Item_string(const NameString name_par, const char *str, uint length,
2777+
Item_string(const Name_string name_par, const char *str, uint length,
27782778
const CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE,
27792779
uint repertoire= MY_REPERTOIRE_UNICODE30)
27802780
: m_cs_specified(FALSE)
@@ -2826,7 +2826,7 @@ class Item_string :public Item_basic_constant
28262826
bool eq(const Item *item, bool binary_cmp) const;
28272827
Item *clone_item()
28282828
{
2829-
return new Item_string(static_cast<NameString>(item_name), str_value.ptr(),
2829+
return new Item_string(static_cast<Name_string>(item_name), str_value.ptr(),
28302830
str_value.length(), collation.collation);
28312831
}
28322832
Item *safe_charset_converter(const CHARSET_INFO *tocs);
@@ -2892,9 +2892,9 @@ double_from_string_with_check (const CHARSET_INFO *cs,
28922892

28932893
class Item_static_string_func :public Item_string
28942894
{
2895-
const NameString func_name;
2895+
const Name_string func_name;
28962896
public:
2897-
Item_static_string_func(const NameString &name_par,
2897+
Item_static_string_func(const Name_string &name_par,
28982898
const char *str, uint length, const CHARSET_INFO *cs,
28992899
Derivation dv= DERIVATION_COERCIBLE)
29002900
:Item_string(null_name_string, str, length, cs, dv), func_name(name_par)
@@ -2914,7 +2914,7 @@ class Item_static_string_func :public Item_string
29142914
class Item_partition_func_safe_string: public Item_string
29152915
{
29162916
public:
2917-
Item_partition_func_safe_string(const NameString name, uint length,
2917+
Item_partition_func_safe_string(const Name_string name, uint length,
29182918
const CHARSET_INFO *cs= NULL):
29192919
Item_string(name, NullS, 0, cs)
29202920
{
@@ -2928,7 +2928,7 @@ class Item_return_date_time :public Item_partition_func_safe_string
29282928
enum_field_types date_time_field_type;
29292929
public:
29302930
Item_return_date_time(const char *name_arg, enum_field_types field_type_arg)
2931-
:Item_partition_func_safe_string(NameString(name_arg, strlen(name_arg)),
2931+
:Item_partition_func_safe_string(Name_string(name_arg, strlen(name_arg)),
29322932
0, &my_charset_bin),
29332933
date_time_field_type(field_type_arg)
29342934
{ decimals= 0; }
@@ -2940,7 +2940,7 @@ class Item_blob :public Item_partition_func_safe_string
29402940
{
29412941
public:
29422942
Item_blob(const char *name, uint length) :
2943-
Item_partition_func_safe_string(NameString(name, strlen(name)),
2943+
Item_partition_func_safe_string(Name_string(name, strlen(name)),
29442944
length, &my_charset_bin)
29452945
{ }
29462946
enum Type type() const { return TYPE_HOLDER; }
@@ -2959,7 +2959,7 @@ class Item_empty_string :public Item_partition_func_safe_string
29592959
public:
29602960
Item_empty_string(const char *header, uint length,
29612961
const CHARSET_INFO *cs= NULL) :
2962-
Item_partition_func_safe_string(NameString(header, strlen(header)),
2962+
Item_partition_func_safe_string(Name_string(header, strlen(header)),
29632963
0, cs ? cs : &my_charset_utf8_general_ci)
29642964
{
29652965
max_length= length * collation.collation->mbmaxlen;
@@ -2974,7 +2974,7 @@ class Item_return_int :public Item_int
29742974
public:
29752975
Item_return_int(const char *name_arg, uint length,
29762976
enum_field_types field_type_arg, longlong value= 0)
2977-
:Item_int(NameString(name_arg, name_arg ? strlen(name_arg) : 0),
2977+
:Item_int(Name_string(name_arg, name_arg ? strlen(name_arg) : 0),
29782978
value, length), int_field_type(field_type_arg)
29792979
{
29802980
unsigned_flag=1;

sql/item_func.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4546,7 +4546,7 @@ longlong Item_func_sleep::val_int()
45464546

45474547
#define extra_size sizeof(double)
45484548

4549-
static user_var_entry *get_variable(HASH *hash, NameString &name,
4549+
static user_var_entry *get_variable(HASH *hash, Name_string &name,
45504550
bool create_if_not_exists)
45514551
{
45524552
user_var_entry *entry;
@@ -5363,7 +5363,7 @@ longlong Item_func_get_user_var::val_int()
53635363

53645364
static int
53655365
get_var_with_binlog(THD *thd, enum_sql_command sql_command,
5366-
NameString &name, user_var_entry **out_entry)
5366+
Name_string &name, user_var_entry **out_entry)
53675367
{
53685368
BINLOG_USER_VAR_EVENT *user_var_event;
53695369
user_var_entry *var_entry;

0 commit comments

Comments
 (0)