wecisecode 5 days ago
parent
commit
aa8012aa00
1 changed files with 9 additions and 3 deletions
  1. 9 3
      odbctest/mql/mqltest.sh

+ 9 - 3
odbctest/mql/mqltest.sh

@@ -71,14 +71,20 @@ if [[ -e ${logfile} ]]; then
     mv -f ${logfile} ${lastlogfile}
 fi
 
+odbver=`./mql odbver? log.level=error "$@"`
 n=`./mql keyspace=matrix - "cql:select count(*) from system_schema.columns where keyspace_name='${keyspace}' and table_name='object_test'" 2>/dev/null | grep "count" | grep -v "grep" | grep -v "select" | awk '{print $2}'`
 if [[ "${n}" == "0" ]]; then
     n=1
 else
-    n=`cat ${keyspace}.test.count 2>/dev/null`
-    n=`expr 0${n} + 1`
+    mapfile -t x < ${keyspace}.test.count
+    if [[ "${x[0]}" == "${odbver}" ]]; then
+        n=`expr 0${x[1]} + 1`
+    else
+        n=1
+    fi
 fi
-echo "${n}" > ${keyspace}.test.count
+echo "${odbver}" > ${keyspace}.test.count
+echo "${n}" >> ${keyspace}.test.count
 ./mql "$@" "log.prefix=test $n" 2>&1 | tee -a ${logfile}
 lastline=`tail -n 1 $logfile 2>&1`
 if [[ "$lastline" = "FAIL" ]]; then