This topic describes how to view a paginated list of tasks based on the given task type.
Ensure that you have the required roles.
To retrieve tasks of a specific type with pagination, use
the task_list
function.
Press CTRL+C to copymysql> SELECT mysql_tasks.task_list('task_type', offset, limit);
Replace the following:
task_type
: filters the tasks based on a specific task type. If the value isNULL
, tasks of all types are included.offset
: the number of rows to skip. The offset value is used for pagination.limit
: the maximum number of task records included in the list of tasks.
For example:
Press CTRL+C to copymysql> SELECT mysql_tasks.task_list('Async_SQL', 5, 5)\G *************************** 1. row *************************** mysql_tasks.task_list('Async_SQL', 5, 5): [{"id": "69edecea-3b7b-11f0-a5dc-02001712c792", "data": {"country": "INDIA", "mysqlMetadata": {"autoGc": true, "events": ["`airportdb`.`69eddbea-3b7b-11f0-a5dc-02001712c792`"]}}, "name": "Create table for flight from JAPAN", "task_type": "Async_SQL", "connection_id": 5600}, {"id": "4f43d993-3b7b-11f0-a5dc-02001712c792", "data": {"country": "INDIA", "mysqlMetadata": {"autoGc": true, "events": ["`airportdb`.`4f43cb11-3b7b-11f0-a5dc-02001712c792`"]}}, "name": "Create table for flight from INDIA", "task_type": "Async_SQL", "connection_id": 5597}, ... 1 row in set (0.2259 sec)
This example lists all the tasks of task type
Async_SQL
.