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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f0cf48a0
Commit
f0cf48a0
authored
Mar 08, 2010
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small code cleanup - "good ifdef is no ifdef"
parent
81424b5b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
24 deletions
+15
-24
sql/handler.cc
sql/handler.cc
+3
-8
sql/set_var.cc
sql/set_var.cc
+3
-3
sql/sql_plugin.cc
sql/sql_plugin.cc
+2
-10
sql/sql_plugin.h
sql/sql_plugin.h
+5
-1
sql/sql_select.cc
sql/sql_select.cc
+1
-1
sql/table.cc
sql/table.cc
+1
-1
No files found.
sql/handler.cc
View file @
f0cf48a0
...
...
@@ -82,7 +82,7 @@ static plugin_ref ha_default_plugin(THD *thd)
{
if
(
thd
->
variables
.
table_plugin
)
return
thd
->
variables
.
table_plugin
;
return
my_plugin_lock
(
thd
,
&
global_system_variables
.
table_plugin
);
return
my_plugin_lock
(
thd
,
global_system_variables
.
table_plugin
);
}
...
...
@@ -163,13 +163,8 @@ plugin_ref ha_lock_engine(THD *thd, handlerton *hton)
{
if
(
hton
)
{
st_plugin_int
**
plugin
=
hton2plugin
+
hton
->
slot
;
#ifdef DBUG_OFF
return
my_plugin_lock
(
thd
,
plugin
);
#else
return
my_plugin_lock
(
thd
,
&
plugin
);
#endif
st_plugin_int
*
plugin
=
hton2plugin
[
hton
->
slot
];
return
my_plugin_lock
(
thd
,
plugin_int_to_ref
(
plugin
));
}
return
NULL
;
}
...
...
sql/set_var.cc
View file @
f0cf48a0
...
...
@@ -3845,7 +3845,7 @@ uchar *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
LEX_STRING
*
engine_name
;
plugin_ref
plugin
=
thd
->
variables
.
*
offset
;
if
(
type
==
OPT_GLOBAL
)
plugin
=
my_plugin_lock
(
thd
,
&
(
global_system_variables
.
*
offset
)
);
plugin
=
my_plugin_lock
(
thd
,
global_system_variables
.
*
offset
);
hton
=
plugin_data
(
plugin
,
handlerton
*
);
engine_name
=
hton_name
(
hton
);
result
=
(
uchar
*
)
thd
->
strmake
(
engine_name
->
str
,
engine_name
->
length
);
...
...
@@ -3866,7 +3866,7 @@ void sys_var_thd_storage_engine::set_default(THD *thd, enum_var_type type)
else
{
value
=
&
(
thd
->
variables
.
*
offset
);
new_value
=
my_plugin_lock
(
NULL
,
&
(
global_system_variables
.
*
offset
)
);
new_value
=
my_plugin_lock
(
NULL
,
global_system_variables
.
*
offset
);
}
DBUG_ASSERT
(
new_value
);
old_value
=
*
value
;
...
...
@@ -3883,7 +3883,7 @@ bool sys_var_thd_storage_engine::update(THD *thd, set_var *var)
old_value
=
*
value
;
if
(
old_value
!=
var
->
save_result
.
plugin
)
{
*
value
=
my_plugin_lock
(
NULL
,
&
var
->
save_result
.
plugin
);
*
value
=
my_plugin_lock
(
NULL
,
var
->
save_result
.
plugin
);
plugin_unlock
(
NULL
,
old_value
);
}
return
0
;
...
...
sql/sql_plugin.cc
View file @
f0cf48a0
...
...
@@ -19,14 +19,6 @@
#define REPORT_TO_LOG 1
#define REPORT_TO_USER 2
#ifdef DBUG_OFF
#define plugin_ref_to_int(A) A
#define plugin_int_to_ref(A) A
#else
#define plugin_ref_to_int(A) (A ? A[0] : NULL)
#define plugin_int_to_ref(A) &(A)
#endif
extern
struct
st_mysql_plugin
*
mysqld_builtins
[];
/**
...
...
@@ -658,13 +650,13 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc CALLER_INFO_PROTO)
}
plugin_ref
plugin_lock
(
THD
*
thd
,
plugin_ref
*
ptr
CALLER_INFO_PROTO
)
plugin_ref
plugin_lock
(
THD
*
thd
,
plugin_ref
ptr
CALLER_INFO_PROTO
)
{
LEX
*
lex
=
thd
?
thd
->
lex
:
0
;
plugin_ref
rc
;
DBUG_ENTER
(
"plugin_lock"
);
pthread_mutex_lock
(
&
LOCK_plugin
);
rc
=
my_intern_plugin_lock_ci
(
lex
,
*
ptr
);
rc
=
my_intern_plugin_lock_ci
(
lex
,
ptr
);
pthread_mutex_unlock
(
&
LOCK_plugin
);
DBUG_RETURN
(
rc
);
}
...
...
sql/sql_plugin.h
View file @
f0cf48a0
...
...
@@ -89,6 +89,8 @@ struct st_plugin_int
*/
#ifdef DBUG_OFF
typedef
struct
st_plugin_int
*
plugin_ref
;
#define plugin_ref_to_int(A) A
#define plugin_int_to_ref(A) A
#define plugin_decl(pi) ((pi)->plugin)
#define plugin_dlib(pi) ((pi)->plugin_dl)
#define plugin_data(pi,cast) ((cast)((pi)->data))
...
...
@@ -97,6 +99,8 @@ typedef struct st_plugin_int *plugin_ref;
#define plugin_equals(p1,p2) ((p1) == (p2))
#else
typedef
struct
st_plugin_int
**
plugin_ref
;
#define plugin_ref_to_int(A) (A ? A[0] : NULL)
#define plugin_int_to_ref(A) &(A)
#define plugin_decl(pi) ((pi)[0]->plugin)
#define plugin_dlib(pi) ((pi)[0]->plugin_dl)
#define plugin_data(pi,cast) ((cast)((pi)[0]->data))
...
...
@@ -120,7 +124,7 @@ extern bool plugin_is_ready(const LEX_STRING *name, int type);
#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C ORIG_CALLER_INFO)
#define my_plugin_lock(A,B) plugin_lock(A,B CALLER_INFO)
#define my_plugin_lock_ci(A,B) plugin_lock(A,B ORIG_CALLER_INFO)
extern
plugin_ref
plugin_lock
(
THD
*
thd
,
plugin_ref
*
ptr
CALLER_INFO_PROTO
);
extern
plugin_ref
plugin_lock
(
THD
*
thd
,
plugin_ref
ptr
CALLER_INFO_PROTO
);
extern
plugin_ref
plugin_lock_by_name
(
THD
*
thd
,
const
LEX_STRING
*
name
,
int
type
CALLER_INFO_PROTO
);
extern
void
plugin_unlock
(
THD
*
thd
,
plugin_ref
plugin
);
...
...
sql/sql_select.cc
View file @
f0cf48a0
...
...
@@ -11014,7 +11014,7 @@ create_internal_tmp_table_from_heap2(THD *thd, TABLE *table,
delete
table
->
file
;
table
->
file
=
0
;
plugin_unlock
(
0
,
table
->
s
->
db_plugin
);
share
.
db_plugin
=
my_plugin_lock
(
0
,
&
share
.
db_plugin
);
share
.
db_plugin
=
my_plugin_lock
(
0
,
share
.
db_plugin
);
new_table
.
s
=
table
->
s
;
// Keep old share
*
table
=
new_table
;
*
table
->
s
=
share
;
...
...
sql/table.cc
View file @
f0cf48a0
...
...
@@ -899,7 +899,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
replacing it with a globally locked version of tmp_plugin
*/
plugin_unlock
(
NULL
,
share
->
db_plugin
);
share
->
db_plugin
=
my_plugin_lock
(
NULL
,
&
tmp_plugin
);
share
->
db_plugin
=
my_plugin_lock
(
NULL
,
tmp_plugin
);
DBUG_PRINT
(
"info"
,
(
"setting dbtype to '%.*s' (%d)"
,
str_db_type_length
,
next_chunk
+
2
,
ha_legacy_type
(
share
->
db_type
())));
...
...
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