You also might want to check out some of the Server System Variables.
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.htmlSome of these may limit your query, depending on your requirements.
max_allowed_packet
max_binlog_cache_size
max_binlog_size
max_connect_errors
max_connections
max_delayed_threads
max_error_count
max_heap_table_size
max_insert_delayed_threads
max_join_size
max_length_for_sort_data
max_prepared_stmt_count
max_relay_log_size
max_seeks_for_key
max_sort_length
max_tmp_tables
max_user_connections
max_write_lock_count
To view these variables on the command line use the show variables command.
Example: You can also run this command to get the max_table_heap_size.