>>obey TEST004(set_up);
>>----------------------------------------------------
>>-------------------- set up section ----------------
>>----------------------------------------------------
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>control query default MVQR_REWRITE_ENABLED_OPTION 'ON';

--- SQL operation complete.
>>control query default QUERY_CACHE '0';

--- SQL operation complete.
>>control query default MVQR_PUBLISH_TO 'PRIVATE';

--- SQL operation complete.
>>control query default REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT '1';

--- SQL operation complete.
>>control query default MULTI_JOIN_THRESHOLD '2';

--- SQL operation complete.
>>
>>-- Turn this on so query descriptor will still be generated for single-table
>>-- queries with no Group By.
>>control query default MVQR_ALL_JBBS_IN_QD 'ON';

--- SQL operation complete.
>>
>>-- This is needed temporarily to work around a problem with automatic loggable
>>-- columns that causes a timestamp mismatch error when the schema is dropped.
>>control query default MV_AUTOMATIC_LOGGABLE_COLUMN_MAINTENANCE 'OFF';

--- SQL operation complete.
>>
>>obey GetMvDesc;
>>--set pattern $$VERS_CURR_SCHEMA_VERSION$$ 2400;
>>set param ?mvDescSubId  -2;
>>set param ?mvName 'SUMBY_DAY';
>>set param ?mvSchemaName 'SUMBY';
>>
>>-- query the TEXT SMD table for the descriptor of an MV
>>-- Note: Cast to UTF8, but we don't want to exceed the 20000 byte line
>>--       length limit of the NT version of awk (file CropDescriptor.ksh).
>>prepare getMVDescFromTEXT from
+>  select cast(text0 || coalesce(text1, '') || coalesce(text2, '') || coalesce(text3, '')
+>                    || coalesce(text4, '') || coalesce(text5, '') || coalesce(text6, '')
+>                    || coalesce(text7, '') || coalesce(text8, '') as char(15000 bytes) character set utf8)  as mv_descriptor_text
+>  from
+>		 (SELECT o.object_uid as uid0, text as text0
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 0 ) as row0
+>	left outer join
+>		 (SELECT o.object_uid as uid1, text as text1
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 1 ) as row1
+>		 on uid0 = uid1
+>	left outer join
+>		 (SELECT o.object_uid as uid2, text as text2
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 2 ) as row2
+>		 on uid0 = uid2
+>	left outer join
+>		 (SELECT o.object_uid as uid3, text as text3
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 3 ) as row3
+>		 on uid0 = uid3
+>	left outer join
+>		 (SELECT o.object_uid as uid4, text as text4
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 4 ) as row4
+>		 on uid0 = uid4
+>	left outer join
+>		 (SELECT o.object_uid as uid5, text as text5
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 5 ) as row5
+>		 on uid0 = uid5
+>	left outer join
+>		 (SELECT o.object_uid as uid6, text as text6
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 6 ) as row6
+>		 on uid0 = uid6
+>	left outer join
+>		 (SELECT o.object_uid as uid7, text as text7
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 7 ) as row7
+>		 on uid0 = uid7
+>	left outer join
+>		 (SELECT o.object_uid as uid8, text as text8
+>		         from  HP_DEFINITION_SCHEMA.TEXT t,
+>		               HP_DEFINITION_SCHEMA.objects o,
+>		               HP_SYSTEM_CATALOG.SYSTEM_SCHEMA.schemata s
+>		         where o.object_name = ?mvName
+>		           and o.OBJECT_TYPE = 'MV'
+>		           and o.object_uid = t.object_uid
+>		           and o.schema_uid = s.schema_uid
+>		           and s.schema_name = ?mvSchemaName
+>		           and t.object_sub_id = ?mvDescSubId
+>		           and sequence_num = 8 ) as row8
+>		 on uid0 = uid8;

--- SQL command prepared.
>>
>>
>>prepare checkPlan from
+>  select operator, tname
+>  from table(explain(NULL, 'QUERYSTMT'))
+>  where operator like '%_SCAN%'
+>  order by tname;

--- SQL command prepared.
>>
>>create schema range;

--- SQL operation complete.
>>set schema range;

--- SQL operation complete.
>>set pattern $$MVSchemaName$$ RANGE;
>>
>>
>>create table fact (
+>	fday   int,
+>	fmonth int,
+>	fyear  int,
+>	fitem  int,
+>	fquant int,
+>	fprice numeric (8,2),
+>	dimkey int);

--- SQL operation complete.
>>
>>create table dim1 (dkey int not null not droppable primary key, dimdata int);

--- SQL operation complete.
>>create table dim2 (dkey int not null not droppable primary key, dimdata int);

--- SQL operation complete.
>>
>>--alter table fact add constraint fact_fk1 foreign key (dimkey) references dim1(dkey);
>>--alter table fact add constraint fact_fk2 foreign key (dimkey) references dim2(dkey);
>>
>>insert into fact values
+> ( 4, 1,2010,4,4,83, 8),
+> (23, 1,2010,2,4,67, 3),
+> (11, 3,2010,1,4,39, 6),
+> ( 8, 4,2010,4,2,56, 5),
+> (16, 4,2010,3,2,67, 9),
+> ( 4, 5,2010,2,4,40, 2),
+> ( 6, 7,2010,3,1,63, 6),
+> ( 8, 7,2010,5,4,90, 3),
+> (19, 7,2010,3,2,50, 8),
+> ( 1, 8,2010,3,3, 4, 3),
+> ( 2, 9,2010,3,4, 8, 1),
+> ( 4, 9,2010,2,5,62, 8),
+> (15, 9,2010,5,3,45, 4),
+> (31,10,2010,2,1,39, 8),
+> (12,11,2010,4,5,27, 9),
+> ( 1,12,2010,3,5,21, 8),
+> (10,12,2010,3,5,31, 1),
+> (22, 1,2011,5,4,12, 2),
+> ( 7, 6,2011,1,4,73, 5),
+> (10, 6,2011,5,2,61, 1),
+> (16, 6,2011,1,4,76, 4),
+> (31, 6,2011,3,2,66, 7),
+> (22, 7,2011,4,1,15, 3),
+> (25, 7,2011,5,5,75, 7),
+> ( 5, 8,2011,1,4,87, 3),
+> (10,10,2011,4,1,66, 6),
+> (24,11,2011,4,3,88, 8),
+> (13,12,2011,1,1,59, 7),
+> (15,12,2011,3,3,95, 5),
+> (25,12,2011,2,3,69, 4),
+> ( 9, 1,2012,2,2,71, 9),
+> ( 1, 2,2012,2,1,49, 6),
+> ( 9, 2,2012,4,3,65, 6),
+> ( 9, 2,2012,3,3,67, 3),
+> (17, 2,2012,2,3,98, 3),
+> ( 1, 3,2012,2,4,55, 7),
+> (10, 3,2012,5,4,11, 8),
+> (28, 3,2012,1,5, 7, 5),
+> (21, 4,2012,1,3,32, 8),
+> (23, 4,2012,4,1,25, 4),
+> (27, 4,2012,4,2,61, 5),
+> (28, 5,2012,5,1,44, 8),
+> ( 2, 6,2012,4,3,31, 2),
+> (21, 6,2012,4,3,70, 5),
+> (29, 6,2012,5,1,51, 5),
+> ( 9, 7,2012,1,5,14, 4),
+> (29, 7,2012,2,3,53, 5),
+> (21, 8,2012,3,1,58,10),
+> (18,12,2012,2,3,20,10),
+> (20,12,2012,5,1, 4, 6);

--- 50 row(s) inserted.
>>
>>insert into dim1 values
+> (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10);

--- 10 row(s) inserted.
>>
>>insert into dim2 values
+> (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10);

--- 10 row(s) inserted.
>>
>>create table numtypes
+>(
+>  i    int not null,
+>  si   smallint,
+>  li   largeint check(li<10000000000),
+>  n42  numeric(4,2),
+>  n61u numeric(6,1) unsigned,
+>  r    real,
+>  d    double precision,
+>  f5   float(5)
+>);

--- SQL operation complete.
>>
>>
>>create table dttypes
+>(
+>  i  int,
+>  d  date,
+>  t  time,
+>  t2 time(2),
+>  t6 time(6),
+>  ts timestamp,
+>  ts0 timestamp(0),
+>  ts3 timestamp(3),
+>  yr interval year not null check(yr >= interval '0' year),
+>  ym interval year(3) to month,
+>  mon interval month(4),
+>  sec interval second(2, 4),
+>  mnt interval minute(1),
+>  ms interval minute to second,
+>  hr interval hour(8),
+>  hm interval hour to minute,
+>  hs interval hour to second,
+>  dy interval day(3),
+>  dh interval day to hour,
+>  dm interval day to minute,
+>  ds interval day(7) to second(6)
+>);

--- SQL operation complete.
>>
>>create table t_rangespec
+>  (int_1       smallint default 0 not null
+>  ,int_2       smallint default 0 not null
+>  ,int_3       smallint default 0 not null
+>  ,primary key (int_1, int_2, int_3)
+>  ) no partition;

--- SQL operation complete.
>>
>>insert into t_rangespec values 
+>  (1, 1,  3), (1, 1,  2), (1, 1,  1), (1, 1,  0),
+>  (1, 1, -1), (1, 1, -2), (1, 1, -3), (1, 1, -4);

--- 8 row(s) inserted.
>>
>>obey TEST004(create_mvs);
>>--===========================================
>>-- MJVs
>>--===========================================
>>
>>-- No range preds.
>>create mv range_mjv1
+>	refresh on request
+>	initialized on create
+>	as  select fprice, fquant, 
+>		         dimkey, dimdata
+>	    from fact, dim1
+>	    where dimkey=dkey;

*** WARNING[12112] A secondary index CAT.RANGE.RANGE_MJV1_433555926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>
>>set pattern $$MVName$$ RANGE_MJV1;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_MJV1
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904315510651' isKeyCovered='1' numCols='2'>
          CAT.RANGE.DIM1
        </Table>
        <Table id='T2' TS='212223904314875638' isKeyCovered='1' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J218'>
          <Column id='C186' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM1.DKEY
          </Column>
          <Column ref='C177'>
          </Column>
        </JoinPred>
      </JoinPredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O197' name='SYS_SYSKEY1'>
        <Column id='C170' tableId='T2' colIndex='0' isNullable='0'>
          CAT.RANGE.FACT.SYSKEY
        </Column>
      </Output>
      <Output id='O212' name='FQUANT'>
        <Column id='C175' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O215' name='FPRICE'>
        <Column id='C176' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O218' name='DIMKEY'>
        <Column id='C177' tableId='T2' colIndex='7'>
          CAT.RANGE.FACT.DIMKEY
        </Column>
      </Output>
      <Output id='O224' name='DIMDATA'>
        <Column id='C187' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM1.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- No range preds, only dimdata*2 provided.
>>-- Not back-joinable.
>>create mv range_mjv11
+>	recompute
+>	initialized on create
+>	as  select fprice, fquant, 
+>		   dimdata*2 data2
+>	    from fact, dim1
+>	    where dimkey=dkey;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ RANGE_MJV11;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_MJV11
  </Table>
  <Misc isIncremental='0'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904322066955' numCols='2'>
          CAT.RANGE.DIM1
        </Table>
        <Table id='T2' TS='212223904322066955' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J133'>
          <Column id='C99' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM1.DKEY
          </Column>
          <Column id='C90' tableId='T2' colIndex='7'>
            CAT.RANGE.FACT.DIMKEY
          </Column>
        </JoinPred>
      </JoinPredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O110' name='DATA2'>
        <Expr id='X110'>
          <BinaryOper id='S110' op='*'>
            <Column id='C100' tableId='T1' colIndex='1'>
              CAT.RANGE.DIM1.DIMDATA
            </Column>
            <NumericVal id='S109' scale='0'>
              2
            </NumericVal>
          </BinaryOper>
        </Expr>
      </Output>
      <Output id='O127' name='FQUANT'>
        <Column id='C88' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O130' name='FPRICE'>
        <Column id='C89' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- single value range pred
>>create mv range_mjv2
+>	refresh on request
+>	initialized on create
+>	as  select fprice, fquant, 
+>		         dimkey, dimdata
+>	    from fact, dim1
+>	    where dimkey=dkey
+>	      and dimdata = 10;

*** WARNING[12112] A secondary index CAT.RANGE.RANGE_MJV2_891755926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>
>>set pattern $$MVName$$ RANGE_MJV2;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_MJV2
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904322066955' isKeyCovered='1' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM1
        </Table>
        <Table id='T2' TS='212223904322066955' isKeyCovered='1' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J226'>
          <Column id='C192' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM1.DKEY
          </Column>
          <Column ref='C183'>
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R243' sqlType='INTEGER SIGNED ALLOWS NULLS'>
          <Column id='C193' tableId='T1' colIndex='1'>
            CAT.RANGE.DIM1.DIMDATA
          </Column>
          <OpEQ>
            <NumericVal scale='0'>
              10
            </NumericVal>
          </OpEQ>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O205' name='SYS_SYSKEY1'>
        <Column id='C176' tableId='T2' colIndex='0' isNullable='0'>
          CAT.RANGE.FACT.SYSKEY
        </Column>
      </Output>
      <Output id='O220' name='FQUANT'>
        <Column id='C181' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O223' name='FPRICE'>
        <Column id='C182' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O226' name='DIMKEY'>
        <Column id='C183' tableId='T2' colIndex='7'>
          CAT.RANGE.FACT.DIMKEY
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- Between range pred
>>create mv range_mjv3
+>	refresh on request
+>	initialized on create
+>	as  select fprice, fquant, 
+>		         dimkey, dimdata
+>	    from fact, dim1
+>	    where dimkey=dkey
+>	      and dimdata between 5 and 15;

*** WARNING[12112] A secondary index CAT.RANGE.RANGE_MJV3_911955926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>
>>set pattern $$MVName$$ RANGE_MJV3;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_MJV3
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904322066955' isKeyCovered='1' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM1
        </Table>
        <Table id='T2' TS='212223904322066955' isKeyCovered='1' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J242'>
          <Column id='C207' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM1.DKEY
          </Column>
          <Column ref='C198'>
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R277' sqlType='INTEGER SIGNED ALLOWS NULLS'>
          <Column ref='C208'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='0'>
              5
            </NumericVal>
            <NumericVal scale='0'>
              15
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O221' name='SYS_SYSKEY1'>
        <Column id='C191' tableId='T2' colIndex='0' isNullable='0'>
          CAT.RANGE.FACT.SYSKEY
        </Column>
      </Output>
      <Output id='O236' name='FQUANT'>
        <Column id='C196' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O239' name='FPRICE'>
        <Column id='C197' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O242' name='DIMKEY'>
        <Column id='C198' tableId='T2' colIndex='7'>
          CAT.RANGE.FACT.DIMKEY
        </Column>
      </Output>
      <Output id='O248' name='DIMDATA'>
        <Column id='C208' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM1.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- Between range pred
>>create mv range_mjv4
+>	refresh on request
+>	initialized on create
+>	as  select fprice, fquant, 
+>		         dimkey, dimdata
+>	    from fact, dim1
+>	    where dimkey=dkey
+>	      and dimdata*2 between 10 and 30;

*** WARNING[12112] A secondary index CAT.RANGE.RANGE_MJV4_878165926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>
>>set pattern $$MVName$$ RANGE_MJV4;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_MJV4
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904322066955' isKeyCovered='1' numCols='2'>
          CAT.RANGE.DIM1
        </Table>
        <Table id='T2' TS='212223904322066955' isKeyCovered='1' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J236'>
          <Column id='C199' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM1.DKEY
          </Column>
          <Column ref='C190'>
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R260' sqlType='NUMERIC(11) SIGNED ALLOWS NULLS'>
          <Expr id='X210'>
            <BinaryOper id='S210' op='*'>
              <Column ref='C200'>
              </Column>
              <NumericVal id='S209' scale='0'>
                2
              </NumericVal>
            </BinaryOper>
          </Expr>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='0'>
              10
            </NumericVal>
            <NumericVal scale='0'>
              30
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O215' name='SYS_SYSKEY1'>
        <Column id='C183' tableId='T2' colIndex='0' isNullable='0'>
          CAT.RANGE.FACT.SYSKEY
        </Column>
      </Output>
      <Output id='O230' name='FQUANT'>
        <Column id='C188' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O233' name='FPRICE'>
        <Column id='C189' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O236' name='DIMKEY'>
        <Column id='C190' tableId='T2' colIndex='7'>
          CAT.RANGE.FACT.DIMKEY
        </Column>
      </Output>
      <Output id='O242' name='DIMDATA'>
        <Column id='C200' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM1.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>--==============================================
