| 1 |
--source include/have_ndb.inc |
| 2 |
|
| 3 |
# This test requires case sensitive file system as the database TEST_DB |
| 4 |
# is in upper case |
| 5 |
--source include/have_case_sensitive_file_system.inc |
| 6 |
|
| 7 |
--echo # |
| 8 |
--echo # BUG11758430 NDB_SHOW_TABLES SHOULD REQUIRE A DATABASE WHEN TABLE IS SUPPLIED |
| 9 |
--echo # |
| 10 |
CREATE TABLE test.t1 ( |
| 11 |
a int primary key, |
| 12 |
b int |
| 13 |
)engine=ndbcluster; |
| 14 |
--echo # Table exists in user db and db specified in ndb_show_tables command |
| 15 |
--replace_regex /^[0-9]+ +/XX / |
| 16 |
--exec $NDB_SHOW_TABLES -dtest t1 |
| 17 |
--echo |
| 18 |
--echo # Table doesn't exist in TEST_DB and no db specified in ndb_show_tables command |
| 19 |
--error 1 |
| 20 |
--exec $NDB_SHOW_TABLES t1 |
| 21 |
--echo |
| 22 |
|
| 23 |
CREATE DATABASE TEST_DB; |
| 24 |
CREATE TABLE TEST_DB.t1 ( |
| 25 |
d int primary key, |
| 26 |
e int |
| 27 |
)engine=ndbcluster; |
| 28 |
--echo # Table exists in TEST_DB and no db specified in ndb_show_tables command |
| 29 |
--replace_regex /^[0-9]+ +/XX / |
| 30 |
--exec $NDB_SHOW_TABLES t1 |
| 31 |
--echo |
| 32 |
|
| 33 |
DROP TABLE test.t1; |
| 34 |
--echo # Table doesn't exist in user db and db specified in ndb_show_tables command |
| 35 |
--error 1 |
| 36 |
--exec $NDB_SHOW_TABLES -dtest t1 |
| 37 |
--echo |
| 38 |
|
| 39 |
DROP TABLE TEST_DB.t1; |
| 40 |
--echo # Table doesn't exist in TEST_DB and no db specified in ndb_show_tables command |
| 41 |
--error 1 |
| 42 |
--exec $NDB_SHOW_TABLES t1 |
| 43 |
--echo |
| 44 |
DROP DATABASE TEST_DB; |
| 45 |
|
| 46 |
--echo # |
| 47 |
--echo # BUG #24383742 NDB : NDB_SHOW_TABLES MISSING TYPE NAME TEXT FOR SOME TYPES |
| 48 |
--echo # |
| 49 |
--echo # |
| 50 |
--echo # Create fully replicated table which will also create a fully replicated |
| 51 |
--echo # trigger |
| 52 |
--echo # |
| 53 |
create table t1 ( |
| 54 |
id1 int primary key |
| 55 |
)engine=ndb comment='NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_NODE'; |
| 56 |
|
| 57 |
--echo # Check that "type" column shows 'HashMap' |
| 58 |
let $assert_file= $MYSQLTEST_VARDIR/tmp/ndb_show_tables_out.txt; |
| 59 |
# Dump command output to file |
| 60 |
--exec $NDB_SHOW_TABLES -t 24 > $assert_file 2>&1 |
| 61 |
let $assert_text= Looking for 'HashMap' in lines starting with a number...; |
| 62 |
let $assert_select=^[0-9]+; |
| 63 |
let $assert_match=HashMap; |
| 64 |
--source include/assert_grep.inc |
| 65 |
--remove_file $assert_file |
| 66 |
|
| 67 |
--echo # Check that "type" column shows 'FullyRepTrigger' |
| 68 |
let $assert_file= $MYSQLTEST_VARDIR/tmp/ndb_show_tables_out.txt; |
| 69 |
# Dump command output to file |
| 70 |
--exec $NDB_SHOW_TABLES -t 28 > $assert_file 2>&1 |
| 71 |
let $assert_text= Looking for 'FullyRepTrigger' in lines starting with a number...; |
| 72 |
let $assert_select=^[0-9]+; |
| 73 |
let $assert_match=FullyRepTrigger; |
| 74 |
--source include/assert_grep.inc |
| 75 |
--remove_file $assert_file |
| 76 |
|
| 77 |
drop table t1; |
| 78 |
|
| 79 |
--echo # |
| 80 |
--echo # Check working of --fully-qualified |
| 81 |
--echo # |
| 82 |
CREATE TABLE test.t1 ( |
| 83 |
a int primary key, |
| 84 |
b int |
| 85 |
)engine=ndbcluster; |
| 86 |
--replace_regex /^[0-9]+ +/XX / /\/[0-9]+/\/YY/ |
| 87 |
--exec $NDB_SHOW_TABLES --fully-qualified -dtest t1 |
| 88 |
--echo |
| 89 |
DROP TABLE test.t1; |