| 1 |
# suite/funcs_1/datadict/table_constraints.inc |
| 2 |
# |
| 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 |
| 6 |
# |
| 7 |
# The variable |
| 8 |
# $table_schema database to be inspected |
| 9 |
# has to be set before sourcing this script. |
| 10 |
# |
| 11 |
# Author: |
| 12 |
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of |
| 13 |
# testsuite funcs_1 |
| 14 |
# Create this script based on older scripts and new code. |
| 15 |
# |
| 16 |
|
| 17 |
--disable_warnings |
| 18 |
DROP DATABASE IF EXISTS db_datadict; |
| 19 |
--enable_warnings |
| 20 |
CREATE DATABASE db_datadict; |
| 21 |
|
| 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; |
| 29 |
|
| 30 |
let $my_select = SELECT * FROM information_schema.table_constraints |
| 31 |
WHERE table_schema = '$table_schema' AND table_name != 'ndb_binlog_index' |
| 32 |
ORDER BY table_schema,table_name,constraint_name COLLATE utf8_general_ci; |
| 33 |
eval $my_select; |
| 34 |
|
| 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); |
| 38 |
eval $my_select; |
| 39 |
|
| 40 |
--echo # Switch to connection default and close connection testuser1 |
| 41 |
connection default; |
| 42 |
disconnect testuser1; |
| 43 |
DROP USER testuser1@localhost; |
| 44 |
DROP DATABASE db_datadict; |
| 45 |
|