>>-- Single-table MVs to test ranges + constraints
>>--==============================================
>>
>>create mv mvrngcon_i(x)
+>    refresh on request
+>    initialized on create
+>    as select i
+>       from numtypes
+>       where i > 100;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_I;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_I
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904320269847' isKeyCovered='1' numCols='9' rangeBits='00000004'>
          CAT.RANGE.NUMTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R158' sqlType='INTEGER SIGNED NO NULLS'>
          <Column ref='C101'>
          </Column>
          <OpGE isNormalized='1'>
            <NumericVal scale='0'>
              101
            </NumericVal>
          </OpGE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O129' name='SYS_SYSKEY1'>
        <Column id='C100' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.NUMTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O132' name='X'>
        <Column id='C101' tableId='T1' colIndex='1' isNullable='0'>
          CAT.RANGE.NUMTYPES.I
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_si(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, si
+>       from numtypes
+>       where si between 50 and 33000;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_SI;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_SI
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904376598581' isKeyCovered='1' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R193' sqlType='SMALLINT SIGNED ALLOWS NULLS'>
          <Column ref='C118'>
          </Column>
          <OpGE isNormalized='1'>
            <NumericVal scale='0'>
              50
            </NumericVal>
          </OpGE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O146' name='SYS_SYSKEY1'>
        <Column id='C116' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.NUMTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O149' name='X'>
        <Column id='C117' tableId='T1' colIndex='1' isNullable='0'>
          CAT.RANGE.NUMTYPES.I
        </Column>
      </Output>
      <Output id='O152' name='Y'>
        <Column id='C118' tableId='T1' colIndex='2'>
          CAT.RANGE.NUMTYPES.SI
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_li(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, li
+>       from numtypes
+>       where li < 10000000000;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_LI;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_LI
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904376598581' isKeyCovered='1' numCols='9' rangeBits='00000001'>
          CAT.RANGE.NUMTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R159' sqlType='LARGEINT ALLOWS NULLS'>
          <Column ref='C105'>
          </Column>
          <OpLE>
            <NumericVal scale='0'>
              9999999999
            </NumericVal>
          </OpLE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O130' name='SYS_SYSKEY1'>
        <Column id='C102' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.NUMTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O133' name='X'>
        <Column id='C103' tableId='T1' colIndex='1' isNullable='0'>
          CAT.RANGE.NUMTYPES.I
        </Column>
      </Output>
      <Output id='O139' name='Y'>
        <Column id='C105' tableId='T1' colIndex='3'>
          CAT.RANGE.NUMTYPES.LI
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_n42(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, n42
+>       from numtypes
+>       where n42 < 100;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_N42;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_N42
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904376598581' isKeyCovered='1' numCols='9' rangeBits='00000080'>
          CAT.RANGE.NUMTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R161' sqlType='NUMERIC(4,2) SIGNED ALLOWS NULLS'>
          <Column ref='C107'>
          </Column>
          <!-- empty Range element indicates IS NOT NULL -->
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O132' name='SYS_SYSKEY1'>
        <Column id='C103' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.NUMTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O135' name='X'>
        <Column id='C104' tableId='T1' colIndex='1' isNullable='0'>
          CAT.RANGE.NUMTYPES.I
        </Column>
      </Output>
      <Output id='O144' name='Y'>
        <Column id='C107' tableId='T1' colIndex='4'>
          CAT.RANGE.NUMTYPES.N42
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_n61u(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, n61u
+>       from numtypes
+>       where n61u between 0 and 100;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_N61U;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_N61U
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904376598581' isKeyCovered='1' numCols='9' rangeBits='00000040'>
          CAT.RANGE.NUMTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R193' sqlType='NUMERIC(6,1) UNSIGNED ALLOWS NULLS'>
          <Column ref='C121'>
          </Column>
          <OpLE isNormalized='1'>
            <NumericVal scale='1'>
              100.0
            </NumericVal>
          </OpLE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O146' name='SYS_SYSKEY1'>
        <Column id='C116' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.NUMTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O149' name='X'>
        <Column id='C117' tableId='T1' colIndex='1' isNullable='0'>
          CAT.RANGE.NUMTYPES.I
        </Column>
      </Output>
      <Output id='O161' name='Y'>
        <Column id='C121' tableId='T1' colIndex='5'>
          CAT.RANGE.NUMTYPES.N61U
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_r(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, r
+>       from numtypes
+>       where r < 3.40282347e+45;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_R;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_R
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904376598581' isKeyCovered='1' numCols='9' rangeBits='00000020'>
          CAT.RANGE.NUMTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R161' sqlType='REAL ALLOWS NULLS'>
          <Column ref='C109'>
          </Column>
          <!-- empty Range element indicates IS NOT NULL -->
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O132' name='SYS_SYSKEY1'>
        <Column id='C103' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.NUMTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O135' name='X'>
        <Column id='C104' tableId='T1' colIndex='1' isNullable='0'>
          CAT.RANGE.NUMTYPES.I
        </Column>
      </Output>
      <Output id='O150' name='Y'>
        <Column id='C109' tableId='T1' colIndex='6'>
          CAT.RANGE.NUMTYPES.R
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>
>>--==========================================================
>>-- Additional MVs to test ranges on date/time/interval types
>>--==========================================================
>>
>>create mv mvrngcon_d(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, d
+>       from dttypes
+>       where d > date'2000-01-30';

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_D;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_D
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904320777110' isKeyCovered='1' numCols='22' rangeBits='00000002'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R289' sqlType='DATE ALLOWS NULLS'>
          <Column ref='C168'>
          </Column>
          <OpGE isNormalized='1'>
            <NumericVal scale='0'>
              2451574
            </NumericVal>
          </OpGE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O221' name='SYS_SYSKEY1'>
        <Column id='C166' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O224' name='X'>
        <Column id='C167' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O227' name='Y'>
        <Column id='C168' tableId='T1' colIndex='2'>
          CAT.RANGE.DTTYPES.D
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_t(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, t
+>       from dttypes
+>       where t between time'10:00:00' and time'11:25:30';

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_T;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_T
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00000001'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R321' sqlType='TIME(0) ALLOWS NULLS'>
          <Column ref='C182'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='0'>
              36000000000
            </NumericVal>
            <NumericVal scale='0'>
              41130000000
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C179' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C180' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O244' name='Y'>
        <Column id='C182' tableId='T1' colIndex='3'>
          CAT.RANGE.DTTYPES.T
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_t2(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, t2
+>       from dttypes
+>       where t2 between time'10:00:00.20' and time'11:25:30.45';

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_T2;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_T2
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00000080'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R321' sqlType='TIME(2) ALLOWS NULLS'>
          <Column ref='C183'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='2'>
              360002000.00
            </NumericVal>
            <NumericVal scale='2'>
              411304500.00
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C179' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C180' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O247' name='Y'>
        <Column id='C183' tableId='T1' colIndex='4'>
          CAT.RANGE.DTTYPES.T2
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_t6(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, t6
+>       from dttypes
+>       where t6 < time'01:15:30.123456';

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_T6;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_T6
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00000040'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R289' sqlType='TIME(6) ALLOWS NULLS'>
          <Column ref='C171'>
          </Column>
          <OpLE isNormalized='1'>
            <NumericVal scale='6'>
              4530.123455
            </NumericVal>
          </OpLE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O221' name='SYS_SYSKEY1'>
        <Column id='C166' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O224' name='X'>
        <Column id='C167' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O236' name='Y'>
        <Column id='C171' tableId='T1' colIndex='5'>
          CAT.RANGE.DTTYPES.T6
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_ts(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, ts
+>       from dttypes
+>       where ts < timestamp'2005-10-12 14:45:01.123456';

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_TS;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_TS
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00000020'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R289' sqlType='TIMESTAMP(6) ALLOWS NULLS'>
          <Column ref='C172'>
          </Column>
          <OpLE isNormalized='1'>
            <NumericVal scale='6'>
              211995888301.123455
            </NumericVal>
          </OpLE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O221' name='SYS_SYSKEY1'>
        <Column id='C166' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O224' name='X'>
        <Column id='C167' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O239' name='Y'>
        <Column id='C172' tableId='T1' colIndex='6'>
          CAT.RANGE.DTTYPES.TS
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_ts3(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, ts3
+>       from dttypes
+>       where ts3 < timestamp'2005-10-12 14:45:01.125'   ;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_TS3;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_TS3
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00000800'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R289' sqlType='TIMESTAMP(3) ALLOWS NULLS'>
          <Column ref='C174'>
          </Column>
          <OpLE isNormalized='1'>
            <NumericVal scale='3'>
              211995888301124.000
            </NumericVal>
          </OpLE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O221' name='SYS_SYSKEY1'>
        <Column id='C166' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O224' name='X'>
        <Column id='C167' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O245' name='Y'>
        <Column id='C174' tableId='T1' colIndex='8'>
          CAT.RANGE.DTTYPES.TS3
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_yr(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, yr
+>       from dttypes
+>       where yr < interval '20' year;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_YR;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_YR
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00000400'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R291' sqlType='INTERVAL YEAR(2) NO NULLS'>
          <Column ref='C177'>
          </Column>
          <OpLE isNormalized='1'>
            <NumericVal scale='0'>
              228
            </NumericVal>
          </OpLE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O223' name='SYS_SYSKEY1'>
        <Column id='C168' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O226' name='X'>
        <Column id='C169' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O250' name='Y'>
        <Column id='C177' tableId='T1' colIndex='9' isNullable='0'>
          CAT.RANGE.DTTYPES.YR
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_ym(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, ym
+>       from dttypes
+>       where ym between interval '2' year and interval '3-6' year to month;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_YM;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_YM
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00000200'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R321' sqlType='INTERVAL YEAR(3) TO MONTH ALLOWS NULLS'>
          <Column ref='C189'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='0'>
              24
            </NumericVal>
            <NumericVal scale='0'>
              42
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C179' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C180' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O265' name='Y'>
        <Column id='C189' tableId='T1' colIndex='10'>
          CAT.RANGE.DTTYPES.YM
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_mon(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, mon
+>       from dttypes
+>       where mon > interval'5000'month(4);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_MON;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_MON
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00000100'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R289' sqlType='INTERVAL MONTH(4) ALLOWS NULLS'>
          <Column ref='C177'>
          </Column>
          <OpGE isNormalized='1'>
            <NumericVal scale='0'>
              5001
            </NumericVal>
          </OpGE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O221' name='SYS_SYSKEY1'>
        <Column id='C166' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O224' name='X'>
        <Column id='C167' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O254' name='Y'>
        <Column id='C177' tableId='T1' colIndex='11'>
          CAT.RANGE.DTTYPES.MON
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- Note that the range in the MV definition extends beyond the range allowable
>>-- for the type.
>>create mv mvrngcon_sec(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, sec
+>       from dttypes
+>       where sec between interval'3.5'second and interval'125.45'second(3,2);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_SEC;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_SEC
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00008000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R321' sqlType='INTERVAL SECOND(2,4) ALLOWS NULLS'>
          <Column ref='C191'>
          </Column>
          <OpGE isNormalized='1'>
            <NumericVal scale='4'>
              350.0000
            </NumericVal>
          </OpGE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C179' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C180' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O271' name='Y'>
        <Column id='C191' tableId='T1' colIndex='12'>
          CAT.RANGE.DTTYPES.SEC
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_mnt(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, mnt
+>       from dttypes
+>       where mnt < interval'5'minute and mnt > interval'30.5'second(2,1);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_MNT;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_MNT
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00004000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R319' sqlType='INTERVAL MINUTE(1) ALLOWS NULLS'>
          <Column ref='C191'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='0'>
              60000000
            </NumericVal>
            <NumericVal scale='0'>
              240000000
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C178' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C179' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O274' name='Y'>
        <Column id='C191' tableId='T1' colIndex='13'>
          CAT.RANGE.DTTYPES.MNT
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_ms(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, ms
+>       from dttypes
+>       where ms = interval'345'second(3) or ms between interval-'5'minute and interval'5'minute;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_MS;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_MS
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00002000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R339' sqlType='INTERVAL MINUTE(2) TO SECOND(6) ALLOWS NULLS'>
          <Column ref='C205'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='6'>
              -300.000000
            </NumericVal>
            <NumericVal scale='6'>
              300.000000
            </NumericVal>
          </OpBT>
          <OpEQ>
            <NumericVal scale='6'>
              345.000000
            </NumericVal>
          </OpEQ>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O250' name='SYS_SYSKEY1'>
        <Column id='C191' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O253' name='X'>
        <Column id='C192' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O292' name='Y'>
        <Column id='C205' tableId='T1' colIndex='14'>
          CAT.RANGE.DTTYPES.MS
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_hr(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, hr
+>       from dttypes
+>       where hr in (interval'30'day, interval'60'minute, interval'7200'second(4)) or hr > interval'10000'hour(5);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_HR;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_HR
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00001000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R350' sqlType='INTERVAL HOUR(8) ALLOWS NULLS'>
          <Column ref='C213'>
          </Column>
          <OpEQ>
            <NumericVal scale='0'>
              3600000000
            </NumericVal>
            <NumericVal scale='0'>
              7200000000
            </NumericVal>
            <NumericVal scale='0'>
              2592000000000
            </NumericVal>
          </OpEQ>
          <OpGE isNormalized='1'>
            <NumericVal scale='0'>
              36003600000000
            </NumericVal>
          </OpGE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O262' name='SYS_SYSKEY1'>
        <Column id='C198' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O265' name='X'>
        <Column id='C199' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O307' name='Y'>
        <Column id='C213' tableId='T1' colIndex='15'>
          CAT.RANGE.DTTYPES.HR
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_hm(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, hm
+>       from dttypes
+>       where hm < interval'90'minute and hm >= interval'1'hour;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_HM;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_HM
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00080000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R319' sqlType='INTERVAL HOUR(2) TO MINUTE ALLOWS NULLS'>
          <Column ref='C194'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='0'>
              3600000000
            </NumericVal>
            <NumericVal scale='0'>
              5340000000
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C178' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C179' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O283' name='Y'>
        <Column id='C194' tableId='T1' colIndex='16'>
          CAT.RANGE.DTTYPES.HM
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- Predicate on hs covers entire range of possible values, so rangepred will
>>-- be generated without any ops in descriptor, indicating that the only requirement
>>-- is that the column has a non-null value.
>>create mv mvrngcon_hs(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, hs
+>       from dttypes
+>       where hs >= interval-'99:59:59.999999'hour to second and hs <= interval'99:59:59.999999'hour to second;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_HS;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_HS
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00040000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R319' sqlType='INTERVAL HOUR(2) TO SECOND(6) ALLOWS NULLS'>
          <Column ref='C195'>
          </Column>
          <!-- empty Range element indicates IS NOT NULL -->
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C178' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C179' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O286' name='Y'>
        <Column id='C195' tableId='T1' colIndex='17'>
          CAT.RANGE.DTTYPES.HS
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- Predicate on hs covers all but the minimum and maximum value for the interval.
>>create mv mvrngcon_hs_1(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, hs
+>       from dttypes
+>       where hs > interval-'99:59:59.999999'hour to second and hs < interval'99:59:59.999999'hour to second;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_HS_1;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_HS_1
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00040000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R319' sqlType='INTERVAL HOUR(2) TO SECOND(6) ALLOWS NULLS'>
          <Column ref='C195'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='6'>
              -359999.999998
            </NumericVal>
            <NumericVal scale='6'>
              359999.999998
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C178' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C179' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O286' name='Y'>
        <Column id='C195' tableId='T1' colIndex='17'>
          CAT.RANGE.DTTYPES.HS
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- Predicate on hs covers interval's max value with a bounded range (no use of >).
>>create mv mvrngcon_hs_2(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, hs
+>       from dttypes
+>       where hs between interval'0'second and interval'99:59:59.999999'hour to second;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_HS_2;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_HS_2
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00040000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R321' sqlType='INTERVAL HOUR(2) TO SECOND(6) ALLOWS NULLS'>
          <Column ref='C196'>
          </Column>
          <OpGE isNormalized='1'>
            <NumericVal scale='6'>
              .000000
            </NumericVal>
          </OpGE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C179' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C180' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O286' name='Y'>
        <Column id='C196' tableId='T1' colIndex='17'>
          CAT.RANGE.DTTYPES.HS
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_dy(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, dy
+>       from dttypes
+>       where dy = interval'100'day(3);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_DY;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_DY
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00020000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R289' sqlType='INTERVAL DAY(3) ALLOWS NULLS'>
          <Column id='C183' tableId='T1' colIndex='18'>
            CAT.RANGE.DTTYPES.DY
          </Column>
          <OpEQ>
            <NumericVal scale='0'>
              8640000000000
            </NumericVal>
          </OpEQ>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O220' name='SYS_SYSKEY1'>
        <Column id='C165' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O223' name='X'>
        <Column id='C166' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- The predicate in the MV definition is not satisfiable because the range covers
>>-- only values that are beyond the range allowable for the type. Therefore, the
>>-- MV will always be empty.
>>create mv mvrngcon_dh(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, dh
+>       from dttypes
+>       where dh > interval'100'day(3);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_DH;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_DH
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <ResidualPredList>
        <Residual id='D291'>
          <Function id='S291' op='return_false'>
          </Function>
        </Residual>
      </ResidualPredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O221' name='SYS_SYSKEY1'>
        <Column id='C166' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O224' name='X'>
        <Column id='C167' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O278' name='Y'>
        <Column id='C185' tableId='T1' colIndex='19'>
          CAT.RANGE.DTTYPES.DH
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- The predicate in the MV definition is not satisfiable because the range covers
>>-- only values that are below the range allowable for the type. Therefore, the
>>-- MV will always be empty.
>>create mv mvrngcon_dm(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, dm
+>       from dttypes
+>       where dm < interval-'100'day(3);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_DM;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_DM
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <ResidualPredList>
        <Residual id='D291'>
          <Function id='S291' op='return_false'>
          </Function>
        </Residual>
      </ResidualPredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O221' name='SYS_SYSKEY1'>
        <Column id='C166' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O224' name='X'>
        <Column id='C167' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O281' name='Y'>
        <Column id='C186' tableId='T1' colIndex='20'>
          CAT.RANGE.DTTYPES.DM
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>create mv mvrngcon_ds(x,y)
+>    refresh on request
+>    initialized on create
+>    as select i, ds
+>       from dttypes
+>       where ds between interval-'1234567 10:20:30.123456'day(7) to second(6) and interval'365'day(3);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ MVRNGCON_DS;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.MVRNGCON_DS
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B10000'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904390906946' isKeyCovered='1' numCols='22' rangeBits='00400000'>
          CAT.RANGE.DTTYPES
        </Table>
      </JBBCList>
      <RangePredList>
        <Range id='R321' sqlType='INTERVAL DAY(7) TO SECOND(6) ALLOWS NULLS'>
          <Column ref='C200'>
          </Column>
          <OpBT startIsIncluded='1' endIsIncluded='1'>
            <NumericVal scale='6'>
              -106666626030.123456
            </NumericVal>
            <NumericVal scale='6'>
              31536000.000000
            </NumericVal>
          </OpBT>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O235' name='SYS_SYSKEY1'>
        <Column id='C179' tableId='T1' colIndex='0' isNullable='0'>
          CAT.RANGE.DTTYPES.SYSKEY
        </Column>
      </Output>
      <Output id='O238' name='X'>
        <Column id='C180' tableId='T1' colIndex='1'>
          CAT.RANGE.DTTYPES.I
        </Column>
      </Output>
      <Output id='O298' name='Y'>
        <Column id='C200' tableId='T1' colIndex='21'>
          CAT.RANGE.DTTYPES.DS
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>
>>obey TEST004(match_JQ1);
>>--===========================================
>>-- JQ1: range pred on different column - only MJV1 (NotProvided) should match
>>--===========================================
>>-- The ORDER BY clause was added to avoid sorting the resulting XML
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>obey TEST004(RANGE_JQ1);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey, dimdata
+>      from fact, dim1
+>      where dimkey=dkey
+>        and fprice between 1 and 6
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>set pattern $$QueryName$$ RANGE_JQ1;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904322066955' numCols='2'>                     
          CAT.RANGE.DIM1                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM1.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8' rangeBits='00000020'>
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J52'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column ref='C8'>                                                     
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R87' sqlType='NUMERIC(8,2) SIGNED ALLOWS NULLS'>             
          <Column ref='C7'>                                                     
          </Column>                                                             
          <OpBT startIsIncluded='1' endIsIncluded='1'>                          
            <NumericVal scale='2'>                                              
              1.00                                                              
            </NumericVal>                                                       
            <NumericVal scale='2'>                                              
              6.00                                                              
            </NumericVal>                                                       
          </OpBT>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O46'>                                                         
        <Column id='C6' tableId='T2' colIndex='5'>                              
          CAT.RANGE.FACT.FQUANT                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O49'>                                                         
        <Column id='C7' tableId='T2' colIndex='6'>                              
          CAT.RANGE.FACT.FPRICE                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O52'>                                                         
        <Column id='C8' tableId='T2' colIndex='7'>                              
          CAT.RANGE.FACT.DIMKEY                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O58'>                                                         
        <Column id='C18' tableId='T1' colIndex='1'>                             
          CAT.RANGE.DIM1.DIMDATA                                                
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 75 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo # All comments should be ignored by QMS. >> range1.in;
>>sh echo # CHECK request does nothing at present, but should not interfere with subsequent requests >> range1.in;
>>sh echo # in the input file. >> range1.in;
>>sh echo CHECK >> range1.in;
>>sh echo # Likewise, an unknown requests is just noted in the log. No exception is thrown, and >> range1.in;
>>sh echo # processing of subsequent requests is continued. >> range1.in;
>>sh echo BLARG >> range1.in;
>>sh echo INITIALIZE             >> range1.in;
>>sh echo PUBLISH RANGE_MJV1.xml >> range1.in;
>>sh echo PUBLISH RANGE_MJV2.xml >> range1.in;
>>sh echo PUBLISH RANGE_MJV3.xml >> range1.in;
>>sh echo PUBLISH RANGE_MJV4.xml >> range1.in;
>>sh echo # STATS request writes to log, not output file. >> range1.in;
>>sh echo STATS                  >> range1.in;
>>sh echo MATCH RANGE_JQ1.xml    >> range1.in;
>>sh echo # CLEANUP has the effect of deleting the singleton instance of the Qms object for command-line QMS. >> range1.in;
>>sh echo # This gets rid of any MVs previously published in the input file or read from metadata by INITIALIZE. >> range1.in;
>>sh echo CLEANUP >> range1.in;
>>sh echo # The same match request will now not match anything. >> range1.in;
>>sh echo MATCH RANGE_JQ1.xml    >> range1.in;
>>sh echo # Now publish the matching MV and match again. The result descriptor should have it, but not the <Info> elements saying why the others do not match. >> range1.in;
>>sh echo PUBLISH RANGE_MJV1.xml >> range1.in;
>>sh echo MATCH RANGE_JQ1.xml    >> range1.in;
>>
>>-- Test handling of empty catalog in QmsInitializer::processCatalogs().
>>create catalog mvqr_t004_emptycat;

--- SQL operation complete.
>>sh sh -c "$QMS range1.in range1.out";
>>drop catalog mvqr_t004_emptycat;

--- SQL operation complete.
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM1
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV1
          </MVName>
          <RangePredList>
            <Range ref='R87' result='NotProvided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O46' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O49' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O52' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
            <Output ref='O58' result='Provided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV11 was disqualified because column CAT.RANGE.DIM1.DKEY cannot be provided.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV2 was disqualified because Table CAT.RANGE.DIM1 failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV3 was disqualified because Table CAT.RANGE.DIM1 failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV4 was disqualified because MV range predicate R260 was not matched by the query.]]></Info>
  </JbbResult>
</Result>
<Result>
  <Version>
    1.0
  </Version>
</Result>
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM1
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV1
          </MVName>
          <RangePredList>
            <Range ref='R87' result='NotProvided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O46' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O49' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O52' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
            <Output ref='O58' result='Provided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
  </JbbResult>
</Result>
>>
>>-- Verify the MV is picked by the optimizer.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey, dimdata
+>      from fact, dim1
+>      where dimkey=dkey
+>        and fprice between 1 and 6
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV1                                        

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY       DIMDATA    
------------  -----------  -----------  -----------

        4.00            3            3            3
        4.00            1            6            6

--- 2 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey, dimdata
+>      from fact, dim1
+>      where dimkey=dkey
+>        and fprice between 1 and 6
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY       DIMDATA    
------------  -----------  -----------  -----------

        4.00            3            3            3
        4.00            1            6            6

--- 2 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>-- Test use of nonexistent input file.
>>sh sh -c "$QMS alkjdlfksuytk range1.out";
>>
>>-- Test use of illegal output file name.
>>sh sh -c "$QMS range1.in xyz:/range1.out";
>>
>>-- This test will fail when DEFAULTS request is implemented, prompting us to
>>-- change the expected file. This ensures we won't forget to test it.
>>sh echo # DEFAULTS request not yet implemented, but should be recognized.
+>sh echo DEFAULTS >> testDefaults.in;
>>sh sh -c "$QMS testDefaults.in testDefaults.out";
>>log;
>>
>>obey TEST004(match_JQ2);
>>--===========================================
>>-- JQ2: single value on dimdata - should match MJV1 (NotProvided), MJV2 (Provided) and MJV3 (NotProvided).
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>obey TEST004(RANGE_JQ2);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata = 10
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>set pattern $$QueryName$$ RANGE_JQ2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904322066955' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM1                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM1.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8'>                     
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J51'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column ref='C8'>                                                     
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R68' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column id='C18' tableId='T1' colIndex='1'>                           
            CAT.RANGE.DIM1.DIMDATA                                              
          </Column>                                                             
          <OpEQ>                                                                
            <NumericVal scale='0'>                                              
              10                                                                
            </NumericVal>                                                       
          </OpEQ>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O45'>                                                         
        <Column id='C6' tableId='T2' colIndex='5'>                              
          CAT.RANGE.FACT.FQUANT                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O48'>                                                         
        <Column id='C7' tableId='T2' colIndex='6'>                              
          CAT.RANGE.FACT.FPRICE                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O51'>                                                         
        <Column id='C8' tableId='T2' colIndex='7'>                              
          CAT.RANGE.FACT.DIMKEY                                                 
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 68 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE             >> range2.in;
>>sh echo PUBLISH RANGE_MJV1.xml >> range2.in;
>>sh echo PUBLISH RANGE_MJV2.xml >> range2.in;
>>sh echo PUBLISH RANGE_MJV3.xml >> range2.in;
>>sh echo PUBLISH RANGE_MJV4.xml >> range2.in;
>>sh echo MATCH RANGE_JQ2.xml    >> range2.in;
>>
>>sh sh -c "$QMS range2.in range2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM1
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV1
          </MVName>
          <RangePredList>
            <Range ref='R68' result='NotProvided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O45' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV2
          </MVName>
          <RangePredList>
            <Range ref='R68' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O45' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV3
          </MVName>
          <RangePredList>
            <Range ref='R68' result='NotProvided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O45' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV11 was disqualified because column CAT.RANGE.DIM1.DIMDATA cannot be provided.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV4 was disqualified because MV range predicate R260 was not matched by the query.]]></Info>
  </JbbResult>
</Result>
>>
>>-- Verify the MV is picked by the optimizer.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata = 10
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV2                                        

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY     
------------  -----------  -----------

       20.00            3           10
       58.00            1           10

--- 2 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata = 10
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY     
------------  -----------  -----------

       20.00            3           10
       58.00            1           10

--- 2 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>obey TEST004(match_JQ3);
>>--===========================================
>>-- JQ3: identical range on dimdata - should match MJV1 (NotProvided) and MJV3 (Provided).
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>obey TEST004(RANGE_JQ3);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata between 5 and 15
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>set pattern $$QueryName$$ RANGE_JQ3;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904322066955' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM1                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM1.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8'>                     
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J52'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column ref='C8'>                                                     
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R86' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column id='C18' tableId='T1' colIndex='1'>                           
            CAT.RANGE.DIM1.DIMDATA                                              
          </Column>                                                             
          <OpBT startIsIncluded='1' endIsIncluded='1'>                          
            <NumericVal scale='0'>                                              
              5                                                                 
            </NumericVal>                                                       
            <NumericVal scale='0'>                                              
              15                                                                
            </NumericVal>                                                       
          </OpBT>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O46'>                                                         
        <Column id='C6' tableId='T2' colIndex='5'>                              
          CAT.RANGE.FACT.FQUANT                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O49'>                                                         
        <Column id='C7' tableId='T2' colIndex='6'>                              
          CAT.RANGE.FACT.FPRICE                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O52'>                                                         
        <Column id='C8' tableId='T2' colIndex='7'>                              
          CAT.RANGE.FACT.DIMKEY                                                 
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 71 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE             >> range3.in;
>>sh echo PUBLISH RANGE_MJV1.xml >> range3.in;
>>sh echo PUBLISH RANGE_MJV2.xml >> range3.in;
>>sh echo PUBLISH RANGE_MJV3.xml >> range3.in;
>>sh echo PUBLISH RANGE_MJV4.xml >> range3.in;
>>sh echo MATCH RANGE_JQ3.xml    >> range3.in;
>>
>>sh sh -c "$QMS range3.in range3.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM1
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV1
          </MVName>
          <RangePredList>
            <Range ref='R86' result='NotProvided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O46' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O49' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O52' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV3
          </MVName>
          <RangePredList>
            <Range ref='R86' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O46' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O49' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O52' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV11 was disqualified because column CAT.RANGE.DIM1.DIMDATA cannot be provided.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV2 was disqualified because The query range predicate R86 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV4 was disqualified because MV range predicate R260 was not matched by the query.]]></Info>
  </JbbResult>
</Result>
>>
>>-- Verify the MV is picked by the optimizer.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata between 5 and 15
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV3                                        

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY     
------------  -----------  -----------

        7.00            5            5
       51.00            1            5
       53.00            3            5
       56.00            2            5
       61.00            2            5
       70.00            3            5
       73.00            4            5
       95.00            3            5
        4.00            1            6
       39.00            4            6
       49.00            1            6
       63.00            1            6
       65.00            3            6
       66.00            1            6
       55.00            4            7
       59.00            1            7
       66.00            2            7
       75.00            5            7
       11.00            4            8
       21.00            5            8
       32.00            3            8
       39.00            1            8
       44.00            1            8
       50.00            2            8
       62.00            5            8
       83.00            4            8
       88.00            3            8
       27.00            5            9
       67.00            2            9
       71.00            2            9
       20.00            3           10
       58.00            1           10

--- 32 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata between 5 and 15
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY     
------------  -----------  -----------

        7.00            5            5
       51.00            1            5
       53.00            3            5
       56.00            2            5
       61.00            2            5
       70.00            3            5
       73.00            4            5
       95.00            3            5
        4.00            1            6
       39.00            4            6
       49.00            1            6
       63.00            1            6
       65.00            3            6
       66.00            1            6
       55.00            4            7
       59.00            1            7
       66.00            2            7
       75.00            5            7
       11.00            4            8
       21.00            5            8
       32.00            3            8
       39.00            1            8
       44.00            1            8
       50.00            2            8
       62.00            5            8
       83.00            4            8
       88.00            3            8
       27.00            5            9
       67.00            2            9
       71.00            2            9
       20.00            3           10
       58.00            1           10

--- 32 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>obey TEST004(match_JQ4);
>>--===========================================
>>-- JQ4: bigger range - should match only MJV1 (NotProvided).
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>obey TEST004(RANGE_JQ4);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata between 5 and 16
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>set pattern $$QueryName$$ RANGE_JQ4;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904322066955' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM1                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM1.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8'>                     
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J52'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column ref='C8'>                                                     
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R86' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column id='C18' tableId='T1' colIndex='1'>                           
            CAT.RANGE.DIM1.DIMDATA                                              
          </Column>                                                             
          <OpBT startIsIncluded='1' endIsIncluded='1'>                          
            <NumericVal scale='0'>                                              
              5                                                                 
            </NumericVal>                                                       
            <NumericVal scale='0'>                                              
              16                                                                
            </NumericVal>                                                       
          </OpBT>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O46'>                                                         
        <Column id='C6' tableId='T2' colIndex='5'>                              
          CAT.RANGE.FACT.FQUANT                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O49'>                                                         
        <Column id='C7' tableId='T2' colIndex='6'>                              
          CAT.RANGE.FACT.FPRICE                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O52'>                                                         
        <Column id='C8' tableId='T2' colIndex='7'>                              
          CAT.RANGE.FACT.DIMKEY                                                 
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 71 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE             >> range4.in;
>>sh echo PUBLISH RANGE_MJV1.xml >> range4.in;
>>sh echo PUBLISH RANGE_MJV2.xml >> range4.in;
>>sh echo PUBLISH RANGE_MJV3.xml >> range4.in;
>>sh echo PUBLISH RANGE_MJV4.xml >> range4.in;
>>sh echo MATCH RANGE_JQ4.xml    >> range4.in;
>>
>>sh sh -c "$QMS range4.in range4.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM1
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV1
          </MVName>
          <RangePredList>
            <Range ref='R86' result='NotProvided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O46' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O49' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O52' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV11 was disqualified because column CAT.RANGE.DIM1.DIMDATA cannot be provided.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV2 was disqualified because The query range predicate R86 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV3 was disqualified because The query range predicate R86 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV4 was disqualified because MV range predicate R260 was not matched by the query.]]></Info>
  </JbbResult>
</Result>
>>
>>-- Verify the MV is picked by the optimizer.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata between 5 and 16
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV1                                        

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY     
------------  -----------  -----------

        7.00            5            5
       51.00            1            5
       53.00            3            5
       56.00            2            5
       61.00            2            5
       70.00            3            5
       73.00            4            5
       95.00            3            5
        4.00            1            6
       39.00            4            6
       49.00            1            6
       63.00            1            6
       65.00            3            6
       66.00            1            6
       55.00            4            7
       59.00            1            7
       66.00            2            7
       75.00            5            7
       11.00            4            8
       21.00            5            8
       32.00            3            8
       39.00            1            8
       44.00            1            8
       50.00            2            8
       62.00            5            8
       83.00            4            8
       88.00            3            8
       27.00            5            9
       67.00            2            9
       71.00            2            9
       20.00            3           10
       58.00            1           10

--- 32 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata between 5 and 16
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY     
------------  -----------  -----------

        7.00            5            5
       51.00            1            5
       53.00            3            5
       56.00            2            5
       61.00            2            5
       70.00            3            5
       73.00            4            5
       95.00            3            5
        4.00            1            6
       39.00            4            6
       49.00            1            6
       63.00            1            6
       65.00            3            6
       66.00            1            6
       55.00            4            7
       59.00            1            7
       66.00            2            7
       75.00            5            7
       11.00            4            8
       21.00            5            8
       32.00            3            8
       39.00            1            8
       44.00            1            8
       50.00            2            8
       62.00            5            8
       83.00            4            8
       88.00            3            8
       27.00            5            9
       67.00            2            9
       71.00            2            9
       20.00            3           10
       58.00            1           10

--- 32 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>obey TEST004(match_JQ5);
>>--===========================================
>>-- JQ5: Same range but also IS NULL - Should match only MJV1 (NotProvided).
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>obey TEST004(RANGE_JQ5);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and (dimdata between 5 and 15 OR dimdata IS NULL)
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>set pattern $$QueryName$$ RANGE_JQ5;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904322066955' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM1                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM1.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8'>                     
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J54'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column ref='C8'>                                                     
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R97' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column id='C18' tableId='T1' colIndex='1'>                           
            CAT.RANGE.DIM1.DIMDATA                                              
          </Column>                                                             
          <OpBT startIsIncluded='1' endIsIncluded='1'>                          
            <NumericVal scale='0'>                                              
              5                                                                 
            </NumericVal>                                                       
            <NumericVal scale='0'>                                              
              15                                                                
            </NumericVal>                                                       
          </OpBT>                                                               
          <OpEQ>                                                                
            <NullVal/>                                                          
          </OpEQ>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O48'>                                                         
        <Column id='C6' tableId='T2' colIndex='5'>                              
          CAT.RANGE.FACT.FQUANT                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O51'>                                                         
        <Column id='C7' tableId='T2' colIndex='6'>                              
          CAT.RANGE.FACT.FPRICE                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O54'>                                                         
        <Column id='C8' tableId='T2' colIndex='7'>                              
          CAT.RANGE.FACT.DIMKEY                                                 
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 74 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE             >> range5.in;
>>sh echo PUBLISH RANGE_MJV1.xml >> range5.in;
>>sh echo PUBLISH RANGE_MJV2.xml >> range5.in;
>>sh echo PUBLISH RANGE_MJV3.xml >> range5.in;
>>sh echo PUBLISH RANGE_MJV4.xml >> range5.in;
>>sh echo MATCH RANGE_JQ5.xml    >> range5.in;
>>
>>sh sh -c "$QMS range5.in range5.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM1
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV1
          </MVName>
          <RangePredList>
            <Range ref='R97' result='NotProvided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O54' result='Provided'>
              <MVColumn ref='C8'>
                DIMKEY
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV11 was disqualified because column CAT.RANGE.DIM1.DIMDATA cannot be provided.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV2 was disqualified because The query range predicate R97 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV3 was disqualified because The query range predicate R97 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV4 was disqualified because MV range predicate R260 was not matched by the query.]]></Info>
  </JbbResult>
</Result>
>>
>>-- Verify the MV is picked by the optimizer.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and (dimdata between 5 and 15 OR dimdata IS NULL)
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV1                                        

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY     
------------  -----------  -----------

        7.00            5            5
       51.00            1            5
       53.00            3            5
       56.00            2            5
       61.00            2            5
       70.00            3            5
       73.00            4            5
       95.00            3            5
        4.00            1            6
       39.00            4            6
       49.00            1            6
       63.00            1            6
       65.00            3            6
       66.00            1            6
       55.00            4            7
       59.00            1            7
       66.00            2            7
       75.00            5            7
       11.00            4            8
       21.00            5            8
       32.00            3            8
       39.00            1            8
       44.00            1            8
       50.00            2            8
       62.00            5            8
       83.00            4            8
       88.00            3            8
       27.00            5            9
       67.00            2            9
       71.00            2            9
       20.00            3           10
       58.00            1           10

--- 32 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant, 
+>             dimkey
+>      from fact, dim1
+>      where dimkey=dkey
+>        and (dimdata between 5 and 15 OR dimdata IS NULL)
+>      order by dimkey, fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT       DIMKEY     
------------  -----------  -----------

        7.00            5            5
       51.00            1            5
       53.00            3            5
       56.00            2            5
       61.00            2            5
       70.00            3            5
       73.00            4            5
       95.00            3            5
        4.00            1            6
       39.00            4            6
       49.00            1            6
       63.00            1            6
       65.00            3            6
       66.00            1            6
       55.00            4            7
       59.00            1            7
       66.00            2            7
       75.00            5            7
       11.00            4            8
       21.00            5            8
       32.00            3            8
       39.00            1            8
       44.00            1            8
       50.00            2            8
       62.00            5            8
       83.00            4            8
       88.00            3            8
       27.00            5            9
       67.00            2            9
       71.00            2            9
       20.00            3           10
       58.00            1           10

--- 32 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>obey TEST004(match_JQ6);
>>--===========================================
>>-- JQ6: Between on expression - 
>>-- Should match MJV1 and MJV11 (NotProvided)
>>-- and MJV4 (Provided).
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- identical range on expression - should match MJV1, MJV11 (NotProvided), MJV4 (Provided) 
>>-- and maybe one day also MJV3 (Provided).
>>obey TEST004(RANGE_JQ6);
>>prepare QueryStmt from
+>      select fprice, fquant
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 10 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>set pattern $$QueryName$$ RANGE_JQ6;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor                                                      
----------------------------------------------------------------------

<Query>                                                               
  <Version>                                                           
    1.0                                                               
  </Version>                                                          
  <Misc rewriteLevel='3'>                                             
  </Misc>                                                             
  <JBB id='B0'>                                                       
    <Hub>                                                             
      <JBBCList>                                                      
        <Table id='T1' TS='212223904322066955' numCols='2'>           
          CAT.RANGE.DIM1                                              
          <Key>                                                       
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>
              CAT.RANGE.DIM1.DKEY                                     
            </Column>                                                 
          </Key>                                                      
        </Table>                                                      
        <Table id='T2' TS='212223904322066955' numCols='8'>           
          CAT.RANGE.FACT                                              
          <Key>                                                       
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'> 
              CAT.RANGE.FACT.SYSKEY                                   
            </Column>                                                 
          </Key>                                                      
        </Table>                                                      
      </JBBCList>                                                     
      <JoinPredList>                                                  
        <JoinPred id='J54'>                                           
          <Column ref='C17'>                                          
          </Column>                                                   
          <Column id='C8' tableId='T2' colIndex='7'>                  
            CAT.RANGE.FACT.DIMKEY                                     
          </Column>                                                   
        </JoinPred>                                                   
      </JoinPredList>                                                 
      <RangePredList>                                                 
        <Range id='R77' sqlType='NUMERIC(11) SIGNED ALLOWS NULLS'>    
          <Expr id='X28'>                                             
            <BinaryOper id='S28' op='*'>                              
              <Column id='C18' tableId='T1' colIndex='1'>             
                CAT.RANGE.DIM1.DIMDATA                                
              </Column>                                               
              <NumericVal id='S27' scale='0'>                         
                2                                                     
              </NumericVal>                                           
            </BinaryOper>                                             
          </Expr>                                                     
          <OpBT startIsIncluded='1' endIsIncluded='1'>                
            <NumericVal scale='0'>                                    
              10                                                      
            </NumericVal>                                             
            <NumericVal scale='0'>                                    
              30                                                      
            </NumericVal>                                             
          </OpBT>                                                     
        </Range>                                                      
      </RangePredList>                                                
    </Hub>                                                            
    <ExtraHub>                                                        
    </ExtraHub>                                                       
    <OutputList>                                                      
      <Output id='O48'>                                               
        <Column id='C6' tableId='T2' colIndex='5'>                    
          CAT.RANGE.FACT.FQUANT                                       
        </Column>                                                     
      </Output>                                                       
      <Output id='O51'>                                               
        <Column id='C7' tableId='T2' colIndex='6'>                    
          CAT.RANGE.FACT.FPRICE                                       
        </Column>                                                     
      </Output>                                                       
    </OutputList>                                                     
  </JBB>                                                              
</Query>                                                              

--- 74 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE             >> range6.in;
>>sh echo PUBLISH RANGE_MJV1.xml >> range6.in;
>>sh echo PUBLISH RANGE_MJV11.xml >> range6.in;
>>sh echo PUBLISH RANGE_MJV2.xml >> range6.in;
>>sh echo PUBLISH RANGE_MJV3.xml >> range6.in;
>>sh echo PUBLISH RANGE_MJV4.xml >> range6.in;
>>sh echo MATCH RANGE_JQ6.xml    >> range6.in;
>>
>>sh sh -c "$QMS range6.in range6.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM1
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV1
          </MVName>
          <RangePredList>
            <Range ref='R77' result='NotProvided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV11
          </MVName>
          <RangePredList>
            <Range ref='R77' result='NotProvided'>
              <MVColumn ref='X28'>
                DATA2
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV4
          </MVName>
          <RangePredList>
            <Range ref='R77' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV2 was disqualified because Table CAT.RANGE.DIM1 failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV3 was disqualified because Table CAT.RANGE.DIM1 failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>-- Verify MV11 is picked by the optimizer.
>>cqd mvqr_rewrite_candidates 'CAT.RANGE.RANGE_MJV11';

--- SQL operation complete.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 10 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV11                                       

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT     
------------  -----------

        4.00            1
        7.00            5
       11.00            4
       20.00            3
       21.00            5
       27.00            5
       32.00            3
       39.00            1
       39.00            4
       44.00            1
       49.00            1
       50.00            2
       51.00            1
       53.00            3
       55.00            4
       56.00            2
       58.00            1
       59.00            1
       61.00            2
       62.00            5
       63.00            1
       65.00            3
       66.00            1
       66.00            2
       67.00            2
       70.00            3
       71.00            2
       73.00            4
       75.00            5
       83.00            4
       88.00            3
       95.00            3

--- 32 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 10 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT     
------------  -----------

        4.00            1
        7.00            5
       11.00            4
       20.00            3
       21.00            5
       27.00            5
       32.00            3
       39.00            1
       39.00            4
       44.00            1
       49.00            1
       50.00            2
       51.00            1
       53.00            3
       55.00            4
       56.00            2
       58.00            1
       59.00            1
       61.00            2
       62.00            5
       63.00            1
       65.00            3
       66.00            1
       66.00            2
       67.00            2
       70.00            3
       71.00            2
       73.00            4
       75.00            5
       83.00            4
       88.00            3
       95.00            3

--- 32 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>
>>-- Verify MV4 is picked by the optimizer.
>>cqd mvqr_rewrite_candidates 'CAT.RANGE.RANGE_MJV4';

--- SQL operation complete.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 10 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV4                                        

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT     
------------  -----------

        4.00            1
        7.00            5
       11.00            4
       20.00            3
       21.00            5
       27.00            5
       32.00            3
       39.00            1
       39.00            4
       44.00            1
       49.00            1
       50.00            2
       51.00            1
       53.00            3
       55.00            4
       56.00            2
       58.00            1
       59.00            1
       61.00            2
       62.00            5
       63.00            1
       65.00            3
       66.00            1
       66.00            2
       67.00            2
       70.00            3
       71.00            2
       73.00            4
       75.00            5
       83.00            4
       88.00            3
       95.00            3

--- 32 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 10 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT     
------------  -----------

        4.00            1
        7.00            5
       11.00            4
       20.00            3
       21.00            5
       27.00            5
       32.00            3
       39.00            1
       39.00            4
       44.00            1
       49.00            1
       50.00            2
       51.00            1
       53.00            3
       55.00            4
       56.00            2
       58.00            1
       59.00            1
       61.00            2
       62.00            5
       63.00            1
       65.00            3
       66.00            1
       66.00            2
       67.00            2
       70.00            3
       71.00            2
       73.00            4
       75.00            5
       83.00            4
       88.00            3
       95.00            3

--- 32 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>
>>obey TEST004(match_JQ7);
>>--===========================================
>>-- JQ7: Between on expression - 
>>-- Should match MJV1 and MJV11 (NotProvided)
>>-- and MJV4 (Provided).
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- Subsumed range on expression - should match MJV1, MJV11 (NotProvided), MJV4 (NotProvided) 
>>obey TEST004(RANGE_JQ7);
>>prepare QueryStmt from
+>      select fprice, fquant 
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 15 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>set pattern $$QueryName$$ RANGE_JQ7;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor                                                      
----------------------------------------------------------------------

<Query>                                                               
  <Version>                                                           
    1.0                                                               
  </Version>                                                          
  <Misc rewriteLevel='3'>                                             
  </Misc>                                                             
  <JBB id='B0'>                                                       
    <Hub>                                                             
      <JBBCList>                                                      
        <Table id='T1' TS='212223904322066955' numCols='2'>           
          CAT.RANGE.DIM1                                              
          <Key>                                                       
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>
              CAT.RANGE.DIM1.DKEY                                     
            </Column>                                                 
          </Key>                                                      
        </Table>                                                      
        <Table id='T2' TS='212223904322066955' numCols='8'>           
          CAT.RANGE.FACT                                              
          <Key>                                                       
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'> 
              CAT.RANGE.FACT.SYSKEY                                   
            </Column>                                                 
          </Key>                                                      
        </Table>                                                      
      </JBBCList>                                                     
      <JoinPredList>                                                  
        <JoinPred id='J54'>                                           
          <Column ref='C17'>                                          
          </Column>                                                   
          <Column id='C8' tableId='T2' colIndex='7'>                  
            CAT.RANGE.FACT.DIMKEY                                     
          </Column>                                                   
        </JoinPred>                                                   
      </JoinPredList>                                                 
      <RangePredList>                                                 
        <Range id='R77' sqlType='NUMERIC(11) SIGNED ALLOWS NULLS'>    
          <Expr id='X28'>                                             
            <BinaryOper id='S28' op='*'>                              
              <Column id='C18' tableId='T1' colIndex='1'>             
                CAT.RANGE.DIM1.DIMDATA                                
              </Column>                                               
              <NumericVal id='S27' scale='0'>                         
                2                                                     
              </NumericVal>                                           
            </BinaryOper>                                             
          </Expr>                                                     
          <OpBT startIsIncluded='1' endIsIncluded='1'>                
            <NumericVal scale='0'>                                    
              15                                                      
            </NumericVal>                                             
            <NumericVal scale='0'>                                    
              30                                                      
            </NumericVal>                                             
          </OpBT>                                                     
        </Range>                                                      
      </RangePredList>                                                
    </Hub>                                                            
    <ExtraHub>                                                        
    </ExtraHub>                                                       
    <OutputList>                                                      
      <Output id='O48'>                                               
        <Column id='C6' tableId='T2' colIndex='5'>                    
          CAT.RANGE.FACT.FQUANT                                       
        </Column>                                                     
      </Output>                                                       
      <Output id='O51'>                                               
        <Column id='C7' tableId='T2' colIndex='6'>                    
          CAT.RANGE.FACT.FPRICE                                       
        </Column>                                                     
      </Output>                                                       
    </OutputList>                                                     
  </JBB>                                                              
</Query>                                                              

--- 74 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE             >> range7.in;
>>sh echo PUBLISH RANGE_MJV1.xml >> range7.in;
>>sh echo PUBLISH RANGE_MJV11.xml >> range7.in;
>>sh echo PUBLISH RANGE_MJV2.xml >> range7.in;
>>sh echo PUBLISH RANGE_MJV3.xml >> range7.in;
>>sh echo PUBLISH RANGE_MJV4.xml >> range7.in;
>>sh echo MATCH RANGE_JQ7.xml    >> range7.in;
>>
>>sh sh -c "$QMS range7.in range7.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM1
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV1
          </MVName>
          <RangePredList>
            <Range ref='R77' result='NotProvided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV11
          </MVName>
          <RangePredList>
            <Range ref='R77' result='NotProvided'>
              <MVColumn ref='X28'>
                DATA2
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MJV4
          </MVName>
          <RangePredList>
            <Range ref='R77' result='NotProvided'>
              <MVColumn ref='C18'>
                DIMDATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O48' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O51' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV2 was disqualified because Table CAT.RANGE.DIM1 failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_MJV3 was disqualified because Table CAT.RANGE.DIM1 failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>-- Verify MV11 is picked by the optimizer.
>>cqd mvqr_rewrite_candidates 'CAT.RANGE.RANGE_MJV11';

--- SQL operation complete.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant 
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 15 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV11                                       

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT     
------------  -----------

       11.00            4
       20.00            3
       21.00            5
       27.00            5
       32.00            3
       39.00            1
       44.00            1
       50.00            2
       58.00            1
       62.00            5
       67.00            2
       71.00            2
       83.00            4
       88.00            3

--- 14 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant 
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 15 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT     
------------  -----------

       11.00            4
       20.00            3
       21.00            5
       27.00            5
       32.00            3
       39.00            1
       44.00            1
       50.00            2
       58.00            1
       62.00            5
       67.00            2
       71.00            2
       83.00            4
       88.00            3

--- 14 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>-- Verify MV4 is picked by the optimizer.
>>cqd mvqr_rewrite_candidates 'CAT.RANGE.RANGE_MJV4';

--- SQL operation complete.
>>obey TEST004(compare);
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant 
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 15 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MJV4                                        

--- 1 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT     
------------  -----------

       11.00            4
       20.00            3
       21.00            5
       27.00            5
       32.00            3
       39.00            1
       44.00            1
       50.00            2
       58.00            1
       62.00            5
       67.00            2
       71.00            2
       83.00            4
       88.00            3

--- 14 row(s) selected.
>>
>>log T004_C1.txt clear;
>>
>>-- Verify the data is correct
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>obey TEST004($$QueryName$$);
>>prepare QueryStmt from
+>      select fprice, fquant 
+>      from fact, dim1
+>      where dimkey=dkey
+>        and dimdata*2 between 15 and 30
+>      order by fprice, fquant;

--- SQL command prepared.
>>
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.DIM1                                              
FILE_SCAN                       CAT.RANGE.FACT                                              

--- 2 row(s) selected.
>>
>>execute QueryStmt;

FPRICE        FQUANT     
------------  -----------

       11.00            4
       20.00            3
       21.00            5
       27.00            5
       32.00            3
       39.00            1
       44.00            1
       50.00            2
       58.00            1
       62.00            5
       67.00            2
       71.00            2
       83.00            4
       88.00            3

--- 14 row(s) selected.
>>
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>
>>log T004_C2.txt clear;
>>
>>-- Diff query results
>>log;
>>-- Diff is done.
>>
>>
>>
>>obey TEST004(match_I);
>>-- Queries requiring application of constraints to ranges
>>--===========================================
>>-- I: type-implied constraint and not null constraint change range from
>>--    [100..MAX] to [100..2147483647]+NULL, allowing match (Provided) with MVRNGCON_I.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_i (Provided) after application of not null constraint
>>prepare QueryStmt from
+>      select i
+>      from numtypes
+>      where i is null or i > 100
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_I;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000004'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R61' sqlType='INTEGER SIGNED NO NULLS'>                      
          <Column ref='C2'>                                                     
          </Column>                                                             
          <OpGE isNormalized='1'>                                               
            <NumericVal scale='0'>                                              
              101                                                               
            </NumericVal>                                                       
          </OpGE>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O35'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 41 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE              >> range_i.in;
>>sh echo PUBLISH MVRNGCON_I.xml  >> range_i.in;
>>sh echo MATCH RANGECONSTR_I.xml >> range_i.in;
>>
>>sh sh -c "$QMS range_i.in range_i.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.NUMTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_I
          </MVName>
          <RangePredList>
            <Range ref='R61' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O35' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_LI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N42 was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N61U was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_R was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R61' result='Provided'>
---
>             <Range ref='R64' result='Provided'>
22c22
<             <Output ref='O35' result='Provided'>
---
>             <Output ref='O36' result='Provided'>
>>
>>obey TEST004(match_SI);
>>--===========================================
>>-- SI: type-implied constraint changes range from [50..MAX] to [50..32767],
>>--     allowing match (Provided) with MVRNGCON_SI.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_si (Provided) after application of type constraint
>>prepare QueryStmt from
+>      select i
+>      from numtypes
+>      where si >= 50
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_SI;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R59' sqlType='SMALLINT SIGNED ALLOWS NULLS'>                 
          <Column id='C3' tableId='T1' colIndex='2'>                            
            CAT.RANGE.NUMTYPES.SI                                               
          </Column>                                                             
          <OpGE isNormalized='1'>                                               
            <NumericVal scale='0'>                                              
              50                                                                
            </NumericVal>                                                       
          </OpGE>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O33'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_si.in;
>>sh echo PUBLISH MVRNGCON_SI.xml  >> range_si.in;
>>sh echo MATCH RANGECONSTR_SI.xml >> range_si.in;
>>
>>sh sh -c "$QMS range_si.in range_si.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.NUMTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_SI
          </MVName>
          <RangePredList>
            <Range ref='R59' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O33' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_I was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_LI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N42 was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N61U was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_R was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R59' result='Provided'>
---
>             <Range ref='R62' result='Provided'>
22c22
<             <Output ref='O33' result='Provided'>
---
>             <Output ref='O34' result='Provided'>
>>
>>obey TEST004(match_LI);
>>--===========================================
>>-- LI: check constraint changes range from [5000000..MAX] to [5000000..10000000000),
>>--     allowing match (NotProvided) with MVRNGCON_LI.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_li (NotProvided) after application of check constraint
>>prepare QueryStmt from
+>      select i
+>      from numtypes
+>      where li >= 5000000
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_LI;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000001'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R59' sqlType='LARGEINT ALLOWS NULLS'>                        
          <Column id='C4' tableId='T1' colIndex='3'>                            
            CAT.RANGE.NUMTYPES.LI                                               
          </Column>                                                             
          <OpBT startIsIncluded='1' endIsIncluded='1'>                          
            <NumericVal scale='0'>                                              
              5000000                                                           
            </NumericVal>                                                       
            <NumericVal scale='0'>                                              
              9999999999                                                        
            </NumericVal>                                                       
          </OpBT>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O33'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_li.in;
>>sh echo PUBLISH MVRNGCON_LI.xml  >> range_li.in;
>>sh echo MATCH RANGECONSTR_LI.xml >> range_li.in;
>>
>>sh sh -c "$QMS range_li.in range_li.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.NUMTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_LI
          </MVName>
          <RangePredList>
            <Range ref='R59' result='NotProvided'>
              <MVColumn ref='C4'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O33' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_I was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N42 was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N61U was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_R was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R59' result='NotProvided'>
---
>             <Range ref='R62' result='NotProvided'>
25c25
<             <Output ref='O33' result='Provided'>
---
>             <Output ref='O34' result='Provided'>
>>
>>obey TEST004(match_N42);
>>--===========================================
>>-- N42: type-implied constraint changes range from [1001..<MAX>] to [1001..9999],
>>--      allowing match (NotProvided) with MVRNGCON_N42.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_n42 (NotProvided) after application of type constraint
>>prepare QueryStmt from
+>      select i
+>      from numtypes
+>      where n42 > 10
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_N42;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000080'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R59' sqlType='NUMERIC(4,2) SIGNED ALLOWS NULLS'>             
          <Column id='C5' tableId='T1' colIndex='4'>                            
            CAT.RANGE.NUMTYPES.N42                                              
          </Column>                                                             
          <OpGE isNormalized='1'>                                               
            <NumericVal scale='2'>                                              
              10.01                                                             
            </NumericVal>                                                       
          </OpGE>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O33'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                >> range_n42.in;
>>sh echo PUBLISH MVRNGCON_N42.xml  >> range_n42.in;
>>sh echo MATCH RANGECONSTR_N42.xml >> range_n42.in;
>>
>>sh sh -c "$QMS range_n42.in range_n42.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.NUMTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_N42
          </MVName>
          <RangePredList>
            <Range ref='R59' result='NotProvided'>
              <MVColumn ref='C5'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O33' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_I was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_LI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N61U was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_R was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R59' result='NotProvided'>
---
>             <Range ref='R62' result='NotProvided'>
25c25
<             <Output ref='O33' result='Provided'>
---
>             <Output ref='O34' result='Provided'>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R59' result='NotProvided'>
---
>             <Range ref='R62' result='NotProvided'>
25c25
<             <Output ref='O33' result='Provided'>
---
>             <Output ref='O34' result='Provided'>
>>
>>obey TEST004(match_N61U);
>>--===========================================
>>-- N61U: type-implied constraint changes range from [<MIN>..499] to [0...499],
>>--       allowing match (NotProvided) with MVRNGCON_N61U.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_n61u (NotProvided) after application of type constraint
>>prepare QueryStmt from
+>      select i
+>      from numtypes
+>      where n61u < 50
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_N61U;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000040'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R59' sqlType='NUMERIC(6,1) UNSIGNED ALLOWS NULLS'>           
          <Column id='C6' tableId='T1' colIndex='5'>                            
            CAT.RANGE.NUMTYPES.N61U                                             
          </Column>                                                             
          <OpLE isNormalized='1'>                                               
            <NumericVal scale='1'>                                              
              49.9                                                              
            </NumericVal>                                                       
          </OpLE>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O33'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                 >> range_n61u.in;
>>sh echo PUBLISH MVRNGCON_N61U.xml  >> range_n61u.in;
>>sh echo MATCH RANGECONSTR_N61U.xml >> range_n61u.in;
>>
>>sh sh -c "$QMS range_n61u.in range_n61u.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.NUMTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_N61U
          </MVName>
          <RangePredList>
            <Range ref='R59' result='NotProvided'>
              <MVColumn ref='C6'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O33' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_I was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_LI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N42 was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_R was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R59' result='NotProvided'>
---
>             <Range ref='R62' result='NotProvided'>
25c25
<             <Output ref='O33' result='Provided'>
---
>             <Output ref='O34' result='Provided'>
>>
>>obey TEST004(match_R);
>>--===========================================
>>-- R: type-implied constraint changes range from (0..<MAX>) to (0..3.40282e+038],
>>--    allowing match (NotProvided) with MVRNGCON_R.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_r (NotProvided) after application of type constraint
>>prepare QueryStmt from
+>      select i
+>      from numtypes
+>      where r > 0
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_R;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000020'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R59' sqlType='REAL ALLOWS NULLS'>                            
          <Column id='C7' tableId='T1' colIndex='6'>                            
            CAT.RANGE.NUMTYPES.R                                                
          </Column>                                                             
          <OpGT isNormalized='1'>                                               
            <FloatVal>                                                          
              0                                                                 
            </FloatVal>                                                         
          </OpGT>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O33'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE              >> range_r.in;
>>sh echo PUBLISH MVRNGCON_R.xml  >> range_r.in;
>>sh echo MATCH RANGECONSTR_R.xml >> range_r.in;
>>
>>sh sh -c "$QMS range_r.in range_r.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.NUMTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_R
          </MVName>
          <RangePredList>
            <Range ref='R59' result='NotProvided'>
              <MVColumn ref='C7'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O33' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_I was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_LI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N42 was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_N61U was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SI was disqualified because Table CAT.RANGE.NUMTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R59' result='NotProvided'>
---
>             <Range ref='R62' result='NotProvided'>
25c25
<             <Output ref='O33' result='Provided'>
---
>             <Output ref='O34' result='Provided'>
>>
>>obey TEST004(match_D);
>>--===========================================
>>-- D: does not match because query range includes values that precede MV range.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should not match anything
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where d > date'1999-12-31'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_D;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000002'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R124' sqlType='DATE ALLOWS NULLS'>                            
          <Column id='C3' tableId='T1' colIndex='2'>                             
            CAT.RANGE.DTTYPES.D                                                  
          </Column>                                                              
          <OpGE isNormalized='1'>                                                
            <NumericVal scale='0'>                                               
              2451544                                                            
            </NumericVal>                                                        
          </OpGE>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O59'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE              >> range_d.in;
>>sh echo PUBLISH MVRNGCON_D.xml  >> range_d.in;
>>sh echo MATCH RANGECONSTR_D.xml >> range_d.in;
>>
>>sh sh -c "$QMS range_d.in range_d.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because The query range predicate R124 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
6c6
<     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because The query range predicate R124 is not subsumed by the corresponding MV predicate.]]></Info>
---
>     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because The query range predicate R127 is not subsumed by the corresponding MV predicate.]]></Info>
>>
>>--===========================================
>>-- D part 2: provided match, same range specified a different way in query.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get provided match with mvrngcon_d
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where not d <= date'2000-01-30'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_D_2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000002'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R125' sqlType='DATE ALLOWS NULLS'>                            
          <Column id='C3' tableId='T1' colIndex='2'>                             
            CAT.RANGE.DTTYPES.D                                                  
          </Column>                                                              
          <OpGE isNormalized='1'>                                                
            <NumericVal scale='0'>                                               
              2451574                                                            
            </NumericVal>                                                        
          </OpGE>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O60'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE              >> range_d_2.in;
>>sh echo PUBLISH MVRNGCON_D.xml  >> range_d_2.in;
>>sh echo MATCH RANGECONSTR_D_2.xml >> range_d_2.in;
>>
>>sh sh -c "$QMS range_d_2.in range_d_2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_D
          </MVName>
          <RangePredList>
            <Range ref='R125' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O60' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R125' result='Provided'>
---
>             <Range ref='R128' result='Provided'>
22c22
<             <Output ref='O60' result='Provided'>
---
>             <Output ref='O61' result='Provided'>
>>
>>--===========================================
>>-- D part 3: not provided match, range ends short of max value.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get not provided match with mvrngcon_d
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where d > date'2000-01-30' and d < date'2010-12-31'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_D_3;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000002'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R142' sqlType='DATE ALLOWS NULLS'>                            
          <Column id='C3' tableId='T1' colIndex='2'>                             
            CAT.RANGE.DTTYPES.D                                                  
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='0'>                                               
              2451574                                                            
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              2455560                                                            
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O61'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE              >> range_d_3.in;
>>sh echo PUBLISH MVRNGCON_D.xml  >> range_d_3.in;
>>sh echo MATCH RANGECONSTR_D_3.xml >> range_d_3.in;
>>
>>sh sh -c "$QMS range_d_3.in range_d_3.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_D
          </MVName>
          <RangePredList>
            <Range ref='R142' result='NotProvided'>
              <MVColumn ref='C3'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O61' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R142' result='NotProvided'>
---
>             <Range ref='R148' result='NotProvided'>
25c25
<             <Output ref='O61' result='Provided'>
---
>             <Output ref='O63' result='Provided'>
>>
>>obey TEST004(match_T);
>>--===========================================
>>-- T: no match; last element in IN list is not part of MV's range for t
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- time'11:25:31' prevents a match
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where t in (time'10:00:00', time'11:25:30', time'10:30:19', time'11:25:31')
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_T;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000001'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R142' sqlType='TIME(0) ALLOWS NULLS'>                         
          <Column id='C4' tableId='T1' colIndex='3'>                             
            CAT.RANGE.DTTYPES.T                                                  
          </Column>                                                              
          <OpEQ>                                                                 
            <NumericVal scale='0'>                                               
              36000000000                                                        
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              37819000000                                                        
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              41130000000                                                        
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              41131000000                                                        
            </NumericVal>                                                        
          </OpEQ>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O68'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 51 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE              >> range_t.in;
>>sh echo PUBLISH MVRNGCON_T.xml  >> range_t.in;
>>sh echo MATCH RANGECONSTR_T.xml >> range_t.in;
>>
>>sh sh -c "$QMS range_t.in range_t.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because The query range predicate R142 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
20c20
<     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because The query range predicate R142 is not subsumed by the corresponding MV predicate.]]></Info>
---
>     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because The query range predicate R154 is not subsumed by the corresponding MV predicate.]]></Info>
>>
>>--===========================================
>>-- T part 2: provided match, same range specified a different way in query.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_t (Provided)
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where not t < time'10:00:00' and not t > time'11:25:30'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_T_2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000001'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R144' sqlType='TIME(0) ALLOWS NULLS'>                         
          <Column id='C4' tableId='T1' colIndex='3'>                             
            CAT.RANGE.DTTYPES.T                                                  
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='0'>                                               
              36000000000                                                        
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              41130000000                                                        
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O63'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE              >> range_t_2.in;
>>sh echo PUBLISH MVRNGCON_T.xml  >> range_t_2.in;
>>sh echo MATCH RANGECONSTR_T_2.xml >> range_t_2.in;
>>
>>sh sh -c "$QMS range_t_2.in range_t_2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_T
          </MVName>
          <RangePredList>
            <Range ref='R144' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O63' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R144' result='Provided'>
---
>             <Range ref='R150' result='Provided'>
22c22
<             <Output ref='O63' result='Provided'>
---
>             <Output ref='O65' result='Provided'>
>>
>>--===========================================
>>-- T part 3: not provided match, all items in IN list contained in MV range.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_t (Not Provided)
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where t in (time'10:00:00', time'11:25:30', time'10:30:19')
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_T_3;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000001'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R136' sqlType='TIME(0) ALLOWS NULLS'>                         
          <Column id='C4' tableId='T1' colIndex='3'>                             
            CAT.RANGE.DTTYPES.T                                                  
          </Column>                                                              
          <OpEQ>                                                                 
            <NumericVal scale='0'>                                               
              36000000000                                                        
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              37819000000                                                        
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              41130000000                                                        
            </NumericVal>                                                        
          </OpEQ>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O65'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 48 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE              >> range_t_3.in;
>>sh echo PUBLISH MVRNGCON_T.xml  >> range_t_3.in;
>>sh echo MATCH RANGECONSTR_T_3.xml >> range_t_3.in;
>>
>>sh sh -c "$QMS range_t_3.in range_t_3.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_T
          </MVName>
          <RangePredList>
            <Range ref='R136' result='NotProvided'>
              <MVColumn ref='C4'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O65' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R136' result='NotProvided'>
---
>             <Range ref='R145' result='NotProvided'>
25c25
<             <Output ref='O65' result='Provided'>
---
>             <Output ref='O68' result='Provided'>
>>
>>obey TEST004(match_T2);
>>--===========================================
>>-- T2: provided match, excess fractional seconds precision truncated
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_t2, .000001 added to end of range, but this results in
>>-- a constant which exceeds the precision of the range column. Truncation puts it
>>-- within the required matching range.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where t2 between time'10:00:00.20' and time'11:25:30.450001'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_T2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000080'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R143' sqlType='TIME(2) ALLOWS NULLS'>                         
          <Column id='C5' tableId='T1' colIndex='4'>                             
            CAT.RANGE.DTTYPES.T2                                                 
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='2'>                                               
              360002000.00                                                       
            </NumericVal>                                                        
            <NumericVal scale='2'>                                               
              411304500.00                                                       
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O60'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_t2.in;
>>sh echo PUBLISH MVRNGCON_T2.xml  >> range_t2.in;
>>sh echo MATCH RANGECONSTR_T2.xml >> range_t2.in;
>>
>>sh sh -c "$QMS range_t2.in range_t2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_T2
          </MVName>
          <RangePredList>
            <Range ref='R143' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O60' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R143' result='Provided'>
---
>             <Range ref='R149' result='Provided'>
22c22
<             <Output ref='O60' result='Provided'>
---
>             <Output ref='O62' result='Provided'>
>>
>>--===========================================
>>-- T2 part 2: provided match, timestamp constants have different fractional
>>--            precision, but are equivalent.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- match (Provided) with mvrngcon_t2
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where t2 <= time'11:25:30.450000' and t2 >= time'10:00:00.200000'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_T2_2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000080'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R142' sqlType='TIME(2) ALLOWS NULLS'>                         
          <Column id='C5' tableId='T1' colIndex='4'>                             
            CAT.RANGE.DTTYPES.T2                                                 
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='2'>                                               
              360002000.00                                                       
            </NumericVal>                                                        
            <NumericVal scale='2'>                                               
              411304500.00                                                       
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O61'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_t2_2.in;
>>sh echo PUBLISH MVRNGCON_T2.xml  >> range_t2_2.in;
>>sh echo MATCH RANGECONSTR_T2_2.xml >> range_t2_2.in;
>>
>>sh sh -c "$QMS range_t2_2.in range_t2_2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_T2
          </MVName>
          <RangePredList>
            <Range ref='R142' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O61' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R142' result='Provided'>
---
>             <Range ref='R148' result='Provided'>
22c22
<             <Output ref='O61' result='Provided'>
---
>             <Output ref='O63' result='Provided'>
>>
>>obey TEST004(match_T6);
>>--===========================================
>>-- T6: No match, query range has same endpoint but is closed, while MV range is open.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should not match; MV does not include value time'01:15:30.123456'
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where t6 <= time'01:15:30.123456'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_T6;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000040'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R124' sqlType='TIME(6) ALLOWS NULLS'>                         
          <Column id='C6' tableId='T1' colIndex='5'>                             
            CAT.RANGE.DTTYPES.T6                                                 
          </Column>                                                              
          <OpLE isNormalized='1'>                                                
            <NumericVal scale='6'>                                               
              4530.123456                                                        
            </NumericVal>                                                        
          </OpLE>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O59'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_t6.in;
>>sh echo PUBLISH MVRNGCON_T6.xml  >> range_t6.in;
>>sh echo MATCH RANGECONSTR_T6.xml >> range_t6.in;
>>
>>sh sh -c "$QMS range_t6.in range_t6.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because The query range predicate R124 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
22c22
<     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because The query range predicate R124 is not subsumed by the corresponding MV predicate.]]></Info>
---
>     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because The query range predicate R127 is not subsumed by the corresponding MV predicate.]]></Info>
>>
>>--===========================================
>>-- T6 part 2: Not provided match with several overlapping subranges.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- Should match (Not Provided) mvrngcon_t6.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where t6 between time'01:00:00.123456' and time'01:15:30.123456' and t6 <> time'01:15:30.123456'
+>         or t6 in (time'00:00:00', time'01:15:30.123455', time'00:15:00.999')
+>         or t6 < time'00:30:00'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_T6_2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000040'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R203' sqlType='TIME(6) ALLOWS NULLS'>                         
          <Column id='C6' tableId='T1' colIndex='5'>                             
            CAT.RANGE.DTTYPES.T6                                                 
          </Column>                                                              
          <OpLE isNormalized='1'>                                                
            <NumericVal scale='6'>                                               
              1799.999999                                                        
            </NumericVal>                                                        
          </OpLE>                                                                
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='6'>                                               
              3600.123456                                                        
            </NumericVal>                                                        
            <NumericVal scale='6'>                                               
              4530.123455                                                        
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O74'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 50 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_t6_2.in;
>>sh echo PUBLISH MVRNGCON_T6.xml  >> range_t6_2.in;
>>sh echo MATCH RANGECONSTR_T6_2.xml >> range_t6_2.in;
>>
>>sh sh -c "$QMS range_t6_2.in range_t6_2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_T6
          </MVName>
          <RangePredList>
            <Range ref='R203' result='NotProvided'>
              <MVColumn ref='C6'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O74' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R203' result='NotProvided'>
---
>             <Range ref='R216' result='NotProvided'>
25c25
<             <Output ref='O74' result='Provided'>
---
>             <Output ref='O79' result='Provided'>
>>
>>obey TEST004(match_TS);
>>--===========================================
>>-- TS: No match, query range has same range but adds null.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should not match; query range is same as mv, but allows null as well.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where ts < timestamp'2005-10-12 14:45:01.123456' or ts is null
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_TS;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000020'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R132' sqlType='TIMESTAMP(6) ALLOWS NULLS'>                    
          <Column id='C7' tableId='T1' colIndex='6'>                             
            CAT.RANGE.DTTYPES.TS                                                 
          </Column>                                                              
          <OpLE isNormalized='1'>                                                
            <NumericVal scale='6'>                                               
              211995888301.123455                                                
            </NumericVal>                                                        
          </OpLE>                                                                
          <OpEQ>                                                                 
            <NullVal/>                                                           
          </OpEQ>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O61'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_ts.in;
>>sh echo PUBLISH MVRNGCON_TS.xml  >> range_ts.in;
>>sh echo MATCH RANGECONSTR_TS.xml >> range_ts.in;
>>
>>sh sh -c "$QMS range_ts.in range_ts.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because The query range predicate R132 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
23c23
<     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because The query range predicate R132 is not subsumed by the corresponding MV predicate.]]></Info>
---
>     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because The query range predicate R135 is not subsumed by the corresponding MV predicate.]]></Info>
>>
>>--===========================================
>>-- TS part 2: Match (Provided) mvrngcon_ts, query has contiguous subranges
>>--            that are equivalent to mv's range.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match (Provided) mvrngcon_ts; query range is equivalent to that of mv.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where ts between timestamp'0001-01-01 00:00:00' and timestamp'1950-12-31 23:59:59.999999'
+>         or ts > timestamp'1951-01-01 00:00:00' and ts < timestamp'2005-10-12 14:45:01.123456'
+>         or ts = timestamp'1951-01-01 00:00:00'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_TS_2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000020'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R179' sqlType='TIMESTAMP(6) ALLOWS NULLS'>                    
          <Column id='C7' tableId='T1' colIndex='6'>                             
            CAT.RANGE.DTTYPES.TS                                                 
          </Column>                                                              
          <OpLE isNormalized='1'>                                                
            <NumericVal scale='6'>                                               
              211995888301.123455                                                
            </NumericVal>                                                        
          </OpLE>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O68'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_ts_2.in;
>>sh echo PUBLISH MVRNGCON_TS.xml  >> range_ts_2.in;
>>sh echo MATCH RANGECONSTR_TS_2.xml >> range_ts_2.in;
>>
>>sh sh -c "$QMS range_ts_2.in range_ts_2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_TS
          </MVName>
          <RangePredList>
            <Range ref='R179' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O68' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R179' result='Provided'>
---
>             <Range ref='R185' result='Provided'>
22c22
<             <Output ref='O68' result='Provided'>
---
>             <Output ref='O70' result='Provided'>
>>
>>obey TEST004(match_TS3);
>>--===========================================
>>-- TS3: No match, query includes one additional value outside range of mv.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should not match; query range is same as mv, but allows null as well.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where ts3 < timestamp'2005-10-12 14:45:01.125' or ts3 = timestamp'2005-10-12 14:45:01.125'
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_TS3;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000800'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R134' sqlType='TIMESTAMP(3) ALLOWS NULLS'>                    
          <Column id='C9' tableId='T1' colIndex='8'>                             
            CAT.RANGE.DTTYPES.TS3                                                
          </Column>                                                              
          <OpLE isNormalized='1'>                                                
            <NumericVal scale='3'>                                               
              211995888301124.000                                                
            </NumericVal>                                                        
          </OpLE>                                                                
          <OpEQ>                                                                 
            <NumericVal scale='3'>                                               
              211995888301125.000                                                
            </NumericVal>                                                        
          </OpEQ>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O61'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 47 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                >> range_ts3.in;
>>sh echo PUBLISH MVRNGCON_TS3.xml  >> range_ts3.in;
>>sh echo MATCH RANGECONSTR_TS3.xml >> range_ts3.in;
>>
>>sh sh -c "$QMS range_ts3.in range_ts3.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because The query range predicate R134 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
24c24
<     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because The query range predicate R134 is not subsumed by the corresponding MV predicate.]]></Info>
---
>     <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because The query range predicate R140 is not subsumed by the corresponding MV predicate.]]></Info>
>>
>>--===========================================
>>-- TS3 part 2: Not Provided match, query has overlapping subranges all subsumed
>>--             by mv range, plus gratuitous NOT NULL.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match (Not Provided) mvrngcon_ts3
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where ts3 is not null and
+>            (ts3 between timestamp'1800-10-10 22:10:10' and timestamp'1900-10-10 22:10:10' or
+>             ts3 between timestamp'1850-10-10 22:10:10' and timestamp'1950-10-10 22:10:10' or
+>             ts3 < timestamp'1850-01-01 00:00:00')
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_TS3_2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000800'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R178' sqlType='TIMESTAMP(3) ALLOWS NULLS'>                    
          <Column id='C9' tableId='T1' colIndex='8'>                             
            CAT.RANGE.DTTYPES.TS3                                                
          </Column>                                                              
          <OpLE isNormalized='1'>                                                
            <NumericVal scale='3'>                                               
              210260052610000.000                                                
            </NumericVal>                                                        
          </OpLE>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O68'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                >> range_ts3_2.in;
