Debian Codegraph @

mysql-test/suite/ndb/include/ndb_check_unique_index.inc

raw
1 #
2 # ndb_check_unique_index.inc - check that all unique index use same fragment
3 # count as main table
4 #
5 # Usage:
6 # let $ndb_database= <table database>;
7 # let $ndb_table= <table name>;
8 # --source suite/ndb/include/ndb_check_unique_index.inc
9 #
10
11 disable_query_log ONCE;
12 disable_result_log ONCE;
13 eval SELECT table_id into @describe_table_id from ndbinfo.dictionary_tables
14 WHERE table_name = "$ndb_table" AND database_name = "$ndb_database";
15
16
17 let $header=`SELECT concat("Table: ", database_name, ".",table_name)
18 FROM ndbinfo.dictionary_tables WHERE table_id = @describe_table_id`;
19 disable_query_log ONCE;
20 eval SELECT concat(
21 "PartitionCount: ", partitions, "\n",
22 "FragmentCount: ", fragments) AS "$header"
23 FROM ndbinfo.dictionary_tables WHERE table_id = @describe_table_id;
24
25 disable_query_log ONCE;
26 SELECT CONCAT(
27 index_name, "(", columns, ") - UniqueHashIndex\n",
28 "FragmentCount: ", tab_fragments) AS ""
29 FROM ndbinfo.index_columns t1
30 JOIN ndbinfo.table_distribution_status t2 ON t1.index_object_id = t2.table_id
31 WHERE index_type = 3 AND t1.table_id = @describe_table_id;
32
33 let $ndb_database=;
34 let $ndb_table=;