diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2005-09-20 10:46:33 +0200 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2005-09-20 10:46:33 +0200 |
commit | 6d576bd34f534ad0f75757bb00a43e70e47dae2a (patch) | |
tree | 60995e94c892ece45bee712856f8b9becfb7d1df /sql/ha_ndbcluster.cc | |
parent | 8dba389bb2a0266a8286a000703aae4ef9f5e82f (diff) | |
parent | 4b25110ca25934fd9507567b9b05914f1efc91a8 (diff) | |
download | mariadb-git-6d576bd34f534ad0f75757bb00a43e70e47dae2a.tar.gz |
Merge perch.ndb.mysql.com:/home/jonas/src/mysql-4.1
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
ndb/include/ndbapi/NdbBlob.hpp:
Auto merged
ndb/include/ndbapi/NdbOperation.hpp:
Auto merged
ndb/include/ndbapi/NdbRecAttr.hpp:
Auto merged
ndb/src/ndbapi/NdbApiSignal.cpp:
Auto merged
ndb/src/ndbapi/NdbApiSignal.hpp:
Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
Auto merged
ndb/src/ndbapi/NdbRecAttr.cpp:
Auto merged
ndb/src/ndbapi/Ndbif.cpp:
Auto merged
ndb/src/ndbapi/Ndbinit.cpp:
Auto merged
ndb/test/include/NDBT_Test.hpp:
Auto merged
ndb/test/ndbapi/bank/BankLoad.cpp:
Auto merged
ndb/test/ndbapi/testOIBasic.cpp:
Auto merged
ndb/test/src/NdbBackup.cpp:
Auto merged
ndb/test/src/NdbRestarts.cpp:
Auto merged
ndb/tools/restore/Restore.cpp:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
ndb/include/ndbapi/Ndb.hpp:
merge
ndb/include/ndbapi/NdbIndexOperation.hpp:
merge
ndb/include/ndbapi/NdbIndexScanOperation.hpp:
merge
ndb/include/ndbapi/NdbTransaction.hpp:
merge
ndb/src/ndbapi/NdbImpl.hpp:
merge
ndb/src/ndbapi/Ndblist.cpp:
merge
ndb/test/src/HugoCalculator.cpp:
merge
ndb/test/src/NDBT_Test.cpp:
merge
sql/ha_ndbcluster.cc:
merge
sql/mysqld.cc:
merge
sql/sql_lex.h:
merge
sql/sql_parse.cc:
merge
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 ff631ac9db8..6e03da4e436 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -7392,4 +7392,50 @@ ha_ndbcluster::generate_scan_filter(Ndb_cond_stack *ndb_cond_stack, DBUG_RETURN(0); } +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 */ |