>>sh echo PUBLISH MVRNGCON_TS3.xml  >> range_ts3_2.in;
>>sh echo MATCH RANGECONSTR_TS3_2.xml >> range_ts3_2.in;
>>
>>sh sh -c "$QMS range_ts3_2.in range_ts3_2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_TS3
          </MVName>
          <RangePredList>
            <Range ref='R178' result='NotProvided'>
              <MVColumn ref='C9'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O68' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R178' result='NotProvided'>
---
>             <Range ref='R184' result='NotProvided'>
25c25
<             <Output ref='O68' result='Provided'>
---
>             <Output ref='O70' result='Provided'>
>>
>>obey TEST004(match_YR);
>>--===========================================
>>-- YR: NotProvided match, query duplicates mv range + null, but null is prohibited
>>--     by NOT NULL constraint. Would be Provided except that check constraints are
>>--     not used for ranges in MV descriptors.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match mvrngcon_yr, "yr is null" ignored because of NOT NULL constraint.
>>-- Match is NotProvided instead of Provided, because check constraints are not
>>-- used in ranges in MV descriptors.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where yr < interval '20' year or yr is null
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_YR;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000400'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R126' sqlType='INTERVAL YEAR(2) NO NULLS'>                    
          <Column id='C10' tableId='T1' colIndex='9' isNullable='0'>             
            CAT.RANGE.DTTYPES.YR                                                 
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='0'>                                               
              0                                                                  
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              228                                                                
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O61'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_yr.in;
>>sh echo PUBLISH MVRNGCON_YR.xml  >> range_yr.in;
>>sh echo MATCH RANGECONSTR_YR.xml >> range_yr.in;
>>
>>sh sh -c "$QMS range_yr.in range_yr.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_YR
          </MVName>
          <RangePredList>
            <Range ref='R126' result='NotProvided'>
              <MVColumn ref='C10'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O61' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R126' result='NotProvided'>
