1
# suite/funcs_1/datadict/table_constraints.inc
3
# Auxiliary script to be sourced by
4
# suite/funcs_1/t/is_table_constraints_mysql.test
5
# suite/funcs_1/t/is_table_constraints_is.test
8
# $table_schema database to be inspected
9
# has to be set before sourcing this script.
12
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
14
# Create this script based on older scripts and new code.
18
DROP DATABASE IF EXISTS db_datadict;
20
CREATE DATABASE db_datadict;
22
# Create a low privileged user.
23
# Note: The database db_datadict is just a "home" for the low privileged user
24
# and not in the focus of testing.
25
--error 0,ER_CANNOT_USER
26
DROP USER testuser1@localhost;
27
CREATE USER testuser1@localhost;
28
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
30
let $my_select = SELECT * FROM information_schema.table_constraints
31
WHERE table_schema = '$table_schema'
32
ORDER BY table_schema,table_name,constraint_name;
35
--echo # Establish connection testuser1 (user=testuser1)
36
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
37
connect (testuser1,localhost,testuser1,,db_datadict);
40
--echo # Switch to connection default and close connection testuser1
43
DROP USER testuser1@localhost;
44
DROP DATABASE db_datadict;