Clone Tools
Constraints: committers
Constraints: files
Constraints: dates
iChanges based on review comments

  1. … 14 more files in changeset.
Fixees to support stroring Udr libraries s Blobs.

  1. … 45 more files in changeset.
Fix for TRAFODION-3112

Internal error: get ... for user/role

Heading incorrect for libraries

Parser error: get procedures/table_mapping functions/functions for user/role

  1. … 11 more files in changeset.
TRAFODION-3121 Enhance 'initialize trafodion' to return progress status

-- init traf will now return status during various steps.

'Started' indication will be returned when that step starts.

'Completed' will be returned when it completes successfully.

'Failed' will be returned if that step fails.

Elapsed time for each step will be shown in {ET hh:mm:ss} format.

-- method CmpSeabaseDDL::initSeabaseMD is rewritten and moved from

file CmpSeabaseDDLcommon.cpp to new file CmpSeabaseDDLinitraf.cpp.

-- priv mgr tables are now always created during init traf.

-- a 'no return status' option has been added if status is not to be

returned during init traf. This is used when init traf is called

internally, for ex, during upgrade.

It is not an externalized option.

-- Output of init traf is shown below.

Note: output is not a printf/cout to stdout.

It is returned as selected rows to the caller.

Apache Trafodion Conversational Interface 2.3.0

Copyright (c) 2015-2017 Apache Software Foundation

>>initialize trafodion;

Initialize Trafodion: Started

Verify User: Started

Verify User: Completed {ET: 00:00:00}

Version Check: Started

Version Check: Completed {ET: 00:00:00}

Create Metadata Tables: Started

Create Metadata Tables: Completed {ET: 00:00:49}

Update Metadata Tables: Started

Update Metadata Tables: Completed {ET: 00:00:06}

Create Schema Objects: Started

Create Schema Objects: Completed {ET: 00:00:20}

Create Metadata Views: Started

Create Metadata Views: Completed {ET: 00:00:05}

Create Repository Tables: Started

Create Repository Tables: Completed {ET: 00:00:16}

Create PrivMgr Tables: Started

Create PrivMgr Tables: Completed {ET: 00:00:29}

Create Library Manager: Started

Create Library Manager: Completed {ET: 00:00:51}

Initialize Trafodion: Completed {ET: 00:03:09}

--- SQL operation complete.

  1. … 36 more files in changeset.
TRAFODION-3046: Privilege support for native HBase tables

-- Grants and revokes against native HBase tables are enforced similar to hive

-- Privilege checking added when creating and dropping native HBase tables

-- Removing dependent Trafodion metadata when native HBase tables are dropped

-- Added regression test (privs2/TEST146)

-- Reorg - split PrivMgrComponents into 2 files:

PrivMgrComponents and PrivMgrUserPrivs

An hbase table can be referenced using one of the following types:

"_CELL_" - references cell data

"_ROW_" - references row data

"_MAP_" - references data defined by the mapped (external) table

Privileges are granted against each of these types, so if you:

select * from hbase."_CELL_".hbase1;

You must have the select privileges on this table

For example: "grant select on hbase."_CELL_".hbase1 to user1"

Likewise for other hbase types, grants are required to gain accessibility

grant select on hbase."_MAP_".hbase1 to user1

grant select on hbase."_ROW_".hbase1 to role1

  1. … 25 more files in changeset.
[TRAFODION-2542] Grantor is not correct when granting privileges for a role

When granting privileges and the authorization ID is not the current user but

one of roles granted to the current user, then the "granted by" clause is

required. In addition, the grantor of the privileges becomes the role specified

in the grant statement instead of the current user.

Added a CQD ALLOW_WGO_FOR_ROLES that will return an error if the user tries to

grant a privilege as a role.

Added error message (1194) when a component operation is not defined.

Added a check to not allow the WITH GRANT OPTION when granting privileges

to public

  1. … 19 more files in changeset.
[TRAFODION-2908] create table with wrong char length hang and crash

  1. … 2 more files in changeset.
[TRAFODION-2895] Update Message Guide for messages 1700-1721 + some others

  1. … 2 more files in changeset.
[TRAFODION-2880] Update Messages Guide in range 1500-1602 + some others

  1. … 5 more files in changeset.
[TRAFODION-2865] Update Messages Guide for some messages in range 1300-1430

  1. … 2 more files in changeset.
[TRAFODION-2852] Bring Messages Guide up-to-date for msgs 1200-1299 + others

  1. … 8 more files in changeset.
