提交 aa3253da 编写于 作者: N Nikhil Kak

add test for a drop table scenario when the schema name is the same as the user name

上级 55ec56f7
......@@ -89,3 +89,22 @@ DROP GROUP IF EXISTS tg1, tg2;
NOTICE: role "tg2" does not exist, skipping
DROP GROUP tg1;
ERROR: role "tg1" does not exist
--create a schema with the same name as the logged in user name and try to drop and recreate a table
drop database if exists drop_table_test;
NOTICE: database "drop_table_test" does not exist, skipping
create database drop_table_test;
\c drop_table_test
--get the username and set it to a variable
\set cur_user `echo $USER`
CREATE SCHEMA :cur_user;
CREATE TABLE tbl_to_drop(i int);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
DROP TABLE tbl_to_drop;
CREATE TABLE tbl_to_drop(i int);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
DROP SCHEMA :cur_user CASCADE;
NOTICE: drop cascades to table tbl_to_drop
\c regression
drop database drop_table_test;
......@@ -116,3 +116,25 @@ DROP GROUP IF EXISTS tg1, tg2;
DROP GROUP tg1;
--create a schema with the same name as the logged in user name and try to drop and recreate a table
drop database if exists drop_table_test;
create database drop_table_test;
\c drop_table_test
--get the username and set it to a variable
\set cur_user `echo $USER`
CREATE SCHEMA :cur_user;
CREATE TABLE tbl_to_drop(i int);
DROP TABLE tbl_to_drop;
CREATE TABLE tbl_to_drop(i int);
DROP SCHEMA :cur_user CASCADE;
\c regression
drop database drop_table_test;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册