You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by rm...@apache.org on 2018/05/21 15:58:26 UTC
[1/3] trafodion git commit: TRAFODION-1573: Additional GET commands
for privileges TRAFODION-3074: Failed to register/unregister user when
security disabled
Repository: trafodion
Updated Branches:
refs/heads/master 2c5f48018 -> 1b9cb1b85
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/privs1/EXPECTED125
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs1/EXPECTED125 b/core/sql/regress/privs1/EXPECTED125
index 8473a1c..d464042 100644
--- a/core/sql/regress/privs1/EXPECTED125
+++ b/core/sql/regress/privs1/EXPECTED125
@@ -98,6 +98,9 @@
>>create library t125_l1 file $$QUOTE$$ $$REGRRUNDIR$$/$$DLL$$ $$QUOTE$$ ;
--- SQL operation complete.
+>>grant usage on library t125_l1 to t125_role1;
+
+--- SQL operation complete.
>>create function translateBitmap(bitmap largeint) returns (bitmap_string char (20))
+>language c parameter style sql external name 'translateBitmap'
+>library t125_l1
@@ -127,6 +130,9 @@
+> file $$QUOTE$$ $$REGRRUNDIR$$/$$JARF$$ $$QUOTE$$;
--- SQL operation complete.
+>>grant all on library t125_l2 to sql_user8;
+
+--- SQL operation complete.
>>
>>create procedure TestHive(
+> IN operation char(20),
@@ -230,6 +236,9 @@
>>create library t125_l1 file $$QUOTE$$ $$REGRRUNDIR$$/$$DLL$$ $$QUOTE$$ ;
--- SQL operation complete.
+>>grant usage on library t125_l1 to t125_role1;
+
+--- SQL operation complete.
>>create function translateBitmap(bitmap largeint) returns (bitmap_string char (20))
+>language c parameter style sql external name 'translateBitmap'
+>library t125_l1
@@ -259,6 +268,9 @@
+> file $$QUOTE$$ $$REGRRUNDIR$$/$$JARF$$ $$QUOTE$$;
--- SQL operation complete.
+>>grant all on library t125_l2 to sql_user8;
+
+--- SQL operation complete.
>>
>>create procedure TestHive(
+> IN operation char(20),
@@ -362,6 +374,9 @@
>>create library t125_l1 file $$QUOTE$$ $$REGRRUNDIR$$/$$DLL$$ $$QUOTE$$ ;
--- SQL operation complete.
+>>grant usage on library t125_l1 to t125_role1;
+
+--- SQL operation complete.
>>create function translateBitmap(bitmap largeint) returns (bitmap_string char (20))
+>language c parameter style sql external name 'translateBitmap'
+>library t125_l1
@@ -391,6 +406,9 @@
+> file $$QUOTE$$ $$REGRRUNDIR$$/$$JARF$$ $$QUOTE$$;
--- SQL operation complete.
+>>grant all on library t125_l2 to sql_user8;
+
+--- SQL operation complete.
>>
>>create procedure TestHive(
+> IN operation char(20),
@@ -471,9 +489,12 @@
Privileges for Role T125_ROLE1
==============================
+----G-- TRAFODION.T125SCH1.T125_L1
S------ TRAFODION.T125SCH2.GAMES <Column> GAME_NUMBER
+----G-- TRAFODION.T125SCH2.T125_L1
S------ TRAFODION.T125SCH2.TEAMS <Column> TEAM_NUMBER
SIDU-R- TRAFODION.T125SCH3.PLAYERS
+----G-- TRAFODION.T125SCH3.T125_L1
------E TRAFODION.T125SCH3.TRANSLATEBITMAP
--- SQL operation complete.
@@ -500,13 +521,16 @@ Privileges for User SQL_USER2
------E TRAFODION."_LIBMGR_".JDBC
SIDU-R- TRAFODION.T125SCH1.GAMES
S------ TRAFODION.T125SCH1.GAMES_BY_PLAYER
+----G-- TRAFODION.T125SCH1.T125_L1
SIDU-R- TRAFODION.T125SCH2.GAMES
S------ TRAFODION.T125SCH2.GAMES <Column> GAME_NUMBER
S------ TRAFODION.T125SCH2.GAMES_BY_PLAYER
+----G-- TRAFODION.T125SCH2.T125_L1
S------ TRAFODION.T125SCH2.TEAMS <Column> TEAM_NUMBER
SIDU-R- TRAFODION.T125SCH3.GAMES
S------ TRAFODION.T125SCH3.GAMES_BY_PLAYER
SIDU-R- TRAFODION.T125SCH3.PLAYERS
+----G-- TRAFODION.T125SCH3.T125_L1
------E TRAFODION.T125SCH3.TRANSLATEBITMAP
--- SQL operation complete.
@@ -517,9 +541,12 @@ Privileges for User SQL_USER7
------E TRAFODION."_LIBMGR_".EVENT_LOG_READER
------E TRAFODION."_LIBMGR_".JDBC
+----G-- TRAFODION.T125SCH1.T125_L1
S------ TRAFODION.T125SCH2.GAMES <Column> GAME_NUMBER
+----G-- TRAFODION.T125SCH2.T125_L1
S------ TRAFODION.T125SCH2.TEAMS <Column> TEAM_NUMBER
SIDU-R- TRAFODION.T125SCH3.PLAYERS
+----G-- TRAFODION.T125SCH3.T125_L1
------E TRAFODION.T125SCH3.TRANSLATEBITMAP
--- SQL operation complete.
@@ -530,6 +557,8 @@ Privileges for User SQL_USER8
------E TRAFODION."_LIBMGR_".EVENT_LOG_READER
------E TRAFODION."_LIBMGR_".JDBC
+---UG-- TRAFODION.T125SCH1.T125_L2
+---UG-- TRAFODION.T125SCH2.T125_L2
SIDU-R- TRAFODION.T125SCH3.GAMES
S----R- TRAFODION.T125SCH3.GAMES_BY_PLAYER
S----R- TRAFODION.T125SCH3.HOME_TEAMS_GAMES
@@ -547,6 +576,488 @@ SIDU-R- TRAFODION.T125SCH3.TEAMS
--- SQL operation complete.
>>
+>>set schema t125sch1;
+
+--- SQL operation complete.
+>>obey TEST125(get_privs);
+>>get privileges on table games;
+
+Privileges on Table T125SCH1.GAMES
+==================================
+
+SIDU-R- DB__ROOT
+SIDU-R- SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user2;
+
+Privileges on Table T125SCH1.GAMES
+==================================
+
+SIDU-R- SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user7;
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user8;
+
+--- SQL operation complete.
+>>get privileges on table games for t125_role1;
+
+--- SQL operation complete.
+>>get privileges on table games for t125_adminrole;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player;
+
+Privileges on View T125SCH1.GAMES_BY_PLAYER
+===========================================
+
+S----R- DB__ROOT
+S------ SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user2;
+
+Privileges on View T125SCH1.GAMES_BY_PLAYER
+===========================================
+
+S------ SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user7;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user8;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for t125_role1;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for t125_adminrole;
+
+--- SQL operation complete.
+>>get privileges on library t125_l1;
+
+Privileges on Sequence T125SCH1.T125_L1
+=======================================
+
+---UG-- DB__ROOT
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user2;
+
+Privileges on Sequence T125SCH1.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user7;
+
+Privileges on Sequence T125SCH1.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user8;
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for t125_role1;
+
+Privileges on Sequence T125SCH1.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for t125_adminrole;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence;
+
+Privileges on Sequence T125SCH1.PLAYERS_SEQUENCE
+================================================
+
+----G-- DB__ROOT
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user2;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user7;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user8;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_role1;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_adminrole;
+
+--- SQL operation complete.
+>>
+>>set schema t125sch2;
+
+--- SQL operation complete.
+>>obey TEST125(get_privs);
+>>get privileges on table games;
+
+Privileges on Table T125SCH2.GAMES
+==================================
+
+SIDU-R- DB__ROOT
+SIDU-R- SQL_USER2
+S------ T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user2;
+
+Privileges on Table T125SCH2.GAMES
+==================================
+
+SIDU-R- SQL_USER2
+S------ T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user7;
+
+Privileges on Table T125SCH2.GAMES
+==================================
+
+S------ T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user8;
+
+--- SQL operation complete.
+>>get privileges on table games for t125_role1;
+
+Privileges on Table T125SCH2.GAMES
+==================================
+
+S------ T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on table games for t125_adminrole;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player;
+
+Privileges on View T125SCH2.GAMES_BY_PLAYER
+===========================================
+
+S----R- DB__ROOT
+S------ SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user2;
+
+Privileges on View T125SCH2.GAMES_BY_PLAYER
+===========================================
+
+S------ SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user7;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user8;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for t125_role1;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for t125_adminrole;
+
+--- SQL operation complete.
+>>get privileges on library t125_l1;
+
+Privileges on Sequence T125SCH2.T125_L1
+=======================================
+
+---UG-- DB__ROOT
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user2;
+
+Privileges on Sequence T125SCH2.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user7;
+
+Privileges on Sequence T125SCH2.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user8;
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for t125_role1;
+
+Privileges on Sequence T125SCH2.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for t125_adminrole;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence;
+
+Privileges on Sequence T125SCH2.PLAYERS_SEQUENCE
+================================================
+
+----G-- DB__ROOT
+----G-- SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user1;
+
+Privileges on Sequence T125SCH2.PLAYERS_SEQUENCE
+================================================
+
+----G-- SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user2;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user7;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user8;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_role1;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_adminrole;
+
+--- SQL operation complete.
+>>
+>>set schema t125sch3;
+
+--- SQL operation complete.
+>>obey TEST125(get_privs);
+>>get privileges on table games;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+-I----- SQL_USER1
+SIDU-R- SQL_USER2
+SIDU-R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user1;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+-I----- SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user2;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+SIDU-R- SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user7;
+
+--- SQL operation complete.
+>>get privileges on table games for sql_user8;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+SIDU-R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on table games for t125_role1;
+
+--- SQL operation complete.
+>>get privileges on table games for t125_adminrole;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+SIDU-R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on view games_by_player;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S------ SQL_USER1
+S------ SQL_USER2
+S----R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user1;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S------ SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user2;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S------ SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user7;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for sql_user8;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S----R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for t125_role1;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for t125_adminrole;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S----R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on library t125_l1;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+---UG-- T125_ADMINROLE
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user2;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user7;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for sql_user8;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+---UG-- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for t125_role1;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for t125_adminrole;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+---UG-- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence;
+
+Privileges on Sequence T125SCH3.PLAYERS_SEQUENCE
+================================================
+
+----G-- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user2;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user7;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for sql_user8;
+
+Privileges on Sequence T125SCH3.PLAYERS_SEQUENCE
+================================================
+
+----G-- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_role1;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_adminrole;
+
+Privileges on Sequence T125SCH3.PLAYERS_SEQUENCE
+================================================
+
+----G-- T125_ADMINROLE
+
+--- SQL operation complete.
+>>
+>>
>>obey TEST125(get_tests);
>>log LOG125;
>>cqd SHOWDDL_DISPLAY_PRIVILEGE_GRANTS 'ON';
@@ -779,6 +1290,19 @@ SB_PERSISTENT_SAMPLES
TEAMS
--- SQL operation complete.
+>>get privileges on table games;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+-I----- SQL_USER1
+SIDU-R- SQL_USER2
+SIDU-R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on table games for t125_role1;
+
+--- SQL operation complete.
>>get views in catalog trafodion, match 'T125SCH%';
Views in Catalog TRAFODION
@@ -795,6 +1319,24 @@ T125SCH3.HOME_TEAMS_GAMES
T125SCH3.PLAYERS_ON_TEAM
--- SQL operation complete.
+>>get privileges on view games_by_player;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S------ SQL_USER1
+S------ SQL_USER2
+S----R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for user sql_user8;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S----R- T125_ADMINROLE
+
+--- SQL operation complete.
>>get indexes in schema t125sch3;
Indexes in Schema TRAFODION.T125SCH3
@@ -813,6 +1355,17 @@ T125SCH2.PLAYERS_SEQUENCE
T125SCH3.PLAYERS_SEQUENCE
--- SQL operation complete.
+>>get privileges on sequence players_sequence;
+
+Privileges on Sequence T125SCH3.PLAYERS_SEQUENCE
+================================================
+
+----G-- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_role1;
+
+--- SQL operation complete.
>>get libraries, match 'T125%';
Libraries in Schema TRAFODION.T125SCH3
@@ -822,6 +1375,23 @@ T125_L1
T125_L2
--- SQL operation complete.
+>>get privileges on library t125_l1;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+---UG-- T125_ADMINROLE
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for user sql_user8;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+---UG-- T125_ADMINROLE
+
+--- SQL operation complete.
>>get functions in schema t125sch3;
Functions in Schema TRAFODION.T125SCH3
@@ -880,6 +1450,8 @@ SQL_USER8
Schemas in Catalog TRAFODION
============================
+T125SCH1
+T125SCH2
T125SCH3
--- SQL operation complete.
@@ -975,6 +1547,17 @@ SB_PERSISTENT_SAMPLES
TEAMS
--- SQL operation complete.
+>>get privileges on table games;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+SIDU-R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on table games for t125_role1;
+
+--- SQL operation complete.
>>get views in catalog trafodion, match 'T125SCH%';
Views in Catalog TRAFODION
@@ -985,6 +1568,22 @@ T125SCH3.HOME_TEAMS_GAMES
T125SCH3.PLAYERS_ON_TEAM
--- SQL operation complete.
+>>get privileges on view games_by_player;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S----R- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for user sql_user8;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S----R- T125_ADMINROLE
+
+--- SQL operation complete.
>>get indexes in schema t125sch3;
--- SQL operation complete.
@@ -996,6 +1595,17 @@ Sequences in catalog TRAFODION
T125SCH3.PLAYERS_SEQUENCE
--- SQL operation complete.
+>>get privileges on sequence players_sequence;
+
+Privileges on Sequence T125SCH3.PLAYERS_SEQUENCE
+================================================
+
+----G-- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_role1;
+
+--- SQL operation complete.
>>get libraries, match 'T125%';
Libraries in Schema TRAFODION.T125SCH3
@@ -1005,6 +1615,22 @@ T125_L1
T125_L2
--- SQL operation complete.
+>>get privileges on library t125_l1;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+---UG-- T125_ADMINROLE
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for user sql_user8;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+---UG-- T125_ADMINROLE
+
+--- SQL operation complete.
>>get functions in schema t125sch3;
Functions in Schema TRAFODION.T125SCH3
@@ -1169,6 +1795,17 @@ Tables in Schema TRAFODION.T125SCH3
GAMES
--- SQL operation complete.
+>>get privileges on table games;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+-I----- SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on table games for t125_role1;
+
+--- SQL operation complete.
>>get views in catalog trafodion, match 'T125SCH%';
Views in Catalog TRAFODION
@@ -1177,6 +1814,17 @@ Views in Catalog TRAFODION
T125SCH3.GAMES_BY_PLAYER
--- SQL operation complete.
+>>get privileges on view games_by_player;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S------ SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for user sql_user8;
+
+--- SQL operation complete.
>>get indexes in schema t125sch3;
--- SQL operation complete.
@@ -1188,9 +1836,21 @@ Sequences in catalog TRAFODION
T125SCH2.PLAYERS_SEQUENCE
--- SQL operation complete.
+>>get privileges on sequence players_sequence;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_role1;
+
+--- SQL operation complete.
>>get libraries, match 'T125%';
--- SQL operation complete.
+>>get privileges on library t125_l1;
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for user sql_user8;
+
+--- SQL operation complete.
>>get functions in schema t125sch3;
--- SQL operation complete.
@@ -1356,6 +2016,17 @@ GAMES
PLAYERS
--- SQL operation complete.
+>>get privileges on table games;
+
+Privileges on Table T125SCH3.GAMES
+==================================
+
+SIDU-R- SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on table games for t125_role1;
+
+--- SQL operation complete.
>>get views in catalog trafodion, match 'T125SCH%';
Views in Catalog TRAFODION
@@ -1366,12 +2037,29 @@ T125SCH2.GAMES_BY_PLAYER
T125SCH3.GAMES_BY_PLAYER
--- SQL operation complete.
+>>get privileges on view games_by_player;
+
+Privileges on View T125SCH3.GAMES_BY_PLAYER
+===========================================
+
+S------ SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for user sql_user8;
+
+--- SQL operation complete.
>>get indexes in schema t125sch3;
--- SQL operation complete.
>>get sequences in catalog trafodion, match 'T125SCH%';
--- SQL operation complete.
+>>get privileges on sequence players_sequence;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_role1;
+
+--- SQL operation complete.
>>get libraries, match 'T125%';
Libraries in Schema TRAFODION.T125SCH3
@@ -1380,6 +2068,17 @@ Libraries in Schema TRAFODION.T125SCH3
T125_L1
--- SQL operation complete.
+>>get privileges on library t125_l1;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for user sql_user8;
+
+--- SQL operation complete.
>>get functions in schema t125sch3;
Functions in Schema TRAFODION.T125SCH3
@@ -1429,6 +2128,7 @@ SQL_USER7
Schemas in Catalog TRAFODION
============================
+T125SCH1
T125SCH2
T125SCH3
@@ -1521,15 +2221,33 @@ Tables in Schema TRAFODION.T125SCH3
PLAYERS
--- SQL operation complete.
+>>get privileges on table games;
+
+--- SQL operation complete.
+>>get privileges on table games for t125_role1;
+
+--- SQL operation complete.
>>get views in catalog trafodion, match 'T125SCH%';
--- SQL operation complete.
+>>get privileges on view games_by_player;
+
+--- SQL operation complete.
+>>get privileges on view games_by_player for user sql_user8;
+
+--- SQL operation complete.
>>get indexes in schema t125sch3;
--- SQL operation complete.
>>get sequences in catalog trafodion, match 'T125SCH%';
--- SQL operation complete.
+>>get privileges on sequence players_sequence;
+
+--- SQL operation complete.
+>>get privileges on sequence players_sequence for t125_role1;
+
+--- SQL operation complete.
>>get libraries, match 'T125%';
Libraries in Schema TRAFODION.T125SCH3
@@ -1538,6 +2256,17 @@ Libraries in Schema TRAFODION.T125SCH3
T125_L1
--- SQL operation complete.
+>>get privileges on library t125_l1;
+
+Privileges on Sequence T125SCH3.T125_L1
+=======================================
+
+----G-- T125_ROLE1
+
+--- SQL operation complete.
+>>get privileges on library t125_l1 for user sql_user8;
+
+--- SQL operation complete.
>>get functions in schema t125sch3;
Functions in Schema TRAFODION.T125SCH3
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/privs1/TEST125
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs1/TEST125 b/core/sql/regress/privs1/TEST125
index de667ea..c29eb36 100644
--- a/core/sql/regress/privs1/TEST125
+++ b/core/sql/regress/privs1/TEST125
@@ -33,6 +33,10 @@
-- get functions, procedures, table mapping functions, libraries (in schema)
-- get privileges on table
-- get privileges on view
+-- get privileges on sequence
+-- get privileges on library
+-- (tests for get privileges on functions, table_mapping functions, and
+-- procedures is part of privs2/TEST144)
--
-- ============================================================================
cqd SHOWDDL_DISPLAY_PRIVILEGE_GRANTS 'ON';
@@ -104,6 +108,13 @@ get privileges for user sql_user2;
get privileges for user sql_user7;
get privileges for user sql_user8;
+set schema t125sch1;
+obey TEST125(get_privs);
+set schema t125sch2;
+obey TEST125(get_privs);
+set schema t125sch3;
+obey TEST125(get_privs);
+
obey TEST125(get_tests);
?section create_db
@@ -167,6 +178,7 @@ set pattern $$DLL$$ etest141.dll;
set pattern $$QUOTE$$ '''';
create library t125_l1 file $$QUOTE$$ $$REGRRUNDIR$$/$$DLL$$ $$QUOTE$$ ;
+grant usage on library t125_l1 to t125_role1;
create function translateBitmap(bitmap largeint) returns (bitmap_string char (20))
language c parameter style sql external name 'translateBitmap'
library t125_l1
@@ -179,6 +191,7 @@ set pattern $$JARF$$ TEST125_procs.jar;
create library t125_l2
file $$QUOTE$$ $$REGRRUNDIR$$/$$JARF$$ $$QUOTE$$;
+grant all on library t125_l2 to sql_user8;
create procedure TestHive(
IN operation char(20),
@@ -192,6 +205,36 @@ create procedure TestHive(
ISOLATE
;
+?section get_privs
+get privileges on table games;
+get privileges on table games for sql_user1;
+get privileges on table games for sql_user2;
+get privileges on table games for sql_user7;
+get privileges on table games for sql_user8;
+get privileges on table games for t125_role1;
+get privileges on table games for t125_adminrole;
+get privileges on view games_by_player;
+get privileges on view games_by_player for sql_user1;
+get privileges on view games_by_player for sql_user2;
+get privileges on view games_by_player for sql_user7;
+get privileges on view games_by_player for sql_user8;
+get privileges on view games_by_player for t125_role1;
+get privileges on view games_by_player for t125_adminrole;
+get privileges on library t125_l1;
+get privileges on library t125_l1 for sql_user1;
+get privileges on library t125_l1 for sql_user2;
+get privileges on library t125_l1 for sql_user7;
+get privileges on library t125_l1 for sql_user8;
+get privileges on library t125_l1 for t125_role1;
+get privileges on library t125_l1 for t125_adminrole;
+get privileges on sequence players_sequence;
+get privileges on sequence players_sequence for sql_user1;
+get privileges on sequence players_sequence for sql_user2;
+get privileges on sequence players_sequence for sql_user7;
+get privileges on sequence players_sequence for sql_user8;
+get privileges on sequence players_sequence for t125_role1;
+get privileges on sequence players_sequence for t125_adminrole;
+
?section clean_up
drop schema t125sch1 cascade;
drop schema t125sch2 cascade;
@@ -243,10 +286,18 @@ get procedures in schema t125sch2;
set schema t125sch3;
get tables;
+get privileges on table games;
+get privileges on table games for t125_role1;
get views in catalog trafodion, match 'T125SCH%';
+get privileges on view games_by_player;
+get privileges on view games_by_player for user sql_user8;
get indexes in schema t125sch3;
get sequences in catalog trafodion, match 'T125SCH%';
+get privileges on sequence players_sequence;
+get privileges on sequence players_sequence for t125_role1;
get libraries, match 'T125%';
+get privileges on library t125_l1;
+get privileges on library t125_l1 for user sql_user8;
get functions in schema t125sch3;
get procedures;
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/privs2/EXPECTED144
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs2/EXPECTED144 b/core/sql/regress/privs2/EXPECTED144
index 6beefa1..d25b4a8 100644
--- a/core/sql/regress/privs2/EXPECTED144
+++ b/core/sql/regress/privs2/EXPECTED144
@@ -130,6 +130,18 @@ CREATE TABLE TRAFODION.T144USER1.CUSTOMERS
--- SQL operation complete.
>>
+>>revoke component privilege "SHOW" on sql_operations from "PUBLIC";
+
+--- SQL operation complete.
+>>get privileges on component sql_operations for "PUBLIC";
+
+Privilege information on Component SQL_OPERATIONS for PUBLIC
+============================================================
+
+CREATE_SCHEMA
+
+--- SQL operation complete.
+>>
>>obey TEST144(set_up);
>>set schema "_PRIVMGR_MD_";
@@ -176,8 +188,70 @@ T144_TRANSLATEP 333
_TRAFODION_T144 -2 33334 ----G-- ----G--
--- 10 row(s) selected.
+>>get privileges on function gen_phone;
+
+Privileges on Routine T144USER1.GEN_PHONE
+=========================================
+
+------E SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on function gen_random;
+
+Privileges on Routine T144USER1.GEN_RANDOM
+==========================================
+
+------E SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on function gen_time;
+
+Privileges on Routine T144USER1.GEN_TIME
+========================================
+
+------E SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on procedure "_LIBMGR_".help;
+
+Privileges on Routine _LIBMGR_.HELP
+===================================
+
+------E DB__LIBMGRROLE
+------E DB__ROOT
+
+--- SQL operation complete.
+>>get privileges on table_mapping function "_LIBMGR_".event_log_reader;
+
+Privileges on Routine _LIBMGR_.EVENT_LOG_READER
+===============================================
+
+------E DB__ROOT
+------E PUBLIC
+
+--- SQL operation complete.
>>
->>-- user1 owns the udfs but does not have execute on procedure help
+>>-- user1 can execute udfs (as owner), but cannot execute procedure help,
+>>-- can execute table_mapping function event_log_reader through public grant
+>>get privileges on function gen_phone for sql_user1;
+
+Privileges on Routine T144USER1.GEN_PHONE
+=========================================
+
+------E SQL_USER1
+
+--- SQL operation complete.
+>>get privileges on procedure "_LIBMGR_".help for sql_user1;
+
+--- SQL operation complete.
+>>get privileges on table_mapping function "_LIBMGR_".event_log_reader for sql_user1;
+
+Privileges on Routine _LIBMGR_.EVENT_LOG_READER
+===============================================
+
+------E PUBLIC
+
+--- SQL operation complete.
>>sh sqlci -i "TEST144(cmds)" -u sql_user1;
>>values (user);
@@ -190,6 +264,24 @@ SQL_USER1
>>set schema t144user1;
--- SQL operation complete.
+>>-- should return privileges only for users that have execute privilege
+>>get privileges on function gen_time;
+
+Privileges on Routine T144USER1.GEN_TIME
+========================================
+
+------E SQL_USER1
+
+--- SQL operation complete.
+>>-- should return no rows for users other than sql_user1
+>>get privileges on function gen_random for sql_user1;
+
+Privileges on Routine T144USER1.GEN_RANDOM
+==========================================
+
+------E SQL_USER1
+
+--- SQL operation complete.
>>select customer_id,
+> 'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
+> customer_areacode
@@ -271,6 +363,14 @@ SQL_USER2
>>set schema t144user1;
--- SQL operation complete.
+>>-- should return privileges only for users that have execute privilege
+>>get privileges on function gen_time;
+
+--- SQL operation complete.
+>>-- should return no rows for users other than sql_user1
+>>get privileges on function gen_random for sql_user1;
+
+--- SQL operation complete.
>>select customer_id,
+> 'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
+> customer_areacode
@@ -332,6 +432,14 @@ SQL_USER3
>>set schema t144user1;
--- SQL operation complete.
+>>-- should return privileges only for users that have execute privilege
+>>get privileges on function gen_time;
+
+--- SQL operation complete.
+>>-- should return no rows for users other than sql_user1
+>>get privileges on function gen_random for sql_user1;
+
+--- SQL operation complete.
>>select customer_id,
+> 'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
+> customer_areacode
@@ -393,6 +501,14 @@ SQL_USER4
>>set schema t144user1;
--- SQL operation complete.
+>>-- should return privileges only for users that have execute privilege
+>>get privileges on function gen_time;
+
+--- SQL operation complete.
+>>-- should return no rows for users other than sql_user1
+>>get privileges on function gen_random for sql_user1;
+
+--- SQL operation complete.
>>select customer_id,
+> 'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
+> customer_areacode
@@ -456,6 +572,38 @@ End of MXCI Session
>>grant execute on procedure "_LIBMGR_".help to sql_user2 with grant option;
--- SQL operation complete.
+>>get privileges on function gen_phone for sql_user2;
+
+Privileges on Routine T144USER1.GEN_PHONE
+=========================================
+
+------E SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on function gen_random for sql_user2;
+
+Privileges on Routine T144USER1.GEN_RANDOM
+==========================================
+
+------E SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on function gen_time for user sql_user2;
+
+Privileges on Routine T144USER1.GEN_TIME
+========================================
+
+------E SQL_USER2
+
+--- SQL operation complete.
+>>get privileges on procedure "_LIBMGR_".help for user sql_user2;
+
+Privileges on Routine _LIBMGR_.HELP
+===================================
+
+------E SQL_USER2
+
+--- SQL operation complete.
>>execute get_privs;
OBJECT_NAME GRANTOR_ID GRANTEE_ID GRANTED_PRIVS GRANTABLE_PRIVS
@@ -477,6 +625,7 @@ _TRAFODION_T144
--- 13 row(s) selected.
>>
+>>
>>-- user2 can execute
>>sh sqlci -i "TEST144(cmds)" -u sql_user2;
>>values (user);
@@ -490,6 +639,19 @@ SQL_USER2
>>set schema t144user1;
--- SQL operation complete.
+>>-- should return privileges only for users that have execute privilege
+>>get privileges on function gen_time;
+
+Privileges on Routine T144USER1.GEN_TIME
+========================================
+
+------E SQL_USER2
+
+--- SQL operation complete.
+>>-- should return no rows for users other than sql_user1
+>>get privileges on function gen_random for sql_user1;
+
+--- SQL operation complete.
>>select customer_id,
+> 'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
+> customer_areacode
@@ -573,6 +735,14 @@ SQL_USER3
>>set schema t144user1;
--- SQL operation complete.
+>>-- should return privileges only for users that have execute privilege
+>>get privileges on function gen_time;
+
+--- SQL operation complete.
+>>-- should return no rows for users other than sql_user1
+>>get privileges on function gen_random for sql_user1;
+
+--- SQL operation complete.
>>select customer_id,
+> 'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
+> customer_areacode
@@ -640,6 +810,33 @@ End of MXCI Session
*** ERROR[1012] No privileges were granted. SQL_USER2 lacks grant option on the specified privileges.
--- SQL operation failed with errors.
+>>get privileges on function gen_phone for user sql_user3;
+
+Privileges on Routine T144USER1.GEN_PHONE
+=========================================
+
+------E SQL_USER3
+
+--- SQL operation complete.
+>>get privileges on function gen_random for user sql_user3;
+
+Privileges on Routine T144USER1.GEN_RANDOM
+==========================================
+
+------E SQL_USER3
+
+--- SQL operation complete.
+>>get privileges on function gen_time for user sql_user3;
+
+--- SQL operation complete.
+>>get privileges on procedure "_LIBMGR_".help for user sql_user3;
+
+Privileges on Routine _LIBMGR_.HELP
+===================================
+
+------E SQL_USER3
+
+--- SQL operation complete.
>>execute get_privs;
OBJECT_NAME GRANTOR_ID GRANTEE_ID GRANTED_PRIVS GRANTABLE_PRIVS
@@ -676,6 +873,14 @@ SQL_USER3
>>set schema t144user1;
--- SQL operation complete.
+>>-- should return privileges only for users that have execute privilege
+>>get privileges on function gen_time;
+
+--- SQL operation complete.
+>>-- should return no rows for users other than sql_user1
+>>get privileges on function gen_random for sql_user1;
+
+--- SQL operation complete.
>>select customer_id,
+> 'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
+> customer_areacode
@@ -762,6 +967,41 @@ End of MXCI Session
>>grant role t144role1 to sql_user4;
--- SQL operation complete.
+>>get privileges on function gen_phone for user sql_user4;
+
+--- SQL operation complete.
+>>get privileges on function gen_random for user sql_user4;
+
+Privileges on Routine T144USER1.GEN_RANDOM
+==========================================
+
+------E T144ROLE1
+
+--- SQL operation complete.
+>>get privileges on function gen_time for user sql_user4;
+
+Privileges on Routine T144USER1.GEN_TIME
+========================================
+
+------E T144ROLE1
+
+--- SQL operation complete.
+>>get privileges on procedure "_LIBMGR_".help for user sql_user4;
+
+Privileges on Routine _LIBMGR_.HELP
+===================================
+
+------E T144ROLE1
+
+--- SQL operation complete.
+>>get privileges on function gen_random for t144role1;
+
+Privileges on Routine T144USER1.GEN_RANDOM
+==========================================
+
+------E T144ROLE1
+
+--- SQL operation complete.
>>execute get_privs;
OBJECT_NAME GRANTOR_ID GRANTEE_ID GRANTED_PRIVS GRANTABLE_PRIVS
@@ -801,6 +1041,19 @@ SQL_USER4
>>set schema t144user1;
--- SQL operation complete.
+>>-- should return privileges only for users that have execute privilege
+>>get privileges on function gen_time;
+
+Privileges on Routine T144USER1.GEN_TIME
+========================================
+
+------E T144ROLE1
+
+--- SQL operation complete.
+>>-- should return no rows for users other than sql_user1
+>>get privileges on function gen_random for sql_user1;
+
+--- SQL operation complete.
>>select customer_id,
+> 'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
+> customer_areacode
@@ -861,6 +1114,50 @@ RM - Remove a library file. SHOWDDL PROCEDURE [SCHEMA NAME.]RM for more info.
End of MXCI Session
>>
+>>get privileges on function gen_phone;
+
+Privileges on Routine T144USER1.GEN_PHONE
+=========================================
+
+------E SQL_USER1
+------E SQL_USER2
+------E SQL_USER3
+------E SQL_USER5
+
+--- SQL operation complete.
+>>get privileges on function gen_random;
+
+Privileges on Routine T144USER1.GEN_RANDOM
+==========================================
+
+------E SQL_USER1
+------E SQL_USER2
+------E SQL_USER3
+------E T144ROLE1
+
+--- SQL operation complete.
+>>get privileges on function gen_time;
+
+Privileges on Routine T144USER1.GEN_TIME
+========================================
+
+------E SQL_USER1
+------E SQL_USER2
+------E T144ROLE1
+
+--- SQL operation complete.
+>>get privileges on procedure "_LIBMGR_".help;
+
+Privileges on Routine _LIBMGR_.HELP
+===================================
+
+------E DB__LIBMGRROLE
+------E DB__ROOT
+------E SQL_USER2
+------E SQL_USER3
+------E T144ROLE1
+
+--- SQL operation complete.
>>obey TEST144(test_revokes);
>>-- ============================================================================
>>-- verify that revoking privileges handle EXECUTE privilege correctly
@@ -919,7 +1216,7 @@ _TRAFODION_T144
--- SQL operation complete.
>>drop role t144role1;
-*** ERROR[1228] Cannot drop role. Role T144ROLE1 has been granted privileges on TRAFODION.T144USER1.GEN_RANDOM.
+*** ERROR[1228] Cannot drop role. Role T144ROLE1 has been granted privileges on TRAFODION._LIBMGR_.HELP.
--- SQL operation failed with errors.
>>revoke execute on function gen_random from t144role1;
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/privs2/EXPECTED146
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs2/EXPECTED146 b/core/sql/regress/privs2/EXPECTED146
index 2baa2f8..7bf43b0 100644
--- a/core/sql/regress/privs2/EXPECTED146
+++ b/core/sql/regress/privs2/EXPECTED146
@@ -50,6 +50,10 @@
--- SQL operation complete.
>>
+>>create hbase table t146t3 ( column family 'cf');
+
+--- SQL operation complete.
+>>
>>-- These operations are not allowed on hbase tables
>>update hbase."_CELL_".t146t1 set col_value = '4' where row_id = '2' and col_name = 'visitor_team';
@@ -87,7 +91,7 @@ CREATE TABLE HBASE."_CELL_".T146T1
CREATE HBASE TABLE T146T1 ( COLUMN FAMILY '#1')
REGISTER /*INTERNAL*/ HBASE TABLE T146T1;
-/* ObjectUID = 2009891765934276385 */
+/* ObjectUID = 7181713655023564985 */
-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON HBASE."_CELL_".T146T1 TO DB__HBASEROLE WITH GRANT OPTION;
@@ -110,7 +114,7 @@ CREATE TABLE HBASE."_ROW_".T146T1
CREATE HBASE TABLE T146T1 ( COLUMN FAMILY '#1')
REGISTER /*INTERNAL*/ HBASE TABLE T146T1;
-/* ObjectUID = 2009891765934276410 */
+/* ObjectUID = 7181713655023565067 */
-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON HBASE."_ROW_".T146T1 TO DB__HBASEROLE WITH GRANT OPTION;
@@ -138,7 +142,9 @@ HBase Registered Tables in Catalog TRAFODION
============================================
"_CELL_".T146T1
+"_CELL_".T146T3
"_ROW_".T146T1
+"_ROW_".T146T3
--- SQL operation complete.
>>
@@ -163,6 +169,15 @@ Privilege information on Component SQL_OPERATIONS for PUBLIC
CREATE_SCHEMA
--- SQL operation complete.
+>>get external hbase objects, match '%T146%';
+
+External HBase objects
+======================
+
+T146T1
+T146T3
+
+--- SQL operation complete.
>>
>>obey TEST146(test_grants);
>>-- =================================================================
@@ -291,7 +306,7 @@ CREATE TABLE HBASE."_CELL_".T146T1
CREATE HBASE TABLE T146T1 ( COLUMN FAMILY '#1')
REGISTER /*INTERNAL*/ HBASE TABLE T146T1;
-/* ObjectUID = 2009891765934276385 */
+/* ObjectUID = 7181713655023564985 */
-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON HBASE."_CELL_".T146T1 TO DB__HBASEROLE WITH GRANT OPTION;
GRANT SELECT ON HBASE."_CELL_".T146T1 TO SQL_USER3 GRANTED BY DB__HBASEROLE;
@@ -319,7 +334,7 @@ CREATE TABLE HBASE."_ROW_".T146T1
CREATE HBASE TABLE T146T1 ( COLUMN FAMILY '#1')
REGISTER /*INTERNAL*/ HBASE TABLE T146T1;
-/* ObjectUID = 2009891765934276410 */
+/* ObjectUID = 7181713655023565067 */
-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON HBASE."_ROW_".T146T1 TO DB__HBASEROLE WITH GRANT OPTION;
GRANT SELECT ON HBASE."_ROW_".T146T1 TO SQL_USER3 GRANTED BY DB__HBASEROLE;
@@ -492,6 +507,18 @@ ROW_ID COL_VALUE
--- 6 row(s) selected.
>>
+>>get external hbase objects, match '%T146%';
+
+--- SQL operation complete.
+>>get hbase registered tables in catalog trafodion, match '%T146%';
+
+HBase Registered Tables in Catalog TRAFODION
+============================================
+
+"_CELL_".T146T1
+"_ROW_".T146T1
+
+--- SQL operation complete.
>>exit;
End of MXCI Session
@@ -630,6 +657,18 @@ ROW_ID COL_VALUE
--- 6 row(s) selected.
>>
+>>get external hbase objects, match '%T146%';
+
+--- SQL operation complete.
+>>get hbase registered tables in catalog trafodion, match '%T146%';
+
+HBase Registered Tables in Catalog TRAFODION
+============================================
+
+"_CELL_".T146T1
+"_ROW_".T146T1
+
+--- SQL operation complete.
>>exit;
End of MXCI Session
@@ -773,6 +812,18 @@ ROW_ID COL_VALUE
--- 6 row(s) selected.
>>
+>>get external hbase objects, match '%T146%';
+
+--- SQL operation complete.
+>>get hbase registered tables in catalog trafodion, match '%T146%';
+
+HBase Registered Tables in Catalog TRAFODION
+============================================
+
+"_CELL_".T146T1
+"_ROW_".T146T1
+
+--- SQL operation complete.
>>exit;
End of MXCI Session
@@ -877,6 +928,12 @@ SQL_USER4
*** ERROR[15017] Statement S1 was not found.
>>
+>>get external hbase objects, match '%T146%';
+
+--- SQL operation complete.
+>>get hbase registered tables in catalog trafodion, match '%T146%';
+
+--- SQL operation complete.
>>exit;
End of MXCI Session
@@ -1018,6 +1075,26 @@ ROW_ID COL_VALUE
--- 6 row(s) selected.
>>
+>>get external hbase objects, match '%T146%';
+
+External HBase objects
+======================
+
+T146T1
+T146T3
+
+--- SQL operation complete.
+>>get hbase registered tables in catalog trafodion, match '%T146%';
+
+HBase Registered Tables in Catalog TRAFODION
+============================================
+
+"_CELL_".T146T1
+"_CELL_".T146T3
+"_ROW_".T146T1
+"_ROW_".T146T3
+
+--- SQL operation complete.
>>exit;
End of MXCI Session
@@ -1172,6 +1249,18 @@ ROW_ID COL_VALUE
--- 6 row(s) selected.
>>
+>>get external hbase objects, match '%T146%';
+
+--- SQL operation complete.
+>>get hbase registered tables in catalog trafodion, match '%T146%';
+
+HBase Registered Tables in Catalog TRAFODION
+============================================
+
+"_CELL_".T146T1
+"_ROW_".T146T1
+
+--- SQL operation complete.
>>exit;
End of MXCI Session
@@ -1279,6 +1368,12 @@ SQL_USER1
*** ERROR[15017] Statement S1 was not found.
>>
+>>get external hbase objects, match '%T146%';
+
+--- SQL operation complete.
+>>get hbase registered tables in catalog trafodion, match '%T146%';
+
+--- SQL operation complete.
>>exit;
End of MXCI Session
@@ -1419,6 +1514,17 @@ ROW_ID COL_VALUE
--- 6 row(s) selected.
>>
+>>get external hbase objects, match '%T146%';
+
+--- SQL operation complete.
+>>get hbase registered tables in catalog trafodion, match '%T146%';
+
+HBase Registered Tables in Catalog TRAFODION
+============================================
+
+"_CELL_".T146T1
+
+--- SQL operation complete.
>>exit;
End of MXCI Session
@@ -1473,8 +1579,10 @@ Privileges for Role DB__HBASEROLE
SIDU-R- HBASE._CELL_.T146T1
SIDU-R- HBASE._CELL_.T146T2
+SIDU-R- HBASE._CELL_.T146T3
SIDU-R- HBASE._ROW_.T146T1
SIDU-R- HBASE._ROW_.T146T2
+SIDU-R- HBASE._ROW_.T146T3
SIDU-R- TRAFODION._HB_MAP_.T146T1
SIDU-R- TRAFODION._HB_MAP_.T146T2
@@ -1489,7 +1597,9 @@ Privileges for Role DB__HBASEROLE
=================================
SIDU-R- HBASE._CELL_.T146T1
+SIDU-R- HBASE._CELL_.T146T3
SIDU-R- HBASE._ROW_.T146T1
+SIDU-R- HBASE._ROW_.T146T3
SIDU-R- TRAFODION._HB_MAP_.T146T1
--- SQL operation complete.
@@ -1605,8 +1715,10 @@ Privileges for Role DB__HBASEROLE
SIDU-R- HBASE._CELL_.T146T1
SIDU-R- HBASE._CELL_.T146T2
+SIDU-R- HBASE._CELL_.T146T3
SIDU-R- HBASE._ROW_.T146T1
SIDU-R- HBASE._ROW_.T146T2
+SIDU-R- HBASE._ROW_.T146T3
SIDU-R- TRAFODION._HB_MAP_.T146T1
SIDU-R- TRAFODION._HB_MAP_.T146T2
@@ -1621,7 +1733,9 @@ Privileges for Role DB__HBASEROLE
=================================
SIDU-R- HBASE._CELL_.T146T1
+SIDU-R- HBASE._CELL_.T146T3
SIDU-R- HBASE._ROW_.T146T1
+SIDU-R- HBASE._ROW_.T146T3
SIDU-R- TRAFODION._HB_MAP_.T146T1
--- SQL operation complete.
@@ -1652,5 +1766,8 @@ End of MXCI Session
*** WARNING[1004] Object T146T2 does not exist or object type is invalid for the current operation.
--- SQL operation complete.
+>>drop hbase table t146t3;
+
+--- SQL operation complete.
>>
>>log;
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/privs2/TEST144
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs2/TEST144 b/core/sql/regress/privs2/TEST144
index fd971cf..910e120 100755
--- a/core/sql/regress/privs2/TEST144
+++ b/core/sql/regress/privs2/TEST144
@@ -48,6 +48,7 @@ revoke execute on procedure "_LIBMGR_".help from sql_user5 by sql_user3;
revoke execute on procedure "_LIBMGR_".help from sql_user3 by sql_user2;
revoke execute on procedure "_LIBMGR_".help from sql_user2;
+grant component privilege "SHOW" on sql_operations to "PUBLIC";
?section create_db
create schema t144user1 authorization sql_user1;
set schema t144user1;
@@ -114,6 +115,9 @@ grant select, insert on customers to "PUBLIC";
showddl customers;
create role t144role1;
+revoke component privilege "SHOW" on sql_operations from "PUBLIC";
+get privileges on component sql_operations for "PUBLIC";
+
?section set_up
set schema "_PRIVMGR_MD_";
prepare get_privs from
@@ -138,8 +142,17 @@ order by 1, 2, 3, 4
-- =================================================================
set schema t144user1;
execute get_privs;
-
--- user1 owns the udfs but does not have execute on procedure help
+get privileges on function gen_phone;
+get privileges on function gen_random;
+get privileges on function gen_time;
+get privileges on procedure "_LIBMGR_".help;
+get privileges on table_mapping function "_LIBMGR_".event_log_reader;
+
+-- user1 can execute udfs (as owner), but cannot execute procedure help,
+-- can execute table_mapping function event_log_reader through public grant
+get privileges on function gen_phone for sql_user1;
+get privileges on procedure "_LIBMGR_".help for sql_user1;
+get privileges on table_mapping function "_LIBMGR_".event_log_reader for sql_user1;
sh sqlci -i "TEST144(cmds)" -u sql_user1;
-- no other user or role has privileges
@@ -152,8 +165,13 @@ grant execute on function gen_phone to sql_user2 with grant option;
grant execute on function gen_random to sql_user2 with grant option;
grant execute on function gen_time to sql_user2;
grant execute on procedure "_LIBMGR_".help to sql_user2 with grant option;
+get privileges on function gen_phone for sql_user2;
+get privileges on function gen_random for sql_user2;
+get privileges on function gen_time for user sql_user2;
+get privileges on procedure "_LIBMGR_".help for user sql_user2;
execute get_privs;
+
-- user2 can execute
sh sqlci -i "TEST144(cmds)" -u sql_user2;
@@ -167,6 +185,10 @@ grant execute on procedure "_LIBMGR_".help to sql_user3 by sql_user2;
-- user2 does not have WGO on gen_time
grant execute on function gen_time to sql_user3 by sql_user2;
+get privileges on function gen_phone for user sql_user3;
+get privileges on function gen_random for user sql_user3;
+get privileges on function gen_time for user sql_user3;
+get privileges on procedure "_LIBMGR_".help for user sql_user3;
execute get_privs;
-- user 3 can execute gen_phone, gen_random, and help but not gen_time
@@ -179,11 +201,20 @@ grant execute on function gen_random to t144role1;
grant execute on function gen_time to t144role1;
grant execute on procedure "_LIBMGR_".help to t144role1;
grant role t144role1 to sql_user4;
+get privileges on function gen_phone for user sql_user4;
+get privileges on function gen_random for user sql_user4;
+get privileges on function gen_time for user sql_user4;
+get privileges on procedure "_LIBMGR_".help for user sql_user4;
+get privileges on function gen_random for t144role1;
execute get_privs;
-- user4 can execute through role t144role1
sh sqlci -i "TEST144(cmds)" -u sql_user4;
+get privileges on function gen_phone;
+get privileges on function gen_random;
+get privileges on function gen_time;
+get privileges on procedure "_LIBMGR_".help;
?section test_revokes
-- ============================================================================
-- verify that revoking privileges handle EXECUTE privilege correctly
@@ -223,6 +254,10 @@ execute get_privs;
log LOG144;
values (user);
set schema t144user1;
+-- should return privileges only for users that have execute privilege
+get privileges on function gen_time;
+-- should return no rows for users other than sql_user1
+get privileges on function gen_random for sql_user1;
select customer_id,
'PHONE: ' || gen_phone(customer_id, customer_areacode) as phone,
customer_areacode
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/privs2/TEST146
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs2/TEST146 b/core/sql/regress/privs2/TEST146
index 9f3f6d0..124aa9f 100755
--- a/core/sql/regress/privs2/TEST146
+++ b/core/sql/regress/privs2/TEST146
@@ -59,6 +59,7 @@ drop external table if exists t146t1;
drop hbase table t146t1;
drop hbase table t146t2;
+drop hbase table t146t3;
drop role t146_role1;
revoke role db__hbaserole from sql_user5;
@@ -87,6 +88,8 @@ create external table t146t1
attribute default column family 'cf'
map to hbase table t146t1;
+create hbase table t146t3 ( column family 'cf');
+
-- These operations are not allowed on hbase tables
update hbase."_CELL_".t146t1 set col_value = '4' where row_id = '2' and col_name = 'visitor_team';
delete from hbase."_CELL_".t146t1 where row_id = '3';
@@ -102,6 +105,7 @@ grant role db__hbaserole to sql_user5;
revoke component privilege "SHOW" on sql_operations from "PUBLIC";
get privileges on component sql_operations for "PUBLIC";
+get external hbase objects, match '%T146%';
?section test_grants
-- =================================================================
@@ -168,6 +172,7 @@ create hbase table t146t2 ( column family 'cf');
drop hbase table t146t2;
drop hbase table t146t2;
+drop hbase table t146t3;
?section perform_ddl
-- ============================================================================
@@ -246,3 +251,5 @@ execute s1;
delete from hbase."_ROW_".t146t1 where row_id = '3';
execute s1;
+get external hbase objects, match '%T146%';
+get hbase registered tables in catalog trafodion, match '%T146%';
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/sqlci/sqlci_lex.ll
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/sqlci_lex.ll b/core/sql/sqlci/sqlci_lex.ll
index 40d891a..ac4376d 100755
--- a/core/sql/sqlci/sqlci_lex.ll
+++ b/core/sql/sqlci/sqlci_lex.ll
@@ -271,8 +271,6 @@ B [ \t\n]+
[Ss][Hh][Oo][Ww] return_IDENT_or_TOKEN(SHOW, 0);
[Ss][Hh][Oo][Ww][Cc][Oo][Nn][Tt][Rr][Oo][Ll] return_IDENT_or_TOKEN(SHOWCONTROL, 0);
[Ss][Hh][Oo][Ww][Dd][Dd][Ll] return_IDENT_or_TOKEN(SHOWDDL, 0);
-[Ss][Hh][Oo][Ww][Ll][Aa][Bb][Ee][Ll] return_IDENT_or_TOKEN(SHOWLABEL, 0);
-[Ss][Hh][Oo][Ww][Ll][Ee][Aa][Kk][Ss] return_IDENT_or_TOKEN(SHOWLEAKS, 0);
[Ss][Hh][Oo][Ww][Pp][Ll][Aa][Nn] return_IDENT_or_TOKEN(SHOWPLAN, 0);
[Ss][Hh][Oo][Ww][Ss][Hh][Aa][Pp][Ee] return_IDENT_or_TOKEN(SHOWSHAPE, 0);
[Ss][Hh][Oo][Ww][Ss][Ee][Tt] return_IDENT_or_TOKEN(SHOWSET, 0);
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/sqlci/sqlci_yacc.y
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/sqlci_yacc.y b/core/sql/sqlci/sqlci_yacc.y
index 33e926a..dc97892 100644
--- a/core/sql/sqlci/sqlci_yacc.y
+++ b/core/sql/sqlci/sqlci_yacc.y
@@ -460,8 +460,6 @@ static char * FCString (const char *idString, int isFC)
%token SHOW
%token SHOWCONTROL
%token SHOWDDL
-%token SHOWLABEL
-%token SHOWLEAKS
%token SHOWPLAN
%token SHOWSHAPE
%token SHOWSET
@@ -1247,14 +1245,6 @@ sql_cmd :
$$ = new DML(SqlciParse_OriginalStr, $1, NULL);
REPOSITION_SqlciParse_InputPos;
}
- | SHOWLEAKS
- { // not ready to log.
- HEAPLOG_CONTROL(LOG_DELETE_ONLY);
- $$ = new DML(SqlciParse_OriginalStr,
- DML_DESCRIBE_TYPE,
- "__SQLCI_DML_SHOWLEAKS__");
- REPOSITION_SqlciParse_InputPos;
- }
| DECLAREtoken IDENTIFIER
{
@@ -1916,7 +1906,6 @@ dml_type :
| UNREGISTER {$$ = DML_DDL_TYPE;}
| SHOWCONTROL {$$ = DML_DESCRIBE_TYPE;}
| SHOWDDL {$$ = DML_DESCRIBE_TYPE;}
- | SHOWLABEL {$$ = DML_DESCRIBE_TYPE;}
| SHOWSTATS {$$ = DML_DESCRIBE_TYPE;}
| SHOWTRANSACTION {$$ = DML_DESCRIBE_TYPE;}
| INVOKE {$$ = DML_DESCRIBE_TYPE;}
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp b/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
index 18b1865..3c9939d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
@@ -358,7 +358,7 @@ Int32 CmpSeabaseDDLauth::getUniqueAuthID(
Int32 len = snprintf(buf, 300,
"SELECT [FIRST 1] auth_id FROM (SELECT auth_id, "
"LEAD(auth_id) OVER (ORDER BY auth_id) L FROM %s.%s ) "
- "WHERE L - auth_id > 1 and auth_id >= %d ",
+ "WHERE (L - auth_id > 1 or L is null) and auth_id >= %d ",
MDSchema_.data(),SEABASE_AUTHS, minValue);
assert (len <= 300);
@@ -1207,20 +1207,22 @@ void CmpSeabaseDDLuser::unregisterUser(StmtDDLRegisterUser * pNode)
return;
}
- // User does not own any roles, but may have been granted roles.
NAString privMgrMDLoc;
-
CONCAT_CATSCH(privMgrMDLoc,systemCatalog_.data(),SEABASE_PRIVMGR_SCHEMA);
+
+ // User does not own any roles, but may have been granted roles.
+ if (CmpCommon::context()->isAuthorizationEnabled())
+ {
- PrivMgrRoles role(std::string(MDSchema_.data()),
- std::string(privMgrMDLoc.data()),
- CmpCommon::diags());
+ PrivMgrRoles role(std::string(MDSchema_.data()),
+ std::string(privMgrMDLoc.data()),
+ CmpCommon::diags());
- if (CmpCommon::context()->isAuthorizationEnabled() &&
- role.isUserGrantedAnyRole(getAuthID()))
- {
- *CmpCommon::diags() << DgSqlCode(-CAT_NO_UNREG_USER_GRANTED_ROLES);
- return;
+ if (role.isUserGrantedAnyRole(getAuthID()))
+ {
+ *CmpCommon::diags() << DgSqlCode(-CAT_NO_UNREG_USER_GRANTED_ROLES);
+ return;
+ }
}
// Does user own any objects?
@@ -1249,32 +1251,39 @@ void CmpSeabaseDDLuser::unregisterUser(StmtDDLRegisterUser * pNode)
return;
}
- PrivMgr privMgr(std::string(privMgrMDLoc),CmpCommon::diags());
- std::vector<PrivClass> privClasses;
+ // Is user granted any privileges?
+ if (CmpCommon::context()->isAuthorizationEnabled())
+ {
+ PrivMgr privMgr(std::string(privMgrMDLoc),CmpCommon::diags());
+ std::vector<PrivClass> privClasses;
- privClasses.push_back(PrivClass::ALL);
+ privClasses.push_back(PrivClass::ALL);
- std::vector<int64_t> objectUIDs;
- if (privMgr.isAuthIDGrantedPrivs(getAuthID(),privClasses, objectUIDs))
- {
- NAString objectName = getObjectName(objectUIDs);
- if (objectName.length() > 0)
- {
- *CmpCommon::diags() << DgSqlCode(-CAT_NO_UNREG_USER_HAS_PRIVS)
- << DgString0(dbUserName.data())
- << DgString1(objectName.data());
+ std::vector<int64_t> objectUIDs;
+ if (privMgr.isAuthIDGrantedPrivs(getAuthID(),privClasses, objectUIDs))
+ {
+ NAString objectName = getObjectName(objectUIDs);
+ if (objectName.length() > 0)
+ {
+ *CmpCommon::diags() << DgSqlCode(-CAT_NO_UNREG_USER_HAS_PRIVS)
+ << DgString0(dbUserName.data())
+ << DgString1(objectName.data());
- return;
- }
+ return;
+ }
+ }
}
// remove any component privileges granted to this user
- PrivMgrComponentPrivileges componentPrivileges(privMgrMDLoc.data(),CmpCommon::diags());
- std::string componentUIDString = "1";
- if (!componentPrivileges.dropAllForGrantee(getAuthID()))
+ if (CmpCommon::context()->isAuthorizationEnabled())
{
- UserException excp (NULL, 0);
- throw excp;
+ PrivMgrComponentPrivileges componentPrivileges(privMgrMDLoc.data(),CmpCommon::diags());
+ std::string componentUIDString = "1";
+ if (!componentPrivileges.dropAllForGrantee(getAuthID()))
+ {
+ UserException excp (NULL, 0);
+ throw excp;
+ }
}
// delete the row
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index 46c92b3..234d2d1 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -10246,6 +10246,7 @@ void CmpSeabaseDDL::createNativeHbaseTable(
// or granted the DB__HBASEROLE
if (isAuthorizationEnabled() &&
!ComUser::isRootUserID() &&
+ !ComUser::currentUserHasRole(ROOT_ROLE_ID) &&
!ComUser::currentUserHasRole(HBASE_ROLE_ID))
{
*CmpCommon::diags() << DgSqlCode (-CAT_NOT_AUTHORIZED);
@@ -10336,6 +10337,7 @@ void CmpSeabaseDDL::dropNativeHbaseTable(
// or granted the DB__HBASEROLE
if (isAuthorizationEnabled() &&
!ComUser::isRootUserID() &&
+ !ComUser::currentUserHasRole(ROOT_ROLE_ID) &&
!ComUser::currentUserHasRole(HBASE_ROLE_ID))
{
*CmpCommon::diags() << DgSqlCode (-CAT_NOT_AUTHORIZED);
[2/3] trafodion git commit: TRAFODION-1573: Additional GET commands
for privileges TRAFODION-3074: Failed to register/unregister user when
security disabled
Posted by rm...@apache.org.
TRAFODION-1573: Additional GET commands for privileges
TRAFODION-3074: Failed to register/unregister user when security disabled
TRAFODION-1573 changes:
- Added support for the following commands:
get privileges on <object>
<object>: [LIBRARY | PROCEDURE | FUNCTION | TABLE_MAPPING FUNCTION | SEQUENCE]
- Added support for the FOR CLAUSE on all supported objects
Removed the need to specify keyword 'USER" before username. If USER is
included, then it is ignored.
get privileges on <object> FOR [USER] <user or role name>
<objects>: [TABLES, VIEWS, LIBRARIES, PROCEDURES, FUNCTIONS,
TABLE_MAPPING FUNCTIONS, SEQUENCES]
- The following get command can only be run by DB__ROOT or a user that has been
granted the DB__ROOTROLE or DB__HIVEROLE role
get <objects> in schema hive.xx.xx;
<objects>: [TABLES, OBJECTS, VIEWS]
- The following get command can only be run by DB__ROOT or a user that has been
granted the DB__ROOTROLE or DB__HBASEROLE role
get external hbase objects;
- The following get commands retrieve privilege details from Trafodion metadata;
users can only see objects where they have been granted at least one privilege
get hive registered tables in catalog trafodion;
get hbase registered tables in catalog trafodion;
- get privileges commands now return owner's privileges in output
- Cleaned up code in the parser.
TRAFODION-3074 changes
- register user - fixed query to find next available authID
- unregister user - added checks to not read privilege metadata if authorization
is not enabled
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/88e2a742
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/88e2a742
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/88e2a742
Branch: refs/heads/master
Commit: 88e2a742b019dd8d22c22c79d1b64048395cfdb1
Parents: 609d7a4
Author: Roberta Marton <ro...@apache.org>
Authored: Fri May 18 16:45:06 2018 +0000
Committer: Roberta Marton <ro...@apache.org>
Committed: Fri May 18 16:45:06 2018 +0000
----------------------------------------------------------------------
core/sql/comexe/ComTdbExeUtil.h | 4 +
core/sql/executor/ExExeUtilGet.cpp | 244 ++++++---
core/sql/generator/GenRelExeUtil.cpp | 14 +-
core/sql/parser/ParKeyWords.cpp | 2 -
core/sql/parser/sqlparser.y | 353 +++---------
core/sql/regress/compGeneral/EXPECTEDTOK | 3 +-
core/sql/regress/compGeneral/EXPECTEDTOK2 | 3 +-
core/sql/regress/core/EXPECTED116 | 197 +++++--
core/sql/regress/privs1/EXPECTED125 | 729 +++++++++++++++++++++++++
core/sql/regress/privs1/TEST125 | 51 ++
core/sql/regress/privs2/EXPECTED144 | 301 +++++++++-
core/sql/regress/privs2/EXPECTED146 | 125 ++++-
core/sql/regress/privs2/TEST144 | 39 +-
core/sql/regress/privs2/TEST146 | 7 +
core/sql/sqlci/sqlci_lex.ll | 2 -
core/sql/sqlci/sqlci_yacc.y | 11 -
core/sql/sqlcomp/CmpSeabaseDDLauth.cpp | 69 ++-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 2 +
18 files changed, 1708 insertions(+), 448 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/comexe/ComTdbExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.h b/core/sql/comexe/ComTdbExeUtil.h
index 4716460..ef48954 100644
--- a/core/sql/comexe/ComTdbExeUtil.h
+++ b/core/sql/comexe/ComTdbExeUtil.h
@@ -2522,6 +2522,7 @@ public:
PRIVILEGES_ON_TABLE_,
PRIVILEGES_ON_MV_,
PRIVILEGES_ON_VIEW_,
+ PRIVILEGES_ON_SEQUENCE_,
SYNONYMS_ON_TABLE_,
OBJECTS_ON_TABLE_,
@@ -2559,6 +2560,9 @@ public:
PROCEDURES_FOR_LIBRARY_,
FUNCTIONS_FOR_LIBRARY_,
TABLE_FUNCTIONS_FOR_LIBRARY_,
+ PRIVILEGES_ON_LIBRARY_,
+ PRIVILEGES_ON_PROCEDURE_,
+ PRIVILEGES_ON_ROUTINE_,
COMPONENTS_,
COMPONENT_OPERATIONS_,
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/executor/ExExeUtilGet.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilGet.cpp b/core/sql/executor/ExExeUtilGet.cpp
index 33865fa..163b190 100644
--- a/core/sql/executor/ExExeUtilGet.cpp
+++ b/core/sql/executor/ExExeUtilGet.cpp
@@ -558,8 +558,7 @@ static const QueryString getTrafPrivsOnObject[] =
{" case when bitextract(privileges_bitmap,58,1) = 1 then 'R' else '-' end || "},
{" case when bitextract(privileges_bitmap,57,1) = 1 then 'E' else '-' end as privs "},
{" from %s.\"%s\".%s "},
- {" where grantor_id <> -2 "},
- {" and object_uid = "},
+ {" where object_uid = "},
{" (select object_uid from %s.\"%s\".%s "},
{" where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' "},
{" and object_type = '%s') %s "},
@@ -573,11 +572,11 @@ static const QueryString getTrafPrivsOnObject[] =
{" case when bitextract(privileges_bitmap,58,1) = 1 then 'R' else '-' end || "},
{" case when bitextract(privileges_bitmap,57,1) = 1 then 'E' else '-' end as privs "},
{" from %s.\"%s\".%s "},
- {" where grantor_id <> -2 "},
- {" and object_uid = "},
+ {" where object_uid = "},
{" (select object_uid from %s.\"%s\".%s "},
{" where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' "},
{" and object_type = '%s') %s )"},
+ {" order by 1 "},
{" ; "}
};
@@ -599,9 +598,9 @@ static const QueryString getHiveRegObjectsInCatalogQuery[] =
{" (select object_type, case when object_type = 'SS' " },
{" then lower(trim(catalog_name) || '.' || trim(schema_name)) "},
{" else lower(trim(catalog_name) || '.' || " },
- {" trim(schema_name) || '.' || trim(object_name)) end " },
+ {" trim(schema_name) || '.' || trim(object_name)) end " },
{" from %s.\"%s\".%s where catalog_name = 'HIVE' and " },
- {" %s) O(t, a) " },
+ {" %s %s) O(t, a) " },
{" left join " },
{" (select '%s' || '.' || trim(y) from " },
{" (get %s in catalog %s, no header) x(y)) G(b)" },
@@ -617,7 +616,7 @@ static const QueryString getHBaseRegTablesInCatalogQuery[] =
{" from " },
{" (select trim(schema_name), trim(object_name) "},
{" from %s.\"%s\".%s where catalog_name = 'HBASE' " },
- {" and object_type = 'BT') O(s, o) " },
+ {" and object_type = 'BT' %s) O(s, o) " },
{" left join " },
{" (select trim(y) from " },
{" (get external hbase objects) x(y)) G(b)" },
@@ -636,7 +635,7 @@ static const QueryString getHiveExtTablesInCatalogQuery[] =
{" char_length(schema_name)-5))) " },
{" || '.' || lower(trim(object_name)) " },
{" from %s.\"%s\".%s where object_type = '%s' " },
- {" and schema_name like '|_HV|_%%|_' escape '|') O(a) " },
+ {" and schema_name like '|_HV|_%%|_' escape '|' %s) O(a)" },
{" left join " },
{" (select '%s' || '.' || trim(y) from " },
{" (get %s in catalog %s, no header) x(y)) G(b) " },
@@ -1013,6 +1012,12 @@ short ExExeUtilGetMetadataInfoTcb::displayHeading()
}
break;
+ case ComTdbExeUtilGetMetadataInfo::HBASE_OBJECTS_:
+ {
+ str_sprintf(headingBuf_, "External HBase objects");
+ }
+ break;
+
case ComTdbExeUtilGetMetadataInfo::HIVE_REG_VIEWS_IN_CATALOG_:
{
str_sprintf(headingBuf_, "Hive Registered Views in Catalog %s",
@@ -1160,6 +1165,27 @@ short ExExeUtilGetMetadataInfoTcb::displayHeading()
}
break;
+ case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_:
+ {
+ str_sprintf(headingBuf_, "Privileges on Sequence %s.%s",
+ getMItdb().getSch(), getMItdb().getObj());
+ }
+ break;
+
+ case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_:
+ {
+ str_sprintf(headingBuf_, "Privileges on Sequence %s.%s",
+ getMItdb().getSch(), getMItdb().getObj());
+ }
+ break;
+
+ case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_:
+ {
+ str_sprintf(headingBuf_, "Privileges on Routine %s.%s",
+ getMItdb().getSch(), getMItdb().getObj());
+ }
+ break;
+
case ComTdbExeUtilGetMetadataInfo::SYNONYMS_ON_TABLE_:
{
str_sprintf(headingBuf_, "Synonyms on Table %s.%s",
@@ -1954,7 +1980,9 @@ short ExExeUtilGetMetadataInfoTcb::work()
||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_FOR_ROLE_
||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_FOR_USER_
||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_
- ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_)
+ ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_
+ ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_
+ ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_)
{
if (!CmpCommon::context()->isAuthorizationEnabled())
{
@@ -2028,22 +2056,22 @@ short ExExeUtilGetMetadataInfoTcb::work()
}
break;
- case ComTdbExeUtilGetMetadataInfo::HIVE_REG_TABLES_IN_CATALOG_:
- case ComTdbExeUtilGetMetadataInfo::HIVE_REG_VIEWS_IN_CATALOG_:
- case ComTdbExeUtilGetMetadataInfo::HIVE_REG_SCHEMAS_IN_CATALOG_:
- case ComTdbExeUtilGetMetadataInfo::HIVE_REG_OBJECTS_IN_CATALOG_:
- {
- qs = getHiveRegObjectsInCatalogQuery;
- sizeOfqs = sizeof(getHiveRegObjectsInCatalogQuery);
+ case ComTdbExeUtilGetMetadataInfo::HIVE_REG_TABLES_IN_CATALOG_:
+ case ComTdbExeUtilGetMetadataInfo::HIVE_REG_VIEWS_IN_CATALOG_:
+ case ComTdbExeUtilGetMetadataInfo::HIVE_REG_SCHEMAS_IN_CATALOG_:
+ case ComTdbExeUtilGetMetadataInfo::HIVE_REG_OBJECTS_IN_CATALOG_:
+ {
+ qs = getHiveRegObjectsInCatalogQuery;
+ sizeOfqs = sizeof(getHiveRegObjectsInCatalogQuery);
- if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::HIVE_REG_TABLES_IN_CATALOG_)
- {
- strcpy(hiveGetType, "tables");
- str_sprintf(hiveObjType, " (object_type = '%s') ",
- COM_BASE_TABLE_OBJECT_LIT);
+ if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::HIVE_REG_TABLES_IN_CATALOG_)
+ {
+ strcpy(hiveGetType, "tables");
+ str_sprintf(hiveObjType, " (object_type = '%s') ",
+ COM_BASE_TABLE_OBJECT_LIT);
}
else if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::HIVE_REG_VIEWS_IN_CATALOG_)
- {
+ {
strcpy(hiveGetType, "views");
str_sprintf(hiveObjType, " (object_type = '%s') ",
COM_VIEW_OBJECT_LIT);
@@ -2063,46 +2091,57 @@ short ExExeUtilGetMetadataInfoTcb::work()
COM_SHARED_SCHEMA_OBJECT_LIT);
}
- param_[0] = cat;
- param_[1] = sch;
- param_[2] = tab;
- param_[3] = hiveObjType;
- param_[4] = hiveSysCat;
- param_[5] = hiveGetType,
- param_[6] = hiveSysCat;
+ if (doPrivCheck)
+ privWhereClause = getGrantedPrivCmd(authList, cat);
+
+ param_[0] = cat;
+ param_[1] = sch;
+ param_[2] = tab;
+ param_[3] = hiveObjType;
+ param_[4] = (char *)privWhereClause.data();
+ param_[5] = hiveSysCat;
+ param_[6] = hiveGetType,
+ param_[7] = hiveSysCat;
}
break;
- case ComTdbExeUtilGetMetadataInfo::HBASE_REG_TABLES_IN_CATALOG_:
- {
- qs = getHBaseRegTablesInCatalogQuery;
- sizeOfqs = sizeof(getHBaseRegTablesInCatalogQuery);
+ case ComTdbExeUtilGetMetadataInfo::HBASE_REG_TABLES_IN_CATALOG_:
+ {
+ qs = getHBaseRegTablesInCatalogQuery;
+ sizeOfqs = sizeof(getHBaseRegTablesInCatalogQuery);
- param_[0] = cat;
- param_[1] = sch;
- param_[2] = tab;
- }
+ if (doPrivCheck)
+ privWhereClause = getGrantedPrivCmd(authList, cat);
+
+ param_[0] = cat;
+ param_[1] = sch;
+ param_[2] = tab;
+ param_[3] = (char *)privWhereClause.data();
+ }
break;
- case ComTdbExeUtilGetMetadataInfo::HIVE_EXT_TABLES_IN_CATALOG_:
- {
- qs = getHiveExtTablesInCatalogQuery;
- sizeOfqs = sizeof(getHiveExtTablesInCatalogQuery);
+ case ComTdbExeUtilGetMetadataInfo::HIVE_EXT_TABLES_IN_CATALOG_:
+ {
+ qs = getHiveExtTablesInCatalogQuery;
+ sizeOfqs = sizeof(getHiveExtTablesInCatalogQuery);
+
+ if (doPrivCheck)
+ privWhereClause = getGrantedPrivCmd(authList, cat);
strcpy(hiveObjType, COM_BASE_TABLE_OBJECT_LIT);
strcpy(hiveGetType, "tables");
- param_[0] = hiveSysCat;
- param_[1] = cat;
- param_[2] = sch;
- param_[3] = tab;
- param_[4] = hiveObjType;
- param_[5] = hiveSysCat;
- param_[6] = hiveGetType,
- param_[7] = hiveSysCat;
-
- }
- break;
+ param_[0] = hiveSysCat;
+ param_[1] = cat;
+ param_[2] = sch;
+ param_[3] = tab;
+ param_[4] = hiveObjType;
+ param_[5] = (char *)privWhereClause.data();
+ param_[6] = hiveSysCat;
+ param_[7] = hiveGetType,
+ param_[8] = hiveSysCat;
+ }
+ break;
case ComTdbExeUtilGetMetadataInfo::VIEWS_IN_SCHEMA_:
{
@@ -2560,22 +2599,58 @@ short ExExeUtilGetMetadataInfoTcb::work()
case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_:
case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_:
+ case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_:
+ case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_:
+ case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_:
{
qs = getTrafPrivsOnObject;
sizeOfqs = sizeof(getTrafPrivsOnObject);
+ // Determine the type of object
NAString objType;
if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_)
objType = COM_BASE_TABLE_OBJECT_LIT;
- else
+ else if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_)
objType = COM_VIEW_OBJECT_LIT;
+ else if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_)
+ objType = COM_SEQUENCE_GENERATOR_OBJECT_LIT;
+ else if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_)
+ objType = COM_LIBRARY_OBJECT_LIT;
+ else
+ objType = COM_USER_DEFINED_ROUTINE_OBJECT_LIT;
+ char buf[authList.length() + 100];
if (doPrivCheck)
- {
- char buf[authList.length() + 100];
- str_sprintf(buf, "and grantee_id in %s ", authList.data());
- privWhereClause = buf;
- }
+ {
+ if (getMItdb().getParam1() &&
+ (strcmp(getMItdb().getParam1(), currContext->getDatabaseUserName()) != 0))
+ str_sprintf(buf, "and grantee_id = -2 ");
+ else
+ str_sprintf(buf, " and grantee_id in %s ", authList.data());
+ privWhereClause = buf;
+ }
+ else
+ {
+ if (getMItdb().getParam1())
+ {
+ if (strcmp(getMItdb().getParam1(), currContext->getDatabaseUserName()) == 0)
+ str_sprintf(buf, " and grantee_id in %s ", authList.data());
+ else
+ {
+ Int32 authID = getAuthID(getMItdb().getParam1(), cat, sch, auths);
+ char *userRoleList = getRoleList(authID, cat, pmsch, role_usage);
+ if (userRoleList)
+ {
+ str_sprintf(buf, " and grantee_id in %s ", userRoleList);
+ NADELETEBASIC(userRoleList, getHeap());
+ }
+ else
+ str_sprintf(buf, " = %d ", authID);
+ }
+ privWhereClause = buf;
+ }
+ }
+
param_[0] = cat;
param_[1] = pmsch;
param_[2] = objPrivs;
@@ -2956,7 +3031,7 @@ short ExExeUtilGetMetadataInfoTcb::work()
step_ = HANDLE_ERROR_;
break;
}
-
+
if (fetchAllRows(infoList_, queryBuf_, numOutputEntries_,
FALSE, retcode) < 0)
{
@@ -2992,7 +3067,10 @@ short ExExeUtilGetMetadataInfoTcb::work()
if ((getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_FOR_USER_) ||
(getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_FOR_ROLE_) ||
(getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_) ||
- (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_))
+ (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_) ||
+ (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_) ||
+ (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_) ||
+ (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_))
{
// output: privileges<4spaces>object name
@@ -3909,6 +3987,16 @@ short ExExeUtilGetHbaseObjectsTcb::work()
case SETUP_HBASE_QUERY_:
{
+ // Since HBase tables are native and Trafodion does not manage them
+ // limit who can view these objects
+ if (((currContext->getSqlParserFlags() & 0x20000) == 0) &&
+ !ComUser::isRootUserID() &&
+ !ComUser::currentUserHasRole(ROOT_ROLE_ID) &&
+ !ComUser::currentUserHasRole(HBASE_ROLE_ID))
+ {
+ step_ = DONE_;
+ break;
+ }
hbaseTables_ = ehi_->listAll("");
if (! hbaseTables_)
{
@@ -3918,10 +4006,33 @@ short ExExeUtilGetHbaseObjectsTcb::work()
currIndex_ = 0;
- step_ = PROCESS_NEXT_ROW_;
+ if (currIndex_ == hbaseTables_->entries())
+ {
+ step_ = DONE_;
+ break;
+ }
+
+ step_ = DISPLAY_HEADING_;
}
break;
+ case DISPLAY_HEADING_:
+ {
+ retcode = displayHeading();
+ if (retcode == 1)
+ return WORK_OK;
+ else if (retcode < 0)
+ {
+ step_ = HANDLE_ERROR_;
+ break;
+ }
+
+ headingReturned_ = TRUE;
+
+ step_ = PROCESS_NEXT_ROW_;
+ }
+ break;
+
case PROCESS_NEXT_ROW_:
{
if (currIndex_ == hbaseTables_->entries())
@@ -4545,6 +4656,17 @@ short ExExeUtilGetHiveMetadataInfoTcb::work()
break;
}
+ // Since Hive tables are native and Trafodion does not manage them
+ // limit the users that can see the data.
+ if (((currContext->getSqlParserFlags() & 0x20000) == 0) &&
+ !ComUser::isRootUserID() &&
+ !ComUser::currentUserHasRole(ROOT_ROLE_ID) &&
+ !ComUser::currentUserHasRole(HIVE_ROLE_ID))
+ {
+ step_ = DONE_;
+ break;
+ }
+
short rc = 0;
retcode = fetchAllHiveRows(infoList_, 1, rc);
if (retcode < 0)
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/generator/GenRelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelExeUtil.cpp b/core/sql/generator/GenRelExeUtil.cpp
index 570c3e5..1b0adb4 100644
--- a/core/sql/generator/GenRelExeUtil.cpp
+++ b/core/sql/generator/GenRelExeUtil.cpp
@@ -1615,8 +1615,10 @@ short ExeUtilGetMetadataInfo::codeGen(Generator * generator)
{ "SYSTEM", "TABLES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::TABLES_IN_SCHEMA_ },
{ "ALL", "TABLES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::TABLES_IN_SCHEMA_ },
- { "ALL", "SEQUENCES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SEQUENCES_IN_SCHEMA_ },
- { "USER", "SEQUENCES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SEQUENCES_IN_SCHEMA_ },
+ { "ALL", "SEQUENCES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SEQUENCES_IN_SCHEMA_ },
+ { "ALL", "PRIVILEGES", "ON", "SEQUENCE", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_ },
+ { "USER", "SEQUENCES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SEQUENCES_IN_SCHEMA_ },
+ { "USER", "PRIVILEGES", "ON", "SEQUENCE", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_ },
{ "USER", "OBJECTS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::OBJECTS_IN_SCHEMA_ },
{ "SYSTEM", "OBJECTS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::OBJECTS_IN_SCHEMA_ },
@@ -1639,7 +1641,10 @@ short ExeUtilGetMetadataInfo::codeGen(Generator * generator)
{ "ALL", "LIBRARIES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::LIBRARIES_IN_SCHEMA_ },
{ "ALL", "PROCEDURES","IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::PROCEDURES_IN_SCHEMA_ },
{ "ALL", "FUNCTIONS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::FUNCTIONS_IN_SCHEMA_ },
- { "ALL", "TABLE_FUNCTIONS", "IN","SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::TABLE_FUNCTIONS_IN_SCHEMA_ },
+ { "ALL", "TABLE_FUNCTIONS", "IN","SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::TABLE_FUNCTIONS_IN_SCHEMA_ },
+ { "ALL", "PRIVILEGES", "ON", "LIBRARY", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_ },
+ { "ALL", "PRIVILEGES", "ON", "PROCEDURE", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_ },
+ { "ALL", "PRIVILEGES", "ON", "ROUTINE", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_ },
// { "ALL", "MVS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::MVS_IN_SCHEMA_ },
// { "ALL", "MVGROUPS", "IN", "SCHEMA", 0, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::MVGROUPS_IN_SCHEMA_ },
// { "ALL", "SYNONYMS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SYNONYMS_IN_SCHEMA_ },
@@ -1650,12 +1655,9 @@ short ExeUtilGetMetadataInfo::codeGen(Generator * generator)
{ "USER", "INDEXES", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::INDEXES_ON_TABLE_ },
{ "USER", "VIEWS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::VIEWS_ON_TABLE_ },
{ "USER", "OBJECTS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::OBJECTS_ON_TABLE_ },
- { "USER", "PRIVILEGES","ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_ },
- { "USER", "PRIVILEGES","ON", "VIEW", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_ },
// { "USER", "INDEXES", "ON", "MV", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::INDEXES_ON_MV_ },
// { "USER", "MVS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::MVS_ON_TABLE_ },
// { "USER", "MVGROUPS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::MVGROUPS_ON_TABLE_ },
-// { "USER", "PRIVILEGES","ON", "MV", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_MV_ },
// { "USER", "SYNONYMS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::SYNONYMS_ON_TABLE_ },
{ "ALL", "INDEXES", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::INDEXES_ON_TABLE_ },
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/parser/ParKeyWords.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParKeyWords.cpp b/core/sql/parser/ParKeyWords.cpp
index a213458..0a152ce 100644
--- a/core/sql/parser/ParKeyWords.cpp
+++ b/core/sql/parser/ParKeyWords.cpp
@@ -988,8 +988,6 @@ ParKeyWord ParKeyWords::keyWords_[] = {
ParKeyWord("SHOW", TOK_SHOW, NONRESTOKEN_),
ParKeyWord("SHOWCONTROL", TOK_SHOWCONTROL, NONRESTOKEN_),
ParKeyWord("SHOWDDL", TOK_SHOWDDL, NONRESTOKEN_|FIRST_),
- ParKeyWord("SHOWLABEL", TOK_SHOWLABEL, NONRESTOKEN_),
- ParKeyWord("SHOWLEAKS", TOK_SHOWLEAKS, NONRESTOKEN_),
ParKeyWord("SHOWPLAN", TOK_SHOWPLAN, NONRESTOKEN_),
ParKeyWord("SHOWSET", TOK_SHOWSET, NONRESTOKEN_),
ParKeyWord("SHOWSHAPE", TOK_SHOWSHAPE, NONRESTOKEN_),
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index 455447e..7e32e8a 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -1046,8 +1046,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
%token <tokval> TOK_SHOWDDL_LIBRARY
%token <tokval> TOK_SHOWDDL_SEQUENCE
%token <tokval> TOK_SHOWDDL /* Tandem extension non-reserved word */
-%token <tokval> TOK_SHOWLABEL /* Tandem extension reserved word */
-%token <tokval> TOK_SHOWLEAKS /* Tandem extension non-reserved word*/
%token <tokval> TOK_SYSDATE
%token <tokval> TOK_SYSTIMESTAMP
%token <tokval> TOK_TARGET
@@ -1908,8 +1906,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
%type <tokval> sign
%type <corrName> table_name
%type <corrName> special_table_name
-%type <corrName> label_name
-%type <corrName> extended_label_name
%type <corrName> actual_table_name
%type <corrName> actual_table_name2
%type <corrName> exception_table_name
@@ -2223,10 +2219,7 @@ static void enableMakeQuotedStringISO88591Mechanism()
%type <corrName> optional_showddl_action_name_clause
%type <longint> showddl_options_list
%type <longint> showddl_options
-%type <longint> showlabel_options
%type <describeType> showcontrol_type
-%type <uint> showleaks_process
-%type <uint> showleaks_session
//%type <uint> returning_clause
%type <item> input_hostvar_expression
%type <item> hostvar_expression
@@ -5533,34 +5526,6 @@ actual_routine_action_name : routine_action_name
$$->getQualifiedNameObj().setObjectNameSpace(COM_UUDF_ACTION_NAME);
}
-/* type corrName */
-label_name : qualified_name
- {
- //
- // note that corrNameFromStrings()
- // contains code that deletes $1
- //
- $$ = corrNameFromStrings($1);
- if ($$ == NULL) YYABORT;
- }
- | guardian_location_name
- {
- ComLocationName locName(*$1,
- ComLocationName::GUARDIAN_LOCATION_NAME_FORMAT);
- if (NOT locName.isValid())
- {
- // The format of the specified location name
- // $0~string0 is invalid.
- *SqlParser_Diags << DgSqlCode(-3061)
- << DgString0($1->data());
- }
- delete $1;
- CorrName *result = new (PARSERHEAP()) CorrName();
- result->setLocationName(locName.
- getGuardianFullyQualifiedName());
- $$ = result;
- }
-
/* 100% identical to "actual_table_name", actual_table_name2 is provided only
* for use in the "select_list_item" productions. By doing so, it
* provides a way to get around a reduce/reduce problem that would
@@ -15448,68 +15413,82 @@ exe_util_get_metadata_info :
$$ = gmi;
}
-user_or_role : TOK_USER | TOK_ROLE
-
-exe_util_get_metadata_info :
- TOK_GET get_info_aus_clause
- TOK_PRIVILEGES TOK_ON object_identifier table_name
- optional_for_user_clause
+ | TOK_GET get_info_aus_clause TOK_PRIVILEGES TOK_ON object_identifier
+ table_name optional_for_user_clause
optional_no_header_and_match_pattern_clause
{
- if ((*$5 != "TABLE") && (*$5 != "SCHEMA") &&
- (*$5 != "VIEW" ) && (*$5 != "MV") &&
- (*$5 != "USER" ) && (*$5 != "ROLE"))
- {
- YYERROR;
- }
+ NAString aus("ALL");
- NAString aus(*$2);
- if (*$2 == "ALL")
- aus = "ALL";
- else if (*$2 == "USER")
- aus = "USER";
- else if (*$2 == "NONE")
- aus = "USER";
- else
- YYERROR;
-
- NAString infoType("PRIVILEGES");
- NABoolean getVersion = FALSE;
- PtrPlaceHolder * pph = $8;
- NAString * noHeader =
- (NAString *)pph->ptr1_;
- NAString * pattern =
- (NAString *)pph->ptr2_;
- NAString * fullyQualNames =
- (NAString *)pph->ptr3_;
-
- NAString iof("ON");
- NAString nas("");
- ExeUtilGetMetadataInfo * gmi =
- new (PARSERHEAP ()) ExeUtilGetMetadataInfo
- (aus, infoType, iof, *$5,
- *$6, pattern,
- (fullyQualNames ? TRUE : FALSE),
- getVersion,
- $7,
- PARSERHEAP ());
-
- if (noHeader)
- gmi->setNoHeader(TRUE);
- else if (NOT ((CmpCommon::getDefault(IS_SQLCI) == DF_ON) ||
- (CmpCommon::getDefault(NVCI_PROCESS) == DF_ON)))
- {
- gmi->setNoHeader(TRUE);
- }
+ NAString infoType("PRIVILEGES");
+ NABoolean getVersion = FALSE;
+ PtrPlaceHolder * pph = $8;
+ NAString * noHeader = (NAString *)pph->ptr1_;
+ NAString * pattern = (NAString *)pph->ptr2_;
+ NAString * fullyQualNames = (NAString *)pph->ptr3_;
+
+ NAString iof("ON");
+ NAString nas("");
+ ExeUtilGetMetadataInfo * gmi =
+ new (PARSERHEAP ()) ExeUtilGetMetadataInfo
+ (aus, infoType, iof, *$5,
+ *$6, pattern,
+ (fullyQualNames ? TRUE : FALSE),
+ getVersion,
+ $7,
+ PARSERHEAP ());
+
+ if (noHeader)
+ gmi->setNoHeader(TRUE);
+ else if (NOT ((CmpCommon::getDefault(IS_SQLCI) == DF_ON) ||
+ (CmpCommon::getDefault(NVCI_PROCESS) == DF_ON)))
+ {
+ gmi->setNoHeader(TRUE);
+ }
+
+ $$ = gmi;
+ }
+
+ // Created a special production for getting privileges on procedures
+ // TOK_PROCEDURE as an object_identifier causes lots of parser conflicts
+ | TOK_GET get_info_aus_clause TOK_PRIVILEGES TOK_ON TOK_PROCEDURE
+ table_name optional_for_user_clause
+ optional_no_header_and_match_pattern_clause
+ {
+ NAString aus("ALL");
+ NAString infoType("PRIVILEGES");
+ NABoolean getVersion = FALSE;
+ PtrPlaceHolder * pph = $8;
+ NAString * noHeader = (NAString *)pph->ptr1_;
+ NAString * pattern = (NAString *)pph->ptr2_;
+ NAString * fullyQualNames = (NAString *)pph->ptr3_;
+
+ NAString iof("ON");
+ NAString nas("");
+ NAString ptype("PROCEDURE");
+ ExeUtilGetMetadataInfo * gmi =
+ new (PARSERHEAP ()) ExeUtilGetMetadataInfo
+ (aus, infoType, iof, ptype,
+ *$6, pattern,
+ (fullyQualNames ? TRUE : FALSE),
+ getVersion,
+ $7,
+ PARSERHEAP ());
+
+ if (noHeader)
+ gmi->setNoHeader(TRUE);
+ else if (NOT ((CmpCommon::getDefault(IS_SQLCI) == DF_ON) ||
+ (CmpCommon::getDefault(NVCI_PROCESS) == DF_ON)))
+ {
+ gmi->setNoHeader(TRUE);
+ }
+
+ $$ = gmi;
+ }
- $$ = gmi;
- }
-
| TOK_GET get_info_aus_clause TOK_COMPONENTS
optional_no_header_and_match_pattern_clause
// GET COMPONENTS
{
- // exe_util_get_metadata_info ::= TOK_GET TOK_COMPONENTS
NAString aus(*$2);
if (*$2 == "ALL")
aus = "ALL";
@@ -15551,8 +15530,6 @@ exe_util_get_metadata_info :
| TOK_GET get_info_aus_clause TOK_COMPONENT TOK_PRIVILEGES
TOK_ON component_name optional_authid_clause
optional_drop_behavior optional_no_header_and_match_pattern_clause
- // GET [CURRENT_USER] COMPONENT PRIVILEGES ON <name> or
- // GET [CURRENT_USER] COMPONENT PRIVILEGES ON <name> FOR <authid>
{
NAString aus(*$2);
if (*$2 == "ALL")
@@ -15711,10 +15688,16 @@ exe_util_get_metadata_info :
$$ = gmi;
}
+user_or_role : TOK_USER | TOK_ROLE
+
optional_for_user_clause : empty { $$ = NULL; }
+ | TOK_FOR authorization_identifier
+ {
+ $$ = new(PARSERHEAP()) NAString(*$2);
+ }
| TOK_FOR TOK_USER authorization_identifier
{
- $$ = new(PARSERHEAP()) NAString(*$3);
+ $$ = new(PARSERHEAP()) NAString(*$3);
}
optional_authid_clause : empty { $$ = NULL; }
@@ -15732,16 +15715,14 @@ get_info_aus_clause : empty { $$ = new (PARSERHEAP()) NAString("NONE"); }
| TOK_TEMP_TABLE { $$ = new (PARSERHEAP()) NAString("TRIGTEMP");}
| TOK_SYSTEM { $$ = new (PARSERHEAP()) NAString("SYSTEM"); }
| TOK_EXTERNAL { $$ = new (PARSERHEAP()) NAString("EXTERNAL"); }
- | TOK_VERSION TOK_OF { $$ = new (PARSERHEAP()) NAString("VERSION_USER"); }
- | TOK_VERSION TOK_OF TOK_ALL { $$ = new (PARSERHEAP()) NAString("VERSION_ALL"); }
- | TOK_VERSION TOK_OF TOK_USER { $$ = new (PARSERHEAP()) NAString("VERSION_USER"); }
- | TOK_VERSION TOK_OF TOK_SYSTEM { $$ = new (PARSERHEAP()) NAString("VERSION_SYSTEM"); }
object_identifier :
TOK_CATALOG { $$ = new (PARSERHEAP()) NAString("CATALOG"); }
| TOK_CONSTRAINT{ $$ = new (PARSERHEAP()) NAString("CONSTRAINT"); }
| TOK_INDEX { $$ = new (PARSERHEAP()) NAString("INDEX"); }
| TOK_LIBRARY { $$ = new (PARSERHEAP()) NAString("LIBRARY"); }
+ | TOK_TABLE_MAPPING TOK_FUNCTION { $$ = new (PARSERHEAP()) NAString("ROUTINE"); }
+ | TOK_FUNCTION { $$ = new (PARSERHEAP()) NAString("ROUTINE"); }
| TOK_MV { $$ = new (PARSERHEAP()) NAString("MV"); }
| TOK_SCHEMA { $$ = new (PARSERHEAP()) NAString("SCHEMA"); }
| TOK_SYNONYM { $$ = new (PARSERHEAP()) NAString("SYNONYM"); }
@@ -22559,19 +22540,6 @@ showcontrol_type:
| TOK_TABLE { $$ = Describe::CONTROL_TABLE_; }
| TOK_SESSION { $$ = Describe::CONTROL_SESSION_; }
-/*showleaks process*/
-showleaks_process:
- TOK_ARKCMP { $$ = LeakDescribe::FLAG_ARKCMP; }
- | TOK_BOTH { $$ = LeakDescribe::FLAG_BOTH; }
- | { $$ = LeakDescribe::FLAG_SQLCI; }
-
-/*session control*/
-showleaks_session:
- TOK_CONTINUE { $$ = LeakDescribe::FLAG_CONTINUE; }
- | TOK_OFF { $$ = LeakDescribe::FLAG_OFF; }
- | TOK_PROMPT { $$ = LeakDescribe::FLAG_PROMPT; }
- | { $$ = 0; }
-
/* type relx */
show_statement:
TOK_SHOWCONTROL showcontrol_type
@@ -22831,72 +22799,6 @@ show_statement:
delete $3; // CorrName * actual_routine_name of UDF or UUDF
delete $4; // CorrName * actual_routine_name of routine action
}
- | TOK_SHOWLABEL extended_label_name showlabel_options
- {
- // Determine the ANSI namespace.
- ExtendedQualName::SpecialTableType stt = $2->getSpecialType();
- ComAnsiNameSpace labelAnsiNameSpace = COM_UNKNOWN_NAME;
- switch (stt)
- {
- case ExtendedQualName::NORMAL_TABLE:
- labelAnsiNameSpace = COM_TABLE_NAME;
- break;
- case ExtendedQualName::INDEX_TABLE:
- labelAnsiNameSpace = COM_INDEX_NAME;
- break;
- case ExtendedQualName::GHOST_TABLE:
- labelAnsiNameSpace = COM_GHOST_TABLE_NAME;
- break;
- case ExtendedQualName::GHOST_INDEX_TABLE:
- labelAnsiNameSpace = COM_GHOST_INDEX_NAME;
- break;
- case ExtendedQualName::ISP_TABLE:
- labelAnsiNameSpace = COM_TABLE_NAME;
- break;
- case ExtendedQualName::IUD_LOG_TABLE:
- labelAnsiNameSpace = COM_IUD_LOG_TABLE_NAME;
- break;
- case ExtendedQualName::RANGE_LOG_TABLE:
- labelAnsiNameSpace = COM_RANGE_LOG_TABLE_NAME;
- break;
- case ExtendedQualName::TRIGTEMP_TABLE:
- labelAnsiNameSpace = COM_TRIGTEMP_TABLE_NAME;
- break;
- default :
- // There should be a case for every special type that
- // is specified by the production extended_label_name.
- ABORT("internal logic error");
- break;
- }
-
- $$ = new (PARSERHEAP())
- RelRoot(new (PARSERHEAP())
- Describe(SQLTEXT(),
- *$2/*label_name*/,
- Describe::LABEL_,
- labelAnsiNameSpace,
- $3 /*showlabel_options*/),
- REL_ROOT,
- new (PARSERHEAP())
- ColReference(new (PARSERHEAP()) ColRefName(TRUE, PARSERHEAP())));
- }
- //ACH TOK_SHOWLIBRARY label_name
-
- | TOK_SHOWLEAKS showleaks_process showleaks_session
- {
- HEAPLOG_CONTROL(LOG_DELETE_ONLY);
- CorrName c;
- $$ = new (PARSERHEAP())
- RelRoot(new (PARSERHEAP())
- Describe(SQLTEXT(),
- c,
- Describe::LEAKS_,
- COM_TABLE_NAME,
- ($2 | $3)),
- REL_ROOT,
- new (PARSERHEAP())
- ColReference(new (PARSERHEAP()) ColRefName(TRUE, PARSERHEAP())));
- }
| TOK_INVOKE table_name
{
$$ = new (PARSERHEAP())
@@ -23845,105 +23747,6 @@ optional_showddl_role_option : empty
$$ = 16;
}
-/* type longint */
-showlabel_options : empty
- {
- $$ = 0;
- }
- | ',' TOK_DETAIL
- {
- $$ = 1;
- }
- | ',' TOK_DETAIL ',' TOK_PRIVILEGES
- {
- $$ = 17;
- }
- | ',' TOK_PRIVILEGES ',' TOK_DETAIL
- {
- $$ = 17;
- }
- | ',' TOK_PRIVILEGES
- {
- $$ = 16;
- }
-
-/* type corrName */
-// With the introduction of ghost objects we now use extended_label_name
-// where we used to use two productions: optional_ansi_name_space label_name
-// Two productions is neater, but we do this to avoid introducing a
-// shift/reduce conflict.
-extended_label_name : label_name
- {
- $$ = $1 /* label_name */;
- $$->setSpecialType(ExtendedQualName::NORMAL_TABLE);
- }
-
- | TOK_INDEX label_name
- {
- $$ = $2 /* label_name */;
- $$->setSpecialType(ExtendedQualName::INDEX_TABLE);
- }
-
- | TOK_TABLE label_name
- {
- $$ = $2 /* label_name */;
- $$->setSpecialType(ExtendedQualName::NORMAL_TABLE);
- }
-
- | ghost TOK_INDEX label_name
- {
- $$ = $3 /* label_name */;
- $$->setSpecialType(ExtendedQualName::GHOST_INDEX_TABLE);
- }
-
- | ghost TOK_TABLE label_name
- {
- $$ = $3 /* label_name */;
- $$->setSpecialType(ExtendedQualName::GHOST_TABLE);
- }
-
- | TOK_PROCEDURE label_name
- {
- $$ = $2 /* label_name */;
- $$->setSpecialType(ExtendedQualName::ISP_TABLE);
- }
- | TOK_IUDLOG TOK_TABLE label_name
- {
- if (Get_SqlParser_Flags(ALLOW_SPECIALTABLETYPE))
- {
- $$ = $3 /* label_name */;
- $$->setSpecialType(ExtendedQualName::IUD_LOG_TABLE);
- }
- else
- {
- yyerror(""); YYERROR; /*internal syntax only!*/
- }
- }
- | TOK_RANGELOG TOK_TABLE label_name
- {
- if (Get_SqlParser_Flags(ALLOW_SPECIALTABLETYPE))
- {
- $$ = $3 /* label_name */;
- $$->setSpecialType(ExtendedQualName::RANGE_LOG_TABLE);
- }
- else
- {
- yyerror(""); YYERROR; /*internal syntax only!*/
- }
- }
- | TOK_TEMP_TABLE TOK_TABLE label_name
- {
- if (Get_SqlParser_Flags(ALLOW_SPECIALTABLETYPE))
- {
- $$ = $3 /* label_name */;
- $$->setSpecialType(ExtendedQualName::TRIGTEMP_TABLE);
- }
- else
- {
- yyerror(""); YYERROR; /*internal syntax only!*/
- }
- }
-
/* type pStmtDDL */
schema_definition : TOK_CREATE schema_class TOK_SCHEMA schema_name_clause char_set collation_option
@@ -34046,7 +33849,6 @@ nonreserved_word : TOK_ABORT
| TOK_SHAPE
| TOK_SHARE
| TOK_SHARED
- | TOK_SHOWLEAKS
| TOK_SIGNED
| TOK_SINGLEDELTA // MV
// | TOK_SIZE
@@ -34132,7 +33934,6 @@ nonreserved_word : TOK_ABORT
| TOK_INVOKE
| TOK_SHOWCONTROL
| TOK_SHOWDDL
- | TOK_SHOWLABEL
| TOK_SHOWPLAN
| TOK_SHOWSHAPE
| TOK_SHOWSET
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/compGeneral/EXPECTEDTOK
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTEDTOK b/core/sql/regress/compGeneral/EXPECTEDTOK
index 87d8497..9c3aa03 100644
--- a/core/sql/regress/compGeneral/EXPECTEDTOK
+++ b/core/sql/regress/compGeneral/EXPECTEDTOK
@@ -1,4 +1,4 @@
-sqlparser.y: warning: 62 shift/reduce conflicts [-Wconflicts-sr]
+sqlparser.y: warning: 61 shift/reduce conflicts [-Wconflicts-sr]
sqlparser.y: warning: 12 reduce/reduce conflicts [-Wconflicts-rr]
nnnn conflicts: 1 shift/reduce nnnn olap_sequence_function: set_function_specification . TOK_OVER '(' opt_olap_part_clause opt_olap_order_clause ')'
@@ -9,7 +9,6 @@ nnnn conflicts: 9 shift/reduce nnnn row_subquery: '(' row_subquery . ')'
nnnn conflicts: 1 reduce/reduce nnnn row_subquery: rel_subquery .
nnnn conflicts: 1 reduce/reduce nnnn transaction_statement: TOK_BEGIN .
nnnn conflicts: 1 shift/reduce nnnn show_statement: TOK_SHOWCONTROL showcontrol_type . optional_control_identifier optional_comma_match_clause
-nnnn conflicts: 1 shift/reduce nnnn extended_label_name: TOK_INDEX . label_name
nnnn conflicts: 1 shift/reduce nnnn table_as_stream_any: table_as_stream .
nnnn conflicts: 1 shift/reduce nnnn row_subquery: '(' row_subquery . ')'
nnnn conflicts: 1 shift/reduce nnnn input_hostvar_expression: HOSTVAR .
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/compGeneral/EXPECTEDTOK2
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTEDTOK2 b/core/sql/regress/compGeneral/EXPECTEDTOK2
index 87d8497..9c3aa03 100644
--- a/core/sql/regress/compGeneral/EXPECTEDTOK2
+++ b/core/sql/regress/compGeneral/EXPECTEDTOK2
@@ -1,4 +1,4 @@
-sqlparser.y: warning: 62 shift/reduce conflicts [-Wconflicts-sr]
+sqlparser.y: warning: 61 shift/reduce conflicts [-Wconflicts-sr]
sqlparser.y: warning: 12 reduce/reduce conflicts [-Wconflicts-rr]
nnnn conflicts: 1 shift/reduce nnnn olap_sequence_function: set_function_specification . TOK_OVER '(' opt_olap_part_clause opt_olap_order_clause ')'
@@ -9,7 +9,6 @@ nnnn conflicts: 9 shift/reduce nnnn row_subquery: '(' row_subquery . ')'
nnnn conflicts: 1 reduce/reduce nnnn row_subquery: rel_subquery .
nnnn conflicts: 1 reduce/reduce nnnn transaction_statement: TOK_BEGIN .
nnnn conflicts: 1 shift/reduce nnnn show_statement: TOK_SHOWCONTROL showcontrol_type . optional_control_identifier optional_comma_match_clause
-nnnn conflicts: 1 shift/reduce nnnn extended_label_name: TOK_INDEX . label_name
nnnn conflicts: 1 shift/reduce nnnn table_as_stream_any: table_as_stream .
nnnn conflicts: 1 shift/reduce nnnn row_subquery: '(' row_subquery . ')'
nnnn conflicts: 1 shift/reduce nnnn input_hostvar_expression: HOSTVAR .
http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/core/EXPECTED116
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED116 b/core/sql/regress/core/EXPECTED116
index 0d65c19..a67e957 100644
--- a/core/sql/regress/core/EXPECTED116
+++ b/core/sql/regress/core/EXPECTED116
@@ -15,11 +15,17 @@
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T1';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T1
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T2
--- SQL operation complete.
@@ -29,9 +35,17 @@ TRAFODION.SCH.T116T2
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T1';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>
>>--repeat the same tables again
@@ -47,11 +61,17 @@ TRAFODION.SCH.T116T2
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T1';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T1
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T2
--- SQL operation complete.
@@ -60,9 +80,17 @@ TRAFODION.SCH.T116T2
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T1';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>
>>-- unique constraint
@@ -78,11 +106,17 @@ TRAFODION.SCH.T116T2
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T1';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T1
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.TC1';
+External HBase objects
+======================
+
TRAFODION.SCH.TC1
--- SQL operation complete.
@@ -91,9 +125,17 @@ TRAFODION.SCH.TC1
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T1';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.TC1';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>
>>--setup two tables
@@ -121,6 +163,9 @@ TRAFODION.SCH.TC1
>>--------------------------
>>get user hbase objects, match 'TRAFODION.SCH.T116T1';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T1
--- SQL operation complete.
@@ -135,6 +180,10 @@ TRAFODION.SCH.T116T1
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T1';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>
>>--drop table with rollback
@@ -142,6 +191,9 @@ TRAFODION.SCH.T116T1
>>--sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`;
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T2
--- SQL operation complete.
@@ -177,6 +229,9 @@ A1 C1 B1
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T2
--- SQL operation complete.
@@ -185,6 +240,9 @@ TRAFODION.SCH.T116T2
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T2
--- SQL operation complete.
@@ -213,11 +271,18 @@ A1 C1 B1
>>-------------------------------------
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T2
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T3';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>begin work;
@@ -230,11 +295,17 @@ TRAFODION.SCH.T116T2
--- 1 row(s) inserted.
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T2
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T3';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T3
--- SQL operation complete.
@@ -246,9 +317,16 @@ TRAFODION.SCH.T116T3
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T2';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T3';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T3
--- SQL operation complete.
@@ -257,11 +335,18 @@ TRAFODION.SCH.T116T3
>>---------------------------------------------------
>>get user hbase objects, match 'TRAFODION.SCH.T116T3';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T3
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T4';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>begin work;
@@ -274,11 +359,17 @@ TRAFODION.SCH.T116T3
--- 1 row(s) inserted.
>>get user hbase objects, match 'TRAFODION.SCH.T116T3';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T3
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T4';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T4
--- SQL operation complete.
@@ -301,6 +392,9 @@ A1 C1 B1
>>get user hbase objects, match 'TRAFODION.SCH.T116T3';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T3
--- SQL operation complete.
@@ -309,11 +403,18 @@ TRAFODION.SCH.T116T3
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T3';
+External HBase objects
+======================
+
TRAFODION.SCH.T116T3
--- SQL operation complete.
>>get user hbase objects, match 'TRAFODION.SCH.T116T4';
+External HBase objects
+======================
+
+
--- SQL operation complete.
>>select * from t116t3;
@@ -341,7 +442,7 @@ A1 C1 B1
>>invoke t116t1;
-- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current Wed Dec 21 21:00:30 2016
+-- Definition current Wed May 16 06:17:20 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -359,7 +460,7 @@ A1 C1 B1
>>invoke t116t1;
-- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current Wed Dec 21 21:00:30 2016
+-- Definition current Wed May 16 06:17:20 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -374,7 +475,7 @@ A1 C1 B1
>>invoke t116v1;
-- Definition of Trafodion view TRAFODION.SCH.T116V1
--- Definition current Wed Dec 21 21:00:31 2016
+-- Definition current Wed May 16 06:17:22 2018
(
A INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -391,7 +492,7 @@ A1 C1 B1
>>invoke t116t1;
-- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current Wed Dec 21 21:00:43 2016
+-- Definition current Wed May 16 06:17:36 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -406,7 +507,7 @@ A1 C1 B1
>>invoke t116v1;
-- Definition of Trafodion view TRAFODION.SCH.T116V1
--- Definition current Wed Dec 21 21:00:44 2016
+-- Definition current Wed May 16 06:17:37 2018
(
A INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -423,7 +524,7 @@ A1 C1 B1
>>invoke t116t1;
-- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current Wed Dec 21 21:00:47 2016
+-- Definition current Wed May 16 06:17:42 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -438,7 +539,7 @@ A1 C1 B1
>>invoke t116v1;
-- Definition of Trafodion view TRAFODION.SCH.T116V1
--- Definition current Wed Dec 21 21:00:48 2016
+-- Definition current Wed May 16 06:17:43 2018
(
A INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -456,7 +557,7 @@ A1 C1 B1
>>invoke t116t1;
-- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current Wed Dec 21 21:00:48 2016
+-- Definition current Wed May 16 06:17:43 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -471,7 +572,7 @@ A1 C1 B1
>>invoke t116v1;
-- Definition of Trafodion view TRAFODION.SCH.T116V1
--- Definition current Wed Dec 21 21:00:48 2016
+-- Definition current Wed May 16 06:17:43 2018
(
A INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -488,7 +589,7 @@ A1 C1 B1
>>invoke t116t1;
-- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current Wed Dec 21 21:01:00 2016
+-- Definition current Wed May 16 06:17:58 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -503,7 +604,7 @@ A1 C1 B1
>>invoke t116v1;
-- Definition of Trafodion view TRAFODION.SCH.T116V1
--- Definition current Wed Dec 21 21:01:01 2016
+-- Definition current Wed May 16 06:17:59 2018
(
A INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -521,7 +622,7 @@ A1 C1 B1
>>invoke t116t1;
-- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current Wed Dec 21 21:01:07 2016
+-- Definition current Wed May 16 06:18:04 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -536,7 +637,7 @@ A1 C1 B1
>>invoke t116v1;
-- Definition of Trafodion view TRAFODION.SCH.T116V1
--- Definition current Wed Dec 21 21:01:08 2016
+-- Definition current Wed May 16 06:18:05 2018
(
A INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -560,8 +661,8 @@ A1 C1 B1
--- SQL operation complete.
>>
>>sh sqlci -iTEST116\(concurrent_ddl\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_ddl
>>cqd ddl_transactions 'ON';
@@ -595,7 +696,7 @@ End of MXCI Session
>>invoke t116t1;
-- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current Wed Dec 21 21:01:31 2016
+-- Definition current Wed May 16 06:18:30 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -718,7 +819,7 @@ T116T1
>>invoke t116t2;
-- Definition of Trafodion table TRAFODION.SCH.T116T2
--- Definition current Wed Dec 21 21:02:32 2016
+-- Definition current Wed May 16 06:19:38 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -744,7 +845,7 @@ T116T1
>>invoke t116t2;
-- Definition of Trafodion table TRAFODION.SCH.T116T2
--- Definition current Wed Dec 21 21:02:51 2016
+-- Definition current Wed May 16 06:19:49 2018
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -872,8 +973,8 @@ T116T1
>>
>>-- insert a row using a concurrent hbase xn
>>sh sqlci -iTEST116\(concurrent_hbase_xn_ins\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_hbase_xn_ins
>>cqd traf_use_region_xn 'OFF';
@@ -925,8 +1026,8 @@ A B
>>
>>-- insert a row using a concurrent region xn
>>sh sqlci -iTEST116\(concurrent_region_xn_ins\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_region_xn_ins
>>cqd traf_use_region_xn 'ON';
@@ -955,8 +1056,8 @@ End of MXCI Session
>>-- should show conflict
>>commit work;
-*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16975 regionTX: false status: PENDING scan Size: 2 write Size: 1 startSQ: 2]] has scan which conflicts with [[transactionId: 1554361158723058 regionTX: true status: COMMITED scan Size: 2 write Size: 1 startSQ: 2 commitedSQ:2]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], inserted row[\x80\x00\x00\x01]
-org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)
+*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4642 regionTX: false status: PENDING neverReadOnly: false scan Size: 2 write Size: 1 startSQ: 2 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600654243836 regionTX: true status: COMMITED neverReadOnly: false scan Size: 2 write Size: 1 startSQ: 2 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:2]] which , inserted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.]
+org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525)
--- SQL operation failed with errors.
>>select * from t116t6;
@@ -981,8 +1082,8 @@ A B
>>
>>-- upsert a row using a concurrent hbase xn
>>sh sqlci -iTEST116\(concurrent_hbase_xn_ups\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_hbase_xn_ups
>>cqd traf_use_region_xn 'OFF';
@@ -1034,8 +1135,8 @@ A B
>>
>>-- insert a row using a concurrent region xn
>>sh sqlci -iTEST116\(concurrent_region_xn_ups\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_region_xn_ups
>>cqd traf_use_region_xn 'ON';
@@ -1064,8 +1165,8 @@ End of MXCI Session
>>-- should show conflict
>>commit work;
-*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16979 regionTX: false status: PENDING scan Size: 1 write Size: 1 startSQ: 6]] has scan which conflicts with [[transactionId: 1554361174452391 regionTX: true status: COMMITED scan Size: 1 write Size: 1 startSQ: 6 commitedSQ:6]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], inserted row[\x80\x00\x00\x01]
-org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)iona
+*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4646 regionTX: false status: PENDING neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 6 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600673118601 regionTX: true status: COMMITED neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 6 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:6]] which , inserted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.]
+org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525)
--- SQL operation failed with errors.
>>select * from t116t6;
@@ -1093,8 +1194,8 @@ A B
>>
>>-- delete a row using a concurrent hbase xn
>>sh sqlci -iTEST116\(concurrent_hbase_xn_del\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_hbase_xn_del
>>cqd traf_use_region_xn 'OFF';
@@ -1144,8 +1245,8 @@ End of MXCI Session
>>
>>-- delete a row using a concurrent region xn
>>sh sqlci -iTEST116\(concurrent_region_xn_del\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_region_xn_del
>>cqd traf_use_region_xn 'ON';
@@ -1174,8 +1275,8 @@ End of MXCI Session
>>-- should show conflict
>>commit work;
-*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16985 regionTX: false status: PENDING scan Size: 1 write Size: 1 startSQ: 11]] has scan which conflicts with [[transactionId: 1554361190181566 regionTX: true status: COMMITED scan Size: 0 write Size: 1 startSQ: 11 commitedSQ:11]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], deleted row[\x80\x00\x00\x01]
-org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)
+*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4652 regionTX: false status: PENDING neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 11 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600691993433 regionTX: true status: COMMITED neverReadOnly: false scan Size: 0 write Size: 1 startSQ: 11 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:11]] which , deleted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.]
+org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525)
--- SQL operation failed with errors.
>>select * from t116t6;
@@ -1198,8 +1299,8 @@ org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)
>>
>>-- delete a row using a concurrent hbase xn
>>sh sqlci -iTEST116\(concurrent_hbase_xn_checkanddel\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_hbase_xn_checkanddel
>>cqd traf_use_region_xn 'OFF';
@@ -1249,8 +1350,8 @@ End of MXCI Session
>>
>>-- delete a row using a concurrent region xn
>>sh sqlci -iTEST116\(concurrent_region_xn_checkanddel\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_region_xn_checkanddel
>>cqd traf_use_region_xn 'ON';
@@ -1279,8 +1380,8 @@ End of MXCI Session
>>-- should show conflict
>>commit work;
-*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16991 regionTX: false status: PENDING scan Size: 1 write Size: 1 startSQ: 15]] has scan which conflicts with [[transactionId: 1554361202764668 regionTX: true status: COMMITED scan Size: 0 write Size: 1 startSQ: 15 commitedSQ:15]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], deleted row[\x80\x00\x00\x01]
-org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)Za
+*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4658 regionTX: false status: PENDING neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 15 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600710868339 regionTX: true status: COMMITED neverReadOnly: false scan Size: 0 write Size: 1 startSQ: 15 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:15]] which , deleted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.]
+org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525)
--- SQL operation failed with errors.
>>select * from t116t6;
@@ -1303,8 +1404,8 @@ org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)Za
>>
>>-- update row using a concurrent hbase xn
>>sh sqlci -iTEST116\(concurrent_hbase_xn_checkandupd\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_hbase_xn_checkandupd
>>cqd traf_use_region_xn 'OFF';
@@ -1359,8 +1460,8 @@ A B
>>
>>-- update row using a concurrent region xn
>>sh sqlci -iTEST116\(concurrent_region_xn_checkandupd\) >> LOG116;
-Apache Trafodion Conversational Interface 2.1.0
-Copyright (c) 2015-2016 Apache Software Foundation
+Apache Trafodion Conversational Interface 2.3.0
+Copyright (c) 2015-2017 Apache Software Foundation
>>?section concurrent_region_xn_checkandupd
>>cqd traf_use_region_xn 'ON';
@@ -1389,8 +1490,8 @@ End of MXCI Session
>>-- should show conflict
>>commit work;
-*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16997 regionTX: false status: PENDING scan Size: 2 write Size: 1 startSQ: 20]] has scan which conflicts with [[transactionId: 1554361218493621 regionTX: true status: COMMITED scan Size: 1 write Size: 1 startSQ: 20 commitedSQ:20]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], inserted row[\x80\x00\x00\x01]
-org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)1
+*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4664 regionTX: false status: PENDING neverReadOnly: false scan Size: 2 write Size: 1 startSQ: 20 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600729743055 regionTX: true status: COMMITED neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 20 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:20]] which , inserted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.]
+org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525)
--- SQL operation failed with errors.
>>select * from t116t6;
[3/3] trafodion git commit: merge [TRAFODION-1573] [TRAFODION-3075]
pr 1568 get command updates and [un]register user fixes
Posted by rm...@apache.org.
merge [TRAFODION-1573] [TRAFODION-3075] pr 1568 get command updates and [un]register user fixes
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/1b9cb1b8
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/1b9cb1b8
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/1b9cb1b8
Branch: refs/heads/master
Commit: 1b9cb1b859502fbed5fbf8c6ed4ad25e060605a1
Parents: 2c5f480 88e2a74
Author: Roberta Marton <ro...@apache.org>
Authored: Mon May 21 15:57:36 2018 +0000
Committer: Roberta Marton <ro...@apache.org>
Committed: Mon May 21 15:57:36 2018 +0000
----------------------------------------------------------------------
core/sql/comexe/ComTdbExeUtil.h | 4 +
core/sql/executor/ExExeUtilGet.cpp | 244 ++++++---
core/sql/generator/GenRelExeUtil.cpp | 14 +-
core/sql/parser/ParKeyWords.cpp | 2 -
core/sql/parser/sqlparser.y | 353 +++---------
core/sql/regress/compGeneral/EXPECTEDTOK | 3 +-
core/sql/regress/compGeneral/EXPECTEDTOK2 | 3 +-
core/sql/regress/core/EXPECTED116 | 197 +++++--
core/sql/regress/privs1/EXPECTED125 | 729 +++++++++++++++++++++++++
core/sql/regress/privs1/TEST125 | 51 ++
core/sql/regress/privs2/EXPECTED144 | 301 +++++++++-
core/sql/regress/privs2/EXPECTED146 | 125 ++++-
core/sql/regress/privs2/TEST144 | 39 +-
core/sql/regress/privs2/TEST146 | 7 +
core/sql/sqlci/sqlci_lex.ll | 2 -
core/sql/sqlci/sqlci_yacc.y | 11 -
core/sql/sqlcomp/CmpSeabaseDDLauth.cpp | 69 ++-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 2 +
18 files changed, 1708 insertions(+), 448 deletions(-)
----------------------------------------------------------------------