---
>             <Range ref='R129' result='NotProvided'>
25c25
<             <Output ref='O61' result='Provided'>
---
>             <Output ref='O62' result='Provided'>
>>
>>--===========================================
>>-- YR part 2: NotProvided match, query excludes negative interval values not
>>--            explicitly excluded by mv range, but check constraint disallows them.
>>--            However, our policy is to not use check constraints in the MV descriptor.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match (NotProvided) mvrngcon_yr
>>-- Match is NotProvided instead of Provided, because check constraints are not
>>-- used in MV descriptors.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where yr >= interval'0'year and yr < interval '20' year
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_YR_2;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000400'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R141' sqlType='INTERVAL YEAR(2) NO NULLS'>                    
          <Column id='C10' tableId='T1' colIndex='9' isNullable='0'>             
            CAT.RANGE.DTTYPES.YR                                                 
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='0'>                                               
              0                                                                  
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              228                                                                
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O60'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_yr_2.in;
>>sh echo PUBLISH MVRNGCON_YR.xml  >> range_yr_2.in;
>>sh echo MATCH RANGECONSTR_YR_2.xml >> range_yr_2.in;
>>
>>sh sh -c "$QMS range_yr_2.in range_yr_2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_YR
          </MVName>
          <RangePredList>
            <Range ref='R141' result='NotProvided'>
              <MVColumn ref='C10'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O60' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R141' result='NotProvided'>
---
>             <Range ref='R148' result='NotProvided'>
25c25
<             <Output ref='O60' result='Provided'>
---
>             <Output ref='O63' result='Provided'>
>>
>>--===========================================
>>-- YR part 3: Not Provided match, query excludes negative interval values not
>>--            explicitly excluded by mv range, but check constraint disallows them.
>>--            Start point not inclusive as in mv range, so Not Provided instead of
>>--            Provided. Would be NotProvided anyway because check constraints not
>>--            used when determining ranges for MV descriptors.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should match (Not Provided) mvrngcon_yr
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where yr > interval'0'year and yr < interval '20' year
+>	    order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_YR_3;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000400'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R141' sqlType='INTERVAL YEAR(2) NO NULLS'>                    
          <Column id='C10' tableId='T1' colIndex='9' isNullable='0'>             
            CAT.RANGE.DTTYPES.YR                                                 
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='0'>                                               
              12                                                                 
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              228                                                                
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O60'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_yr_3.in;
>>sh echo PUBLISH MVRNGCON_YR.xml  >> range_yr_3.in;
>>sh echo MATCH RANGECONSTR_YR_3.xml >> range_yr_3.in;
>>
>>sh sh -c "$QMS range_yr_3.in range_yr_3.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_YR
          </MVName>
          <RangePredList>
            <Range ref='R141' result='NotProvided'>
              <MVColumn ref='C10'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O60' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
Diffs with result descriptor after changing predicate used in query:
18c18
<             <Range ref='R141' result='NotProvided'>
---
>             <Range ref='R148' result='NotProvided'>
25c25
<             <Output ref='O60' result='Provided'>
---
>             <Output ref='O63' result='Provided'>
>>
>>obey TEST004(match_MON);
>>--===========================================
>>-- MON: NotProvided match on mvrngcon_mon.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match on mvrngcon_mon. Note use of year interval as opposed
>>-- to month interval used in the predicate of the mv.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where mon > interval '500' year(3)
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_MON;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00000100'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R124' sqlType='INTERVAL MONTH(4) ALLOWS NULLS'>               
          <Column id='C12' tableId='T1' colIndex='11'>                           
            CAT.RANGE.DTTYPES.MON                                                
          </Column>                                                              
          <OpGE isNormalized='1'>                                                
            <NumericVal scale='0'>                                               
              6001                                                               
            </NumericVal>                                                        
          </OpGE>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O59'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                >> range_mon.in;
>>sh echo PUBLISH MVRNGCON_MON.xml  >> range_mon.in;
>>sh echo MATCH RANGECONSTR_MON.xml >> range_mon.in;
>>
>>sh sh -c "$QMS range_mon.in range_mon.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_MON
          </MVName>
          <RangePredList>
            <Range ref='R124' result='NotProvided'>
              <MVColumn ref='C12'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O59' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_SEC);
>>--===========================================
>>-- SEC: NotProvided match on mvrngcon_sec.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match on mvrngcon_sec.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where sec = interval '10.1' second(2,1)
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_SEC;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00008000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R125' sqlType='INTERVAL SECOND(2,4) ALLOWS NULLS'>            
          <Column id='C13' tableId='T1' colIndex='12'>                           
            CAT.RANGE.DTTYPES.SEC                                                
          </Column>                                                              
          <OpEQ>                                                                 
            <NumericVal scale='4'>                                               
              1010.0000                                                          
            </NumericVal>                                                        
          </OpEQ>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O59'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                >> range_sec.in;
>>sh echo PUBLISH MVRNGCON_SEC.xml  >> range_sec.in;
>>sh echo MATCH RANGECONSTR_SEC.xml >> range_sec.in;
>>
>>sh sh -c "$QMS range_sec.in range_sec.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_SEC
          </MVName>
          <RangePredList>
            <Range ref='R125' result='NotProvided'>
              <MVColumn ref='C13'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O59' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_MNT);
>>--===========================================
>>-- MNT: NotProvided match on mvrngcon_mnt.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match on mvrngcon_mnt.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where mnt between interval '1' minute and interval '3' minute
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_MNT;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00004000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R143' sqlType='INTERVAL MINUTE(1) ALLOWS NULLS'>              
          <Column id='C14' tableId='T1' colIndex='13'>                           
            CAT.RANGE.DTTYPES.MNT                                                
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='0'>                                               
              60000000                                                           
            </NumericVal>                                                        
            <NumericVal scale='0'>                                               
              180000000                                                          
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O60'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                >> range_mnt.in;
>>sh echo PUBLISH MVRNGCON_MNT.xml  >> range_mnt.in;
>>sh echo MATCH RANGECONSTR_MNT.xml >> range_mnt.in;
>>
>>sh sh -c "$QMS range_mnt.in range_mnt.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_MNT
          </MVName>
          <RangePredList>
            <Range ref='R143' result='NotProvided'>
              <MVColumn ref='C14'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O60' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_MS);
>>--===========================================
>>-- MS: NotProvided match on mvrngcon_ms.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match on mvrngcon_ms.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where ms = interval'345'second(3) or ms = interval-'300'second(3)
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_MS;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00002000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R135' sqlType='INTERVAL MINUTE(2) TO SECOND(6) ALLOWS NULLS'> 
          <Column id='C15' tableId='T1' colIndex='14'>                           
            CAT.RANGE.DTTYPES.MS                                                 
          </Column>                                                              
          <OpEQ>                                                                 
            <NumericVal scale='6'>                                               
              -300.000000                                                        
            </NumericVal>                                                        
            <NumericVal scale='6'>                                               
              345.000000                                                         
            </NumericVal>                                                        
          </OpEQ>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O62'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_ms.in;
>>sh echo PUBLISH MVRNGCON_MS.xml  >> range_ms.in;
>>sh echo MATCH RANGECONSTR_MS.xml >> range_ms.in;
>>
>>sh sh -c "$QMS range_ms.in range_ms.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_MS
          </MVName>
          <RangePredList>
            <Range ref='R135' result='NotProvided'>
              <MVColumn ref='C15'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O62' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_HR);
