1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-15 22:22:17 +03:00
Files
mariadb-columnstore-engine/mysql/queries/nightly/scripts/mysqlHelpers.sh
2016-01-06 14:08:59 -06:00

25 lines
540 B
Bash
Executable File

#!/bin/bash
#
# Functions that make mysql calls used by some of the nightly test scripts.
#
#
# This function outputs the count from the passed sql statement.
# Parameters:
# db - the database
# sql - the sql statement
#
# Example:
# liCount=`getCount tpch1 "select count(*) from lineitem;"`
#
getCount()
{
# The awk in the result is a hack for cygwin to avoid arithmetic expression errors and jumbled wrapping in the status
# output.
db=$1
sql=$2
$MYSQLCMD $db -e "$sql" | tail -1 | awk '{print $0}'
}