Debian Codegraph @

mysql-test/suite/ndb_ddl/list_objects.inc

raw
1 if (!$create_table_name)
2 {
3 die Need the name of temporary table where to put list of objects;
4 }
5
6 if (!$list_table_name)
7 {
8 die Need the name of the table to list objects for;
9 }
10
11 --disable_query_log
12
13 # Create temporary table for storing the original
14 # list of objects in the table
15 eval CREATE TEMPORARY TABLE $create_table_name (
16 id INT UNSIGNED PRIMARY KEY,
17 type INT UNSIGNED,
18 version INT UNSIGNED,
19 state INT UNSIGNED,
20 parent_obj_type INT UNSIGNED,
21 parent_obj_id INT UNSIGNED,
22 fq_name VARCHAR(512)
23 );
24
25 # Split the table_name variable into db and name part
26 # since ndbinfo.ndb$dict_obj_info.parent_fq_name uses format
27 # db/catalog/name
28 let $_db = `SELECT IF(INSTR('$list_table_name', '.'),
29 SUBSTRING_INDEX('$list_table_name', '.', 1),
30 'ndb_ddl_test')`; # Default to ndb_ddl_test
31 let $_name = `SELECT SUBSTRING_INDEX('$list_table_name', '.', -1)`;
32
33 let $table_id = `SELECT id FROM test.ndbinfo_dict_obj_info
34 WHERE fq_name = '$_db/def/$_name'`;
35 eval INSERT INTO $create_table_name
36 SELECT * FROM test.ndbinfo_dict_obj_info
37 WHERE parent_obj_id = $table_id;
38
39 # Show the object list
40 #eval select * from $create_table_name;
41
42 --enable_query_log
43
44 # Reset arguments
45 let $create_table_name =;
46 let $list_table_name =;