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
668a192c
Commit
668a192c
authored
Sep 19, 2005
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - imlp. show engine ndb status;
that dump free list allocation per connection
parent
5c836e2a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
1 deletion
+64
-1
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+46
-0
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+2
-0
sql/mysqld.cc
sql/mysqld.cc
+1
-0
sql/sql_lex.h
sql/sql_lex.h
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+11
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-0
No files found.
sql/ha_ndbcluster.cc
View file @
668a192c
...
...
@@ -5096,4 +5096,50 @@ int ha_ndbcluster::write_ndb_file()
DBUG_RETURN
(
error
);
}
int
ndbcluster_show_status
(
THD
*
thd
)
{
Protocol
*
protocol
=
thd
->
protocol
;
DBUG_ENTER
(
"ndbcluster_show_status"
);
if
(
have_ndbcluster
!=
SHOW_OPTION_YES
)
{
my_message
(
ER_NOT_SUPPORTED_YET
,
"Cannot call SHOW NDBCLUSTER STATUS because skip-ndbcluster is defined"
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
List
<
Item
>
field_list
;
field_list
.
push_back
(
new
Item_empty_string
(
"free_list"
,
255
));
field_list
.
push_back
(
new
Item_return_int
(
"created"
,
10
,
MYSQL_TYPE_LONG
));
field_list
.
push_back
(
new
Item_return_int
(
"free"
,
10
,
MYSQL_TYPE_LONG
));
field_list
.
push_back
(
new
Item_return_int
(
"sizeof"
,
10
,
MYSQL_TYPE_LONG
));
if
(
protocol
->
send_fields
(
&
field_list
,
1
))
DBUG_RETURN
(
TRUE
);
if
(
thd
->
transaction
.
thd_ndb
&&
((
Thd_ndb
*
)
thd
->
transaction
.
thd_ndb
)
->
ndb
)
{
Ndb
*
ndb
=
((
Thd_ndb
*
)
thd
->
transaction
.
thd_ndb
)
->
ndb
;
Ndb
::
Free_list_usage
tmp
;
tmp
.
m_name
=
0
;
while
(
ndb
->
get_free_list_usage
(
&
tmp
))
{
protocol
->
prepare_for_resend
();
protocol
->
store
(
tmp
.
m_name
,
&
my_charset_bin
);
protocol
->
store
((
uint
)
tmp
.
m_created
);
protocol
->
store
((
uint
)
tmp
.
m_free
);
protocol
->
store
((
uint
)
tmp
.
m_sizeof
);
if
(
protocol
->
write
())
DBUG_RETURN
(
TRUE
);
}
}
send_eof
(
thd
);
DBUG_RETURN
(
FALSE
);
}
#endif
/* HAVE_NDBCLUSTER_DB */
sql/ha_ndbcluster.h
View file @
668a192c
...
...
@@ -279,3 +279,5 @@ int ndbcluster_table_exists_in_engine(THD* thd,
int
ndbcluster_drop_database
(
const
char
*
path
);
void
ndbcluster_print_error
(
int
error
,
const
NdbOperation
*
error_op
);
int
ndbcluster_show_status
(
THD
*
);
sql/mysqld.cc
View file @
668a192c
...
...
@@ -5492,6 +5492,7 @@ struct show_var_st status_vars[]= {
{
"Com_show_fields"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_SHOW_FIELDS
),
SHOW_LONG
},
{
"Com_show_grants"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_SHOW_GRANTS
),
SHOW_LONG
},
{
"Com_show_innodb_status"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_SHOW_INNODB_STATUS
),
SHOW_LONG
},
{
"Com_show_ndb_status"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_SHOW_NDBCLUSTER_STATUS
),
SHOW_LONG
},
{
"Com_show_keys"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_SHOW_KEYS
),
SHOW_LONG
},
{
"Com_show_logs"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_SHOW_LOGS
),
SHOW_LONG
},
{
"Com_show_master_status"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_SHOW_MASTER_STAT
),
SHOW_LONG
},
...
...
sql/sql_lex.h
View file @
668a192c
...
...
@@ -49,7 +49,7 @@ enum enum_sql_command {
SQLCOM_SHOW_DATABASES
,
SQLCOM_SHOW_TABLES
,
SQLCOM_SHOW_FIELDS
,
SQLCOM_SHOW_KEYS
,
SQLCOM_SHOW_VARIABLES
,
SQLCOM_SHOW_LOGS
,
SQLCOM_SHOW_STATUS
,
SQLCOM_SHOW_INNODB_STATUS
,
SQLCOM_SHOW_INNODB_STATUS
,
SQLCOM_SHOW_NDBCLUSTER_STATUS
,
SQLCOM_SHOW_PROCESSLIST
,
SQLCOM_SHOW_MASTER_STAT
,
SQLCOM_SHOW_SLAVE_STAT
,
SQLCOM_SHOW_GRANTS
,
SQLCOM_SHOW_CREATE
,
SQLCOM_SHOW_CHARSETS
,
SQLCOM_SHOW_COLLATIONS
,
SQLCOM_SHOW_CREATE_DB
,
...
...
sql/sql_parse.cc
View file @
668a192c
...
...
@@ -25,6 +25,10 @@
#include "ha_innodb.h"
#endif
#ifdef HAVE_NDBCLUSTER_DB
#include "ha_ndbcluster.h"
#endif
#ifdef HAVE_OPENSSL
/*
Without SSL the handshake consists of one packet. This packet
...
...
@@ -2386,6 +2390,13 @@ mysql_execute_command(THD *thd)
res
=
load_master_data
(
thd
);
break
;
#endif
/* HAVE_REPLICATION */
#ifdef HAVE_NDBCLUSTER_DB
case
SQLCOM_SHOW_NDBCLUSTER_STATUS
:
{
res
=
ndbcluster_show_status
(
thd
);
break
;
}
#endif
#ifdef HAVE_INNOBASE_DB
case
SQLCOM_SHOW_INNODB_STATUS
:
{
...
...
sql/sql_yacc.yy
View file @
668a192c
...
...
@@ -4533,6 +4533,9 @@ show_engine_param:
STATUS_SYM
{
switch (Lex->create_info.db_type) {
case DB_TYPE_NDBCLUSTER:
Lex->sql_command = SQLCOM_SHOW_NDBCLUSTER_STATUS;
break;
case DB_TYPE_INNODB:
Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
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