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
4822696e
Commit
4822696e
authored
May 05, 2009
by
Chad MILLER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pull 5.1 treatment of community features into 5.0.
parent
14f923c0
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
88 additions
and
27 deletions
+88
-27
configure.in
configure.in
+30
-6
mysql-test/include/have_community_features.inc
mysql-test/include/have_community_features.inc
+4
-0
mysql-test/include/have_profiling.inc
mysql-test/include/have_profiling.inc
+4
-0
mysql-test/r/have_community_features.require
mysql-test/r/have_community_features.require
+2
-0
mysql-test/r/have_profiling.require
mysql-test/r/have_profiling.require
+2
-0
mysql-test/t/profiling.test
mysql-test/t/profiling.test
+2
-0
sql/mysql_priv.h
sql/mysql_priv.h
+2
-0
sql/mysqld.cc
sql/mysqld.cc
+17
-1
sql/set_var.cc
sql/set_var.cc
+3
-1
sql/sp_head.cc
sql/sp_head.cc
+5
-5
sql/sql_class.cc
sql/sql_class.cc
+2
-2
sql/sql_class.h
sql/sql_class.h
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+7
-7
sql/sql_prepare.cc
sql/sql_prepare.cc
+1
-1
sql/sql_profile.cc
sql/sql_profile.cc
+2
-2
sql/sql_profile.h
sql/sql_profile.h
+1
-1
sql/sql_show.cc
sql/sql_show.cc
+3
-0
No files found.
configure.in
View file @
4822696e
...
...
@@ -661,7 +661,6 @@ then
fi
fi
AC_ARG_WITH
(
server-suffix,
[
--with-server-suffix
Append value to the version string.],
[
MYSQL_SERVER_SUFFIX
=
`
echo
"
$withval
"
|
sed
-e
's/^\(...................................\)..*$/\1/'
`
]
,
...
...
@@ -724,17 +723,42 @@ else
AC_MSG_RESULT
([
no]
)
fi
AC_MSG_CHECKING
(
whether features provided by the user community should be included.
)
AC_ARG_ENABLE
(
community-features,
AC_HELP_STRING
(
[
--enable-community-features
]
,
[
Enable additional features provided by the user community.]
)
,
[
ENABLE_COMMUNITY_FEATURES
=
$enableval
]
,
[
ENABLE_COMMUNITY_FEATURES
=
no
]
)
if
test
"
$ENABLE_COMMUNITY_FEATURES
"
=
"yes"
then
AC_DEFINE
([
COMMUNITY_SERVER],
[
1],
[
Whether features provided by the user community should be included]
)
AC_MSG_RESULT
([
yes
])
else
AC_MSG_RESULT
([
no]
)
fi
# Add query profiler
AC_MSG_CHECKING
(
whether query profiling should be included
)
AC_ARG_ENABLE
(
profiling,
AS_HELP_STRING
([
--
disable-profiling
]
,
[
Build a version without query profiling code
]
)
,
AS_HELP_STRING
([
--
enable-profiling
]
,
[
Add query-profiling code.
]
)
,
[
ENABLED_PROFILING
=
$enableval
]
,
[
ENABLED_PROFILING
=
yes
])
[
ENABLED_PROFILING
=
no
])
if
test
"
$ENABLED_PROFILING
"
=
"yes"
then
AC_DEFINE
([
ENABLED_PROFILING],
[
1],
[
If SHOW PROFILE should be enabled]
)
AC_MSG_RESULT
([
yes
])
if
test
"
$ENABLE_COMMUNITY_FEATURES
"
=
"yes"
;
then
AC_DEFINE
([
ENABLED_PROFILING],
[
1],
[
If SHOW PROFILE should be enabled]
)
AC_MSG_RESULT
([
yes
])
else
ENABLED_PROFILING
=
"no"
AC_MSG_RESULT
([
no, overridden because community-features disabled]
)
AC_MSG_ERROR
([
This is almost certainly wrong. Add
--enable-community-features
or remove
--enable-profiling
.]
)
fi
else
AC_MSG_RESULT
([
no]
)
fi
...
...
mysql-test/include/have_community_features.inc
0 → 100644
View file @
4822696e
--
require
r
/
have_community_features
.
require
--
disable_query_log
show
variables
like
'have_community_features'
;
--
enable_query_log
mysql-test/include/have_profiling.inc
0 → 100644
View file @
4822696e
--
require
r
/
have_profiling
.
require
--
disable_query_log
show
variables
like
'have_profiling'
;
--
enable_query_log
mysql-test/r/have_community_features.require
0 → 100644
View file @
4822696e
Variable_name Value
have_community_features YES
mysql-test/r/have_profiling.require
0 → 100644
View file @
4822696e
Variable_name Value
have_profiling YES
mysql-test/t/profiling.test
View file @
4822696e
--
source
include
/
have_profiling
.
inc
# Verify that the protocol isn't violated if we ask for profiling info
# before profiling has recorded anything.
show
profiles
;
...
...
sql/mysql_priv.h
View file @
4822696e
...
...
@@ -1479,6 +1479,8 @@ extern SHOW_COMP_OPTION have_query_cache;
extern
SHOW_COMP_OPTION
have_geometry
,
have_rtree_keys
;
extern
SHOW_COMP_OPTION
have_crypt
;
extern
SHOW_COMP_OPTION
have_compress
;
extern
SHOW_COMP_OPTION
have_community_features
;
extern
SHOW_COMP_OPTION
have_profiling
;
#ifndef __WIN__
extern
pthread_t
signal_thread
;
...
...
sql/mysqld.cc
View file @
4822696e
...
...
@@ -538,6 +538,8 @@ SHOW_COMP_OPTION have_isam;
SHOW_COMP_OPTION
have_raid
,
have_ssl
,
have_symlink
,
have_query_cache
;
SHOW_COMP_OPTION
have_geometry
,
have_rtree_keys
,
have_dlopen
;
SHOW_COMP_OPTION
have_crypt
,
have_compress
;
SHOW_COMP_OPTION
have_community_features
;
SHOW_COMP_OPTION
have_profiling
;
/* Thread specific variables */
...
...
@@ -5638,7 +5640,7 @@ Disable with --skip-ndbcluster (will save memory).",
"Maximum time in seconds to wait for the port to become free. "
"(Default: no wait)"
,
(
gptr
*
)
&
mysqld_port_timeout
,
(
gptr
*
)
&
mysqld_port_timeout
,
0
,
GET_UINT
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#if
def ENABLED_PROFILING
#if
defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
{
"profiling_history_size"
,
OPT_PROFILING
,
"Limit of query profiling memory"
,
(
gptr
*
)
&
global_system_variables
.
profiling_history_size
,
(
gptr
*
)
&
max_system_variables
.
profiling_history_size
,
...
...
@@ -6685,7 +6687,9 @@ struct show_var_st status_vars[]= {
{
"Threads_created"
,
(
char
*
)
&
thread_created
,
SHOW_LONG_CONST
},
{
"Threads_running"
,
(
char
*
)
&
thread_running
,
SHOW_INT_CONST
},
{
"Uptime"
,
(
char
*
)
0
,
SHOW_STARTTIME
},
#ifdef COMMUNITY_SERVER
{
"Uptime_since_flush_status"
,(
char
*
)
0
,
SHOW_FLUSHTIME
},
#endif
{
NullS
,
NullS
,
SHOW_LONG
}
};
...
...
@@ -6992,6 +6996,16 @@ static void mysql_init_variables(void)
#if !defined(my_pthread_setprio) && !defined(HAVE_PTHREAD_SETSCHEDPARAM)
opt_specialflag
|=
SPECIAL_NO_PRIOR
;
#endif
#ifdef ENABLED_PROFILING
have_profiling
=
SHOW_OPTION_YES
;
#else
have_profiling
=
SHOW_OPTION_NO
;
#endif
#ifdef COMMUNITY_SERVER
have_community_features
=
SHOW_OPTION_YES
;
#else
have_community_features
=
SHOW_OPTION_NO
;
#endif
#if defined(__WIN__) || defined(__NETWARE__)
/* Allow Win32 and NetWare users to move MySQL anywhere */
...
...
@@ -8016,7 +8030,9 @@ void refresh_status(THD *thd)
/* Reset the counters of all key caches (default and named). */
process_key_caches
(
reset_key_cache_counters
);
#ifdef COMMUNITY_SERVER
flush_status_time
=
time
((
time_t
*
)
0
);
#endif
pthread_mutex_unlock
(
&
LOCK_status
);
/*
...
...
sql/set_var.cc
View file @
4822696e
...
...
@@ -564,7 +564,7 @@ static sys_var_thd_bit sys_unique_checks("unique_checks", 0,
set_option_bit
,
OPTION_RELAXED_UNIQUE_CHECKS
,
1
);
#if
def ENABLED_PROFILING
#if
defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
static
sys_var_thd_bit
sys_profiling
(
"profiling"
,
NULL
,
set_option_bit
,
ulonglong
(
OPTION_PROFILING
));
static
sys_var_thd_ulong
sys_profiling_history_size
(
"profiling_history_size"
,
...
...
@@ -899,6 +899,8 @@ struct show_var_st init_vars[]= {
{
"have_bdb"
,
(
char
*
)
&
have_berkeley_db
,
SHOW_HAVE
},
{
"have_blackhole_engine"
,
(
char
*
)
&
have_blackhole_db
,
SHOW_HAVE
},
{
"have_compress"
,
(
char
*
)
&
have_compress
,
SHOW_HAVE
},
{
"have_community_features"
,
(
char
*
)
&
have_community_features
,
SHOW_HAVE
},
{
"have_profiling"
,
(
char
*
)
&
have_profiling
,
SHOW_HAVE
},
{
"have_crypt"
,
(
char
*
)
&
have_crypt
,
SHOW_HAVE
},
{
"have_csv"
,
(
char
*
)
&
have_csv_db
,
SHOW_HAVE
},
{
"have_dynamic_loading"
,
(
char
*
)
&
have_dlopen
,
SHOW_HAVE
},
...
...
sql/sp_head.cc
View file @
4822696e
...
...
@@ -1103,7 +1103,7 @@ sp_head::execute(THD *thd)
*/
thd
->
spcont
->
callers_arena
=
&
backup_arena
;
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
/* Discard the initial part of executing routines. */
thd
->
profiling
.
discard_current_query
();
#endif
...
...
@@ -1112,7 +1112,7 @@ sp_head::execute(THD *thd)
sp_instr
*
i
;
uint
hip
;
// Handler ip
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
/*
Treat each "instr" of a routine as discrete unit that could be profiled.
Profiling only records information for segments of code that set the
...
...
@@ -1125,7 +1125,7 @@ sp_head::execute(THD *thd)
i
=
get_instr
(
ip
);
// Returns NULL when we're done.
if
(
i
==
NULL
)
{
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
thd
->
profiling
.
discard_current_query
();
#endif
break
;
...
...
@@ -1209,7 +1209,7 @@ sp_head::execute(THD *thd)
}
}
while
(
!
err_status
&&
!
thd
->
killed
);
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
thd
->
profiling
.
finish_current_query
();
thd
->
profiling
.
start_new_query
(
"tail end of routine"
);
#endif
...
...
@@ -2633,7 +2633,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
query
=
thd
->
query
;
query_length
=
thd
->
query_length
;
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
/* This s-p instr is profilable and will be captured. */
thd
->
profiling
.
set_query_source
(
m_query
.
str
,
m_query
.
length
);
#endif
...
...
sql/sql_class.cc
View file @
4822696e
...
...
@@ -173,7 +173,7 @@ const char *set_thd_proc_info(THD *thd, const char *info,
{
const
char
*
old_info
=
thd
->
proc_info
;
DBUG_PRINT
(
"proc_info"
,
(
"%s:%d %s"
,
calling_file
,
calling_line
,
info
));
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
thd
->
profiling
.
status_change
(
info
,
calling_function
,
calling_file
,
calling_line
);
#endif
thd
->
proc_info
=
info
;
...
...
@@ -272,7 +272,7 @@ THD::THD()
init
();
/* Initialize sub structures */
init_sql_alloc
(
&
warn_root
,
WARN_ALLOC_BLOCK_SIZE
,
WARN_ALLOC_PREALLOC_SIZE
);
#if
def ENABLED_PROFILING
#if
defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
profiling
.
set_thd
(
this
);
#endif
user_connect
=
(
USER_CONN
*
)
0
;
...
...
sql/sql_class.h
View file @
4822696e
...
...
@@ -1434,7 +1434,7 @@ class THD :public Statement,
List
<
MYSQL_ERROR
>
warn_list
;
uint
warn_count
[(
uint
)
MYSQL_ERROR
::
WARN_LEVEL_END
];
uint
total_warn_count
;
#if
def ENABLED_PROFILING
#if
defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
PROFILING
profiling
;
#endif
...
...
sql/sql_parse.cc
View file @
4822696e
...
...
@@ -1355,7 +1355,7 @@ pthread_handler_t handle_bootstrap(void *arg)
thd
->
db_length
+
1
+
QUERY_CACHE_FLAGS_SIZE
);
thd
->
query
[
length
]
=
'\0'
;
DBUG_PRINT
(
"query"
,(
"%-.4096s"
,
thd
->
query
));
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
thd
->
profiling
.
set_query_source
(
thd
->
query
,
length
);
#endif
...
...
@@ -1594,7 +1594,7 @@ static bool do_command(THD *thd)
net_new_transaction
(
net
);
packet_length
=
my_net_read
(
net
);
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
thd
->
profiling
.
start_new_query
();
#endif
if
(
packet_length
==
packet_error
)
...
...
@@ -1642,7 +1642,7 @@ static bool do_command(THD *thd)
return_value
=
dispatch_command
(
command
,
thd
,
packet
+
1
,
(
uint
)
(
packet_length
));
out:
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
thd
->
profiling
.
finish_current_query
();
#endif
DBUG_RETURN
(
return_value
);
...
...
@@ -1951,7 +1951,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
mysql_log
.
write
(
thd
,
command
,
format
,
thd
->
query_length
,
thd
->
query
);
DBUG_PRINT
(
"query"
,(
"%-.4096s"
,
thd
->
query
));
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
thd
->
profiling
.
set_query_source
(
thd
->
query
,
thd
->
query_length
);
#endif
...
...
@@ -1981,7 +1981,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
length
--
;
}
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
thd
->
profiling
.
finish_current_query
();
thd
->
profiling
.
start_new_query
(
"continuing"
);
thd
->
profiling
.
set_query_source
(
next_packet
,
length
);
...
...
@@ -2485,7 +2485,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
Mark this current profiling record to be discarded. We don't
wish to have SHOW commands show up in profiling.
*/
#if
def ENABLED_PROFILING
#if
defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd
->
profiling
.
discard_current_query
();
#endif
break
;
...
...
@@ -2961,7 +2961,7 @@ mysql_execute_command(THD *thd)
}
case
SQLCOM_SHOW_PROFILES
:
{
#if
def ENABLED_PROFILING
#if
defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd
->
profiling
.
discard_current_query
();
res
=
thd
->
profiling
.
show_profiles
();
if
(
res
)
...
...
sql/sql_prepare.cc
View file @
4822696e
...
...
@@ -2283,7 +2283,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
,
"mysql_stmt_execute"
)))
DBUG_VOID_RETURN
;
#if
def ENABLED_PROFILING
#if
defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd
->
profiling
.
set_query_source
(
stmt
->
query
,
stmt
->
query_length
);
#endif
DBUG_PRINT
(
"exec_query"
,
(
"%s"
,
stmt
->
query
));
...
...
sql/sql_profile.cc
View file @
4822696e
...
...
@@ -47,7 +47,7 @@ const char * const _unknown_func_ = "<unknown>";
int
fill_query_profile_statistics_info
(
THD
*
thd
,
TABLE_LIST
*
tables
,
Item
*
cond
)
{
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
return
(
thd
->
profiling
.
fill_statistics_info
(
thd
,
tables
,
cond
));
#else
my_error
(
ER_FEATURE_DISABLED
,
MYF
(
0
),
"SHOW PROFILE"
,
"enable-profiling"
);
...
...
@@ -129,7 +129,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table)
}
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
#define RUSAGE_USEC(tv) ((tv).tv_sec*1000*1000 + (tv).tv_usec)
#define RUSAGE_DIFF_USEC(tv1, tv2) (RUSAGE_USEC((tv1))-RUSAGE_USEC((tv2)))
...
...
sql/sql_profile.h
View file @
4822696e
...
...
@@ -54,7 +54,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table);
#define PROFILE_ALL (~0)
#if defined(ENABLED_PROFILING)
#if defined(ENABLED_PROFILING)
&& defined(COMMUNITY_SERVER)
#include "mysql_priv.h"
#ifdef HAVE_SYS_RESOURCE_H
...
...
sql/sql_show.cc
View file @
4822696e
...
...
@@ -1549,9 +1549,12 @@ static bool show_status_array(THD *thd, const char *wild,
nr
=
(
long
)
(
thd
->
query_start
()
-
server_start_time
);
end
=
int10_to_str
(
nr
,
buff
,
10
);
break
;
#ifdef COMMUNITY_SERVER
case
SHOW_FLUSHTIME
:
nr
=
(
long
)
(
thd
->
query_start
()
-
flush_status_time
);
end
=
int10_to_str
(
nr
,
buff
,
10
);
break
;
#endif
case
SHOW_QUERIES
:
end
=
int10_to_str
((
long
)
thd
->
query_id
,
buff
,
10
);
break
;
...
...
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