Skip to content

Commit f55dc7f

Browse files
committed
Change C_STRING_WITH_LEN to STRING_WITH_LEN
This preserves const str for constant strings Other things - A few variables where changed from LEX_STRING to LEX_CSTRING - Incident_log_event::Incident_log_event and record_incident where changed to take LEX_CSTRING* as an argument instead of LEX_STRING
1 parent 18e22cb commit f55dc7f

38 files changed

+764
-779
lines changed

sql/event_data_objects.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,8 +1266,8 @@ Event_job_data::construct_sp_sql(THD *thd, String *sp_sql)
12661266
sp_sql->length(0);
12671267

12681268

1269-
sp_sql->append(C_STRING_WITH_LEN("CREATE "));
1270-
sp_sql->append(C_STRING_WITH_LEN("PROCEDURE "));
1269+
sp_sql->append(STRING_WITH_LEN("CREATE "));
1270+
sp_sql->append(STRING_WITH_LEN("PROCEDURE "));
12711271
/*
12721272
Let's use the same name as the event name to perhaps produce a
12731273
better error message in case it is a part of some parse error.
@@ -1282,7 +1282,7 @@ Event_job_data::construct_sp_sql(THD *thd, String *sp_sql)
12821282
let's execute the procedure with the invoker rights to save on
12831283
resets of security contexts.
12841284
*/
1285-
sp_sql->append(C_STRING_WITH_LEN("() SQL SECURITY INVOKER "));
1285+
sp_sql->append(STRING_WITH_LEN("() SQL SECURITY INVOKER "));
12861286

12871287
sp_sql->append(&body);
12881288

@@ -1310,7 +1310,7 @@ Event_job_data::construct_drop_event_sql(THD *thd, String *sp_sql)
13101310
sp_sql->set(buffer.str, buffer.length, system_charset_info);
13111311
sp_sql->length(0);
13121312

1313-
sp_sql->append(C_STRING_WITH_LEN("DROP EVENT "));
1313+
sp_sql->append(STRING_WITH_LEN("DROP EVENT "));
13141314
append_identifier(thd, sp_sql, &dbname);
13151315
sp_sql->append('.');
13161316
append_identifier(thd, sp_sql, &name);

