~gl-az/+junk/scripts

« back to all changes in this revision

Viewing changes to imtr/imtr.serversql.sh

  • Committer: George O. Lorch III
  • Date: 2013-01-29 18:27:00 UTC
  • mfrom: (24.1.2 scripts)
  • Revision ID: george.lorch@percona.com-20130129182700-9yqozic74ff4qyty
Merged changes from path

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
        local max=`expr "$count" - 1`
7
7
        local instanceid="$1"
8
8
        shift
9
 
        local sql="$@"
 
9
        local sql="$*"
10
10
 
11
11
        if [ -z "$instanceid" ]; then
12
12
                imtr_error "You must specify a valid server instance id from 1-$max. [$instanceid]"
27
27
                imtr_error "You must specify a valid sql statement. [$instanceid]"
28
28
        elif [ -f "$sql" ]; then
29
29
                imtr_report "$instanceid file: $sql"
30
 
                ${S_MYSQL[$instanceid]} ${S_MYSQL_OPTIONS[$instanceid]} < $sql
 
30
                ( PATH=${S_BINDIR[$instanceid]}/bin:$PATH; mysql --defaults-file=${S_DEFAULTSFILE[$instanceid]} < $sql )
31
31
                return $?
32
32
        else
33
33
                imtr_report "$instanceid sql: \"$sql\""
34
 
                ${S_MYSQL[$instanceid]} ${S_MYSQL_OPTIONS[$instanceid]} -e "$sql"
 
34
                ( PATH=${S_BINDIR[$instanceid]}/bin:$PATH; mysql --defaults-file=${S_DEFAULTSFILE[$instanceid]} -e "$sql" )
35
35
                return $?
36
36
        fi
37
37
        return 1