Ticket #1373: script_error.sh

File script_error.sh, 1.4 KB (added by Dimitar Misev, 8 years ago)
Line 
1#!/bin/bash
2r='rasql --user rasadmin --passwd rasadmin'
3
4
5$r -q 'drop collection test_1' > /dev/null 2>&1
6
7echo "Create first type"
8$r -q 'drop type type1_set' > /dev/null 2>&1
9$r -q 'drop type type1_mdd' > /dev/null 2>&1
10$r -q 'drop type type1_base' > /dev/null 2>&1
11$r -q 'CREATE TYPE type1_base AS ( b1 char, b2 char, b3 char)' > /dev/null
12$r -q 'CREATE TYPE type1_mdd AS type1_base MDARRAY [a0, a1]' > /dev/null
13$r -q 'CREATE TYPE type1_set AS SET (type1_mdd)' > /dev/null
14
15echo "Create second type"
16$r -q 'drop type type2_set' > /dev/null 2>&1
17$r -q 'drop type type2_mdd' > /dev/null 2>&1
18$r -q 'drop type type2_base' > /dev/null 2>&1
19$r -q 'CREATE TYPE type2_base AS ( b3 char, b2 char, b1 char)' > /dev/null
20$r -q 'CREATE TYPE type2_mdd AS type2_base MDARRAY [a0, a1]' > /dev/null
21$r -q 'CREATE TYPE type2_set AS SET (type2_mdd)' > /dev/null
22
23echo "Create a collection based on type_2 (note: it should be in order: b3, b2, b1)"
24$r -q 'CREATE COLLECTION test_1 type2_set' > /dev/null
25$r -q 'INSERT INTO test_1 VALUES <[0:0,0:0] {0c,1c,2c}>' > /dev/null
26
27echo "Check the band names of the test coverage"
28$r -q 'SELECT dbinfo(c) from test_1 as c' --out string --quiet
29
30echo "Expected output: 0, 1, 2"
31$r -q 'SELECT csv(c.b3) from test_1 as c' --out string --quiet
32$r -q 'SELECT csv(c.b2) from test_1 as c' --out string --quiet
33$r -q 'SELECT csv(c.b1) from test_1 as c' --out string --quiet