>>--===========================================
>>-- HR: NotProvided match on mvrngcon_hr.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match on mvrngcon_hr.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where hr > interval'10001'hour(5)
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_HR;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00001000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R124' sqlType='INTERVAL HOUR(8) ALLOWS NULLS'>                
          <Column id='C16' tableId='T1' colIndex='15'>                           
            CAT.RANGE.DTTYPES.HR                                                 
          </Column>                                                              
          <OpGE isNormalized='1'>                                                
            <NumericVal scale='0'>                                               
              36007200000000                                                     
            </NumericVal>                                                        
          </OpGE>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O59'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_hr.in;
>>sh echo PUBLISH MVRNGCON_HR.xml  >> range_hr.in;
>>sh echo MATCH RANGECONSTR_HR.xml >> range_hr.in;
>>
>>sh sh -c "$QMS range_hr.in range_hr.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_HR
          </MVName>
          <RangePredList>
            <Range ref='R124' result='NotProvided'>
              <MVColumn ref='C16'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O59' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_HM);
>>--===========================================
>>-- HM: NotProvided match on mvrngcon_hm.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match on mvrngcon_hm.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where hm = interval '1:10' hour to minute
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_HM;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00080000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R125' sqlType='INTERVAL HOUR(2) TO MINUTE ALLOWS NULLS'>      
          <Column id='C17' tableId='T1' colIndex='16'>                           
            CAT.RANGE.DTTYPES.HM                                                 
          </Column>                                                              
          <OpEQ>                                                                 
            <NumericVal scale='0'>                                               
              4200000000                                                         
            </NumericVal>                                                        
          </OpEQ>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O59'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 42 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_hm.in;
>>sh echo PUBLISH MVRNGCON_HM.xml  >> range_hm.in;
>>sh echo MATCH RANGECONSTR_HM.xml >> range_hm.in;
>>
>>sh sh -c "$QMS range_hm.in range_hm.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_HM
          </MVName>
          <RangePredList>
            <Range ref='R125' result='NotProvided'>
              <MVColumn ref='C17'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O59' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_HS);
>>--===========================================
>>-- HS: NotProvided match on mvrngcon_hs.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match on mvrngcon_hs.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where hs between interval -'10' hour(2) and interval '1000' minute(4)
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_HS;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00040000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R143' sqlType='INTERVAL HOUR(2) TO SECOND(6) ALLOWS NULLS'>   
          <Column id='C18' tableId='T1' colIndex='17'>                           
            CAT.RANGE.DTTYPES.HS                                                 
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='6'>                                               
              -36000.000000                                                      
            </NumericVal>                                                        
            <NumericVal scale='6'>                                               
              60000.000000                                                       
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O60'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>-- Don't do an INITIALIZE here; it causes unwanted MVs to be considered.
>>sh echo PUBLISH MVRNGCON_HS.xml  >> range_hs.in;
>>sh echo MATCH RANGECONSTR_HS.xml >> range_hs.in;
>>
>>sh sh -c "$QMS range_hs.in range_hs.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_HS
          </MVName>
          <RangePredList>
            <Range ref='R143' result='NotProvided'>
              <MVColumn ref='C18'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O60' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_HS_1);
>>--===========================================
>>-- HS_1: Provided match on mvrngcon_hs_1.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get provided match on mvrngcon_hs_1. The mv has a range including all
>>-- allowable values but the first and last, and the query predicate just excludes
>>-- the first and last allowable value.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where hs <> interval-'99:59:59.999999'hour to second and hs <> interval'99:59:59.999999'hour to second
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_HS_1;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00040000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R154' sqlType='INTERVAL HOUR(2) TO SECOND(6) ALLOWS NULLS'>   
          <Column id='C18' tableId='T1' colIndex='17'>                           
            CAT.RANGE.DTTYPES.HS                                                 
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='6'>                                               
              -359999.999998                                                     
            </NumericVal>                                                        
            <NumericVal scale='6'>                                               
              359999.999998                                                      
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O61'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>-- Don't do an INITIALIZE here; it causes unwanted MVs to be considered.
>>sh echo PUBLISH MVRNGCON_HS_1.xml  >> range_hs_1.in;
>>sh echo MATCH RANGECONSTR_HS_1.xml >> range_hs_1.in;
>>
>>sh sh -c "$QMS range_hs_1.in range_hs_1.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_HS_1
          </MVName>
          <RangePredList>
            <Range ref='R154' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O61' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_DY);
>>--===========================================
>>-- DY: NotProvided match on mvrngcon_dy.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match on mvrngcon_dy. Rewrite instructions should
>>-- include predicates on dh and dm as well.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where dy > interval '99' day(2) and dy < interval '101' day(3)
+>        and dh > interval '10 12' day(2) to hour
+>        and dm < interval '1 2:30' day to minute
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_DY;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00830000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R146' sqlType='INTERVAL DAY(2) TO HOUR ALLOWS NULLS'>         
          <Column id='C20' tableId='T1' colIndex='19'>                           
            CAT.RANGE.DTTYPES.DH                                                 
          </Column>                                                              
          <OpGE isNormalized='1'>                                                
            <NumericVal scale='0'>                                               
              910800000000                                                       
            </NumericVal>                                                        
          </OpGE>                                                                
        </Range>                                                                 
        <Range id='R147' sqlType='INTERVAL DAY(2) TO MINUTE ALLOWS NULLS'>       
          <Column id='C21' tableId='T1' colIndex='20'>                           
            CAT.RANGE.DTTYPES.DM                                                 
          </Column>                                                              
          <OpLE isNormalized='1'>                                                
            <NumericVal scale='0'>                                               
              95340000000                                                        
            </NumericVal>                                                        
          </OpLE>                                                                
        </Range>                                                                 
        <Range id='R149' sqlType='INTERVAL DAY(3) ALLOWS NULLS'>                 
          <Column id='C19' tableId='T1' colIndex='18'>                           
            CAT.RANGE.DTTYPES.DY                                                 
          </Column>                                                              
          <OpEQ>                                                                 
            <NumericVal scale='0'>                                               
              8640000000000                                                      
            </NumericVal>                                                        
          </OpEQ>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O65'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 62 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_dy.in;
>>sh echo PUBLISH MVRNGCON_DY.xml  >> range_dy.in;
>>sh echo MATCH RANGECONSTR_DY.xml >> range_dy.in;
>>
>>sh sh -c "$QMS range_dy.in range_dy.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_DY
          </MVName>
          <TableList>
            <Table ref='T1'>
              CAT.RANGE.DTTYPES
            </Table>
          </TableList>
          <JoinPredList>
            <JoinPred>
              <Column ref='C1' tableId='T1'>
                CAT.RANGE.DTTYPES.SYSKEY
              </Column>
              <MVColumn>
                SYS_SYSKEY1
              </MVColumn>
            </JoinPred>
          </JoinPredList>
          <RangePredList>
            <Range ref='R149' result='Provided'>
            </Range>
            <Range ref='R147' result='NotProvided'>
              <Column ref='C21' tableId='T1'>
                CAT.RANGE.DTTYPES.DM
              </Column>
            </Range>
            <Range ref='R146' result='NotProvided'>
              <Column ref='C20' tableId='T1'>
                CAT.RANGE.DTTYPES.DH
              </Column>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O65' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_DH);
>>--===========================================
>>-- DH: Matches empty mv.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- Matches mvrngcon_dh, which is guaranteed to be empty due to its predicate.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where dh > interval'100'day(3)
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_DH;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor                                                     
---------------------------------------------------------------------

<Query>                                                              
  <Version>                                                          
    1.0                                                              
  </Version>                                                         
  <Misc rewriteLevel='3'>                                            
  </Misc>                                                            
  <JBB id='B10000'>                                                  
    <Hub>                                                            
      <JBBCList>                                                     
        <Table id='T1' TS='212223904390906946' numCols='22'>         
          CAT.RANGE.DTTYPES                                          
          <Key>                                                      
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>
              CAT.RANGE.DTTYPES.SYSKEY                               
            </Column>                                                
          </Key>                                                     
        </Table>                                                     
      </JBBCList>                                                    
      <ResidualPredList>                                             
        <Residual id='D126'>                                         
          <Function id='S126' op='return_false'>                     
          </Function>                                                
        </Residual>                                                  
      </ResidualPredList>                                            
    </Hub>                                                           
    <ExtraHub>                                                       
    </ExtraHub>                                                      
    <OutputList>                                                     
      <Output id='O59'>                                              
        <Column id='C2' tableId='T1' colIndex='1'>                   
          CAT.RANGE.DTTYPES.I                                        
        </Column>                                                    
      </Output>                                                      
    </OutputList>                                                    
  </JBB>                                                             
</Query>                                                             

--- 36 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>-- Don't do an INITIALIZE here; it causes unwanted MVs to be considered.
>>sh echo PUBLISH MVRNGCON_DH.xml  >> range_dh.in;
>>sh echo MATCH RANGECONSTR_DH.xml >> range_dh.in;
>>
>>sh sh -c "$QMS range_dh.in range_dh.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_DH
          </MVName>
          <ResidualPredList>
            <Residual ref='D126' result='Provided'>
            </Residual>
          </ResidualPredList>
          <OutputList>
            <Output ref='O59' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_DM);
>>--===========================================
>>-- DM: Matches empty mv.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- Matches mvrngcon_dm, which is guaranteed to be empty due to its predicate.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where dm < interval-'100'day(3)
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_DM;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor                                                     
---------------------------------------------------------------------

<Query>                                                              
  <Version>                                                          
    1.0                                                              
  </Version>                                                         
  <Misc rewriteLevel='3'>                                            
  </Misc>                                                            
  <JBB id='B10000'>                                                  
    <Hub>                                                            
      <JBBCList>                                                     
        <Table id='T1' TS='212223904390906946' numCols='22'>         
          CAT.RANGE.DTTYPES                                          
          <Key>                                                      
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>
              CAT.RANGE.DTTYPES.SYSKEY                               
            </Column>                                                
          </Key>                                                     
        </Table>                                                     
      </JBBCList>                                                    
      <ResidualPredList>                                             
        <Residual id='D126'>                                         
          <Function id='S126' op='return_false'>                     
          </Function>                                                
        </Residual>                                                  
      </ResidualPredList>                                            
    </Hub>                                                           
    <ExtraHub>                                                       
    </ExtraHub>                                                      
    <OutputList>                                                     
      <Output id='O59'>                                              
        <Column id='C2' tableId='T1' colIndex='1'>                   
          CAT.RANGE.DTTYPES.I                                        
        </Column>                                                    
      </Output>                                                      
    </OutputList>                                                    
  </JBB>                                                             
</Query>                                                             

--- 36 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>-- Don't do an INITIALIZE here; it causes unwanted MVs to be considered.
>>sh echo PUBLISH MVRNGCON_DM.xml  >> range_dm.in;
>>sh echo MATCH RANGECONSTR_DM.xml >> range_dm.in;
>>
>>sh sh -c "$QMS range_dm.in range_dm.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_DM
          </MVName>
          <ResidualPredList>
            <Residual ref='D126' result='Provided'>
            </Residual>
          </ResidualPredList>
          <OutputList>
            <Output ref='O59' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
  </JbbResult>
</Result>
>>
>>obey TEST004(match_DS);
>>--===========================================
>>-- DS: NotProvided match with mvrngcon_ds.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- should get notprovided match with mvrngcon_ds; has same range except for stopping 1 microsecond short.
>>prepare QueryStmt from
+>      select i
+>      from dttypes
+>      where ds between interval-'1234567 10:20:30.123456'day(7) to second(6) and (interval'365'day(3) - interval'0.000001'second(6))
+>      order by i;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGECONSTR_DS;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------

<Query>                                                                          
  <Version>                                                                      
    1.0                                                                          
  </Version>                                                                     
  <Misc rewriteLevel='3'>                                                        
  </Misc>                                                                        
  <JBB id='B10000'>                                                              
    <Hub>                                                                        
      <JBBCList>                                                                 
        <Table id='T1' TS='212223904390906946' numCols='22' rangeBits='00400000'>
          CAT.RANGE.DTTYPES                                                      
          <Key>                                                                  
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>            
              CAT.RANGE.DTTYPES.SYSKEY                                           
            </Column>                                                            
          </Key>                                                                 
        </Table>                                                                 
      </JBBCList>                                                                
      <RangePredList>                                                            
        <Range id='R148' sqlType='INTERVAL DAY(7) TO SECOND(6) ALLOWS NULLS'>    
          <Column id='C22' tableId='T1' colIndex='21'>                           
            CAT.RANGE.DTTYPES.DS                                                 
          </Column>                                                              
          <OpBT startIsIncluded='1' endIsIncluded='1'>                           
            <NumericVal scale='6'>                                               
              -106666626030.123456                                               
            </NumericVal>                                                        
            <NumericVal scale='6'>                                               
              31535999.999999                                                    
            </NumericVal>                                                        
          </OpBT>                                                                
        </Range>                                                                 
      </RangePredList>                                                           
    </Hub>                                                                       
    <ExtraHub>                                                                   
    </ExtraHub>                                                                  
    <OutputList>                                                                 
      <Output id='O62'>                                                          
        <Column id='C2' tableId='T1' colIndex='1'>                               
          CAT.RANGE.DTTYPES.I                                                    
        </Column>                                                                
      </Output>                                                                  
    </OutputList>                                                                
  </JBB>                                                                         
</Query>                                                                         

--- 45 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE               >> range_ds.in;
>>sh echo PUBLISH MVRNGCON_DS.xml  >> range_ds.in;
>>sh echo MATCH RANGECONSTR_DS.xml >> range_ds.in;
>>
>>sh sh -c "$QMS range_ds.in range_ds.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B10000'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DTTYPES
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.MVRNGCON_DS
          </MVName>
          <RangePredList>
            <Range ref='R148' result='NotProvided'>
              <MVColumn ref='C22'>
                Y
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O62' result='Provided'>
              <MVColumn ref='C2'>
                X
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_D was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DH was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DM was disqualified because it has residual predicates and the Query does not.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_DY was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_1 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_HS_2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MNT was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MON was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_MS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_SEC was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T2 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_T6 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_TS3 was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YM was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.MVRNGCON_YR was disqualified because Table CAT.RANGE.DTTYPES failed on range bitmap.]]></Info>
  </JbbResult>
</Result>
>>
>>obey TEST004(float_coverage);
>>--===========================================
>>-- Additional tests to extend code coverage for floating point types.
>>--===========================================
>>
>>create mv mvqr_004_flt_mv1 refresh on request initialized on create as select d from numtypes where d>5e0 group by d;

*** WARNING[12112] A secondary index CAT.RANGE.MVQR_004_FLT_MV1_385385926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>create mv mvqr_004_flt_mv2 refresh on request initialized on create as select d from numtypes where d<5e0 group by d;

*** WARNING[12112] A secondary index CAT.RANGE.MVQR_004_FLT_MV2_678385926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>cqd mvqr_rewrite_candidates 'CAT.RANGE.MVQR_004_FLT_MV1 :,CAT.RANGE.MVQR_004_FLT_MV2';

--- SQL operation complete.
>>prepare s from select d from numtypes where d>10e0 group by d;

--- SQL command prepared.
>>select 'Success: MV used' from table(explain(null,'S')) where tname like '%MVQR_004_FLT_MV1%';

(EXPR)          
----------------

Success: MV used

--- 1 row(s) selected.
>>prepare s from select d from numtypes where d<0e0 group by d;

--- SQL command prepared.
>>select 'Success: MV used' from table(explain(null,'S')) where tname like '%MVQR_004_FLT_MV2%';

(EXPR)          
----------------

Success: MV used

--- 1 row(s) selected.
>>
>>obey TEST004(string_coverage);
>>--===========================================
>>-- Additional tests to extend code coverage for char types.
>>--===========================================
>>
>>create table tch
+>(
+>  i int,
+>  ch char(20),
+>  uch char(20) character set ucs2
+>);

--- SQL operation complete.
>>create mv mvqr_004_str_mv1 refresh on request initialized on create as select ch from tch where ch>'seattle' group by ch;

*** WARNING[12112] A secondary index CAT.RANGE.MVQR_004_STR_MV1_183485926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>create mv mvqr_004_str_mv2 refresh on request initialized on create as select ch from tch where ch<'seattle' group by ch;

*** WARNING[12112] A secondary index CAT.RANGE.MVQR_004_STR_MV2_926485926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>cqd mvqr_rewrite_candidates 'CAT.RANGE.MVQR_004_STR_MV1 :,CAT.RANGE.MVQR_004_STR_MV2';

--- SQL operation complete.
>>prepare s from select ch from tch where ch>'tampa' group by ch;

--- SQL command prepared.
>>select 'Success: MV used' from table(explain(null,'S')) where tname like '%MVQR_004_STR_MV1%';

(EXPR)          
----------------

Success: MV used

--- 1 row(s) selected.
>>prepare s from select ch from tch where ch<'new york' group by ch;

--- SQL command prepared.
>>select 'Success: MV used' from table(explain(null,'S')) where tname like '%MVQR_004_STR_MV2%';

(EXPR)          
----------------

Success: MV used

--- 1 row(s) selected.
>>
>>
>>obey TEST004(toItemExpr_coverage);
>>--=====================================================================================
>>-- Test several redefinitions of QRELement::toItemExpr() that aren't hit by other tests.
>>--=====================================================================================
>>create table t1
+>(
+>  a1 int not null not droppable primary key, b1 int, c1 int
+>);

--- SQL operation complete.
>>
>>create table t2
+>(
+>  a2 int not null not droppable primary key, b2 int, c2 int
+>);

--- SQL operation complete.
>>
>>create table t3
+>(
+>  a3 int not null not droppable primary key, b3 int, c3 int
+>);

--- SQL operation complete.
>>
>>-- This hits QRUnaryOper::toItemExpr().
>>create mv mv1 refresh on request initialized on create as
+>  select b1,b2
+>  from t1,t2
+>  where b1=b2 and b1>10;

*** WARNING[12112] A secondary index CAT.RANGE.MV1_754785926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>
>>cqd mvqr_rewrite_candidates 'CAT.SCH.MV1';

--- SQL operation complete.
>>prepare QueryStmt from
+>select b1+5,nvl(b2, 999)
+>from t1,t2
+>where b1=b2 and b1>10;

--- SQL command prepared.
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.MV1                                               

--- 1 row(s) selected.
>>
>>-- This hits QRNullVal::toItemExpr().
>>drop mv mv1 cascade;

--- SQL operation complete.
>>create mv mv1 refresh on request initialized on create as
+>  select c1,c2
+>  from t1,t2
+>  where b1=b2 and b1>10;

*** WARNING[12112] A secondary index CAT.RANGE.MV1_976985926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>
>>cqd mvqr_rewrite_candidates 'CAT.SCH.MV1';

--- SQL operation complete.
>>prepare QueryStmt from
+>select nullif(c1,c2)
+>from t1,t2
+>where b1=b2 and b1>10;

--- SQL command prepared.
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.MV1                                               

--- 1 row(s) selected.
>>
>>-- This hits QRColumn::toItemExpr(); also tests use of backjoin column in expression
>>drop mv mv1 cascade;

--- SQL operation complete.
>>create mv mv1 refresh on request initialized on create as
+>  select c1
+>  from t1,t2,t3
+>  where b1=b2 and b2=b3;

*** WARNING[12112] A secondary index CAT.RANGE.MV1_763395926_9676 was created for the materialized view.

*** WARNING[12112] A secondary index CAT.RANGE.MV1_655395926_9676 was created for the materialized view.

--- SQL operation completed with warnings.
>>
>>cqd mvqr_rewrite_candidates 'CAT.SCH.MV1';

--- SQL operation complete.
>>prepare QueryStmt from
+>select c1+c2
+>from t1,t2,t3
+>where b1=b2 and b2=b3;

--- SQL command prepared.
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       BACKJOIN@T2 (CAT.RANGE.T2)                                  
FILE_SCAN                       CAT.RANGE.MV1                                               

--- 2 row(s) selected.
>>
>>drop mv mv1 cascade;

--- SQL operation complete.
>>drop table t1 cascade;

--- SQL operation complete.
>>drop table t2 cascade;

--- SQL operation complete.
>>
>>
>>obey TEST004(test_type_constraints);
>>--===========================================
>>-- Test the effect of applying type-implied constraints to query ranges having
>>-- various relations to the constraint range. This test does not involve matching,
>>-- just generation of the query descriptor.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- Query range entirely contained within type boundaries.
>>select i from numtypes where si between -32000 and 32000 order by i;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R81' sqlType='SMALLINT SIGNED ALLOWS NULLS'>                 
          <Column id='C3' tableId='T1' colIndex='2'>                            
            CAT.RANGE.NUMTYPES.SI                                               
          </Column>                                                             
          <OpBT startIsIncluded='1' endIsIncluded='1'>                          
            <NumericVal scale='0'>                                              
              -32000                                                            
            </NumericVal>                                                       
            <NumericVal scale='0'>                                              
              32000                                                             
            </NumericVal>                                                       
          </OpBT>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O35'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 45 row(s) selected.
>>
>>-- Query range coincides with type boundaries.
>>select i from numtypes where si between -32768 and 32767 order by i;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R82' sqlType='SMALLINT SIGNED ALLOWS NULLS'>                 
          <Column id='C3' tableId='T1' colIndex='2'>                            
            CAT.RANGE.NUMTYPES.SI                                               
          </Column>                                                             
          <!-- empty Range element indicates IS NOT NULL -->                    
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O36'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 38 row(s) selected.
>>
>>-- Query range spans lower type boundary.
>>select i from numtypes where si between -33000 and -32000 order by i;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R85' sqlType='SMALLINT SIGNED ALLOWS NULLS'>                 
          <Column id='C3' tableId='T1' colIndex='2'>                            
            CAT.RANGE.NUMTYPES.SI                                               
          </Column>                                                             
          <OpLE isNormalized='1'>                                               
            <NumericVal scale='0'>                                              
              -32000                                                            
            </NumericVal>                                                       
          </OpLE>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O37'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 42 row(s) selected.
>>
>>-- Query range spans upper type boundary.
>>select i from numtypes where si between 32000 and 33000 order by i;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R78' sqlType='SMALLINT SIGNED ALLOWS NULLS'>                 
          <Column id='C3' tableId='T1' colIndex='2'>                            
            CAT.RANGE.NUMTYPES.SI                                               
          </Column>                                                             
          <OpGE isNormalized='1'>                                               
            <NumericVal scale='0'>                                              
              32000                                                             
            </NumericVal>                                                       
          </OpGE>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O34'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 42 row(s) selected.
>>
>>-- Query range spans both type boundaries.
>>select i from numtypes where si between -33000 and 33000 order by i;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R81' sqlType='SMALLINT SIGNED ALLOWS NULLS'>                 
          <Column id='C3' tableId='T1' colIndex='2'>                            
            CAT.RANGE.NUMTYPES.SI                                               
          </Column>                                                             
          <!-- empty Range element indicates IS NOT NULL -->                    
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O35'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 38 row(s) selected.
>>
>>-- Query range starts at lower type boundary, extends beyond upper boundary.
>>select i from numtypes where si between -32768 and 33000 order by i;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R82' sqlType='SMALLINT SIGNED ALLOWS NULLS'>                 
          <Column id='C3' tableId='T1' colIndex='2'>                            
            CAT.RANGE.NUMTYPES.SI                                               
          </Column>                                                             
          <!-- empty Range element indicates IS NOT NULL -->                    
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O36'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 38 row(s) selected.
>>
>>-- Query range starts below lower type boundary, ends at upper boundary.
>>select i from numtypes where si between -33000 and 32767 order by i;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904376598581' numCols='9' rangeBits='00000002'>
          CAT.RANGE.NUMTYPES                                                    
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.NUMTYPES.SYSKEY                                         
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R82' sqlType='SMALLINT SIGNED ALLOWS NULLS'>                 
          <Column id='C3' tableId='T1' colIndex='2'>                            
            CAT.RANGE.NUMTYPES.SI                                               
          </Column>                                                             
          <!-- empty Range element indicates IS NOT NULL -->                    
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O36'>                                                         
        <Column id='C2' tableId='T1' colIndex='1' isNullable='0'>               
          CAT.RANGE.NUMTYPES.I                                                  
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 38 row(s) selected.
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>
>>obey TEST004(test_equality_sets);
>>--===========================================
>>-- Test the division of equality set members into join pred, range preds, and
>>-- residual preds. This test does not involve matching, just generation of the
>>-- query descriptor.
>>--===========================================
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>-- JP + const
>>select fday, dimdata
+>from fact f, dim1 d
+>where f.dimkey=d.dkey and d.dkey=10
+>order by 1,2;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904322066955' numCols='2' rangeBits='00000008'>
          CAT.RANGE.DIM1                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM1.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8' rangeBits='00000010'>
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J51'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column id='C8' tableId='T2' colIndex='7'>                            
            CAT.RANGE.FACT.DIMKEY                                               
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R52' sqlType='INTEGER SIGNED NO NULLS'>                      
          <Column ref='C8'>                                                     
          </Column>                                                             
          <OpEQ>                                                                
            <NumericVal scale='0'>                                              
              10                                                                
            </NumericVal>                                                       
          </OpEQ>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O33'>                                                         
        <Column id='C2' tableId='T2' colIndex='1'>                              
          CAT.RANGE.FACT.FDAY                                                   
        </Column>                                                               
      </Output>                                                                 
      <Output id='O57'>                                                         
        <Column id='C18' tableId='T1' colIndex='1'>                             
          CAT.RANGE.DIM1.DIMDATA                                                
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 63 row(s) selected.
>>
>>-- JP + const + duplicate node
>>select fday, dimdata
+>from fact f, dim1 d
+>where f.dimkey=d.dkey and d.dkey=10 and d.dimdata=10
+>order by 1,2;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904322066955' numCols='2' rangeBits='0000000C'>
          CAT.RANGE.DIM1                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM1.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8' rangeBits='00000010'>
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J58'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column id='C8' tableId='T2' colIndex='7'>                            
            CAT.RANGE.FACT.DIMKEY                                               
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R59' sqlType='INTEGER SIGNED NO NULLS'>                      
          <Column ref='C8'>                                                     
          </Column>                                                             
          <OpEQ>                                                                
            <NumericVal scale='0'>                                              
              10                                                                
            </NumericVal>                                                       
          </OpEQ>                                                               
        </Range>                                                                
        <Range id='R71' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column id='C18' tableId='T1' colIndex='1'>                           
            CAT.RANGE.DIM1.DIMDATA                                              
          </Column>                                                             
          <OpEQ>                                                                
            <NumericVal scale='0'>                                              
              10                                                                
            </NumericVal>                                                       
          </OpEQ>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O34'>                                                         
        <Column id='C2' tableId='T2' colIndex='1'>                              
          CAT.RANGE.FACT.FDAY                                                   
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 68 row(s) selected.
>>
>>-- 1 node + const + resid
>>select fday, dimdata
+>from fact f, dim1 d
+>where f.dimkey=f.fquant and f.fquant=10
+>order by 1,2;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904322066955' numCols='2'>                     
          CAT.RANGE.DIM1                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM1.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8' rangeBits='00000050'>
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R68' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column id='C8' tableId='T2' colIndex='7'>                            
            CAT.RANGE.FACT.DIMKEY                                               
          </Column>                                                             
          <OpEQ>                                                                
            <NumericVal scale='0'>                                              
              10                                                                
            </NumericVal>                                                       
          </OpEQ>                                                               
        </Range>                                                                
        <Range id='R69' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column id='C6' tableId='T2' colIndex='5'>                            
            CAT.RANGE.FACT.FQUANT                                               
          </Column>                                                             
          <OpEQ>                                                                
            <NumericVal scale='0'>                                              
              10                                                                
            </NumericVal>                                                       
          </OpEQ>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O33'>                                                         
        <Column id='C2' tableId='T2' colIndex='1'>                              
          CAT.RANGE.FACT.FDAY                                                   
        </Column>                                                               
      </Output>                                                                 
      <Output id='O57'>                                                         
        <Column id='C18' tableId='T1' colIndex='1'>                             
          CAT.RANGE.DIM1.DIMDATA                                                
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 65 row(s) selected.
>>
>>-- JP + resid
>>select fday, dimdata
+>from fact f, dim1 d
+>where f.dimkey=d.dkey and f.dimkey=fday+fmonth
+>order by 1,2;

