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
cb334d03
Commit
cb334d03
authored
Oct 07, 2003
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL #562: Change format of slow log in 4.1
parent
5b13ec47
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
12 deletions
+25
-12
sql/log.cc
sql/log.cc
+2
-2
sql/mysqld.cc
sql/mysqld.cc
+20
-8
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
sql/unireg.h
sql/unireg.h
+2
-1
No files found.
sql/log.cc
View file @
cb334d03
...
...
@@ -1564,7 +1564,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
return
0
;
}
if
(
(
specialflag
&
SPECIAL_LONG
_LOG_FORMAT
)
||
query_start_arg
)
if
(
!
(
specialflag
&
SPECIAL_SHORT
_LOG_FORMAT
)
||
query_start_arg
)
{
current_time
=
time
(
NULL
);
if
(
current_time
!=
last_time
)
...
...
@@ -1617,7 +1617,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
// Save value if we do an insert.
if
(
thd
->
insert_id_used
)
{
if
(
specialflag
&
SPECIAL_LONG_LOG_FORMAT
)
if
(
!
(
specialflag
&
SPECIAL_SHORT_LOG_FORMAT
)
)
{
end
=
strmov
(
end
,
",insert_id="
);
end
=
longlong10_to_str
((
longlong
)
thd
->
last_insert_id
,
end
,
-
10
);
...
...
sql/mysqld.cc
View file @
cb334d03
...
...
@@ -262,6 +262,8 @@ my_bool opt_log_slave_updates= 0;
my_bool
opt_console
=
0
,
opt_bdb
,
opt_innodb
,
opt_isam
;
my_bool
opt_readonly
,
use_temp_pool
,
relay_log_purge
;
my_bool
opt_secure_auth
=
0
;
my_bool
opt_short_log_format
=
0
;
my_bool
opt_log_queries_not_using_indexes
=
0
;
volatile
bool
mqh_used
=
0
;
uint
mysqld_port
,
test_flags
,
select_errors
,
dropping_tables
,
ha_open_options
;
...
...
@@ -3455,7 +3457,7 @@ enum options
OPT_SKIP_PRIOR
,
OPT_BIG_TABLES
,
OPT_STANDALONE
,
OPT_ONE_THREAD
,
OPT_CONSOLE
,
OPT_LOW_PRIORITY_UPDATES
,
OPT_SKIP_HOST_CACHE
,
OPT_
LON
G_FORMAT
,
OPT_SKIP_HOST_CACHE
,
OPT_
SHORT_LO
G_FORMAT
,
OPT_FLUSH
,
OPT_SAFE
,
OPT_BOOTSTRAP
,
OPT_SKIP_SHOW_DB
,
OPT_TABLE_TYPE
,
OPT_INIT_FILE
,
...
...
@@ -3562,7 +3564,8 @@ enum options
OPT_DEFAULT_WEEK_FORMAT
,
OPT_GROUP_CONCAT_MAX_LEN
,
OPT_DEFAULT_COLLATION
,
OPT_SECURE_AUTH
OPT_SECURE_AUTH
,
OPT_LOG_QUERIES_NOT_USING_INDEXES
};
...
...
@@ -3769,9 +3772,17 @@ Disable with --skip-bdb (will save memory).",
"Log slow queries to this log file. Defaults logging to hostname-slow.log file."
,
(
gptr
*
)
&
opt_slow_logname
,
(
gptr
*
)
&
opt_slow_logname
,
0
,
GET_STR
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"log-long-format"
,
OPT_LONG_FORMAT
,
"Log some extra information to update log."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"log-long-format"
,
'0'
,
"Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"log-short-format"
,
OPT_SHORT_LOG_FORMAT
,
"Don't log extra information to update and slow-query logs."
,
(
gptr
*
)
&
opt_short_log_format
,
(
gptr
*
)
&
opt_short_log_format
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"log-queries-not-using-indexes"
,
OPT_LOG_QUERIES_NOT_USING_INDEXES
,
"Log queries that are executed without benefit of any index."
,
(
gptr
*
)
&
opt_log_queries_not_using_indexes
,
(
gptr
*
)
&
opt_log_queries_not_using_indexes
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"log-slave-updates"
,
OPT_LOG_SLAVE_UPDATES
,
"Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves."
,
(
gptr
*
)
&
opt_log_slave_updates
,
(
gptr
*
)
&
opt_log_slave_updates
,
0
,
GET_BOOL
,
...
...
@@ -5166,9 +5177,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case
(
int
)
OPT_SKIP_RESOLVE
:
opt_specialflag
|=
SPECIAL_NO_RESOLVE
;
break
;
case
(
int
)
OPT_LONG_FORMAT
:
opt_specialflag
|=
SPECIAL_LONG_LOG_FORMAT
;
break
;
case
(
int
)
OPT_SKIP_NETWORKING
:
opt_disable_networking
=
1
;
mysqld_port
=
0
;
...
...
@@ -5508,6 +5516,10 @@ static void get_options(int argc,char **argv)
keybuff_size
=
(((
KEY_CACHE
*
)
find_named
(
&
key_caches
,
"default"
,
7
,
&
not_used
))
->
size
);
}
if
(
opt_short_log_format
)
opt_specialflag
|=
SPECIAL_SHORT_LOG_FORMAT
;
if
(
opt_log_queries_not_using_indexes
)
opt_specialflag
|=
SPECIAL_LOG_QUERIES_NOT_USING_INDEXES
;
}
...
...
sql/sql_parse.cc
View file @
cb334d03
...
...
@@ -1566,7 +1566,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd
->
variables
.
long_query_time
||
((
thd
->
lex
.
select_lex
.
options
&
(
QUERY_NO_INDEX_USED
|
QUERY_NO_GOOD_INDEX_USED
))
&&
(
specialflag
&
SPECIAL_LO
NG_LOG_FORMAT
)))
(
specialflag
&
SPECIAL_LO
G_QUERIES_NOT_USING_INDEXES
)))
{
long_query_count
++
;
mysql_slow_log
.
write
(
thd
,
thd
->
query
,
thd
->
query_length
,
start_of_query
);
...
...
sql/unireg.h
View file @
cb334d03
...
...
@@ -107,8 +107,9 @@
#define SPECIAL_NO_PRIOR 128
/* Don't prioritize threads */
#define SPECIAL_BIG_SELECTS 256
/* Don't use heap tables */
#define SPECIAL_NO_HOST_CACHE 512
/* Don't cache hosts */
#define SPECIAL_
LONG
_LOG_FORMAT 1024
#define SPECIAL_
SHORT
_LOG_FORMAT 1024
#define SPECIAL_SAFE_MODE 2048
#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096
/* Log q not using indexes */
/* Extern defines */
#define store_record(A,B) bmove_align((A)->B,(A)->record[0],(size_t) (A)->reclength)
...
...
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