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

Bug #1417741 reported by Julie Thai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
In Progress
Medium
Hans Zeller

Bug Description

>>create table mtdworks1(col_si smallint unsigned not null,
+> col_int integer signed not null,
+> col_lint largeint signed not null,
+> col_flt float(8) not null,
+> col_num numeric not null,
+> col_real real not null,
+> col_dp double precision not null,
+> col_dec decimal(9,2) not null,
+> col_date date default date '2011-09-05' not null,
+> col_time time default time '12:34:56' not null,
+> col_ts timestamp default timestamp '2011-09-05 12:34:56' not null,
+> col_intrvl interval year to month not null,
+> primary key (col_int, col_date))
+> division by (date_part('year', add_months(col_date, 2, 0)));

*** ERROR[3044] The interval YEAR(0) TO MONTH is not valid.

*** ERROR[1135] Clustering key column _DIVISION_1_ must be assigned a NOT NULL NOT DROPPABLE constraint.

--- SQL operation failed with errors.

Tags: sql-cmp
Changed in trafodion:
assignee: nobody → Hans Zeller (hans-zeller)
Revision history for this message
Hans Zeller (hans-zeller) wrote :

It looks like there are really two bugs here. One is that we internally use a CAST in the parser that creates a nullable value for the ADD_MONTHS function. That causes the error 1135. The other problem is that adding a divisioning clause somehow makes us choose the wrong leading precision for the col_intrvl table. We use 0 instead of the correct default, 2, and so get an error.

Changed in trafodion:
status: New → In Progress
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.