Query Descriptor
-----------------------------------------------------------------------------------

<Query>                                                                            
  <Version>                                                                        
    1.0                                                                            
  </Version>                                                                       
  <Misc rewriteLevel='3'>                                                          
  </Misc>                                                                          
  <JBB id='B0'>                                                                    
    <Hub>                                                                          
      <JBBCList>                                                                   
        <Table id='T1' TS='212223904322066955' numCols='2' residualBits='00000008'>
          CAT.RANGE.DIM1                                                           
          <Key>                                                                    
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>             
              CAT.RANGE.DIM1.DKEY                                                  
            </Column>                                                              
          </Key>                                                                   
        </Table>                                                                   
        <Table id='T2' TS='212223904322066955' numCols='8' residualBits='00000016'>
          CAT.RANGE.FACT                                                           
          <Key>                                                                    
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>              
              CAT.RANGE.FACT.SYSKEY                                                
            </Column>                                                              
          </Key>                                                                   
        </Table>                                                                   
      </JBBCList>                                                                  
      <JoinPredList>                                                               
        <JoinPred id='J51'>                                                        
          <Column ref='C17'>                                                       
          </Column>                                                                
          <Column id='C8' tableId='T2' colIndex='7'>                               
            CAT.RANGE.FACT.DIMKEY                                                  
          </Column>                                                                
        </JoinPred>                                                                
      </JoinPredList>                                                              
      <ResidualPredList>                                                           
        <Residual id='D69'>                                                        
          <BinaryOper id='S69' op='='>                                             
            <BinaryOper id='S27' op='+'>                                           
              <Column ref='C2'>                                                    
              </Column>                                                            
              <Column id='C3' tableId='T2' colIndex='2'>                           
                CAT.RANGE.FACT.FMONTH                                              
              </Column>                                                            
            </BinaryOper>                                                          
            <Column ref='C8'>                                                      
            </Column>                                                              
          </BinaryOper>                                                            
        </Residual>                                                                
      </ResidualPredList>                                                          
    </Hub>                                                                         
    <ExtraHub>                                                                     
    </ExtraHub>                                                                    
    <OutputList>                                                                   
      <Output id='O33'>                                                            
        <Column id='C2' tableId='T2' colIndex='1'>                                 
          CAT.RANGE.FACT.FDAY                                                      
        </Column>                                                                  
      </Output>                                                                    
      <Output id='O57'>                                                            
        <Column id='C18' tableId='T1' colIndex='1'>                                
          CAT.RANGE.DIM1.DIMDATA                                                   
        </Column>                                                                  
      </Output>                                                                    
    </OutputList>                                                                  
  </JBB>                                                                           
</Query>                                                                           

--- 67 row(s) selected.
>>
>>-- JP + const + resid
>>select fday, dimdata
+>from fact f, dim1 d
+>where 10=fday+fmonth and f.dimkey=d.dkey and d.dkey=10
+>order by 1,2;

Query Descriptor
--------------------------------------------------------------------------------------------------------

<Query>                                                                                                 
  <Version>                                                                                             
    1.0                                                                                                 
  </Version>                                                                                            
  <Misc rewriteLevel='3'>                                                                               
  </Misc>                                                                                               
  <JBB id='B0'>                                                                                         
    <Hub>                                                                                               
      <JBBCList>                                                                                        
        <Table id='T1' TS='212223904322066955' numCols='2' rangeBits='00000008'>                        
          CAT.RANGE.DIM1                                                                                
          <Key>                                                                                         
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>                                  
              CAT.RANGE.DIM1.DKEY                                                                       
            </Column>                                                                                   
          </Key>                                                                                        
        </Table>                                                                                        
        <Table id='T2' TS='212223904322066955' numCols='8' rangeBits='00000010' residualBits='00000006'>
          CAT.RANGE.FACT                                                                                
          <Key>                                                                                         
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>                                   
              CAT.RANGE.FACT.SYSKEY                                                                     
            </Column>                                                                                   
          </Key>                                                                                        
        </Table>                                                                                        
      </JBBCList>                                                                                       
      <JoinPredList>                                                                                    
        <JoinPred id='J53'>                                                                             
          <Column ref='C17'>                                                                            
          </Column>                                                                                     
          <Column id='C8' tableId='T2' colIndex='7'>                                                    
            CAT.RANGE.FACT.DIMKEY                                                                       
          </Column>                                                                                     
        </JoinPred>                                                                                     
      </JoinPredList>                                                                                   
      <RangePredList>                                                                                   
        <Range id='R54' sqlType='INTEGER SIGNED NO NULLS'>                                              
          <Column ref='C8'>                                                                             
          </Column>                                                                                     
          <OpEQ>                                                                                        
            <NumericVal scale='0'>                                                                      
              10                                                                                        
            </NumericVal>                                                                               
          </OpEQ>                                                                                       
        </Range>                                                                                        
      </RangePredList>                                                                                  
      <ResidualPredList>                                                                                
        <Residual id='D73'>                                                                             
          <BinaryOper id='S73' op='='>                                                                  
            <BinaryOper id='S27' op='+'>                                                                
              <Column ref='C2'>                                                                         
              </Column>                                                                                 
              <Column id='C3' tableId='T2' colIndex='2'>                                                
                CAT.RANGE.FACT.FMONTH                                                                   
              </Column>                                                                                 
            </BinaryOper>                                                                               
            <NumericVal id='S26' scale='0'>                                                             
              10                                                                                        
            </NumericVal>                                                                               
          </BinaryOper>                                                                                 
        </Residual>                                                                                     
      </ResidualPredList>                                                                               
    </Hub>                                                                                              
    <ExtraHub>                                                                                          
    </ExtraHub>                                                                                         
    <OutputList>                                                                                        
      <Output id='O35'>                                                                                 
        <Column id='C2' tableId='T2' colIndex='1'>                                                      
          CAT.RANGE.FACT.FDAY                                                                           
        </Column>                                                                                       
      </Output>                                                                                         
      <Output id='O59'>                                                                                 
        <Column id='C18' tableId='T1' colIndex='1'>                                                     
          CAT.RANGE.DIM1.DIMDATA                                                                        
        </Column>                                                                                       
      </Output>                                                                                         
    </OutputList>                                                                                       
  </JBB>                                                                                                
</Query>                                                                                                

--- 79 row(s) selected.
>>
>>-- JP + const + multinode
>>select fday, dimdata
+>from fact f, dim1 d
+>where f.dimkey=d.dkey and f.dimkey=10 and 10=f.fitem+d.dimdata
+>order by 1,2;

Query Descriptor
--------------------------------------------------------------------------------------------------------

<Query>                                                                                                 
  <Version>                                                                                             
    1.0                                                                                                 
  </Version>                                                                                            
  <Misc rewriteLevel='3'>                                                                               
  </Misc>                                                                                               
  <JBB id='B0'>                                                                                         
    <Hub>                                                                                               
      <JBBCList>                                                                                        
        <Table id='T1' TS='212223904322066955' numCols='2' rangeBits='00000008' residualBits='00000004'>
          CAT.RANGE.DIM1                                                                                
          <Key>                                                                                         
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>                                  
              CAT.RANGE.DIM1.DKEY                                                                       
            </Column>                                                                                   
          </Key>                                                                                        
        </Table>                                                                                        
        <Table id='T2' TS='212223904322066955' numCols='8' rangeBits='00000010' residualBits='00000080'>
          CAT.RANGE.FACT                                                                                
          <Key>                                                                                         
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>                                   
              CAT.RANGE.FACT.SYSKEY                                                                     
            </Column>                                                                                   
          </Key>                                                                                        
        </Table>                                                                                        
      </JBBCList>                                                                                       
      <JoinPredList>                                                                                    
        <JoinPred id='J53'>                                                                             
          <Column ref='C17'>                                                                            
          </Column>                                                                                     
          <Column id='C8' tableId='T2' colIndex='7'>                                                    
            CAT.RANGE.FACT.DIMKEY                                                                       
          </Column>                                                                                     
        </JoinPred>                                                                                     
      </JoinPredList>                                                                                   
      <RangePredList>                                                                                   
        <Range id='R54' sqlType='INTEGER SIGNED NO NULLS'>                                              
          <Column ref='C8'>                                                                             
          </Column>                                                                                     
          <OpEQ>                                                                                        
            <NumericVal scale='0'>                                                                      
              10                                                                                        
            </NumericVal>                                                                               
          </OpEQ>                                                                                       
        </Range>                                                                                        
      </RangePredList>                                                                                  
      <ResidualPredList>                                                                                
        <Residual id='D72'>                                                                             
          <BinaryOper id='S72' op='='>                                                                  
            <BinaryOper id='S29' op='+'>                                                                
              <Column id='C5' tableId='T2' colIndex='4'>                                                
                CAT.RANGE.FACT.FITEM                                                                    
              </Column>                                                                                 
              <Column ref='C18'>                                                                        
              </Column>                                                                                 
            </BinaryOper>                                                                               
            <NumericVal id='S27' scale='0'>                                                             
              10                                                                                        
            </NumericVal>                                                                               
          </BinaryOper>                                                                                 
        </Residual>                                                                                     
      </ResidualPredList>                                                                               
    </Hub>                                                                                              
    <ExtraHub>                                                                                          
    </ExtraHub>                                                                                         
    <OutputList>                                                                                        
      <Output id='O35'>                                                                                 
        <Column id='C2' tableId='T2' colIndex='1'>                                                      
          CAT.RANGE.FACT.FDAY                                                                           
        </Column>                                                                                       
      </Output>                                                                                         
      <Output id='O59'>                                                                                 
        <Column id='C18' tableId='T1' colIndex='1'>                                                     
          CAT.RANGE.DIM1.DIMDATA                                                                        
        </Column>                                                                                       
      </Output>                                                                                         
    </OutputList>                                                                                       
  </JBB>                                                                                                
</Query>                                                                                                

--- 79 row(s) selected.
>>
>>-- 3 multi-node expns
>>select fday, dimdata
+>from fact f, dim1 d
+>where fitem+dkey=fquant+dimdata and fmonth+dimdata=fitem+dkey
+>order by 1,2;

Query Descriptor
-----------------------------------------------------------------------------------

<Query>                                                                            
  <Version>                                                                        
    1.0                                                                            
  </Version>                                                                       
  <Misc rewriteLevel='3'>                                                          
  </Misc>                                                                          
  <JBB id='B0'>                                                                    
    <Hub>                                                                          
      <JBBCList>                                                                   
        <Table id='T1' TS='212223904322066955' numCols='2' residualBits='0000000C'>
          CAT.RANGE.DIM1                                                           
          <Key>                                                                    
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>             
              CAT.RANGE.DIM1.DKEY                                                  
            </Column>                                                              
          </Key>                                                                   
        </Table>                                                                   
        <Table id='T2' TS='212223904322066955' numCols='8' residualBits='000000C2'>
          CAT.RANGE.FACT                                                           
          <Key>                                                                    
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>              
              CAT.RANGE.FACT.SYSKEY                                                
            </Column>                                                              
          </Key>                                                                   
        </Table>                                                                   
      </JBBCList>                                                                  
      <ResidualPredList>                                                           
        <Residual id='D72'>                                                        
          <BinaryOper id='S72' op='='>                                             
            <BinaryOper id='S26' op='+'>                                           
              <Column id='C5' tableId='T2' colIndex='4'>                           
                CAT.RANGE.FACT.FITEM                                               
              </Column>                                                            
              <Column ref='C17'>                                                   
              </Column>                                                            
            </BinaryOper>                                                          
            <BinaryOper id='S27' op='+'>                                           
              <Column id='C6' tableId='T2' colIndex='5'>                           
                CAT.RANGE.FACT.FQUANT                                              
              </Column>                                                            
              <Column ref='C18'>                                                   
              </Column>                                                            
            </BinaryOper>                                                          
          </BinaryOper>                                                            
        </Residual>                                                                
        <Residual id='D73'>                                                        
          <BinaryOper id='S73' op='='>                                             
            <BinaryOper id='S27' op='+'>                                           
              <Column ref='C6'>                                                    
              </Column>                                                            
              <Column ref='C18'>                                                   
              </Column>                                                            
            </BinaryOper>                                                          
            <BinaryOper id='S29' op='+'>                                           
              <Column id='C3' tableId='T2' colIndex='2'>                           
                CAT.RANGE.FACT.FMONTH                                              
              </Column>                                                            
              <Column ref='C18'>                                                   
              </Column>                                                            
            </BinaryOper>                                                          
          </BinaryOper>                                                            
        </Residual>                                                                
      </ResidualPredList>                                                          
    </Hub>                                                                         
    <ExtraHub>                                                                     
    </ExtraHub>                                                                    
    <OutputList>                                                                   
      <Output id='O36'>                                                            
        <Column id='C2' tableId='T2' colIndex='1'>                                 
          CAT.RANGE.FACT.FDAY                                                      
        </Column>                                                                  
      </Output>                                                                    
      <Output id='O60'>                                                            
        <Column id='C18' tableId='T1' colIndex='1'>                                
          CAT.RANGE.DIM1.DIMDATA                                                   
        </Column>                                                                  
      </Output>                                                                    
    </OutputList>                                                                  
  </JBB>                                                                           
</Query>                                                                           

--- 80 row(s) selected.
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>
>>obey TEST004(test_rangespec_transformation);
>>--===========================================
>>--== Test comparison of endpoint values for string subranges. We disable rewrite
>>--== for this and just compare results with rangespec_transformation on and off.
>>--== The main issue is strings of differing length with the shorter string matching
>>--== the initial portion of the longer ones. We need to make sure we use the
>>--== blank-padding semantics of SQL string comparions. See Solution 10-100707-1629.
>>--==
>>--== Test range that includes all values. See Solution 10-100708-1655.
>>--===========================================
>>
>>control query default MVQR_REWRITE_LEVEL '0';

--- SQL operation complete.
>>
>>create table mvqr_test004_t1( s varchar(10) );

--- SQL operation complete.
>>insert into mvqr_test004_t1 values(' 1s'),('1s'),(convertfromhex('0921')),('');

--- 4 row(s) inserted.
>>select '|' || s || '|' from mvqr_test004_t1;

(EXPR)      
------------

| 1s|       
|1s|        
|	!|        
||          

--- 4 row(s) selected.
>>control query default  rangespec_transformation 'MINIMUM';

--- SQL operation complete.
>>select '|' || s || '|' from mvqr_test004_t1 where s <= ' ';

(EXPR)      
------------

|	!|        
||          

--- 2 row(s) selected.
>>select '|' || s || '|' from mvqr_test004_t1 where s <= '';

(EXPR)      
------------

|	!|        
||          

--- 2 row(s) selected.
>>select '|' || s || '|' from mvqr_test004_t1 where s >= ' ';

(EXPR)      
------------

| 1s|       
|1s|        
||          

--- 3 row(s) selected.
>>select '|' || s || '|' from mvqr_test004_t1 where s >= '';

(EXPR)      
------------

| 1s|       
|1s|        
||          

--- 3 row(s) selected.
>>control query default  rangespec_transformation 'OFF';

--- SQL operation complete.
>>select '|' || s || '|' from mvqr_test004_t1 where s <= ' ';

(EXPR)      
------------

|	!|        
||          

--- 2 row(s) selected.
>>select '|' || s || '|' from mvqr_test004_t1 where s <= '';

(EXPR)      
------------

|	!|        
||          

--- 2 row(s) selected.
>>select '|' || s || '|' from mvqr_test004_t1 where s >= ' ';

(EXPR)      
------------

| 1s|       
|1s|        
||          

--- 3 row(s) selected.
>>select '|' || s || '|' from mvqr_test004_t1 where s >= '';

(EXPR)      
------------

| 1s|       
|1s|        
||          

--- 3 row(s) selected.
>>drop table mvqr_test004_t1;

--- SQL operation complete.
>>
>>create table mvqr_test004_t2(a1 int, x1 char(10));

--- SQL operation complete.
>>insert into mvqr_test004_t2(a1,x1) values(1,x'616208'), (2,'abc'),(3,'ab'),(4,'ab ');

--- 4 row(s) inserted.
>>control query default rangespec_transformation 'MINIMUM';

--- SQL operation complete.
>>select a1 from mvqr_test004_t2 where x1>x'616208' and x1<='ab ';

A1         
-----------

          3
          4

--- 2 row(s) selected.
>>control query default rangespec_transformation 'OFF';

--- SQL operation complete.
>>select a1 from mvqr_test004_t2 where x1>x'616208' and x1<='ab ';

A1         
-----------

          3
          4

--- 2 row(s) selected.
>>
>>-- Using the same table as above, test a range that covers all values (except NULL).
>>-- This duplicates the problem reported by Solution 10-100708-1655.
>>control query default rangespec_transformation 'MINIMUM';

--- SQL operation complete.
>>select a1 from mvqr_test004_t2 where a1 not between 2 and 1;

A1         
-----------

          1
          2
          3
          4

--- 4 row(s) selected.
>>
>>-- Using same table as above test intersection with a range derived from a LIKE
>>-- pred with a trailing wild card. Descriptor should show a range pred for x1='A'.
>>control query default MVQR_REWRITE_LEVEL '3';

--- SQL operation complete.
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>select x1 from mvqr_test004_t2 where x1 in ('A', 'B') and x1 like 'A%' order by x1;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B10000'>                                                             
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904597816730' numCols='3' rangeBits='00000002'>
          CAT.RANGE.MVQR_TEST004_T2                                             
          <Key>                                                                 
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.MVQR_TEST004_T2.SYSKEY                                  
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <RangePredList>                                                           
        <Range id='R53' sqlType='CHAR(10) CHARACTER SET ISO88591 ALLOWS NULLS'> 
          <Column ref='C3'>                                                     
          </Column>                                                             
          <OpEQ>                                                                
            <StringVal><![CDATA[A]]></StringVal>                                
          </OpEQ>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O26'>                                                         
        <Column id='C3' tableId='T1' colIndex='2'>                              
          CAT.RANGE.MVQR_TEST004_T2.X1                                          
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 39 row(s) selected.
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>-- Drop table and restore setting for rangespec cqd.
>>drop table mvqr_test004_t2;

--- SQL operation complete.
>>control query default rangespec_transformation reset;

--- SQL operation complete.
>>
>>
>>obey TEST004(test_mapvid_pushdown);
>>--===========================================
>>--== Test predicate that results in a vegref that includes a constant being placed
>>--== in the bottom values of the mapvids node above the MV scan node. When we 
>>--== call pushdownCoveredExpressions, this vegref will be removed as a covered
>>--== expression. We have to restore the original map to prevent a fault in the
>>--== Generator.
>>--==
>>--== See Solution 10-100707-1647.
>>--===========================================
>>create table t1(a1 int not null not droppable primary key);

--- SQL operation complete.
>>create table t2(a2 int not null not droppable primary key);

--- SQL operation complete.
>>insert into t1(a1) values(1),(2),(3),(4),(5),(6),(7),(8),(9);

--- 9 row(s) inserted.
>>insert into t2(a2) values(1),(2),(3),(4),(5),(6),(7),(8),(9);

--- 9 row(s) inserted.
>>create mv RANGE_MV_MAPVID_PUSHDOWN refresh on request initialized on create as 
+>  select a1,a2 
+>  from t1,t2 
+>  where a1=a2 
+>    and a1>5;

--- SQL operation complete.
>>set pattern $$MVName$$ RANGE_MV_MAPVID_PUSHDOWN;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_MV_MAPVID_PUSHDOWN
  </Table>
  <Misc isIncremental='1'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T2' TS='212223904599159705' isKeyCovered='1' numCols='1' rangeBits='00000008'>
          CAT.RANGE.T1
        </Table>
        <Table id='T1' TS='212223904600894791' isKeyCovered='1' numCols='1' rangeBits='00000008'>
          CAT.RANGE.T2
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J158'>
          <Column ref='C140'>
          </Column>
          <Column id='C147' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.T2.A2
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R181' sqlType='INTEGER SIGNED NO NULLS'>
          <Column ref='C140'>
          </Column>
          <OpGE isNormalized='1'>
            <NumericVal scale='0'>
              6
            </NumericVal>
          </OpGE>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O158' name='A1'>
        <Column id='C140' tableId='T2' colIndex='0' isNullable='0'>
          CAT.RANGE.T1.A1
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>cqd mvqr_rewrite_candidates 'CAT.RANGE.RANGE_MV_MAPVID_PUSHDOWN';

--- SQL operation complete.
>>
>>-- The following where clause resolves the two betweens to the constant 6.
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>prepare QueryStmt from 
+>  select a1,a2 
+>  from t1,t2 
+>  where a1=a2 
+>    and a1 between 0 and 6 
+>    and a1 between 6 and 10
+>  order by a1;

--- SQL command prepared.
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>set pattern $$QueryName$$ RANGE_MAPVID_PUSHDOWN;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T2' TS='212223904603803843' numCols='1' rangeBits='00000008'>
          CAT.RANGE.T1                                                          
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.T1.A1                                                   
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T1' TS='212223904603803843' numCols='1' rangeBits='00000008'>
          CAT.RANGE.T2                                                          
          <Key>                                                                 
            <Column id='C8' tableId='T1' colIndex='0' isNullable='0'>           
              CAT.RANGE.T2.A2                                                   
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J22'>                                                     
          <Column ref='C1'>                                                     
          </Column>                                                             
          <Column ref='C8'>                                                     
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R23' sqlType='INTEGER SIGNED NO NULLS'>                      
          <Column ref='C1'>                                                     
          </Column>                                                             
          <OpEQ>                                                                
            <NumericVal scale='0'>                                              
              6                                                                 
            </NumericVal>                                                       
          </OpEQ>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O22'>                                                         
        <Column ref='C1'>                                                       
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 56 row(s) selected.
>>
>>
>>sh echo INITIALIZE >> range_mapvid.in;
>>sh echo PUBLISH RANGE_MV_MAPVID_PUSHDOWN.xml  >> range_mapvid.in;
>>sh echo MATCH RANGE_MAPVID_PUSHDOWN.xml >> range_mapvid.in;
>>
>>sh sh -c "$QMS range_mapvid.in range_mapvid.out";
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T2'>
          CAT.RANGE.T1
        </Table>
        <Table ref='T1'>
          CAT.RANGE.T2
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_MV_MAPVID_PUSHDOWN
          </MVName>
          <RangePredList>
            <Range ref='R23' result='NotProvided'>
              <MVColumn ref='C1'>
                A1
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O22' result='Provided'>
              <MVColumn ref='C1'>
                A1
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
  </JbbResult>
</Result>
>>
>>-- Now check the plan
>>prepare QueryStmt from 
+>  select a1,a2 
+>  from t1,t2 
+>  where a1=a2 
+>    and a1 between 0 and 6 
+>    and a1 between 6 and 10;

--- SQL command prepared.
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_MV_MAPVID_PUSHDOWN                          

--- 1 row(s) selected.
>>execute QueryStmt;

A1           A2         
-----------  -----------

          6            6

--- 1 row(s) selected.
>>drop mv RANGE_MV_MAPVID_PUSHDOWN cascade;

--- SQL operation complete.
>>drop table t1 cascade;

--- SQL operation complete.
>>drop table t2 cascade;

--- SQL operation complete.
>>
>>
>>obey TEST004(test_end_key);
>>--===========================================
>>--== Test redundant predicates that result in an incorrect end key value being
>>--== without the duplicate elimination done by rangespec. Without rangespec, this
>>--== resulted in an executor predicate corresponding to the Between predicate,
>>--== a begin key having the starting value, and an end key of <MAX>. The performance
>>--== was very bad. The fix was to add rangespec support for date type, which
>>--== eliminated the executor predicate and restored the correct end key.
>>--==
>>--== See Solution 10-101122-4639.
>>--===========================================
>>create table t4639dt
+>(
+>  dt date not null not droppable primary key,
+>  i int
+>);

--- SQL operation complete.
>>
>>cqd rangespec_transformation 'MINIMUM';

