Nagios: check_mysql_query returns \"(null)\"

Ran into a problem at $WORK today when trying to use the Nagios plugin checkmysqlplugin. I wanted to verify that the table had > 0 rows. The configuration looked like this:

define command{
command_name check_table_size
command_line $USER1$/check_mysql_query -q "select count(*) from example;"  -H $HOSTADDRESS$ $ARG1$
}
define service{
host_name                       foo
service_description             Table size
check_command                   check_table_size!-u nagios -p password -d database -w 1:1000000000 -c 1:1000000000
}

I could run it find from the command line, but Nagios kept getting CRITICAL, and the only output it had was "(null)". I turned on debugging, and kept seeing this:

Done.  Final output: '/usr/lib64/nagios/plugins/check_mysql_query -q 'select count(*) from example'

I finally figured out that the semicolon in the -q argument was messing things up. Removing it and restarting Nagios fixed the problem.