[TRAFODION-2398] Revise Message Guide msgs 1146-1199 + isolated others

  1. … 7 more files in changeset.
new COMMENT-ON SQL statement: review change

1. handle return value of function getSeabaseObjectComment

2. add a new error code : 1033 - CAT_UNABLE_TO_RETRIEVE_COMMENTS

3. add showddl support for sequence comment

4. moved function getSeabaseObjectComment to file


5. changed str_sprintf to sprintf

  1. … 5 more files in changeset.
Miscellaneous authorization changes:

- Unregister user does not remove component privileges

- Reuse unused entries from the authID ranges

- Add "changeuser" command to update user credentials in place instead of

requiring a new sqlci session to be started. Changed privs1/TEST132 to use

this change and cut about 5 minutes off the test time.

  1. … 18 more files in changeset.
TRAFODION-2731 CodeCleanup: Remove obsolete, legacy and unused code

This phase handles the following:

-- removal of code that dealt with:

-- mpalias, NSK, MP, mploc, resource fork, rfork

-- ARLIB, DISK, VOLUME, PFS, compiler version info

-- interpretasrow/IAR, AuditImage, ExtractColumns functions

-- ARKCMP_SINGLE_PROCESS and oneProcess()

-- recompControl, remoteDefaults, rtdu, module

-- latebind thru nsk defines, guardian names, nametype nsk

-- SHADOW implementation


-- older sqlcat ReadTableDef


-- internal cli methods no longer used by any caller

Code within the following defines is removed if it is obsolete

or the define itself is removed if that feature is always on:

-- removed NA_EIDPROC

-- removed SQLEXP_LIB_FUNC

-- removed NA_CMPDLL


-- removed SQ_NEW_PHANDLE

-- removed __EID

-- removed ARKFS_OPEN

-- removed STAND_ALONE

-- removed __TANDEM

-- removed NA_C89

-- removed NA_NSK


-- removed SQLCLI_LIB_FUNC

-- removed CLI_PRIV_SRL

-- removed PRIV_SRL

-- removed NA_LINUX

-- removed NA_HSC_LINUX

-- removed NA_UNIX

-- removed NA_WINNT

-- removed HAVE_MMAP

-- removed NA_NO_C_RUNTIME

-- removed NA_DEBUG_C_RUNTIME(replaced with _DEBUG)

-- removed NA_64BIT usage except in sqlcli.h

-- removed dg64

-- removed SQLEXPORT_LIB

-- removed NA_ARKFS

-- removed NA_IEEE_FLOAT

-- removed NA_GUARDIAN_MSG

-- removed NA_HSC


-- removed ERROR

-- removed ERROR_STATE


Contents of these files have been removed.

Next checkin fill remove the files itself from git:


executor/ExMeas.h, ExMeas.cpp

executor/tempfile.h, .cpp


executor/stubs.cpp, stubs2.cpp


cli/rtdu.h, rtdu2.h, rtdu.cpp, rtdu.cpp












sqlcat/ReadTableDef.h, cpp

sqlcat/readRealArk.h, cpp

  1. … 460 more files in changeset.
[TRAFODION-2398] Edit some of the messages in range 1111-1145

  1. … 3 more files in changeset.
[TRAFODION-2398] Update Messages Guide for messages 1100-1108 as needed

  1. … 2 more files in changeset.
TRAFODION-2439 add support for traf views on hive tables

support for creation of trafodion views on hive tables.

cqd hive_views is set to ON by default to enable it.

During view creation, an implicit external table is created

on underlying hive table if one doesn't already exists.

This is used to track usage info

in views_usage metadata table and to track privileges.

Usage info is used to return views on tables or tables in views

during GET stmts.

trafodion view is created in trafodion catalog/schema and not in hive


delete and update operations are not allowed on traf/hive views.

drop of external hive table with CASCADE option will cause all

dependent views to be dropped.

drop of external table without CASCADE option will not drop it

an a dependent view exists on that table.

If the underlying hive table is dropped from hive shell,

then an error is returned at runtime when that view is accessed.

new test regress/hive/TEST007 contains tests for this feature.

  1. … 15 more files in changeset.
[TRAFODION-2389] Update some messages in the range 1001-1099

  1. … 4 more files in changeset.
[TRAFODION-2389] Update some messages in the range 1000-1059

  1. … 2 more files in changeset.
[TRAFODION-2378] Update Messages Guide for messages 1002-1015

  1. … 4 more files in changeset.
