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
3d4971c4
Commit
3d4971c4
authored
Mar 09, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/jimw/my/mysql-5.0-clean sql/mysqld.cc: Auto merged
parents
f8b66f76
c9f3e0f4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
54 deletions
+91
-54
mysql-test/lib/init_db.sql
mysql-test/lib/init_db.sql
+50
-50
scripts/mysqldumpslow.sh
scripts/mysqldumpslow.sh
+40
-3
sql/sql_class.cc
sql/sql_class.cc
+1
-1
No files found.
mysql-test/lib/init_db.sql
View file @
3d4971c4
...
...
@@ -4,18 +4,18 @@ CREATE TABLE db (
Host
char
(
60
)
binary
DEFAULT
''
NOT
NULL
,
Db
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
User
char
(
16
)
binary
DEFAULT
''
NOT
NULL
,
Select_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Insert_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Update_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Delete_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Create_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Drop_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Grant_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
References_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Index_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Alter_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Lock_tables_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Select_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Insert_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Update_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Delete_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Create_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Drop_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Grant_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
PRIMARY
KEY
Host
(
Host
,
Db
,
User
),
KEY
User
(
User
)
)
engine
=
MyISAM
...
...
@@ -30,18 +30,18 @@ INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y',
CREATE
TABLE
host
(
Host
char
(
60
)
binary
DEFAULT
''
NOT
NULL
,
Db
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
Select_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Insert_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Update_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Delete_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Create_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Drop_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Grant_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
References_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Index_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Alter_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Lock_tables_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Select_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Insert_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Update_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Delete_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Create_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Drop_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Grant_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
PRIMARY
KEY
Host
(
Host
,
Db
)
)
engine
=
MyISAM
CHARACTER
SET
utf8
COLLATE
utf8_bin
...
...
@@ -52,28 +52,28 @@ CREATE TABLE user (
Host
char
(
60
)
binary
DEFAULT
''
NOT
NULL
,
User
char
(
16
)
binary
DEFAULT
''
NOT
NULL
,
Password
char
(
41
)
binary
DEFAULT
''
NOT
NULL
,
Select_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Insert_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Update_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Delete_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Create_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Drop_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Reload_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Shutdown_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Process_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
File_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Grant_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
References_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Index_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Alter_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Show_db_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Super_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Lock_tables_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Execute_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Repl_slave_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
Repl_client_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
ssl_type
enum
(
''
,
'ANY'
,
'X509'
,
'SPECIFIED'
)
DEFAULT
''
NOT
NULL
,
Select_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Insert_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Update_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Delete_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Create_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Drop_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Reload_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Shutdown_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Process_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
File_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Grant_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Show_db_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Super_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Execute_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Repl_slave_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
Repl_client_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
ssl_type
enum
(
''
,
'ANY'
,
'X509'
,
'SPECIFIED'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
ssl_cipher
BLOB
NOT
NULL
,
x509_issuer
BLOB
NOT
NULL
,
x509_subject
BLOB
NOT
NULL
,
...
...
@@ -97,7 +97,7 @@ CREATE TABLE func (
name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
ret
tinyint
(
1
)
DEFAULT
'0'
NOT
NULL
,
dl
char
(
128
)
DEFAULT
''
NOT
NULL
,
type
enum
(
'function'
,
'aggregate'
)
NOT
NULL
,
type
enum
(
'function'
,
'aggregate'
)
COLLATE
utf8_general_ci
NOT
NULL
,
PRIMARY
KEY
(
name
)
)
engine
=
MyISAM
CHARACTER
SET
utf8
COLLATE
utf8_bin
...
...
@@ -111,8 +111,8 @@ CREATE TABLE tables_priv (
Table_name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
Grantor
char
(
77
)
DEFAULT
''
NOT
NULL
,
Timestamp
timestamp
(
14
),
Table_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'Delete'
,
'Create'
,
'Drop'
,
'Grant'
,
'References'
,
'Index'
,
'Alter'
)
DEFAULT
''
NOT
NULL
,
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
DEFAULT
''
NOT
NULL
,
Table_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'Delete'
,
'Create'
,
'Drop'
,
'Grant'
,
'References'
,
'Index'
,
'Alter'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
PRIMARY
KEY
(
Host
,
Db
,
User
,
Table_name
),
KEY
Grantor
(
Grantor
)
)
engine
=
MyISAM
CHARACTER
SET
utf8
COLLATE
utf8_bin
...
...
@@ -126,7 +126,7 @@ CREATE TABLE columns_priv (
Table_name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
Column_name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
Timestamp
timestamp
(
14
),
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
DEFAULT
''
NOT
NULL
,
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
PRIMARY
KEY
(
Host
,
Db
,
User
,
Table_name
,
Column_name
)
)
engine
=
MyISAM
CHARACTER
SET
utf8
COLLATE
utf8_bin
...
...
scripts/mysqldumpslow.sh
View file @
3d4971c4
...
...
@@ -17,8 +17,9 @@ my %opt = (
)
;
GetOptions
(
\%
opt,
'v+'
,
# verbose
'd+'
,
# debug
'verbose|v+'
,# verbose
'help+'
,
# write usage info
'debug|d+'
,
# debug
's=s'
,
# what to sort by (t, at, l, al, r, ar etc)
'r!'
,
# reverse the sort order (largest last instead of first)
't=i'
,
# just show the top n queries
...
...
@@ -28,8 +29,9 @@ GetOptions(\%opt,
'h=s'
,
# hostname of db server for *-slow.log filename (can be wildcard)
'i=s'
,
# name of server instance (if using mysql.server startup script)
'l!'
,
# don't subtract lock time from total time
)
or
die
"Bad option"
;
)
or
usage
(
"bad option"
)
;
$opt
{
'help'
}
and usage
()
;
unless
(
@ARGV
)
{
my
$defaults
=
`
my_print_defaults mysqld
`
;
...
...
@@ -141,3 +143,38 @@ foreach (@sorted) {
printf "
Count: %d
Time
=
%.2fs
(
%ds
)
Lock
=
%.2fs
(
%ds
)
Rows
=
%.1f
(
%d
)
,
$user
\@
$host
\n
%s
\n\n
",
$c
,
$at
,
$t
,
$al
,
$l
,
$ar
,
$r
,
$_
;
}
sub usage {
my
$str
= shift;
my
$text
= <<HERE;
Usage: mysqldumpslow [ OPTS... ] [ LOGS... ]
Parse and summarize the MySQL slow query log. Options are
--verbose verbose
--debug debug
--help write this text to standard output
-v verbose
-d debug
-s ORDER what to sort by (t, at, l, al, r, ar etc), 'at' is default
-r reverse the sort order (largest last instead of first)
-t NUM just show the top n queries
-a don't abstract all numbers to N and strings to 'S'
-n NUM abstract numbers with at least n digits within names
-g PATTERN grep: only consider stmts that include this string
-h HOSTNAME hostname of db server for *-slow.log filename (can be wildcard),
default is '*', i.e. match all
-i NAME name of server instance (if using mysql.server startup script)
-l don't subtract lock time from total time
HERE
if (
$str
) {
print STDERR "
ERROR:
$str
\n\n
";
print STDERR
$text
;
exit 1;
} else {
print
$text
;
exit 0;
}
}
sql/sql_class.cc
View file @
3d4971c4
...
...
@@ -1782,7 +1782,7 @@ void TMP_TABLE_PARAM::init()
void
thd_increment_bytes_sent
(
ulong
length
)
{
THD
*
thd
=
current_thd
;
if
(
likely
(
thd
))
if
(
likely
(
thd
!=
0
))
{
/* current_thd==0 when close_connection() calls net_send_error() */
thd
->
status_var
.
bytes_sent
+=
length
;
}
...
...
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