--- SQL operation complete.
>>prepare s from
+>  SELECT COUNT (*)
+>  FROM t4639dt
+>  WHERE dt between date'2009-11-01' AND date'2009-11-30'
+>    AND dt >= date'2007-11-01';

--- SQL command prepared.
>>
>>select case when position('begin_key: (DT = 2009-11-01) end_key: (DT = 2009-11-30)' in description) > 0 and
+>                 position('executor_predicate' in description) = 0
+>            then 'pass'
+>            else 'fail'
+>       end
+>from table(explain(NULL, 'S'))
+>where tname = 'CAT.RANGE.T4639DT';

(EXPR)
------

pass  

--- 1 row(s) selected.
>>
>>cqd rangespec_transformation RESET;

--- SQL operation complete.
>>
>>
>>obey TEST004(test_interval_lp);
>>--===========================================
>>--== Test limits of leading precision for interval types. Since we represent
>>--== interval values in terms of the lowest field (either months or microseconds)
>>--== possible for the particular type, the leading field precision may be
>>--== diminished even for specific interval types that don't extend to those end
>>--== fields. In cases where this leading precision is exceeded, a range predicate
>>--== involving the type results in a residual predicate in the descriptor.
>>--== See QC bug 4299.
>>--===========================================
>>create table tIntvlLp
+>(
+>  i        int not null not droppable primary key,
+>  year16   interval year(16),     -- range
+>  year17   interval year(17),     -- residual
+>  month18  interval month(18),    -- range; minimal unit allows full max leading precision
+>  day7     interval day(7),       -- range
+>  day8     interval day(8),       -- residual
+>  hour8    interval hour(8),      -- range
+>  hour9    interval hour(9),      -- residual
+>  minute10 interval minute(10),   -- range
+>  minute11 interval minute(11),   -- residual
+>  second12 interval second(12,0), -- range
+>  second13 interval second(13,0)  -- residual; need 6 digits for microseconds
+>);

--- SQL operation complete.
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>prepare QueryStmt from
+>select i from tIntvlLp
+>where year16 > interval'123456'year(16)
+>  and year17 > interval'123456'year(17)
+>  and month18 > interval'123456'month(18)
+>  and day7 > interval'1234'day(7)
+>  and day8 > interval'1234'day(8)
+>  and hour8 > interval'1234'hour(8)
+>  and hour9 > interval'1234'hour(9)
+>  and minute10 > interval'1234'minute(10)
+>  and minute11 > interval'1234'minute(11)
+>  and second12 > interval'1234'second(12,0)
+>  and second13 > interval'1234'second(13,0)
+>order by 1;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ INTERVAL_LP;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
---------------------------------------------------------------------------------------------------------

<Query>                                                                                                  
  <Version>                                                                                              
    1.0                                                                                                  
  </Version>                                                                                             
  <Misc rewriteLevel='3'>                                                                                
  </Misc>                                                                                                
  <JBB id='B10000'>                                                                                      
    <Hub>                                                                                                
      <JBBCList>                                                                                         
        <Table id='T1' TS='212223904622816086' numCols='12' rangeBits='00000AA5' residualBits='00000552'>
          CAT.RANGE.TINTVLLP                                                                             
          <Key>                                                                                          
            <Column id='C1' tableId='T1' colIndex='0' isNullable='0'>                                    
              CAT.RANGE.TINTVLLP.I                                                                       
            </Column>                                                                                    
          </Key>                                                                                         
        </Table>                                                                                         
      </JBBCList>                                                                                        
      <RangePredList>                                                                                    
        <Range id='R121' sqlType='INTERVAL YEAR(16) ALLOWS NULLS'>                                       
          <Column id='C2' tableId='T1' colIndex='1'>                                                     
            CAT.RANGE.TINTVLLP.YEAR16                                                                    
          </Column>                                                                                      
          <OpGE isNormalized='1'>                                                                        
            <NumericVal scale='0'>                                                                       
              1481484                                                                                    
            </NumericVal>                                                                                
          </OpGE>                                                                                        
        </Range>                                                                                         
        <Range id='R122' sqlType='INTERVAL MONTH(18) ALLOWS NULLS'>                                      
          <Column id='C4' tableId='T1' colIndex='3'>                                                     
            CAT.RANGE.TINTVLLP.MONTH18                                                                   
          </Column>                                                                                      
          <OpGE isNormalized='1'>                                                                        
            <NumericVal scale='0'>                                                                       
              123457                                                                                     
            </NumericVal>                                                                                
          </OpGE>                                                                                        
        </Range>                                                                                         
        <Range id='R123' sqlType='INTERVAL DAY(7) ALLOWS NULLS'>                                         
          <Column id='C5' tableId='T1' colIndex='4'>                                                     
            CAT.RANGE.TINTVLLP.DAY7                                                                      
          </Column>                                                                                      
          <OpGE isNormalized='1'>                                                                        
            <NumericVal scale='0'>                                                                       
              106704000000000                                                                            
            </NumericVal>                                                                                
          </OpGE>                                                                                        
        </Range>                                                                                         
        <Range id='R124' sqlType='INTERVAL HOUR(8) ALLOWS NULLS'>                                        
          <Column id='C7' tableId='T1' colIndex='6'>                                                     
            CAT.RANGE.TINTVLLP.HOUR8                                                                     
          </Column>                                                                                      
          <OpGE isNormalized='1'>                                                                        
            <NumericVal scale='0'>                                                                       
              4446000000000                                                                              
            </NumericVal>                                                                                
          </OpGE>                                                                                        
        </Range>                                                                                         
        <Range id='R125' sqlType='INTERVAL MINUTE(10) ALLOWS NULLS'>                                     
          <Column id='C9' tableId='T1' colIndex='8'>                                                     
            CAT.RANGE.TINTVLLP.MINUTE10                                                                  
          </Column>                                                                                      
          <OpGE isNormalized='1'>                                                                        
            <NumericVal scale='0'>                                                                       
              74100000000                                                                                
            </NumericVal>                                                                                
          </OpGE>                                                                                        
        </Range>                                                                                         
        <Range id='R126' sqlType='INTERVAL SECOND(12,0) ALLOWS NULLS'>                                   
          <Column id='C11' tableId='T1' colIndex='10'>                                                   
            CAT.RANGE.TINTVLLP.SECOND12                                                                  
          </Column>                                                                                      
          <OpGE isNormalized='1'>                                                                        
            <NumericVal scale='0'>                                                                       
              1235000000                                                                                 
            </NumericVal>                                                                                
          </OpGE>                                                                                        
        </Range>                                                                                         
      </RangePredList>                                                                                   
      <ResidualPredList>                                                                                 
        <Residual id='D33'>                                                                              
          <BinaryOper id='S33' op='>'>                                                                   
            <Column id='C3' tableId='T1' colIndex='2'>                                                   
              CAT.RANGE.TINTVLLP.YEAR17                                                                  
            </Column>                                                                                    
            <NumericVal id='S32' scale='0'>                                                              
              INTERVAL '123456' YEAR(17)                                                                 
            </NumericVal>                                                                                
          </BinaryOper>                                                                                  
        </Residual>                                                                                      
        <Residual id='D39'>                                                                              
          <BinaryOper id='S39' op='>'>                                                                   
            <Column id='C6' tableId='T1' colIndex='5'>                                                   
              CAT.RANGE.TINTVLLP.DAY8                                                                    
            </Column>                                                                                    
            <NumericVal id='S38' scale='0'>                                                              
              INTERVAL '1234' DAY(8)                                                                     
            </NumericVal>                                                                                
          </BinaryOper>                                                                                  
        </Residual>                                                                                      
        <Residual id='D43'>                                                                              
          <BinaryOper id='S43' op='>'>                                                                   
            <Column id='C8' tableId='T1' colIndex='7'>                                                   
              CAT.RANGE.TINTVLLP.HOUR9                                                                   
            </Column>                                                                                    
            <NumericVal id='S42' scale='0'>                                                              
              INTERVAL '1234' HOUR(9)                                                                    
            </NumericVal>                                                                                
          </BinaryOper>                                                                                  
        </Residual>                                                                                      
        <Residual id='D47'>                                                                              
          <BinaryOper id='S47' op='>'>                                                                   
            <Column id='C10' tableId='T1' colIndex='9'>                                                  
              CAT.RANGE.TINTVLLP.MINUTE11                                                                
            </Column>                                                                                    
            <NumericVal id='S46' scale='0'>                                                              
              INTERVAL '1234' MINUTE(11)                                                                 
            </NumericVal>                                                                                
          </BinaryOper>                                                                                  
        </Residual>                                                                                      
        <Residual id='D51'>                                                                              
          <BinaryOper id='S51' op='>'>                                                                   
            <Column id='C12' tableId='T1' colIndex='11'>                                                 
              CAT.RANGE.TINTVLLP.SECOND13                                                                
            </Column>                                                                                    
            <NumericVal id='S50' scale='0'>                                                              
              INTERVAL '1234' SECOND(13,0)                                                               
            </NumericVal>                                                                                
          </BinaryOper>                                                                                  
        </Residual>                                                                                      
      </ResidualPredList>                                                                                
    </Hub>                                                                                               
    <ExtraHub>                                                                                           
    </ExtraHub>                                                                                          
    <OutputList>                                                                                         
      <Output id='O53'>                                                                                  
        <Column ref='C1'>                                                                                
        </Column>                                                                                        
      </Output>                                                                                          
    </OutputList>                                                                                        
  </JBB>                                                                                                 
</Query>                                                                                                 

--- 143 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>
>>-- comp_int_22 test uses too much memory for NT
>>#ifLINUX
>>obey TEST004(comp_int_22);
>>--===========================================
>>--== Test use of very large in-list with comp_int_22 set to 0 and rangespec enabled.
>>--== See bug 3248.
>>--===========================================
>>
>>cqd comp_int_22 '0';

--- SQL operation complete.
>>cqd rangespec_transformation 'ON';

--- SQL operation complete.
>>
>>create table t3248_compint22
+>(
+>  i int not null not droppable primary key,
+>  ch char(20)
+>);

--- SQL operation complete.
>>
>>insert into t3248_compint22 values
+>  (1, 'abc'), (2, '105'), (3, '3000'), (4, '1'), (5,'5000'), (6, '2391'), (7, '');

--- 7 row(s) inserted.
>>
>>SELECT * FROM t3248_compint22 WHERE ch in (
+>'1','2','3','4','5','6','7','8','9','10',
+>'11','12','13','14','15','16','17','18','19','20',
+>'21','22','23','24','25','26','27','28','29','30',
+>'31','32','33','34','35','36','37','38','39','40',
+>'41','42','43','44','45','46','47','48','49','50',
+>'51','52','53','54','55','56','57','58','59','60',
+>'61','62','63','64','65','66','67','68','69','70',
+>'71','72','73','74','75','76','77','78','79','80',
+>'81','82','83','84','85','86','87','88','89','90',
+>'91','92','93','94','95','96','97','98','99','100',
+>'101','102','103','104','105','106','107','108','109','110',
+>'111','112','113','114','115','116','117','118','119','120',
+>'121','122','123','124','125','126','127','128','129','130',
+>'131','132','133','134','135','136','137','138','139','140',
+>'141','142','143','144','145','146','147','148','149','150',
+>'151','152','153','154','155','156','157','158','159','160',
+>'161','162','163','164','165','166','167','168','169','170',
+>'171','172','173','174','175','176','177','178','179','180',
+>'181','182','183','184','185','186','187','188','189','190',
+>'191','192','193','194','195','196','197','198','199','200',
+>'201','202','203','204','205','206','207','208','209','210',
+>'211','212','213','214','215','216','217','218','219','220',
+>'221','222','223','224','225','226','227','228','229','230',
+>'231','232','233','234','235','236','237','238','239','240',
+>'241','242','243','244','245','246','247','248','249','250',
+>'251','252','253','254','255','256','257','258','259','260',
+>'261','262','263','264','265','266','267','268','269','270',
+>'271','272','273','274','275','276','277','278','279','280',
+>'281','282','283','284','285','286','287','288','289','290',
+>'291','292','293','294','295','296','297','298','299','300',
+>'301','302','303','304','305','306','307','308','309','310',
+>'311','312','313','314','315','316','317','318','319','320',
+>'321','322','323','324','325','326','327','328','329','330',
+>'331','332','333','334','335','336','337','338','339','340',
+>'341','342','343','344','345','346','347','348','349','350',
+>'351','352','353','354','355','356','357','358','359','360',
+>'361','362','363','364','365','366','367','368','369','370',
+>'371','372','373','374','375','376','377','378','379','380',
+>'381','382','383','384','385','386','387','388','389','390',
+>'391','392','393','394','395','396','397','398','399','400',
+>'401','402','403','404','405','406','407','408','409','410',
+>'411','412','413','414','415','416','417','418','419','420',
+>'421','422','423','424','425','426','427','428','429','430',
+>'431','432','433','434','435','436','437','438','439','440',
+>'441','442','443','444','445','446','447','448','449','450',
+>'451','452','453','454','455','456','457','458','459','460',
+>'461','462','463','464','465','466','467','468','469','470',
+>'471','472','473','474','475','476','477','478','479','480',
+>'481','482','483','484','485','486','487','488','489','490',
+>'491','492','493','494','495','496','497','498','499','500',
+>'501','502','503','504','505','506','507','508','509','510',
+>'511','512','513','514','515','516','517','518','519','520',
+>'521','522','523','524','525','526','527','528','529','530',
+>'531','532','533','534','535','536','537','538','539','540',
+>'541','542','543','544','545','546','547','548','549','550',
+>'551','552','553','554','555','556','557','558','559','560',
+>'561','562','563','564','565','566','567','568','569','570',
+>'571','572','573','574','575','576','577','578','579','580',
+>'581','582','583','584','585','586','587','588','589','590',
+>'591','592','593','594','595','596','597','598','599','600',
+>'601','602','603','604','605','606','607','608','609','610',
+>'611','612','613','614','615','616','617','618','619','620',
+>'621','622','623','624','625','626','627','628','629','630',
+>'631','632','633','634','635','636','637','638','639','640',
+>'641','642','643','644','645','646','647','648','649','650',
+>'651','652','653','654','655','656','657','658','659','660',
+>'661','662','663','664','665','666','667','668','669','670',
+>'671','672','673','674','675','676','677','678','679','680',
+>'681','682','683','684','685','686','687','688','689','690',
+>'691','692','693','694','695','696','697','698','699','700',
+>'701','702','703','704','705','706','707','708','709','710',
+>'711','712','713','714','715','716','717','718','719','720',
+>'721','722','723','724','725','726','727','728','729','730',
+>'731','732','733','734','735','736','737','738','739','740',
+>'741','742','743','744','745','746','747','748','749','750',
+>'751','752','753','754','755','756','757','758','759','760',
+>'761','762','763','764','765','766','767','768','769','770',
+>'771','772','773','774','775','776','777','778','779','780',
+>'781','782','783','784','785','786','787','788','789','790',
+>'791','792','793','794','795','796','797','798','799','800',
+>'801','802','803','804','805','806','807','808','809','810',
+>'811','812','813','814','815','816','817','818','819','820',
+>'821','822','823','824','825','826','827','828','829','830',
+>'831','832','833','834','835','836','837','838','839','840',
+>'841','842','843','844','845','846','847','848','849','850',
+>'851','852','853','854','855','856','857','858','859','860',
+>'861','862','863','864','865','866','867','868','869','870',
+>'871','872','873','874','875','876','877','878','879','880',
+>'881','882','883','884','885','886','887','888','889','890',
+>'891','892','893','894','895','896','897','898','899','900',
+>'901','902','903','904','905','906','907','908','909','910',
+>'911','912','913','914','915','916','917','918','919','920',
+>'921','922','923','924','925','926','927','928','929','930',
+>'931','932','933','934','935','936','937','938','939','940',
+>'941','942','943','944','945','946','947','948','949','950',
+>'951','952','953','954','955','956','957','958','959','960',
+>'961','962','963','964','965','966','967','968','969','970',
+>'971','972','973','974','975','976','977','978','979','980',
+>'981','982','983','984','985','986','987','988','989','990',
+>'991','992','993','994','995','996','997','998','999','1000',
+>'1001','1004','1003','1004','1005','1006','1007','1008','1009','1010',
+>'1011','1012','1013','1014','1015','1016','1017','1018','1019','1020',
+>'1021','1022','1023','1024','1025','1026','1027','1028','1029','1030',
+>'1031','1032','1033','1034','1035','1036','1037','1038','1039','1040',
+>'1041','1042','1043','1044','1045','1046','1047','1048','1049','1050',
+>'1051','1052','1053','1054','1055','1056','1057','1058','1059','1060',
+>'1061','1062','1063','1064','1065','1066','1067','1068','1069','1070',
+>'1071','1072','1073','1074','1075','1076','1077','1078','1079','1080',
+>'1081','1082','1083','1084','1085','1086','1087','1088','1089','1090',
+>'1091','1092','1093','1094','1095','1096','1097','1098','1099','1100',
+>'1101','1102','1103','1104','1105','1106','1107','1108','1109','1110',
+>'1111','1112','1113','1114','1115','1116','1117','1118','1119','1120',
+>'1121','1122','1123','1124','1125','1126','1127','1128','1129','1130',
+>'1131','1132','1133','1134','1135','1136','1137','1138','1139','1140',
+>'1141','1142','1143','1144','1145','1146','1147','1148','1149','1150',
+>'1151','1152','1153','1154','1155','1156','1157','1158','1159','1160',
+>'1161','1162','1163','1164','1165','1166','1167','1168','1169','1170',
+>'1171','1172','1173','1174','1175','1176','1177','1178','1179','1180',
+>'1181','1182','1183','1184','1185','1186','1187','1188','1189','1190',
+>'1191','1192','1193','1194','1195','1196','1197','1198','1199','1200',
+>'1201','1202','1203','1204','1205','1206','1207','1208','1209','1210',
+>'1211','1212','1213','1214','1215','1216','1217','1218','1219','1220',
+>'1221','1222','1223','1224','1225','1226','1227','1228','1229','1230',
+>'1231','1232','1233','1234','1235','1236','1237','1238','1239','1240',
+>'1241','1242','1243','1244','1245','1246','1247','1248','1249','1250',
+>'1251','1252','1253','1254','1255','1256','1257','1258','1259','1260',
+>'1261','1262','1263','1264','1265','1266','1267','1268','1269','1270',
+>'1271','1272','1273','1274','1275','1276','1277','1278','1279','1280',
+>'1281','1282','1283','1284','1285','1286','1287','1288','1289','1290',
+>'1291','1292','1293','1294','1295','1296','1297','1298','1299','1300',
+>'1301','1302','1303','1304','1305','1306','1307','1308','1309','1310',
+>'1311','1312','1313','1314','1315','1316','1317','1318','1319','1320',
+>'1321','1322','1323','1324','1325','1326','1327','1328','1329','1330',
+>'1331','1332','1333','1334','1335','1336','1337','1338','1339','1340',
+>'1341','1342','1343','1344','1345','1346','1347','1348','1349','1350',
+>'1351','1352','1353','1354','1355','1356','1357','1358','1359','1360',
+>'1361','1362','1363','1364','1365','1366','1367','1368','1369','1370',
+>'1371','1372','1373','1374','1375','1376','1377','1378','1379','1380',
+>'1381','1382','1383','1384','1385','1386','1387','1388','1389','1390',
+>'1391','1392','1393','1394','1395','1396','1397','1398','1399','1400',
+>'1401','1402','1403','1404','1405','1406','1407','1408','1409','1410',
+>'1411','1412','1413','1414','1415','1416','1417','1418','1419','1420',
+>'1421','1422','1423','1424','1425','1426','1427','1428','1429','1430',
+>'1431','1432','1433','1434','1435','1436','1437','1438','1439','1440',
+>'1441','1442','1443','1444','1445','1446','1447','1448','1449','1450',
+>'1451','1452','1453','1454','1455','1456','1457','1458','1459','1460',
+>'1461','1462','1463','1464','1465','1466','1467','1468','1469','1470',
+>'1471','1472','1473','1474','1475','1476','1477','1478','1479','1480',
+>'1481','1482','1483','1484','1485','1486','1487','1488','1489','1490',
+>'1491','1492','1493','1494','1495','1496','1497','1498','1499','1500',
+>'1501','1502','1503','1504','1505','1506','1507','1508','1509','1510',
+>'1511','1512','1513','1514','1515','1516','1517','1518','1519','1520',
+>'1521','1522','1523','1524','1525','1526','1527','1528','1529','1530',
+>'1531','1532','1533','1534','1535','1536','1537','1538','1539','1540',
+>'1541','1542','1543','1544','1545','1546','1547','1548','1549','1550',
+>'1551','1552','1553','1554','1555','1556','1557','1558','1559','1560',
+>'1561','1562','1563','1564','1565','1566','1567','1568','1569','1570',
+>'1571','1572','1573','1574','1575','1576','1577','1578','1579','1580',
+>'1581','1582','1583','1584','1585','1586','1587','1588','1589','1590',
+>'1591','1592','1593','1594','1595','1596','1597','1598','1599','1600',
+>'1601','1602','1603','1604','1605','1606','1607','1608','1609','1610',
+>'1611','1612','1613','1614','1615','1616','1617','1618','1619','1620',
+>'1621','1622','1623','1624','1625','1626','1627','1628','1629','1630',
+>'1631','1632','1633','1634','1635','1636','1637','1638','1639','1640',
+>'1641','1642','1643','1644','1645','1646','1647','1648','1649','1650',
+>'1651','1652','1653','1654','1655','1656','1657','1658','1659','1660',
+>'1661','1662','1663','1664','1665','1666','1667','1668','1669','1670',
+>'1671','1672','1673','1674','1675','1676','1677','1678','1679','1680',
+>'1681','1682','1683','1684','1685','1686','1687','1688','1689','1690',
+>'1691','1692','1693','1694','1695','1696','1697','1698','1699','1700',
+>'1701','1702','1703','1704','1705','1706','1707','1708','1709','1710',
+>'1711','1712','1713','1714','1715','1716','1717','1718','1719','1720',
+>'1721','1722','1723','1724','1725','1726','1727','1728','1729','1730',
+>'1731','1732','1733','1734','1735','1736','1737','1738','1739','1740',
+>'1741','1742','1743','1744','1745','1746','1747','1748','1749','1750',
+>'1751','1752','1753','1754','1755','1756','1757','1758','1759','1760',
+>'1761','1762','1763','1764','1765','1766','1767','1768','1769','1770',
+>'1771','1772','1773','1774','1775','1776','1777','1778','1779','1780',
+>'1781','1782','1783','1784','1785','1786','1787','1788','1789','1790',
+>'1791','1792','1793','1794','1795','1796','1797','1798','1799','1800',
+>'1801','1802','1803','1804','1805','1806','1807','1808','1809','1810',
+>'1811','1812','1813','1814','1815','1816','1817','1818','1819','1820',
+>'1821','1822','1823','1824','1825','1826','1827','1828','1829','1830',
+>'1831','1832','1833','1834','1835','1836','1837','1838','1839','1840',
+>'1841','1842','1843','1844','1845','1846','1847','1848','1849','1850',
+>'1851','1852','1853','1854','1855','1856','1857','1858','1859','1860',
+>'1861','1862','1863','1864','1865','1866','1867','1868','1869','1870',
+>'1871','1872','1873','1874','1875','1876','1877','1878','1879','1880',
+>'1881','1882','1883','1884','1885','1886','1887','1888','1889','1890',
+>'1891','1892','1893','1894','1895','1896','1897','1898','1899','1900',
+>'1901','1902','1903','1904','1905','1906','1907','1908','1909','1910',
+>'1911','1912','1913','1914','1915','1916','1917','1918','1919','1920',
+>'1921','1922','1923','1924','1925','1926','1927','1928','1929','1930',
+>'1931','1932','1933','1934','1935','1936','1937','1938','1939','1940',
+>'1941','1942','1943','1944','1945','1946','1947','1948','1949','1950',
+>'1951','1952','1953','1954','1955','1956','1957','1958','1959','1960',
+>'1961','1962','1963','1964','1965','1966','1967','1968','1969','1970',
+>'1971','1972','1973','1974','1975','1976','1977','1978','1979','1980',
+>'1981','1982','1983','1984','1985','1986','1987','1988','1989','1990',
+>'1991','1992','1993','1994','1995','1996','1997','1998','1999','2000',
+>'2001','2004','2003','2004','2005','2006','2007','2008','2009','2010',
+>'2011','2012','2013','2014','2015','2016','2017','2018','2019','2020',
+>'2021','2022','2023','2024','2025','2026','2027','2028','2029','2030',
+>'2031','2032','2033','2034','2035','2036','2037','2038','2039','2040',
+>'2041','2042','2043','2044','2045','2046','2047','2048','2049','2050',
+>'2051','2052','2053','2054','2055','2056','2057','2058','2059','2060',
+>'2061','2062','2063','2064','2065','2066','2067','2068','2069','2070',
+>'2071','2072','2073','2074','2075','2076','2077','2078','2079','2080',
+>'2081','2082','2083','2084','2085','2086','2087','2088','2089','2090',
+>'2091','2092','2093','2094','2095','2096','2097','2098','2099','2100',
+>'2101','2102','2103','2104','2105','2106','2107','2108','2109','2110',
+>'2111','2112','2113','2114','2115','2116','2117','2118','2119','2120',
+>'2121','2122','2123','2124','2125','2126','2127','2128','2129','2130',
+>'2131','2132','2133','2134','2135','2136','2137','2138','2139','2140',
+>'2141','2142','2143','2144','2145','2146','2147','2148','2149','2150',
+>'2151','2152','2153','2154','2155','2156','2157','2158','2159','2160',
+>'2161','2162','2163','2164','2165','2166','2167','2168','2169','2170',
+>'2171','2172','2173','2174','2175','2176','2177','2178','2179','2180',
+>'2181','2182','2183','2184','2185','2186','2187','2188','2189','2190',
+>'2191','2192','2193','2194','2195','2196','2197','2198','2199','2200',
+>'2201','2202','2203','2204','2205','2206','2207','2208','2209','2210',
+>'2211','2212','2213','2214','2215','2216','2217','2218','2219','2220',
+>'2221','2222','2223','2224','2225','2226','2227','2228','2229','2230',
+>'2231','2232','2233','2234','2235','2236','2237','2238','2239','2240',
+>'2241','2242','2243','2244','2245','2246','2247','2248','2249','2250',
+>'2251','2252','2253','2254','2255','2256','2257','2258','2259','2260',
+>'2261','2262','2263','2264','2265','2266','2267','2268','2269','2270',
+>'2271','2272','2273','2274','2275','2276','2277','2278','2279','2280',
+>'2281','2282','2283','2284','2285','2286','2287','2288','2289','2290',
+>'2291','2292','2293','2294','2295','2296','2297','2298','2299','2300',
+>'2301','2302','2303','2304','2305','2306','2307','2308','2309','2310',
+>'2311','2312','2313','2314','2315','2316','2317','2318','2319','2320',
+>'2321','2322','2323','2324','2325','2326','2327','2328','2329','2330',
+>'2331','2332','2333','2334','2335','2336','2337','2338','2339','2340',
+>'2341','2342','2343','2344','2345','2346','2347','2348','2349','2350',
+>'2351','2352','2353','2354','2355','2356','2357','2358','2359','2360',
+>'2361','2362','2363','2364','2365','2366','2367','2368','2369','2370',
+>'2371','2372','2373','2374','2375','2376','2377','2378','2379','2380',
+>'2381','2382','2383','2384','2385','2386','2387','2388','2389','2390',
+>'2391','2392','2393','2394','2395','2396','2397','2398','2399','2400',
+>'2401','2402','2403','2404','2405','2406','2407','2408','2409','2410',
+>'2411','2412','2413','2414','2415','2416','2417','2418','2419','2420',
+>'2421','2422','2423','2424','2425','2426','2427','2428','2429','2430',
+>'2431','2432','2433','2434','2435','2436','2437','2438','2439','2440',
+>'2441','2442','2443','2444','2445','2446','2447','2448','2449','2450',
+>'2451','2452','2453','2454','2455','2456','2457','2458','2459','2460',
+>'2461','2462','2463','2464','2465','2466','2467','2468','2469','2470',
+>'2471','2472','2473','2474','2475','2476','2477','2478','2479','2480',
+>'2481','2482','2483','2484','2485','2486','2487','2488','2489','2490',
+>'2491','2492','2493','2494','2495','2496','2497','2498','2499','2500',
+>'2501','2502','2503','2504','2505','2506','2507','2508','2509','2510',
+>'2511','2512','2513','2514','2515','2516','2517','2518','2519','2520',
+>'2521','2522','2523','2524','2525','2526','2527','2528','2529','2530',
+>'2531','2532','2533','2534','2535','2536','2537','2538','2539','2540',
+>'2541','2542','2543','2544','2545','2546','2547','2548','2549','2550',
+>'2551','2552','2553','2554','2555','2556','2557','2558','2559','2560',
+>'2561','2562','2563','2564','2565','2566','2567','2568','2569','2570',
+>'2571','2572','2573','2574','2575','2576','2577','2578','2579','2580',
+>'2581','2582','2583','2584','2585','2586','2587','2588','2589','2590',
+>'2591','2592','2593','2594','2595','2596','2597','2598','2599','2600',
+>'2601','2602','2603','2604','2605','2606','2607','2608','2609','2610',
+>'2611','2612','2613','2614','2615','2616','2617','2618','2619','2620',
+>'2621','2622','2623','2624','2625','2626','2627','2628','2629','2630',
+>'2631','2632','2633','2634','2635','2636','2637','2638','2639','2640',
+>'2641','2642','2643','2644','2645','2646','2647','2648','2649','2650',
+>'2651','2652','2653','2654','2655','2656','2657','2658','2659','2660',
+>'2661','2662','2663','2664','2665','2666','2667','2668','2669','2670',
+>'2671','2672','2673','2674','2675','2676','2677','2678','2679','2680',
+>'2681','2682','2683','2684','2685','2686','2687','2688','2689','2690',
+>'2691','2692','2693','2694','2695','2696','2697','2698','2699','2700',
+>'2701','2702','2703','2704','2705','2706','2707','2708','2709','2710',
+>'2711','2712','2713','2714','2715','2716','2717','2718','2719','2720',
+>'2721','2722','2723','2724','2725','2726','2727','2728','2729','2730',
+>'2731','2732','2733','2734','2735','2736','2737','2738','2739','2740',
+>'2741','2742','2743','2744','2745','2746','2747','2748','2749','2750',
+>'2751','2752','2753','2754','2755','2756','2757','2758','2759','2760',
+>'2761','2762','2763','2764','2765','2766','2767','2768','2769','2770',
+>'2771','2772','2773','2774','2775','2776','2777','2778','2779','2780',
+>'2781','2782','2783','2784','2785','2786','2787','2788','2789','2790',
+>'2791','2792','2793','2794','2795','2796','2797','2798','2799','2800',
+>'2801','2802','2803','2804','2805','2806','2807','2808','2809','2810',
+>'2811','2812','2813','2814','2815','2816','2817','2818','2819','2820',
+>'2821','2822','2823','2824','2825','2826','2827','2828','2829','2830',
+>'2831','2832','2833','2834','2835','2836','2837','2838','2839','2840',
+>'2841','2842','2843','2844','2845','2846','2847','2848','2849','2850',
+>'2851','2852','2853','2854','2855','2856','2857','2858','2859','2860',
+>'2861','2862','2863','2864','2865','2866','2867','2868','2869','2870',
+>'2871','2872','2873','2874','2875','2876','2877','2878','2879','2880',
+>'2881','2882','2883','2884','2885','2886','2887','2888','2889','2890',
+>'2891','2892','2893','2894','2895','2896','2897','2898','2899','2900',
+>'2901','2902','2903','2904','2905','2906','2907','2908','2909','2910',
+>'2911','2912','2913','2914','2915','2916','2917','2918','2919','2920',
+>'2921','2922','2923','2924','2925','2926','2927','2928','2929','2930',
+>'2931','2932','2933','2934','2935','2936','2937','2938','2939','2940',
+>'2941','2942','2943','2944','2945','2946','2947','2948','2949','2950',
+>'2951','2952','2953','2954','2955','2956','2957','2958','2959','2960',
+>'2961','2962','2963','2964','2965','2966','2967','2968','2969','2970',
+>'2971','2972','2973','2974','2975','2976','2977','2978','2979','2980',
+>'2981','2982','2983','2984','2985','2986','2987','2988','2989','2990',
+>'2991','2992','2993','2994','2995','2996','2997','2998','2999','3000'
+>);

