multi-temperature data: divisioning on (date_part('year', add_months(...)) fails with ERROR[3044], ERROR[1135]
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(
*** 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.
Changed in trafodion: | |
assignee: | nobody → Hans Zeller (hans-zeller) |
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.