sql/event_db_repository.cc

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -41,82 +41,82 @@ static
4141
const TABLE_FIELD_TYPE event_table_fields[ET_FIELD_COUNT] =
4242
{
4343
{
44-
{ C_STRING_WITH_LEN("db") },
45-
{ C_STRING_WITH_LEN("char(64)") },
46-
{ C_STRING_WITH_LEN("utf8") }
44+
{ STRING_WITH_LEN("db") },
45+
{ STRING_WITH_LEN("char(64)") },
46+
{ STRING_WITH_LEN("utf8") }
4747
},
4848
{
49-
{ C_STRING_WITH_LEN("name") },
50-
{ C_STRING_WITH_LEN("char(64)") },
51-
{ C_STRING_WITH_LEN("utf8") }
49+
{ STRING_WITH_LEN("name") },
50+
{ STRING_WITH_LEN("char(64)") },
51+
{ STRING_WITH_LEN("utf8") }
5252
},
5353
{
54-
{ C_STRING_WITH_LEN("body") },
55-
{ C_STRING_WITH_LEN("longblob") },
54+
{ STRING_WITH_LEN("body") },
55+
{ STRING_WITH_LEN("longblob") },
5656
{NULL, 0}
5757
},
5858
{
59-
{ C_STRING_WITH_LEN("definer") },
60-
{ C_STRING_WITH_LEN("char(") },
61-
{ C_STRING_WITH_LEN("utf8") }
59+
{ STRING_WITH_LEN("definer") },
60+
{ STRING_WITH_LEN("char(") },
61+
{ STRING_WITH_LEN("utf8") }
6262
},
6363
{
64-
{ C_STRING_WITH_LEN("execute_at") },
65-
{ C_STRING_WITH_LEN("datetime") },
64+
{ STRING_WITH_LEN("execute_at") },
65+
{ STRING_WITH_LEN("datetime") },
6666
{NULL, 0}
6767
},
6868
{
69-
{ C_STRING_WITH_LEN("interval_value") },
70-
{ C_STRING_WITH_LEN("int(11)") },
69+
{ STRING_WITH_LEN("interval_value") },
70+
{ STRING_WITH_LEN("int(11)") },
7171
{NULL, 0}
7272
},
7373
{
74-
{ C_STRING_WITH_LEN("interval_field") },
75-
{ C_STRING_WITH_LEN("enum('YEAR','QUARTER','MONTH','DAY',"
74+
{ STRING_WITH_LEN("interval_field") },
75+
{ STRING_WITH_LEN("enum('YEAR','QUARTER','MONTH','DAY',"
7676
"'HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR',"
7777
"'DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND',"
7878
"'DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND',"
7979
"'SECOND_MICROSECOND')") },
8080
{NULL, 0}
8181
},
8282
{
83-
{ C_STRING_WITH_LEN("created") },
84-
{ C_STRING_WITH_LEN("timestamp") },
83+
{ STRING_WITH_LEN("created") },
84+
{ STRING_WITH_LEN("timestamp") },
8585
{NULL, 0}
8686
},
8787
{
88-
{ C_STRING_WITH_LEN("modified") },
89-
{ C_STRING_WITH_LEN("timestamp") },
88+
{ STRING_WITH_LEN("modified") },
89+
{ STRING_WITH_LEN("timestamp") },
9090
{NULL, 0}
9191
},
9292
{
93-
{ C_STRING_WITH_LEN("last_executed") },
94-
{ C_STRING_WITH_LEN("datetime") },
93+
{ STRING_WITH_LEN("last_executed") },
94+
{ STRING_WITH_LEN("datetime") },
9595
{NULL, 0}
9696
},
9797
{
98-
{ C_STRING_WITH_LEN("starts") },
99-
{ C_STRING_WITH_LEN("datetime") },
98+
{ STRING_WITH_LEN("starts") },
99+
{ STRING_WITH_LEN("datetime") },
100100
{NULL, 0}
101101
},
102102
{
103-
{ C_STRING_WITH_LEN("ends") },
104-
{ C_STRING_WITH_LEN("datetime") },
103+
{ STRING_WITH_LEN("ends") },
104+
{ STRING_WITH_LEN("datetime") },
105105
{NULL, 0}
106106
},
107107
{
108-
{ C_STRING_WITH_LEN("status") },
109-
{ C_STRING_WITH_LEN("enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')") },
108+
{ STRING_WITH_LEN("status") },
109+
{ STRING_WITH_LEN("enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')") },
110110
{NULL, 0}
111111
},
112112
{
113-
{ C_STRING_WITH_LEN("on_completion") },
114-
{ C_STRING_WITH_LEN("enum('DROP','PRESERVE')") },
113+
{ STRING_WITH_LEN("on_completion") },
114+
{ STRING_WITH_LEN("enum('DROP','PRESERVE')") },
115115
{NULL, 0}
116116
},
117117
{
118-
{ C_STRING_WITH_LEN("sql_mode") },
119-
{ C_STRING_WITH_LEN("set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES',"
118+
{ STRING_WITH_LEN("sql_mode") },
119+
{ STRING_WITH_LEN("set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES',"
120120
"'IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY',"
121121
"'NO_UNSIGNED_SUBTRACTION',"
122122
"'NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB',"
@@ -128,38 +128,38 @@ const TABLE_FIELD_TYPE event_table_fields[ET_FIELD_COUNT] =
128128
{NULL, 0}
129129
},
130130
{
131-
{ C_STRING_WITH_LEN("comment") },
132-
{ C_STRING_WITH_LEN("char(64)") },
133-
{ C_STRING_WITH_LEN("utf8") }
131+
{ STRING_WITH_LEN("comment") },
132+
{ STRING_WITH_LEN("char(64)") },
133+
{ STRING_WITH_LEN("utf8") }
134134
},
135135
{
136-
{ C_STRING_WITH_LEN("originator") },
137-
{ C_STRING_WITH_LEN("int(10)") },
136+
{ STRING_WITH_LEN("originator") },
137+
{ STRING_WITH_LEN("int(10)") },
138138
{NULL, 0}
139139
},
140140
{
141-
{ C_STRING_WITH_LEN("time_zone") },
142-
{ C_STRING_WITH_LEN("char(64)") },
143-
{ C_STRING_WITH_LEN("latin1") }
141+
{ STRING_WITH_LEN("time_zone") },
142+
{ STRING_WITH_LEN("char(64)") },
143+
{ STRING_WITH_LEN("latin1") }
144144
},
145145
{
146-
{ C_STRING_WITH_LEN("character_set_client") },
147-
{ C_STRING_WITH_LEN("char(32)") },
148-
{ C_STRING_WITH_LEN("utf8") }
146+
{ STRING_WITH_LEN("character_set_client") },
147+
{ STRING_WITH_LEN("char(32)") },
148+
{ STRING_WITH_LEN("utf8") }
149149
},
150150
{
151-
{ C_STRING_WITH_LEN("collation_connection") },
152-
{ C_STRING_WITH_LEN("char(32)") },
153-
{ C_STRING_WITH_LEN("utf8") }
151+
{ STRING_WITH_LEN("collation_connection") },
152+
{ STRING_WITH_LEN("char(32)") },
153+
{ STRING_WITH_LEN("utf8") }
154154
},
155155
{
156-
{ C_STRING_WITH_LEN("db_collation") },
157-
{ C_STRING_WITH_LEN("char(32)") },
158-
{ C_STRING_WITH_LEN("utf8") }
156+
{ STRING_WITH_LEN("db_collation") },
157+
{ STRING_WITH_LEN("char(32)") },
158+
{ STRING_WITH_LEN("utf8") }
159159
},
160160
{
161-
{ C_STRING_WITH_LEN("body_utf8") },
162-
{ C_STRING_WITH_LEN("longblob") },
161+
{ STRING_WITH_LEN("body_utf8") },
162+
{ STRING_WITH_LEN("longblob") },
163163
{ NULL, 0 }
164164
}
165165
};

sql/event_scheduler.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ Event_db_repository *Event_worker_thread::db_repository;
4949

5050

5151
static
52-
const LEX_STRING scheduler_states_names[] =
52+
const LEX_CSTRING scheduler_states_names[] =
5353
{
54-
{ C_STRING_WITH_LEN("INITIALIZED") },
55-
{ C_STRING_WITH_LEN("RUNNING") },
56-
{ C_STRING_WITH_LEN("STOPPING") }
54+
{ STRING_WITH_LEN("INITIALIZED") },
55+
{ STRING_WITH_LEN("RUNNING") },
56+
{ STRING_WITH_LEN("STOPPING") }
5757
};
5858

5959
struct scheduler_param {

sql/item.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4565,13 +4565,13 @@ const String *Item_param::value_query_val_str(THD *thd, String *str) const
45654565
/* Create date string inplace */
45664566
switch (value.time.time_type) {
45674567
case MYSQL_TIMESTAMP_DATE:
4568-
str->append(C_STRING_WITH_LEN("DATE"));
4568+
str->append(STRING_WITH_LEN("DATE"));
45694569
break;
45704570
case MYSQL_TIMESTAMP_TIME:
4571-
str->append(C_STRING_WITH_LEN("TIME"));
4571+
str->append(STRING_WITH_LEN("TIME"));
45724572
break;
45734573
case MYSQL_TIMESTAMP_DATETIME:
4574-
str->append(C_STRING_WITH_LEN("TIMESTAMP"));
4574+
str->append(STRING_WITH_LEN("TIMESTAMP"));
45754575
break;
45764576
case MYSQL_TIMESTAMP_ERROR:
45774577
case MYSQL_TIMESTAMP_NONE:

0 commit comments

Comments
 (0)