# mysql.proc Table

The `mysql.proc` table contains information about [stored procedures](https://mariadb.com/docs/server/server-usage/stored-routines/stored-procedures) and [stored functions](https://mariadb.com/docs/server/server-usage/stored-routines/stored-functions). It contains similar information to that stored in the [INFORMATION SCHEMA.ROUTINES](https://mariadb.com/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-routines-table) table.

This table uses the [Aria](https://mariadb.com/docs/server/server-usage/storage-engines/aria) storage engine.

The `mysql.proc` table contains the following fields:

| Field                  | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Null | Key | Default             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | --- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| db                     | char(64)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | NO   | PRI |                     | Database name.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| name                   | char(64)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | NO   | PRI |                     | Routine name.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| type                   | enum('FUNCTION','PROCEDURE','PACKAGE', 'PACKAGE BODY')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | NO   | PRI | NULL                | Whether [stored procedure](https://mariadb.com/docs/server/server-usage/stored-routines/stored-procedures), [stored function](https://mariadb.com/docs/server/server-usage/stored-routines/stored-functions) or a [package](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package) or [package body](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package-body). |
| specific\_name         | char(64)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | NO   |     |                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| language               | enum('SQL')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | NO   |     | SQL                 | Always SQL.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| sql\_data\_access      | enum('CONTAINS\_SQL', 'NO\_SQL', 'READS\_SQL\_DATA', 'MODIFIES\_SQL\_DATA')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | NO   |     | CONTAINS\_SQL       |                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| is\_deterministic      | enum('YES','NO')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | NO   |     | NO                  | Whether the routine is deterministic (can produce only one result for a given list of parameters) or not.                                                                                                                                                                                                                                                                                                                                           |
| security\_type         | enum('INVOKER','DEFINER')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | NO   |     | DEFINER             | INVOKER or DEFINER. Indicates which user's privileges apply to this routine.                                                                                                                                                                                                                                                                                                                                                                        |
| param\_list            | blob                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | NO   |     | NULL                | List of parameters.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| returns                | longblob                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | NO   |     | NULL                | What the routine returns.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| body                   | longblob                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | NO   |     | NULL                | Definition of the routine.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| definer                | char(141)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | NO   |     |                     | If the security\_type is DEFINER, this value indicates which user defined this routine.                                                                                                                                                                                                                                                                                                                                                             |
| created                | timestamp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | NO   |     | CURRENT\_TIMESTAMP  | Date and time the routine was created.                                                                                                                                                                                                                                                                                                                                                                                                              |
| modified               | timestamp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | NO   |     | 0000-00-00 00:00:00 | Date and time the routine was modified.                                                                                                                                                                                                                                                                                                                                                                                                             |
| sql\_mode              | set('REAL\_AS\_FLOAT', 'PIPES\_AS\_CONCAT', 'ANSI\_QUOTES', 'IGNORE\_SPACE', 'IGNORE\_BAD\_TABLE\_OPTIONS', 'ONLY\_FULL\_GROUP\_BY', 'NO\_UNSIGNED\_SUBTRACTION', 'NO\_DIR\_IN\_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO\_KEY\_OPTIONS', 'NO\_TABLE\_OPTIONS', 'NO\_FIELD\_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO\_AUTO\_VALUE\_ON\_ZERO', 'NO\_BACKSLASH\_ESCAPES', 'STRICT\_TRANS\_TABLES', 'STRICT\_ALL\_TABLES', 'NO\_ZERO\_IN\_DATE', 'NO\_ZERO\_DATE', 'INVALID\_DATES', 'ERROR\_FOR\_DIVISION\_BY\_ZERO', 'TRADITIONAL', 'NO\_AUTO\_CREATE\_USER', 'HIGH\_NOT\_PRECEDENCE', 'NO\_ENGINE\_SUBSTITUTION', 'PAD\_CHAR\_TO\_FULL\_LENGTH', 'EMPTY\_STRING\_IS\_NULL', 'SIMULTANEOUS\_ASSIGNMENT') | NO   |     |                     | The [SQL\_MODE](https://mariadb.com/docs/server/server-management/variables-and-modes/sql_mode) at the time the routine was created.                                                                                                                                                                                                                                                                                                                |
| comment                | text                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | NO   |     | NULL                | Comment associated with the routine.                                                                                                                                                                                                                                                                                                                                                                                                                |
| character\_set\_client | char(32)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | YES  |     | NULL                | The [character set](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets) used by the client that created the routine.                                                                                                                                                                                                                                                                                             |
| collation\_connection  | char(32)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | YES  |     | NULL                | The [collation](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets) (and character set) used by the connection that created the routine.                                                                                                                                                                                                                                                                         |
| db\_collation          | char(32)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | YES  |     | NULL                | The default [collation](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets) (and character set) for the database, at the time the routine was created.                                                                                                                                                                                                                                                           |
| body\_utf8             | longblob                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | YES  |     | NULL                | Definition of the routine in utf8.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| aggregate              | enum('NONE', 'GROUP')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | NO   |     | NONE                |                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Field                  | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Null | Key | Default             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                         |

## See Also

* [Stored Procedure Internals](https://mariadb.com/docs/server/reference/system-tables/the-mysql-database-tables/broken-reference)
* [MySQL to MariaDB migration: handling privilege table differences when using mysqldump](https://mariadb.com/blog/mysql-mariadb-migration-handling-privilege-table-differences-when-using-mysqldump)

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

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