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
51c43b9b
Commit
51c43b9b
authored
Dec 15, 2000
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
merge
BitKeeper/etc/logging_ok: auto-union
parents
a6d7bfe4
559429a1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
117 additions
and
6 deletions
+117
-6
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
Docs/manual.texi
Docs/manual.texi
+22
-2
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+41
-0
sql/ha_berkeley.h
sql/ha_berkeley.h
+1
-0
sql/mysql_priv.h
sql/mysql_priv.h
+5
-0
sql/sql_lex.h
sql/sql_lex.h
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+12
-0
sql/sql_show.cc
sql/sql_show.cc
+31
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-1
No files found.
BitKeeper/etc/logging_ok
View file @
51c43b9b
...
...
@@ -7,3 +7,4 @@ paul@central.snake.net
sasha@mysql.sashanet.com
sasha@work.mysql.com
serg@serg.mysql.com
tim@cane.mysql.fi
Docs/manual.texi
View file @
51c43b9b
...
...
@@ -19895,6 +19895,7 @@ or SHOW INDEX FROM tbl_name [FROM db_name]
or SHOW TABLE STATUS [FROM db_name] [LIKE wild]
or SHOW STATUS [LIKE wild]
or SHOW VARIABLES [LIKE wild]
or SHOW LOGS
or SHOW [FULL] PROCESSLIST
or SHOW GRANTS FOR user
or SHOW CREATE TABLE table_name
...
...
@@ -19916,6 +19917,7 @@ and @samp{_} wild-card characters.
* SHOW TABLE STATUS::
* SHOW STATUS::
* SHOW VARIABLES::
* SHOW LOGS::
* SHOW PROCESSLIST::
* SHOW GRANTS::
* SHOW CREATE TABLE::
...
...
@@ -20160,7 +20162,7 @@ your @code{mysqld} @code{sort_buffer} variables is probably too small.
tables.
@end itemize
@node SHOW VARIABLES, SHOW
PROCESSLIST
, SHOW STATUS, SHOW
@node SHOW VARIABLES, SHOW
LOGS
, SHOW STATUS, SHOW
@subsection SHOW VARIABLES
@code{SHOW VARIABLES} shows the values of some @strong{MySQL} system
...
...
@@ -20620,11 +20622,27 @@ closing it. See also @code{interactive_timeout}.
The manual section that describes tuning @strong{MySQL} contains some
information of how to tune the above variables. @xref{Server parameters}.
@node SHOW LOGS, SHOW PROCESSLIST, SHOW VARIABLES, SHOW
@subsection SHOW Information About Log Files
@code{SHOW LOGS} shows you status information about existing log
files. It currently only displays information about Berkeley DB log
files.
@itemize @bullet
@item @code{File} shows the full path to the log file
@item @code{Type} shows the type of the log file (@code{BDB} for Berkeley
DB log files)
@item @code{Status} shows the status of the log file (@code{FREE} if the
file can be removed, or @code{IN USE} if the file is needed by the transaction
subsystem)
@end itemize
@cindex threads, display
@cindex processes, display
@findex threads
@findex PROCESSLIST
@node SHOW PROCESSLIST, SHOW GRANTS, SHOW
VARIABLE
S, SHOW
@node SHOW PROCESSLIST, SHOW GRANTS, SHOW
LOG
S, SHOW
@subsection SHOW Information About Connected Threads (Processes)
@code{SHOW PROCESSLIST} shows you which threads are running. You can
...
...
@@ -39789,6 +39807,8 @@ Fixed bug in @code{REPLACE} with BDB tables.
@code{LPAD()} and @code{RPAD()} will shorten the result string if it's longer
than the length argument.
@item
Added @code{SHOW LOGS} command.
@item
Remove not used BDB logs on shutdown.
@item
When creating a table, put @code{PRIMARY} keys first, followed by
sql/ha_berkeley.cc
View file @
51c43b9b
...
...
@@ -93,6 +93,7 @@ u_int32_t berkeley_lock_types[]=
{
DB_LOCK_DEFAULT
,
DB_LOCK_OLDEST
,
DB_LOCK_RANDOM
};
TYPELIB
berkeley_lock_typelib
=
{
array_elements
(
berkeley_lock_names
),
""
,
berkeley_lock_names
};
static
MEM_ROOT
show_logs_root
;
static
void
berkeley_print_error
(
const
char
*
db_errpfx
,
char
*
buffer
);
static
byte
*
bdb_get_key
(
BDB_SHARE
*
share
,
uint
*
length
,
...
...
@@ -210,6 +211,46 @@ int berkeley_rollback(THD *thd, void *trans)
DBUG_RETURN
(
error
);
}
static
void
*
show_logs_alloc
(
size_t
size
)
{
return
alloc_root
(
&
show_logs_root
,
size
);
}
int
berkeley_show_logs
(
THD
*
thd
)
{
char
**
all_logs
,
**
free_logs
;
String
*
packet
=
&
thd
->
packet
;
int
error
;
DBUG_ENTER
(
"berkeley_show_logs"
);
init_alloc_root
(
&
show_logs_root
,
1024
,
1024
);
if
((
error
=
log_archive
(
db_env
,
&
all_logs
,
DB_ARCH_ABS
|
DB_ARCH_LOG
,
show_logs_alloc
))
||
(
error
=
log_archive
(
db_env
,
&
free_logs
,
DB_ARCH_ABS
,
show_logs_alloc
)))
{
DBUG_PRINT
(
"error"
,
(
"log_archive failed (error %d)"
,
error
));
db_env
->
err
(
db_env
,
error
,
"log_archive: DB_ARCH_ABS"
);
DBUG_RETURN
(
1
);
}
for
(
char
**
a
=
all_logs
,
**
f
=
free_logs
;
*
a
;
++
a
)
{
packet
->
length
(
0
);
net_store_data
(
packet
,
*
a
);
net_store_data
(
packet
,
"BDB"
);
if
(
f
&&
*
f
&&
strcmp
(
*
a
,
*
f
)
==
0
)
{
net_store_data
(
packet
,
SHOW_LOG_STATUS_FREE
);
++
f
;
}
else
net_store_data
(
packet
,
SHOW_LOG_STATUS_INUSE
);
if
(
my_net_write
(
&
thd
->
net
,(
char
*
)
packet
->
ptr
(),
packet
->
length
()))
DBUG_RETURN
(
1
);
/* purecov: inspected */
}
free_root
(
&
show_logs_root
,
MYF
(
0
));
DBUG_RETURN
(
0
);
}
static
void
berkeley_print_error
(
const
char
*
db_errpfx
,
char
*
buffer
)
{
...
...
sql/ha_berkeley.h
View file @
51c43b9b
...
...
@@ -168,3 +168,4 @@ bool berkeley_end(void);
bool
berkeley_flush_logs
(
void
);
int
berkeley_commit
(
THD
*
thd
,
void
*
trans
);
int
berkeley_rollback
(
THD
*
thd
,
void
*
trans
);
int
berkeley_show_logs
(
THD
*
thd
);
sql/mysql_priv.h
View file @
51c43b9b
...
...
@@ -175,6 +175,10 @@ void kill_one_thread(THD *thd, ulong id);
#define BINLOG_DUMP_NON_BLOCK 1
/* sql_show.cc:show_log_files() */
#define SHOW_LOG_STATUS_FREE "FREE"
#define SHOW_LOG_STATUS_INUSE "IN USE"
/* Some portable defines */
#define portable_sizeof_char_ptr 8
...
...
@@ -354,6 +358,7 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild);
int
mysqld_extend_show_tables
(
THD
*
thd
,
const
char
*
db
,
const
char
*
wild
);
int
mysqld_show_fields
(
THD
*
thd
,
TABLE_LIST
*
table
,
const
char
*
wild
);
int
mysqld_show_keys
(
THD
*
thd
,
TABLE_LIST
*
table
);
int
mysqld_show_logs
(
THD
*
thd
);
void
mysqld_list_fields
(
THD
*
thd
,
TABLE_LIST
*
table
,
const
char
*
wild
);
int
mysqld_dump_create_info
(
THD
*
thd
,
TABLE
*
table
,
int
fd
=
-
1
);
int
mysqld_show_create
(
THD
*
thd
,
TABLE_LIST
*
table_list
);
...
...
sql/sql_lex.h
View file @
51c43b9b
...
...
@@ -39,7 +39,7 @@ enum enum_sql_command {
SQLCOM_DELETE
,
SQLCOM_TRUNCATE
,
SQLCOM_DROP_TABLE
,
SQLCOM_DROP_INDEX
,
SQLCOM_SHOW_DATABASES
,
SQLCOM_SHOW_TABLES
,
SQLCOM_SHOW_FIELDS
,
SQLCOM_SHOW_KEYS
,
SQLCOM_SHOW_VARIABLES
,
SQLCOM_SHOW_STATUS
,
SQLCOM_SHOW_KEYS
,
SQLCOM_SHOW_VARIABLES
,
SQLCOM_SHOW_
LOGS
,
SQLCOM_SHOW_
STATUS
,
SQLCOM_SHOW_PROCESSLIST
,
SQLCOM_SHOW_MASTER_STAT
,
SQLCOM_SHOW_SLAVE_STAT
,
SQLCOM_SHOW_GRANTS
,
SQLCOM_SHOW_CREATE
,
...
...
sql/sql_parse.cc
View file @
51c43b9b
...
...
@@ -1475,6 +1475,18 @@ mysql_execute_command(void)
res
=
mysqld_show
(
thd
,
(
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
),
init_vars
);
break
;
case
SQLCOM_SHOW_LOGS
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
#else
{
if
(
grant_option
&&
check_access
(
thd
,
FILE_ACL
,
any_db
))
goto
error
;
res
=
mysqld_show_logs
(
thd
);
break
;
}
#endif
case
SQLCOM_SHOW_TABLES
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
...
...
sql/sql_show.cc
View file @
51c43b9b
...
...
@@ -24,6 +24,10 @@
#include "sql_acl.h"
#include <my_dir.h>
#ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h" // For berkeley_show_logs
#endif
/* extern "C" pthread_mutex_t THR_LOCK_keycache; */
static
const
char
*
grant_names
[]
=
{
...
...
@@ -402,6 +406,7 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild)
restore_record
(
table
,
2
);
// Get empty record
Field
**
ptr
,
*
field
;
String
*
packet
=
&
thd
->
packet
;
for
(
ptr
=
table
->
field
;
(
field
=
*
ptr
)
;
ptr
++
)
{
if
(
!
wild
||
!
wild
[
0
]
||
!
wild_case_compare
(
field
->
field_name
,
wild
))
...
...
@@ -414,7 +419,7 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild)
{
byte
*
pos
;
uint
flags
=
field
->
flags
;
String
*
packet
=
&
thd
->
packet
,
type
(
tmp
,
sizeof
(
tmp
));
String
type
(
tmp
,
sizeof
(
tmp
));
uint
col_access
;
bool
null_default_value
=
0
;
...
...
@@ -526,6 +531,30 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
}
#ifdef HAVE_BERKELEY_DB
int
mysqld_show_logs
(
THD
*
thd
)
{
DBUG_ENTER
(
"mysqld_show_logs"
);
List
<
Item
>
field_list
;
Item
*
item
;
field_list
.
push_back
(
new
Item_empty_string
(
"File"
,
FN_REFLEN
));
field_list
.
push_back
(
new
Item_empty_string
(
"Type"
,
10
));
field_list
.
push_back
(
new
Item_empty_string
(
"Status"
,
10
));
if
(
send_fields
(
thd
,
field_list
,
1
))
DBUG_RETURN
(
1
);
if
(
berkeley_show_logs
(
thd
))
DBUG_RETURN
(
1
);
send_eof
(
&
thd
->
net
);
DBUG_RETURN
(
0
);
}
#endif
int
mysqld_show_keys
(
THD
*
thd
,
TABLE_LIST
*
table_list
)
{
...
...
@@ -562,13 +591,13 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
if
(
send_fields
(
thd
,
field_list
,
1
))
DBUG_RETURN
(
1
);
String
*
packet
=
&
thd
->
packet
;
KEY
*
key_info
=
table
->
key_info
;
table
->
file
->
info
(
HA_STATUS_VARIABLE
|
HA_STATUS_NO_LOCK
|
HA_STATUS_TIME
);
for
(
uint
i
=
0
;
i
<
table
->
keys
;
i
++
,
key_info
++
)
{
KEY_PART_INFO
*
key_part
=
key_info
->
key_part
;
char
*
end
;
String
*
packet
=
&
thd
->
packet
;
for
(
uint
j
=
0
;
j
<
key_info
->
key_parts
;
j
++
,
key_part
++
)
{
packet
->
length
(
0
);
...
...
sql/sql_yacc.yy
View file @
51c43b9b
...
...
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* sql_yacc.y */
/* sql_yacc.y
y
*/
%{
#define MYSQL_YACC
...
...
@@ -2179,6 +2179,8 @@ show_param:
{ Lex->sql_command= SQLCOM_SHOW_PROCESSLIST; Lex->verbose=1; }
| VARIABLES wild
{ Lex->sql_command= SQLCOM_SHOW_VARIABLES; }
| LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_LOGS; }
| GRANTS FOR_SYM user
{ Lex->sql_command= SQLCOM_SHOW_GRANTS;
Lex->grant_user=$3; Lex->grant_user->password.str=NullS; }
...
...
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