added $table_name to cache_query_result