diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2005-09-19 15:35:07 +0200 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2005-09-19 15:35:07 +0200 |
commit | b390a1a4000d15588162cddc445fb9663ae3c089 (patch) | |
tree | fe6285c964091b9461ed089a7bef0de93bb2d58b /sql/ha_ndbcluster.cc | |
parent | 90e6060858c4db92af07e1624ee7347d2d95b0f4 (diff) | |
download | mariadb-git-b390a1a4000d15588162cddc445fb9663ae3c089.tar.gz |
ndb - imlp. show engine ndb status;
that dump free list allocation per connection
sql/ha_ndbcluster.cc:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/ha_ndbcluster.h:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/mysqld.cc:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/sql_lex.h:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/sql_parse.cc:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/sql_yacc.yy:
imlp. show engine ndb status;
that dump free list allocation per connection
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d1de0bd100e..cc60c807bc9 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -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 */ |