#!/bin/sh
#
# A one-shot test battery using a copy of the 'assays' table called 'assays_manip'
#

SHSQL="shsql -echo -nat"
# SHSQL="shsql -echo -nat -noindex"

(cd ../data; cp assays assays_manip)

echo "
0."
$SHSQL "create index (type=direct) on assays_manip measnum"

echo "
1. tabdef assays_manip"
tabdef assays_manip

echo "
2."
$SHSQL "delete from assays_manip where measnum = 2909"
$SHSQL "select * from assays_manip where measnum = 2909"

echo "
3."

$SHSQL "update assays_manip set desc = 'test update of desc field.. abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz' where measnum = 1705"
$SHSQL "select * from assays_manip where measnum = 1705"

echo "
4."
$SHSQL "delete from assays_manip where measnum in '2909,2910,2911'"
$SHSQL "select * from assays_manip where measnum in '2909,2910,2911,2912'"

echo "
5. "
$SHSQL "delete from assays_manip where measnum in '9923,9924,2911,14318,6210'"
$SHSQL "select * from assays_manip where measnum in '9923,9924,2911,14318,6210,6215'"

echo "
6. "
$SHSQL "delete from assays_manip where measnum like '17??' "
$SHSQL "select * from assays_manip where measnum like '17??' "

echo "
7. "
$SHSQL "update assays_manip set projsym = 'Hello' where measnum like '108??'"
$SHSQL "select projsym from assays_manip where measnum like '108??'"

echo "
8. "
$SHSQL "update assays_manip set projsym = 'Howdy' where measnum inlike '3608,2206,9907,161?'"
$SHSQL "select * from assays_manip where measnum inlike '3608,2206,9907,16??'"
