Changeset: 2ba552eae228 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2ba552eae228
Modified Files:
        sql/test/nested/Tests/inserts.test
Branch: tvtree
Log Message:

Extends inserts test


diffs (78 lines):

diff --git a/sql/test/nested/Tests/inserts.test 
b/sql/test/nested/Tests/inserts.test
--- a/sql/test/nested/Tests/inserts.test
+++ b/sql/test/nested/Tests/inserts.test
@@ -12,20 +12,33 @@ statement ok
 create table ct_col (c ct)
 
 # composite with basic-array type
+# NOTE: the composite's members different order matters for
+# code generation so we test for composites with same fields
+# but different order
 
 statement ok
-create type cabt as (an int[], m text)
+create type cabt_o1 as (an int[], m text)
+
+statement ok
+create table cabt_o1_col (cab cabt_1)
+
+statement ok
+create type cabt_o2 as (m text, an int[])
 
 statement ok
-create table cabt_col (cab cabt)
+create table cabt_o2_col (cab cabt_o2)
 
-# composite with composite-array type
+statement ok
+create type cact_o1 as (ac ct[], m text)
 
 statement ok
-create type cact as (ac ct[], m text)
+create table cact_o1_col (cac cact_1)
 
 statement ok
-create table cact_col (cac cact)
+create type cact_o2 as (m text, ac ct[])
+
+statement ok
+create table cact_o2_col (cac cact_o2)
 
 # arrays
 
@@ -44,16 +57,31 @@ statement ok
 insert into ct_col values ((1, 'hello')), ((2, 'world'))
 
 statement error 42000!
-insert into cabt_col values (((1, 2), 'alice')), (((3, 4), 'bob'))
+insert into cabt_o1_col values (((1, 2), 'alice')), (((3, 4), 'bob'))
+
+statement ok
+insert into cabt_o1_col values ((array[101, 102], 'hi'))
+
+statement ok
+insert into cabt_o1_col values ((array[201, 202], 'alice')), ((array[301, 
302], 'bob'))
+
+statement ok
+insert into cabt_o2_col values (('hi', array[101, 102]))
 
 statement ok
-insert into cabt_col values ((array[1, 2], 'alice')), ((array[3, 4], 'bob'))
+insert into cabt_o2_col values (('alice', array[201, 202])), (('bob', 
array[301, 302]))
+
+statement ok
+insert into cact_o1_col values ((array[(101, 'one'), (102, 'two')], 'hi'))
 
 statement ok
-insert into cact_col values ((array[(1, 'tic'), (2, 'tac')], 'alice'))
+insert into cact_o1_col values ((array[(201, 'tic'), (202, 'tac')], 'alice')), 
((array[(301, 'toc')], 'bob'))
 
 statement ok
-insert into cact_col values ((array[(10, 'one'), (20, 'two')], 'bob')), 
((array[(30, 'hop')], 'joe'))
+insert into cact_o2_col values (('hi', array[(101, 'one'), (102, 'two')]))
+
+statement ok
+insert into cact_o2_col values (('alice', array[(201, 'tic'), (202, 'tac')])), 
(('bob', array[(301, 'toc')]))
 
 statement ok
 insert into bt_arr values (array[1, 2]), (array[10, 20])
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to