I            CH                  
-----------  --------------------

          3  3000                
          6  2391                
          2  105                 
          4  1                   

--- 4 row(s) selected.
>>
>>cqd rangespec_transformation reset;

--- SQL operation complete.
>>cqd comp_int_22 reset;

--- SQL operation complete.
>>
>>
>>#ifLINUX
>>obey TEST004(check_nulls);
>>--===========================================
>>--== Check if IS NULL and IS NOT NULL are represented correctly in the descriptors.
>>--===========================================
>>
>>-- Simple IS NULL predicate
>>create mv range_nulls_isnull
+>	recompute
+>	initialized on create
+>	as  select fprice, fquant, 
+>		   dimdata data
+>	    from fact, dim2
+>	    where dimkey=dkey
+>	      and dimdata IS NULL;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ RANGE_NULLS_ISNULL;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_NULLS_ISNULL
  </Table>
  <Misc isIncremental='0'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904317211689' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM2
        </Table>
        <Table id='T2' TS='212223904322066955' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J137'>
          <Column id='C104' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM2.DKEY
          </Column>
          <Column id='C95' tableId='T2' colIndex='7'>
            CAT.RANGE.FACT.DIMKEY
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R151' sqlType='INTEGER SIGNED ALLOWS NULLS'>
          <Column ref='C105'>
          </Column>
          <OpEQ>
            <NullVal/>
          </OpEQ>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O131' name='FQUANT'>
        <Column id='C93' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O134' name='FPRICE'>
        <Column id='C94' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O143' name='DATA'>
        <Column id='C105' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM2.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- IS NULL or EQUAL (same subrange)
>>create mv range_nulls_isnullorequal
+>	recompute
+>	initialized on create
+>	as  select fprice, fquant, 
+>		   dimdata data
+>	    from fact, dim2
+>	    where dimkey=dkey
+>	      and (dimdata IS NULL or dimdata=10);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ RANGE_NULLS_ISNULLOREQUAL;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_NULLS_ISNULLOREQUAL
  </Table>
  <Misc isIncremental='0'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904317211689' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM2
        </Table>
        <Table id='T2' TS='212223904322066955' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J151'>
          <Column id='C115' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM2.DKEY
          </Column>
          <Column id='C106' tableId='T2' colIndex='7'>
            CAT.RANGE.FACT.DIMKEY
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R172' sqlType='INTEGER SIGNED ALLOWS NULLS'>
          <Column ref='C116'>
          </Column>
          <OpEQ>
            <NullVal/>
            <NumericVal scale='0'>
              10
            </NumericVal>
          </OpEQ>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O145' name='FQUANT'>
        <Column id='C104' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O148' name='FPRICE'>
        <Column id='C105' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O157' name='DATA'>
        <Column id='C116' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM2.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- IS NULL or LESS (different subrange)
>>create mv range_nulls_isnullorless
+>	recompute
+>	initialized on create
+>	as  select fprice, fquant, 
+>		   dimdata data
+>	    from fact, dim2
+>	    where dimkey=dkey
+>	      and (dimdata IS NULL or dimdata<10);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ RANGE_NULLS_ISNULLORLESS;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_NULLS_ISNULLORLESS
  </Table>
  <Misc isIncremental='0'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904317211689' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM2
        </Table>
        <Table id='T2' TS='212223904322066955' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J150'>
          <Column id='C114' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM2.DKEY
          </Column>
          <Column id='C105' tableId='T2' colIndex='7'>
            CAT.RANGE.FACT.DIMKEY
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R171' sqlType='INTEGER SIGNED ALLOWS NULLS'>
          <Column ref='C115'>
          </Column>
          <OpLE isNormalized='1'>
            <NumericVal scale='0'>
              9
            </NumericVal>
          </OpLE>
          <OpEQ>
            <NullVal/>
          </OpEQ>
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O144' name='FQUANT'>
        <Column id='C103' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O147' name='FPRICE'>
        <Column id='C104' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O156' name='DATA'>
        <Column id='C115' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM2.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- Simple IS NOT NULL
>>create mv range_nulls_isnotnull
+>	recompute
+>	initialized on create
+>	as  select fprice, fquant, 
+>		   dimdata data
+>	    from fact, dim2
+>	    where dimkey=dkey
+>	      and dimdata IS NOT NULL;

--- SQL operation complete.
>>
>>set pattern $$MVName$$ RANGE_NULLS_ISNOTNULL;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_NULLS_ISNOTNULL
  </Table>
  <Misc isIncremental='0'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904317211689' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM2
        </Table>
        <Table id='T2' TS='212223904322066955' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J137'>
          <Column id='C104' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM2.DKEY
          </Column>
          <Column id='C95' tableId='T2' colIndex='7'>
            CAT.RANGE.FACT.DIMKEY
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R151' sqlType='INTEGER SIGNED ALLOWS NULLS'>
          <Column ref='C105'>
          </Column>
          <!-- empty Range element indicates IS NOT NULL -->
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O131' name='FQUANT'>
        <Column id='C93' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O134' name='FPRICE'>
        <Column id='C94' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O143' name='DATA'>
        <Column id='C105' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM2.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- IS NOT NULL or EQUAL (equivalent to only IS NOT NULL)
>>create mv range_nulls_isnotnullorequal
+>	recompute
+>	initialized on create
+>	as  select fprice, fquant, 
+>		   dimdata data
+>	    from fact, dim2
+>	    where dimkey=dkey
+>	      and (dimdata IS NOT NULL or dimdata=10);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ RANGE_NULLS_ISNOTNULLOREQUAL;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_NULLS_ISNOTNULLOREQUAL
  </Table>
  <Misc isIncremental='0'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904317211689' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM2
        </Table>
        <Table id='T2' TS='212223904322066955' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J147'>
          <Column id='C111' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM2.DKEY
          </Column>
          <Column id='C102' tableId='T2' colIndex='7'>
            CAT.RANGE.FACT.DIMKEY
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R165' sqlType='INTEGER SIGNED ALLOWS NULLS'>
          <Column ref='C112'>
          </Column>
          <!-- empty Range element indicates IS NOT NULL -->
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O141' name='FQUANT'>
        <Column id='C100' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O144' name='FPRICE'>
        <Column id='C101' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O153' name='DATA'>
        <Column id='C112' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM2.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>-- IS NOT NULL or LESS (equivalent to only IS NOT NULL)
>>create mv range_nulls_isnotnullorless
+>	recompute
+>	initialized on create
+>	as  select fprice, fquant, 
+>		   dimdata data
+>	    from fact, dim2
+>	    where dimkey=dkey
+>	      and (dimdata IS NOT NULL or dimdata<10);

--- SQL operation complete.
>>
>>set pattern $$MVName$$ RANGE_NULLS_ISNOTNULLORLESS;
>>obey TEST004(dump_MV);
>>--===========================================
>>--== Create the MV descriptor XML
>>--===========================================
>>
>>log $$MVName$$.tmp clear;
<Publish TS='0'>
<MV>
  <Version>
    1.0
  </Version>
  <Table>
    CAT.RANGE.RANGE_NULLS_ISNOTNULLORLESS
  </Table>
  <Misc isIncremental='0'>
  </Misc>
  <JBB id='B0'>
    <Hub>
      <JBBCList>
        <Table id='T1' TS='212223904317211689' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM2
        </Table>
        <Table id='T2' TS='212223904322066955' numCols='8'>
          CAT.RANGE.FACT
        </Table>
      </JBBCList>
      <JoinPredList>
        <JoinPred id='J147'>
          <Column id='C111' tableId='T1' colIndex='0' isNullable='0'>
            CAT.RANGE.DIM2.DKEY
          </Column>
          <Column id='C102' tableId='T2' colIndex='7'>
            CAT.RANGE.FACT.DIMKEY
          </Column>
        </JoinPred>
      </JoinPredList>
      <RangePredList>
        <Range id='R165' sqlType='INTEGER SIGNED ALLOWS NULLS'>
          <Column ref='C112'>
          </Column>
          <!-- empty Range element indicates IS NOT NULL -->
        </Range>
      </RangePredList>
    </Hub>
    <ExtraHub>
    </ExtraHub>
    <OutputList>
      <Output id='O141' name='FQUANT'>
        <Column id='C100' tableId='T2' colIndex='5'>
          CAT.RANGE.FACT.FQUANT
        </Column>
      </Output>
      <Output id='O144' name='FPRICE'>
        <Column id='C101' tableId='T2' colIndex='6'>
          CAT.RANGE.FACT.FPRICE
        </Column>
      </Output>
      <Output id='O153' name='DATA'>
        <Column id='C112' tableId='T1' colIndex='1'>
          CAT.RANGE.DIM2.DIMDATA
        </Column>
      </Output>
    </OutputList>
  </JBB>
</MV>
<Update op='Refresh' TS='1'> </Update>
</Publish>
>>
>>
>>--===========================================
>>-- Query with Simple IS NULL predicate.
>>-- Should match all 3 IS NULL MVs.
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>prepare QueryStmt from
+>	select fprice, fquant, 
+>	       dimdata data
+>	from fact, dim2
+>	where dimkey=dkey
+>	  and dimdata IS NULL
+>	order by fprice;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGE_Q_NULLS_ISNULL;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904317211689' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM2                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM2.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8'>                     
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J50'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column id='C8' tableId='T2' colIndex='7'>                            
            CAT.RANGE.FACT.DIMKEY                                               
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R64' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column ref='C18'>                                                    
          </Column>                                                             
          <OpEQ>                                                                
            <NullVal/>                                                          
          </OpEQ>                                                               
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O44'>                                                         
        <Column id='C6' tableId='T2' colIndex='5'>                              
          CAT.RANGE.FACT.FQUANT                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O47'>                                                         
        <Column id='C7' tableId='T2' colIndex='6'>                              
          CAT.RANGE.FACT.FPRICE                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O56'>                                                         
        <Column id='C18' tableId='T1' colIndex='1'>                             
          CAT.RANGE.DIM2.DIMDATA                                                
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 66 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                               >> range_nulls1.in;
>>sh echo PUBLISH RANGE_NULLS_ISNULL.xml           >> range_nulls1.in;
>>sh echo PUBLISH RANGE_NULLS_ISNULLOREQUAL.xml    >> range_nulls1.in;
>>sh echo PUBLISH RANGE_NULLS_ISNULLORLESS.xml     >> range_nulls1.in;
>>sh echo PUBLISH RANGE_NULLS_ISNOTNULL.xml        >> range_nulls1.in;
>>sh echo PUBLISH RANGE_NULLS_ISNOTNULLOREQUAL.xml >> range_nulls1.in;
>>sh echo PUBLISH RANGE_NULLS_ISNOTNULLORLESS.xml  >> range_nulls1.in;
>>sh echo MATCH RANGE_Q_NULLS_ISNULL.xml           >> range_nulls1.in;
>>
>>sh sh -c "$QMS range_nulls1.in range_nulls1.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM2
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_NULLS_ISNULL
          </MVName>
          <RangePredList>
            <Range ref='R64' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O44' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O47' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O56' result='Provided'>
              <MVColumn ref='C18'>
                DATA
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_NULLS_ISNULLOREQUAL
          </MVName>
          <RangePredList>
            <Range ref='R64' result='NotProvided'>
              <MVColumn ref='C18'>
                DATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O44' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O47' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O56' result='Provided'>
              <MVColumn ref='C18'>
                DATA
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_NULLS_ISNULLORLESS
          </MVName>
          <RangePredList>
            <Range ref='R64' result='NotProvided'>
              <MVColumn ref='C18'>
                DATA
              </MVColumn>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O44' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O47' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O56' result='Provided'>
              <MVColumn ref='C18'>
                DATA
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_NULLS_ISNOTNULL was disqualified because The query range predicate R64 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_NULLS_ISNOTNULLOREQUAL was disqualified because The query range predicate R64 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_NULLS_ISNOTNULLORLESS was disqualified because The query range predicate R64 is not subsumed by the corresponding MV predicate.]]></Info>
  </JbbResult>
</Result>
>>
>>-- Verify the MV is picked by the optimizer.
>>prepare QueryStmt from
+>	select fprice, fquant, 
+>	       dimdata data
+>	from fact, dim2
+>	where dimkey=dkey
+>	  and dimdata IS NULL
+>	order by fprice;

--- SQL command prepared.
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_NULLS_ISNULL                                

--- 1 row(s) selected.
>>
>>--===========================================
>>-- Query with Simple IS NOT NULL predicate.
>>-- Should match all 3 IS NOT NULL MVs (which are equivalent anyway).
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'DUMP';

--- SQL operation complete.
>>
>>prepare QueryStmt from
+>	select fprice, fquant, 
+>	       dimdata data
+>	from fact, dim2
+>	where dimkey=dkey
+>	  and dimdata IS NOT NULL
+>	order by fprice;

--- SQL command prepared.
>>
>>set pattern $$QueryName$$ RANGE_Q_NULLS_ISNOTNULL;
>>obey TEST004(dump_Query);
>>--===========================================
>>--== Create the query descriptor XML
>>--===========================================
>>
>>log $$QueryName$$.tmp clear;
>>sh sh ./CropDescriptor.ksh -q -i $$QueryName$$.TMP -o $$QueryName$$.xml;
>>-- and once for the test log file
>>execute QueryStmt;

Query Descriptor
--------------------------------------------------------------------------------

<Query>                                                                         
  <Version>                                                                     
    1.0                                                                         
  </Version>                                                                    
  <Misc rewriteLevel='3'>                                                       
  </Misc>                                                                       
  <JBB id='B0'>                                                                 
    <Hub>                                                                       
      <JBBCList>                                                                
        <Table id='T1' TS='212223904317211689' numCols='2' rangeBits='00000004'>
          CAT.RANGE.DIM2                                                        
          <Key>                                                                 
            <Column id='C17' tableId='T1' colIndex='0' isNullable='0'>          
              CAT.RANGE.DIM2.DKEY                                               
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
        <Table id='T2' TS='212223904322066955' numCols='8'>                     
          CAT.RANGE.FACT                                                        
          <Key>                                                                 
            <Column id='C1' tableId='T2' colIndex='0' isNullable='0'>           
              CAT.RANGE.FACT.SYSKEY                                             
            </Column>                                                           
          </Key>                                                                
        </Table>                                                                
      </JBBCList>                                                               
      <JoinPredList>                                                            
        <JoinPred id='J50'>                                                     
          <Column ref='C17'>                                                    
          </Column>                                                             
          <Column id='C8' tableId='T2' colIndex='7'>                            
            CAT.RANGE.FACT.DIMKEY                                               
          </Column>                                                             
        </JoinPred>                                                             
      </JoinPredList>                                                           
      <RangePredList>                                                           
        <Range id='R64' sqlType='INTEGER SIGNED ALLOWS NULLS'>                  
          <Column ref='C18'>                                                    
          </Column>                                                             
          <!-- empty Range element indicates IS NOT NULL -->                    
        </Range>                                                                
      </RangePredList>                                                          
    </Hub>                                                                      
    <ExtraHub>                                                                  
    </ExtraHub>                                                                 
    <OutputList>                                                                
      <Output id='O44'>                                                         
        <Column id='C6' tableId='T2' colIndex='5'>                              
          CAT.RANGE.FACT.FQUANT                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O47'>                                                         
        <Column id='C7' tableId='T2' colIndex='6'>                              
          CAT.RANGE.FACT.FPRICE                                                 
        </Column>                                                               
      </Output>                                                                 
      <Output id='O56'>                                                         
        <Column id='C18' tableId='T1' colIndex='1'>                             
          CAT.RANGE.DIM2.DIMDATA                                                
        </Column>                                                               
      </Output>                                                                 
    </OutputList>                                                               
  </JBB>                                                                        
</Query>                                                                        

--- 64 row(s) selected.
>>
>>
>>control query default MVQR_LOG_QUERY_DESCRIPTORS 'OFF';

--- SQL operation complete.
>>
>>sh echo INITIALIZE                               >> range_nulls2.in;
>>sh echo PUBLISH RANGE_NULLS_ISNULL.xml           >> range_nulls2.in;
>>sh echo PUBLISH RANGE_NULLS_ISNULLOREQUAL.xml    >> range_nulls2.in;
>>sh echo PUBLISH RANGE_NULLS_ISNULLORLESS.xml     >> range_nulls2.in;
>>sh echo PUBLISH RANGE_NULLS_ISNOTNULL.xml        >> range_nulls2.in;
>>sh echo PUBLISH RANGE_NULLS_ISNOTNULLOREQUAL.xml >> range_nulls2.in;
>>sh echo PUBLISH RANGE_NULLS_ISNOTNULLORLESS.xml  >> range_nulls2.in;
>>sh echo MATCH RANGE_Q_NULLS_ISNOTNULL.xml        >> range_nulls2.in;
>>
>>sh sh -c "$QMS range_nulls2.in range_nulls2.out";
>>
>>log;
<Result>
  <Version>
    1.0
  </Version>
  <JbbResult ref='B0'>
    <JbbSubset hasGroupby='0'>
      <TableList>
        <Table ref='T1'>
          CAT.RANGE.DIM2
        </Table>
        <Table ref='T2'>
          CAT.RANGE.FACT
        </Table>
      </TableList>
      <CandidateList>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_NULLS_ISNOTNULL
          </MVName>
          <RangePredList>
            <Range ref='R64' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O44' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O47' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O56' result='Provided'>
              <MVColumn ref='C18'>
                DATA
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_NULLS_ISNOTNULLOREQUAL
          </MVName>
          <RangePredList>
            <Range ref='R64' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O44' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O47' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O56' result='Provided'>
              <MVColumn ref='C18'>
                DATA
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
        <Candidate isPreferredMatch='0' statsOnly='0'>
          <MVName TS='0'>
            CAT.RANGE.RANGE_NULLS_ISNOTNULLORLESS
          </MVName>
          <RangePredList>
            <Range ref='R64' result='Provided'>
            </Range>
          </RangePredList>
          <OutputList>
            <Output ref='O44' result='Provided'>
              <MVColumn ref='C6'>
                FQUANT
              </MVColumn>
            </Output>
            <Output ref='O47' result='Provided'>
              <MVColumn ref='C7'>
                FPRICE
              </MVColumn>
            </Output>
            <Output ref='O56' result='Provided'>
              <MVColumn ref='C18'>
                DATA
              </MVColumn>
            </Output>
          </OutputList>
        </Candidate>
      </CandidateList>
    </JbbSubset>
    <Info><![CDATA[MV CAT.RANGE.RANGE_NULLS_ISNULL was disqualified because The query range predicate R64 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_NULLS_ISNULLOREQUAL was disqualified because The query range predicate R64 is not subsumed by the corresponding MV predicate.]]></Info>
    <Info><![CDATA[MV CAT.RANGE.RANGE_NULLS_ISNULLORLESS was disqualified because The query range predicate R64 is not subsumed by the corresponding MV predicate.]]></Info>
  </JbbResult>
</Result>
>>
>>-- Verify the MV is picked by the optimizer.
>>prepare QueryStmt from
+>	select fprice, fquant, 
+>	       dimdata data
+>	from fact, dim2
+>	where dimkey=dkey
+>	  and dimdata IS NOT NULL
+>	order by fprice;

--- SQL command prepared.
>>
>>execute checkPlan;

OPERATOR                        TNAME
------------------------------  ------------------------------------------------------------

FILE_SCAN                       CAT.RANGE.RANGE_NULLS_ISNOTNULL                             

--- 1 row(s) selected.
>>
>>
>>obey TEST004(clean_up);
>>----------------------------------------------------
>>------------------ clean up section ----------------
>>----------------------------------------------------
>>drop schema range cascade;

--- SQL operation complete.
>>
>>exit;

End of MXCI Session