Merge branch 'master' into trafodion-1788







  1. … 20 more files in changeset.
metadata access performance improvement for accessing traf objects

Packed version of descriptor structures is now stored in traf TEXT

table during various DDL operations.

During dml, if packed descriptors exist, then they are read and used.

If they dont exist, then descriptors are generated on the fly.

Descriptor classes are defined in file sqlcat/TrafDDLdesc.h and

are based off the older desc structures from desc.h.

These are simplified and class'ified version of the older structures

and are versioned. Changes to these classes should be done carefully

by either using filler bytes or versioning them.

2 new cqds, traf_store_object_descriptor and traf_read_object_descriptor,

are added to control if packed descs should be stored/read.

These are currently set to OFF by default but are enabled during

regressions run. Once this feature is tested, these cqds will be turned

on by default.

In addition, some helper commands have been added to manipulate descrs.


alter table t [check|generate|delete|disable|enable] stored descritors

If authorization is enabled, then auth/priv specific info

is generated on the fly and currently not stored in metadata.

In a later checkin, these will also be stored in metadata.

  1. … 74 more files in changeset.
TRAFODION [2025] Initialize authorization cannot be run in a DDL transaction

As part of DDL transaction work, there is a goal to run all DDL and DDL like

operations in a single DDL transaction. This delivery changes initialize

trafodion and initialize authorization to make this happen.

Prior to DDL transactions, initialize authorization would either add or drop

authorization support. Part of this required that all compiler processes

associated with the master process be killed to clear out information stored

in memory. When DDL transactions were added, killing the compiler processes

caused the DDL transaction to abort. This means that initialize authorization

could not be run in DDL transation. Initialize trafodion calls initialize

authorization when security is enabled, so initialize trafodion was not able

to run in DDL transactions.

A change was made to send a CmpMessageDatabaseUser request to the child arkcmp

processes after authorization was initialized or dropped. This request is

reponsible for setting appropriate memory attributes so we no longer require

arkcmps to be terminated. Changes were piggy backed on current support that

sends usernames and IDs to child arkcmps.

A new method called ContextCli::updateMxcmpSession is called during initialize

and drop requests. This calls send a message to associated arkcmp process to

update session attributes for user information. It then propagates the message

to other child arkcmp processes.

To make this work, the following code was changed to generate and recognize the

new message format:

CmpStatement.cpp (process - CmpMessageDatabaseUser)

Context.cpp (createMxcmpSession & updateMxcmpSession)

ExSqlComp.cpp (resendControls)

The following was changed to support DDL transactions:

CmpSeabaseDDLcommon.cpp (initSeabaseAuthorization & dropSeabaseAuthorization)

GenPreCode.cpp (allow DDL transaction for initialize trafodion)

SqlciErrors.txt (allow initialize authorization to succeed with warnings)

This also includes a change on how Trafodion processes alter user operations

that allow predefined users to be modified by someone with the correct


  1. … 10 more files in changeset.

TRAFODION-1789: Create the histogram metadata tables at schema creation time

Added a list of MDTableInfo structs called allMDHistInfo that describes

histogram tables similar to other metadata tables in CmpSeabaseDDLmd.h.

During schema create, this list is traversed and each histogram table created.

This is performed by calling the static function - createHistogramTables.

Similarily, this list is traversed at drop schema time to drop existing

histogram tables. With this change, you can drop a schema without the

cascade option when only histogram tables remain.

In histogram code (hs_cli.cpp), removed hard coded create statements and

changed code to call the createHistogramTables static function. With this

change, there is only one place where Histogram tables are defined. Today,

histogram tables are defined in ../sqlcomp/CmpSeabaseDDLmd.h and


TRAFODION-1812: cleanup schema causes transaction to hang in aborting state

While testing the fix for TRAFODION-1789, some of the regression tests failed.

There is an issue when trying to cleanup a schema that contains histogram

tables. Changes were made to cleanup histogram tables first and to avoid

deleting histogram entries for the histogram table itself.

Added IF EXISTS syntax to routine drops. Also added IF NOT EXISTS syntax to

routine creates. The DROP IF EXISTS was needed to fix an issue when dropping

routines as part of drop schema code.

  1. … 22 more files in changeset.
Resolving the following JIRAs : TRAFODION-1604 - Fixed one place in CharType.h where 100 was the max limit for lob handle length TRAFODION-1596 - Added checks in alter code to prevent altering adding LOB columns. TRAFODION-1598 - Added several syntax filxes in parser and ExpLOBaccess.cpp to address these problems. TRAFODION-1599 - Added checks in binder to prevent sample columns from being LOB columns. TRAFODION-1602 - Added checks in DDL layer to prevent LOB columns as unique constraints or store by.

  1. … 17 more files in changeset.


Made the following changes:

Removed support for locklength from the parser

Test and fix issues with create table variants

Made recommended changes as mentioned in the initial delivery

Rename some of the variable names to make them more informative

Assume prefix length for HIVE and HBASE tables can be different and verify code works correctly

Fix commented code to be correct and remove lines no longer needed

Update error text for messages 1180 to include external table type

Beefed up the new regression test (hive/TEST009)

Check column list from hive descriptor with external table description and return an error if there is a mismatch

Add an error if the user specifies a different target schema name than the source

Allow someone with privileges to drop HIVE exernal schemas


Added support for external HBase tables similar to Hive table support

  1. … 33 more files in changeset.
Fixes for Jira's trafodion-19 & trafodion-29

See Jira's for a description.

Also removed obsolete code from the parser

  1. … 46 more files in changeset.
Part 1 of updates to licensing info in Trafodion source

Added NOTICE.txt file in root directory per ASF guidelines.

Updated copyright text in one directory (core/sql/sqlcomp)

as a test of a tool to update such text. One or more later

check-ins will take care of the remaining directories.

  1. … 63 more files in changeset.
TRAFODION-13 Multiple MTD-related bug fixes, UDF and RI constraint fixes

Bug fixes for Multi-temperature Data aka MTD aka divisioning and a related bug for RI constraints. These will be converted to JIRAs soon.

Also added an Excel tool to draw query plans, has limited support only.

LaunchPad 1466209 Referential constraint column correspondence not recorded correctly in metadata

LaunchPad 1417739 Multi-temperature data: should not allow divisioning on float datatype.

LaunchPad 1417741 multi-temperature data: divisioning on (date_part('year', add_months(...)) fails with ERROR[3044], ERROR[1135]

LaunchPad 1417743 multi-temperature data: able to define a RI constraint on a system column.

LaunchPad 1427527 Multi-temperature data: create-table-like-with-constrains-without-division table should not be divisioned

LaunchPad 1442774 TMUDF: Compiling a TPCH query with TMUDF returns internal assertion in BaseTypes.cpp:118


LaunchPad 1466209 Referential constraint column correspondence not recorded correctly in metadata

For an RI constraint, we record a list of foreign key columns in the

KEYS metadata table, as well as the UID of the referenced uniqueness

constraint. The foreign key column list is matched with the unique key

columns. We needed to add logic to reorder the lists in case the

unique constraint was specified in a different order. For example, in


alter table test020t9 add constraint test020t9ri4

foreign key (r1,r2) references test020t8 (c3,c2);

This will trigger the reorder logic to convert it to

foreign key (r2,r1) references test020t8 (c2,c3)

to match the index on test020t8 (c2,c3).

LaunchPad 1417739 Multi-temperature data: should not allow divisioning on float datatype.

Added a check and a new error number 4257. Note that we do allow float

as key columns, and that could have similar issues that rounding

errors could cause us to find a row sometimes and not other times,

although those issues should be rare. Nevertheless, I prefer not to

take that chance and allow divisioning on floating point columns (it

does not make much sense anyway).

LaunchPad 1417741 multi-temperature data: divisioning on (date_part('year', add_months(...)) fails with ERROR[3044], ERROR[1135]

There are really two issues here. First, the CAST operator that is

internally used in ADD_MONTHS in the parser generates a nullable

result, since in the parser we don't know whether the result is

nullable or not. We need to fix that in the binder to avoid the error

1135. Second, there were some cases where the interval leading

precision of a data type was not initialized correctly (error 3044).

LaunchPad 1417743 multi-temperature data: able to define a RI constraint on a system column.

This uncovered a bigger issue in the integration between MTD and RI

constraints. We need to ignore salt and divisioning columns in the

keys we consider, since these columns are redundant and not

user-visible. Added code to do that and while working on it, also

found the first bug in this list.

LaunchPad 1427527 Multi-temperature data: create-table-like-with-constrains-without-division table should not be divisioned

A typo in the parser code led us to ignore the WITHOUT DIVISION clause.

LaunchPad 1442774 TMUDF: Compiling a TPCH query with TMUDF returns internal assertion in BaseTypes.cpp:118

Used incorrect set of values in preCodeGen.

  1. … 18 more files in changeset.