#!/bin/bash
r='rasql --user rasadmin --passwd rasadmin'
$r -q 'drop collection test_1' > /dev/null 2>&1

$r -q 'CREATE TYPE type1_base AS ( b1 char, b2 char, b3 char)' > /dev/null 2>&1
$r -q 'CREATE TYPE type1_mdd AS type1_base MDARRAY [a0, a1]' > /dev/null 2>&1
$r -q 'CREATE TYPE type1_set AS SET (type1_mdd)' > /dev/null 2>&1

$r -q 'CREATE COLLECTION test_1 type1_set' > /dev/null 2>&1
$r -q 'INSERT INTO test_1 values marray x in [0:300, 0:200] values {1c, 2c, 3c}' > /dev/null 2>&1

for i in {1..12}; do
	$r -q 'select (char)c into test_1 from test_1 as c' --user rasadmin --passwd rasadmin
	echo "Test query with $i time."
done

