Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e8fb2466
Commit
e8fb2466
authored
Aug 16, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: use null_lex_str where appropriate
parent
6e05aabb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
27 deletions
+14
-27
sql/sp_head.cc
sql/sp_head.cc
+1
-3
sql/sql_lex.cc
sql/sql_lex.cc
+1
-2
sql/sql_lex.h
sql/sql_lex.h
+4
-8
sql/sql_parse.cc
sql/sql_parse.cc
+4
-7
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-7
No files found.
sql/sp_head.cc
View file @
e8fb2466
...
@@ -582,8 +582,6 @@ sp_head::sp_head()
...
@@ -582,8 +582,6 @@ sp_head::sp_head()
m_next_cached_sp
(
0
),
m_next_cached_sp
(
0
),
m_cont_level
(
0
)
m_cont_level
(
0
)
{
{
const
LEX_STRING
str_reset
=
{
NULL
,
0
};
m_first_instance
=
this
;
m_first_instance
=
this
;
m_first_free_instance
=
this
;
m_first_free_instance
=
this
;
m_last_cached_sp
=
this
;
m_last_cached_sp
=
this
;
...
@@ -594,7 +592,7 @@ sp_head::sp_head()
...
@@ -594,7 +592,7 @@ sp_head::sp_head()
be rewritten soon. Remove the else part and replace 'if' with
be rewritten soon. Remove the else part and replace 'if' with
an assert when this is done.
an assert when this is done.
*/
*/
m_db
=
m_name
=
m_qname
=
str_reset
;
m_db
=
m_name
=
m_qname
=
null_lex_str
;
DBUG_ENTER
(
"sp_head::sp_head"
);
DBUG_ENTER
(
"sp_head::sp_head"
);
...
...
sql/sql_lex.cc
View file @
e8fb2466
...
@@ -515,8 +515,7 @@ void lex_start(THD *thd)
...
@@ -515,8 +515,7 @@ void lex_start(THD *thd)
lex
->
check_exists
=
FALSE
;
lex
->
check_exists
=
FALSE
;
lex
->
verbose
=
0
;
lex
->
verbose
=
0
;
lex
->
name
.
str
=
0
;
lex
->
name
=
null_lex_str
;
lex
->
name
.
length
=
0
;
lex
->
event_parse_data
=
NULL
;
lex
->
event_parse_data
=
NULL
;
lex
->
profile_options
=
PROFILE_NONE
;
lex
->
profile_options
=
PROFILE_NONE
;
lex
->
nest_level
=
0
;
lex
->
nest_level
=
0
;
...
...
sql/sql_lex.h
View file @
e8fb2466
...
@@ -135,6 +135,9 @@ struct sys_var_with_base
...
@@ -135,6 +135,9 @@ struct sys_var_with_base
#ifdef MYSQL_SERVER
#ifdef MYSQL_SERVER
extern
const
LEX_STRING
null_lex_str
;
extern
const
LEX_STRING
empty_lex_str
;
enum
enum_sp_suid_behaviour
enum
enum_sp_suid_behaviour
{
{
SP_IS_DEFAULT_SUID
=
0
,
SP_IS_DEFAULT_SUID
=
0
,
...
@@ -242,8 +245,7 @@ struct LEX_MASTER_INFO
...
@@ -242,8 +245,7 @@ struct LEX_MASTER_INFO
heartbeat_period
=
0
;
heartbeat_period
=
0
;
ssl
=
ssl_verify_server_cert
=
heartbeat_opt
=
ssl
=
ssl_verify_server_cert
=
heartbeat_opt
=
repl_ignore_server_ids_opt
=
LEX_MI_UNCHANGED
;
repl_ignore_server_ids_opt
=
LEX_MI_UNCHANGED
;
gtid_pos_str
.
length
=
0
;
gtid_pos_str
=
null_lex_str
;
gtid_pos_str
.
str
=
NULL
;
use_gtid_opt
=
LEX_GTID_UNCHANGED
;
use_gtid_opt
=
LEX_GTID_UNCHANGED
;
}
}
};
};
...
@@ -1021,9 +1023,6 @@ struct st_sp_chistics
...
@@ -1021,9 +1023,6 @@ struct st_sp_chistics
enum
enum_sp_data_access
daccess
;
enum
enum_sp_data_access
daccess
;
};
};
extern
const
LEX_STRING
null_lex_str
;
extern
const
LEX_STRING
empty_lex_str
;
struct
st_trg_chistics
struct
st_trg_chistics
{
{
enum
trg_action_time_type
action_time
;
enum
trg_action_time_type
action_time
;
...
@@ -1035,9 +1034,6 @@ extern sys_var *trg_new_row_fake_var;
...
@@ -1035,9 +1034,6 @@ extern sys_var *trg_new_row_fake_var;
enum
xa_option_words
{
XA_NONE
,
XA_JOIN
,
XA_RESUME
,
XA_ONE_PHASE
,
enum
xa_option_words
{
XA_NONE
,
XA_JOIN
,
XA_RESUME
,
XA_ONE_PHASE
,
XA_SUSPEND
,
XA_FOR_MIGRATE
};
XA_SUSPEND
,
XA_FOR_MIGRATE
};
extern
const
LEX_STRING
null_lex_str
;
extern
const
LEX_STRING
empty_lex_str
;
class
Sroutine_hash_entry
;
class
Sroutine_hash_entry
;
/*
/*
...
...
sql/sql_parse.cc
View file @
e8fb2466
...
@@ -1748,8 +1748,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
...
@@ -1748,8 +1748,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
else
else
#endif
#endif
{
{
thd
->
lex
->
relay_log_connection_name
.
str
=
(
char
*
)
""
;
thd
->
lex
->
relay_log_connection_name
=
empty_lex_str
;
thd
->
lex
->
relay_log_connection_name
.
length
=
0
;
if
(
reload_acl_and_cache
(
thd
,
options
,
(
TABLE_LIST
*
)
0
,
&
not_used
))
if
(
reload_acl_and_cache
(
thd
,
options
,
(
TABLE_LIST
*
)
0
,
&
not_used
))
break
;
break
;
}
}
...
@@ -6721,7 +6720,7 @@ void create_select_for_variable(const char *var_name)
...
@@ -6721,7 +6720,7 @@ void create_select_for_variable(const char *var_name)
{
{
THD
*
thd
;
THD
*
thd
;
LEX
*
lex
;
LEX
*
lex
;
LEX_STRING
tmp
,
null_lex_string
;
LEX_STRING
tmp
;
Item
*
var
;
Item
*
var
;
char
buff
[
MAX_SYS_VAR_LENGTH
*
2
+
4
+
8
],
*
end
;
char
buff
[
MAX_SYS_VAR_LENGTH
*
2
+
4
+
8
],
*
end
;
DBUG_ENTER
(
"create_select_for_variable"
);
DBUG_ENTER
(
"create_select_for_variable"
);
...
@@ -6732,12 +6731,11 @@ void create_select_for_variable(const char *var_name)
...
@@ -6732,12 +6731,11 @@ void create_select_for_variable(const char *var_name)
lex
->
sql_command
=
SQLCOM_SELECT
;
lex
->
sql_command
=
SQLCOM_SELECT
;
tmp
.
str
=
(
char
*
)
var_name
;
tmp
.
str
=
(
char
*
)
var_name
;
tmp
.
length
=
strlen
(
var_name
);
tmp
.
length
=
strlen
(
var_name
);
bzero
((
char
*
)
&
null_lex_string
.
str
,
sizeof
(
null_lex_string
));
/*
/*
We set the name of Item to @@session.var_name because that then is used
We set the name of Item to @@session.var_name because that then is used
as the column name in the output.
as the column name in the output.
*/
*/
if
((
var
=
get_system_var
(
thd
,
OPT_SESSION
,
tmp
,
null_lex_str
ing
)))
if
((
var
=
get_system_var
(
thd
,
OPT_SESSION
,
tmp
,
null_lex_str
)))
{
{
end
=
strxmov
(
buff
,
"@@session."
,
var_name
,
NullS
);
end
=
strxmov
(
buff
,
"@@session."
,
var_name
,
NullS
);
var
->
set_name
(
buff
,
end
-
buff
,
system_charset_info
);
var
->
set_name
(
buff
,
end
-
buff
,
system_charset_info
);
...
@@ -8762,8 +8760,7 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
...
@@ -8762,8 +8760,7 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
definer
->
user
=
*
user_name
;
definer
->
user
=
*
user_name
;
definer
->
host
=
*
host_name
;
definer
->
host
=
*
host_name
;
definer
->
password
.
str
=
NULL
;
definer
->
password
=
null_lex_str
;
definer
->
password
.
length
=
0
;
return
definer
;
return
definer
;
}
}
...
...
sql/sql_yacc.yy
View file @
e8fb2466
...
@@ -2374,8 +2374,7 @@ create:
...
@@ -2374,8 +2374,7 @@ create:
lex->query_tables->open_strategy= TABLE_LIST::OPEN_STUB;
lex->query_tables->open_strategy= TABLE_LIST::OPEN_STUB;
lex->create_info.options= ($1 | $2 | $4);
lex->create_info.options= ($1 | $2 | $4);
lex->create_info.default_table_charset= NULL;
lex->create_info.default_table_charset= NULL;
lex->name.str= 0;
lex->name= null_lex_str;
lex->name.length= 0;
lex->create_last_non_select_table= lex->last_table();
lex->create_last_non_select_table= lex->last_table();
}
}
create_body
create_body
...
@@ -7029,8 +7028,7 @@ string_list:
...
@@ -7029,8 +7028,7 @@ string_list:
alter:
alter:
ALTER
ALTER
{
{
Lex->name.str= 0;
Lex->name= null_lex_str;
Lex->name.length= 0;
Lex->sql_command= SQLCOM_ALTER_TABLE;
Lex->sql_command= SQLCOM_ALTER_TABLE;
Lex->duplicates= DUP_ERROR;
Lex->duplicates= DUP_ERROR;
Lex->col_list.empty();
Lex->col_list.empty();
...
@@ -7247,7 +7245,7 @@ opt_ev_sql_stmt:
...
@@ -7247,7 +7245,7 @@ opt_ev_sql_stmt:
;
;
ident_or_empty:
ident_or_empty:
/* empty */ { $$
.str= 0; $$.length= 0
; }
/* empty */ { $$
= null_lex_str
; }
| ident { $$= $1; }
| ident { $$= $1; }
;
;
...
@@ -12892,8 +12890,7 @@ flush_option:
...
@@ -12892,8 +12890,7 @@ flush_option:
| LOGS_SYM
| LOGS_SYM
{
{
Lex->type|= REFRESH_LOG;
Lex->type|= REFRESH_LOG;
Lex->relay_log_connection_name.str= (char*) "";
Lex->relay_log_connection_name= empty_lex_str;
Lex->relay_log_connection_name.length= 0;
}
}
| STATUS_SYM
| STATUS_SYM
{ Lex->type|= REFRESH_STATUS; }
{ Lex->type|= REFRESH_STATUS; }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment