showddl does not display salt clause following 'create table...like...salt using...'.

Bug #1409939 reported by Julie Thai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Released
Medium
Hans Zeller

Bug Description

showddl does not display salt clause for table that was created via 'create table...like...salt using n partitions'.
Noted on 20141216 build.

>>create table mytbl( a int not null, b int, c int) primary key (a) salt using 8 partitions;
..

--- SQL operation complete.
>>showddl mytbl;

CREATE TABLE TRAFODION.JULSCH.MYTBL
  (
    A INT NO DEFAULT NOT NULL NOT DROPPABLE
  , B INT DEFAULT NULL
  , C INT DEFAULT NULL
  , PRIMARY KEY (A ASC)
  )
  SALT USING 8 PARTITIONS
;

--- SQL operation complete.
>>create table myliketbl like mytbl salt using 12 partitions;

--- SQL operation complete.
>>showddl myliketbl;

CREATE TABLE TRAFODION.JULSCH.MYLIKETBL
  (
    A INT NO DEFAULT NOT NULL NOT DROPPABLE
  , B INT DEFAULT NULL
  , C INT DEFAULT NULL
  , PRIMARY KEY (A ASC)
  )
;

--- SQL operation complete.

to reproduce:
create table mytbl( a int not null, b int, c int) primary key (a) salt using 8 partitions;
showddl mytbl;
create table myliketbl like mytbl salt using 12 partitions;
showddl myliketbl;

Tags: sql-cmu
Changed in trafodion:
assignee: nobody → Hans Zeller (hans-zeller)
Revision history for this message
Julie Thai (julie-y-thai) wrote :

Also, invoke does not display _SALT_ column.
>>invoke myliketbl;

-- Definition of Trafodion table TRAFODION.SEABASE.MYLIKETBL
-- Definition current Tue Jan 13 12:40:06 2015

  (
    A INT NO DEFAULT NOT NULL NOT DROPPABLE
  , B INT DEFAULT NULL
  , C INT DEFAULT NULL
  )
  PRIMARY KEY (A ASC)

--- SQL operation complete.

Changed in trafodion:
status: New → Confirmed
Revision history for this message
Hans Zeller (hans-zeller) wrote :

There are really two issues here. First, the condition to salt the target table in CREATE TABLE LIKE is too restrictive (requires with PARTITIONS clause). I am going to fix that. Second, we accept additional table attributes in CREATE TABLE LIKE but we don't actually process them - yet. I'll add a new error to indicate that. The output will look like the following:

>>create table myliketbl like mytbl salt using 12 partitions;

*** ERROR[3111] The LIKE clause and SALT clause cannot coexist in the same statement.

--- SQL operation failed with errors.
>>create table myliketbl like mytbl;

--- SQL operation complete.
>>showddl myliketbl;

CREATE TABLE TRAFODION.SCH.MYLIKETBL
  (
    A INT NO DEFAULT NOT NULL NOT DROPPABLE
  , B INT DEFAULT NULL
  , C INT DEFAULT NULL
  , PRIMARY KEY (A ASC)
  )
  SALT USING 8 PARTITIONS
;

--- SQL operation complete.
>>
>>create table myliketbl2 like mytbl without salt;

--- SQL operation complete.
>>showddl myliketbl2;

CREATE TABLE TRAFODION.SCH.MYLIKETBL2
  (
    A INT NO DEFAULT NOT NULL NOT DROPPABLE
  , B INT DEFAULT NULL
  , C INT DEFAULT NULL
  , PRIMARY KEY (A ASC)
  )
;

--- SQL operation complete.
>>

Changed in trafodion:
status: Confirmed → In Progress
Changed in trafodion:
milestone: r1.1 → r1.0
importance: Low → Medium
Revision history for this message
Hans Zeller (hans-zeller) wrote :
Changed in trafodion:
status: In Progress → Fix Committed
Revision history for this message
Paul Low (paul-low-x) wrote :

Verified on R1.1 build

Changed in trafodion:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.