// FIRST, check unnesting of VARRAY/TABLE of NUMBER
// ------------------------------------------------
// Unnesting arrays
assertEquals(emptyList(),
create().select().from(table(new UNumberArrayRecord(ora(), (Integer[]) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(new UNumberArrayRecord(ora()))).fetch(0));
assertEquals(asList(1),
create().select().from(table(new UNumberArrayRecord(ora(), 1))).fetch(0));
assertEquals(asList(1, 2),
create().select().from(table(new UNumberArrayRecord(ora(), 1, 2))).fetch(0));
// Unnesting tables
assertEquals(emptyList(),
create().select().from(table(new UNumberTableRecord(ora(), (Integer[]) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(new UNumberTableRecord(ora()))).fetch(0));
assertEquals(asList(1),
create().select().from(table(new UNumberTableRecord(ora(), 1))).fetch(0));
assertEquals(asList(1, 2),
create().select().from(table(new UNumberTableRecord(ora(), 1, 2))).fetch(0));
// Unnesting arrays from functions
assertEquals(emptyList(),
create().select().from(table(fArrays1((UNumberArrayRecord) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fArrays1(new UNumberArrayRecord(ora(), (Integer[]) null)))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fArrays1(new UNumberArrayRecord(ora())))).fetch(0));
assertEquals(asList(1),
create().select().from(table(fArrays1(fArrays1(new UNumberArrayRecord(ora(), 1))))).fetch(0));
assertEquals(asList(1, 2),
create().select().from(table(fArrays1(fArrays1(new UNumberArrayRecord(ora(), 1, 2))))).fetch(0));
// Unnesting tables from functions
assertEquals(emptyList(),
create().select().from(table(fTables1((UNumberTableRecord) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fTables1(new UNumberTableRecord(ora(), (Integer[]) null)))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fTables1(new UNumberTableRecord(ora())))).fetch(0));
assertEquals(asList(1),
create().select().from(table(fTables1(fTables1(new UNumberTableRecord(ora(), 1))))).fetch(0));
assertEquals(asList(1, 2),
create().select().from(table(fTables1(fTables1(new UNumberTableRecord(ora(), 1, 2))))).fetch(0));
// Retrieving arrays from functions
assertNull(fArrays1(ora(), null));
assertEquals(emptyList(),
fArrays1(ora(), new UNumberArrayRecord(ora(), (Integer[]) null)).getList());
assertEquals(emptyList(),
fArrays1(ora(), new UNumberArrayRecord(ora())).getList());
assertEquals(asList(1),
fArrays1(ora(), fArrays1(ora(), new UNumberArrayRecord(ora(), 1))).getList());
assertEquals(asList(1, 2),
fArrays1(ora(), fArrays1(ora(), new UNumberArrayRecord(ora(), 1, 2))).getList());
// Retrieving tables from functions
assertNull(fTables1(ora(), null));
assertEquals(emptyList(),
fTables1(ora(), new UNumberTableRecord(ora(), (Integer[]) null)).getList());
assertEquals(emptyList(),
fTables1(ora(), new UNumberTableRecord(ora())).getList());
assertEquals(asList(1),
fTables1(ora(), fTables1(ora(), new UNumberTableRecord(ora(), 1))).getList());
assertEquals(asList(1, 2),
fTables1(ora(), fTables1(ora(), new UNumberTableRecord(ora(), 1, 2))).getList());
// Retrieving arrays from procedures
assertNull(pArrays1(ora(), null));
assertEquals(emptyList(),
pArrays1(ora(), new UNumberArrayRecord(ora(), (Integer[]) null)).getList());
assertEquals(emptyList(),
pArrays1(ora(), new UNumberArrayRecord(ora())).getList());
assertEquals(asList(1),
pArrays1(ora(), pArrays1(ora(), new UNumberArrayRecord(ora(), 1))).getList());
assertEquals(asList(1, 2),
pArrays1(ora(), pArrays1(ora(), new UNumberArrayRecord(ora(), 1, 2))).getList());
// Retrieving tables from procedures
assertNull(pTables1(ora(), null));
assertEquals(emptyList(),
pTables1(ora(), new UNumberTableRecord(ora(), (Integer[]) null)).getList());