> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_thread_trx_info.md).

# ps\_thread\_trx\_info

{% hint style="info" %}
Sys Schema is available from MariaDB 10.6.
{% endhint %}

## Syntax

```
sys.ps_thread_trx_info(thread_id)
```

## Description

`ps_thread_trx_info` is a [stored function](/docs/server/server-usage/stored-routines/stored-functions.md) available with the [Sys Schema](/docs/server/reference/system-tables/sys-schema.md).

It returns a JSON object with information about the thread specified by the given *thread\_id*. This information includes:

* the current transaction;
* executed statements (derived from the [Performance Schema events\_transactions\_current Table](/docs/server/reference/system-tables/performance-schema/performance-schema-tables/performance-schema-events_transactions_current-table.md) and the [Performance Schema events\_statements\_history Table](/docs/server/reference/system-tables/performance-schema/performance-schema-tables/performance-schema-events_statements_history-table.md) (full data will only returned if the consumers for those tables are enabled).

The maximum length of the returned JSON object is determined by the value of the [ps\_thread\_trx\_info.max\_length sys\_config option](/docs/server/reference/system-tables/sys-schema/sys-schema-sys_config-table.md) (by default 65535). If the returned value exceeds this length, a JSON object error is returned.

## See Also

* [Sys Schema sys\_config Table](/docs/server/reference/system-tables/sys-schema/sys-schema-sys_config-table.md)

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
