diff --git a/docs/generated/eventlog.md b/docs/generated/eventlog.md index e43d665e45d6..670a8a3b2e02 100644 --- a/docs/generated/eventlog.md +++ b/docs/generated/eventlog.md @@ -324,7 +324,7 @@ An event of type `set_cluster_setting` is recorded when a cluster setting is cha | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `set_tenant_cluster_setting` @@ -351,7 +351,7 @@ is changed, either for another tenant or for all tenants. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ## SQL Access Audit Events @@ -384,7 +384,7 @@ is directly or indirectly a member of the admin role) executes a query. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `ExecMode` | How the statement was being executed (exec/prepare, etc.) | no | | `NumRows` | Number of rows returned. For mutation statements (INSERT, etc) that do not produce result rows, this field reports the number of rows affected. | no | @@ -418,7 +418,7 @@ a table marked as audited. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `ExecMode` | How the statement was being executed (exec/prepare, etc.) | no | | `NumRows` | Number of rows returned. For mutation statements (INSERT, etc) that do not produce result rows, this field reports the number of rows affected. | no | @@ -459,7 +459,7 @@ and the cluster setting `sql.trace.log_statement_execute` is set. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `ExecMode` | How the statement was being executed (exec/prepare, etc.) | no | | `NumRows` | Number of rows returned. For mutation statements (INSERT, etc) that do not produce result rows, this field reports the number of rows affected. | no | @@ -505,7 +505,7 @@ An event of type `alter_database_add_region` is recorded when a region is added | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_database_drop_region` @@ -529,7 +529,7 @@ AlterDatabaseAddRegion is recorded when a region is added to a database. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_database_placement` @@ -553,7 +553,7 @@ An event of type `alter_database_placement` is recorded when the database placem | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_database_primary_region` @@ -577,7 +577,7 @@ An event of type `alter_database_primary_region` is recorded when a primary regi | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_database_set_zone_config_extension` @@ -597,7 +597,7 @@ An event of type `alter_database_set_zone_config_extension` is recorded when a z | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Target` | The target object of the zone config change. | yes | | `Config` | The applied zone config in YAML format. | yes | @@ -624,7 +624,7 @@ An event of type `alter_database_survival_goal` is recorded when the survival go | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_index` @@ -649,7 +649,7 @@ An event of type `alter_index` is recorded when an index is altered. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_index_visible` @@ -674,7 +674,7 @@ AlterIndex is recorded when an index visibility is altered. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_sequence` @@ -697,7 +697,7 @@ An event of type `alter_sequence` is recorded when a sequence is altered. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_table` @@ -722,7 +722,7 @@ An event of type `alter_table` is recorded when a table is altered. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_type` @@ -745,7 +745,7 @@ EventAlterType is recorded when a user-defined type is altered. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `comment_on_column` @@ -771,7 +771,7 @@ An event of type `comment_on_column` is recorded when a column is commented. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `comment_on_constraint` @@ -797,7 +797,7 @@ An event of type `comment_on_constraint` is recorded when an constraint is comme | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `comment_on_database` @@ -822,7 +822,7 @@ CommentOnTable is recorded when a database is commented. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `comment_on_index` @@ -848,7 +848,7 @@ An event of type `comment_on_index` is recorded when an index is commented. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `comment_on_schema` @@ -872,7 +872,7 @@ An event of type `comment_on_index` is recorded when an index is commented. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `comment_on_table` @@ -897,7 +897,7 @@ An event of type `comment_on_table` is recorded when a table is commented. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `convert_to_schema` @@ -921,7 +921,7 @@ An event of type `convert_to_schema` is recorded when a database is converted to | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_database` @@ -944,7 +944,7 @@ An event of type `create_database` is recorded when a database is created. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_index` @@ -969,7 +969,7 @@ An event of type `create_index` is recorded when an index is created. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_schema` @@ -993,7 +993,7 @@ An event of type `create_schema` is recorded when a schema is created. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_sequence` @@ -1017,7 +1017,7 @@ An event of type `create_sequence` is recorded when a sequence is created. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_statistics` @@ -1044,7 +1044,7 @@ Events of this type are only collected when the cluster setting | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_table` @@ -1068,7 +1068,7 @@ An event of type `create_table` is recorded when a table is created. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_type` @@ -1092,7 +1092,7 @@ An event of type `create_type` is recorded when a user-defined type is created. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_view` @@ -1117,7 +1117,7 @@ An event of type `create_view` is recorded when a view is created. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `drop_database` @@ -1141,7 +1141,7 @@ An event of type `drop_database` is recorded when a database is dropped. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `drop_index` @@ -1167,7 +1167,7 @@ An event of type `drop_index` is recorded when an index is dropped. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `drop_schema` @@ -1190,7 +1190,7 @@ An event of type `drop_schema` is recorded when a schema is dropped. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `drop_sequence` @@ -1213,7 +1213,7 @@ An event of type `drop_sequence` is recorded when a sequence is dropped. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `drop_table` @@ -1237,7 +1237,7 @@ An event of type `drop_table` is recorded when a table is dropped. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `drop_type` @@ -1260,7 +1260,7 @@ An event of type `drop_type` is recorded when a user-defined type is dropped. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `drop_view` @@ -1284,7 +1284,7 @@ An event of type `drop_view` is recorded when a view is dropped. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `finish_schema_change` @@ -1342,7 +1342,7 @@ initiated schema change rollback has completed. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `rename_database` @@ -1366,7 +1366,7 @@ An event of type `rename_database` is recorded when a database is renamed. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `rename_schema` @@ -1390,7 +1390,7 @@ An event of type `rename_schema` is recorded when a schema is renamed. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `rename_table` @@ -1414,7 +1414,7 @@ An event of type `rename_table` is recorded when a table, sequence or view is re | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `rename_type` @@ -1438,7 +1438,7 @@ An event of type `rename_type` is recorded when a user-defined type is renamed. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `reverse_schema_change` @@ -1485,7 +1485,7 @@ An event of type `set_schema` is recorded when a table, view, sequence or type's | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `truncate_table` @@ -1508,7 +1508,7 @@ An event of type `truncate_table` is recorded when a table is truncated. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `unsafe_delete_descriptor` @@ -1539,7 +1539,7 @@ patch releases without advance notice. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `unsafe_delete_namespace_entry` @@ -1570,7 +1570,7 @@ patch releases without advance notice. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `unsafe_upsert_descriptor` @@ -1597,7 +1597,7 @@ using crdb_internal.unsafe_upsert_descriptor(). | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `unsafe_upsert_namespace_entry` @@ -1630,7 +1630,7 @@ patch releases without advance notice. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ## SQL Privilege changes @@ -1667,7 +1667,7 @@ An event of type `alter_database_owner` is recorded when a database's owner is c | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_default_privileges` @@ -1693,7 +1693,7 @@ An event of type `alter_default_privileges` is recorded when default privileges | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Grantee` | The user/role affected by the grant or revoke operation. | yes | | `GrantedPrivileges` | The privileges being granted to the grantee. | no | @@ -1720,7 +1720,7 @@ An event of type `alter_schema_owner` is recorded when a schema's owner is chang | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_table_owner` @@ -1744,7 +1744,7 @@ An event of type `alter_table_owner` is recorded when the owner of a table, view | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `alter_type_owner` @@ -1768,7 +1768,7 @@ An event of type `alter_type_owner` is recorded when the owner of a user-defiend | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `change_database_privilege` @@ -1792,7 +1792,7 @@ added to / removed from a user for a database object. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Grantee` | The user/role affected by the grant or revoke operation. | yes | | `GrantedPrivileges` | The privileges being granted to the grantee. | no | @@ -1817,7 +1817,7 @@ added to / removed from a user for a database object. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Grantee` | The user/role affected by the grant or revoke operation. | yes | | `GrantedPrivileges` | The privileges being granted to the grantee. | no | @@ -1844,7 +1844,7 @@ removed from a user for a schema object. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Grantee` | The user/role affected by the grant or revoke operation. | yes | | `GrantedPrivileges` | The privileges being granted to the grantee. | no | @@ -1871,7 +1871,7 @@ from a user for a table, sequence or view object. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Grantee` | The user/role affected by the grant or revoke operation. | yes | | `GrantedPrivileges` | The privileges being granted to the grantee. | no | @@ -1898,7 +1898,7 @@ removed from a user for a type object. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Grantee` | The user/role affected by the grant or revoke operation. | yes | | `GrantedPrivileges` | The privileges being granted to the grantee. | no | @@ -2132,7 +2132,7 @@ set to a non-zero value, AND | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `ExecMode` | How the statement was being executed (exec/prepare, etc.) | no | | `NumRows` | Number of rows returned. For mutation statements (INSERT, etc) that do not produce result rows, this field reports the number of rows affected. | no | @@ -2164,7 +2164,7 @@ are more statement within the transaction that haven't been executed yet. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `TxnID` | TxnID is the ID of the transaction that hit the row count limit. | no | | `SessionID` | SessionID is the ID of the session that initiated the transaction. | no | @@ -2191,7 +2191,7 @@ been executed yet. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `TxnID` | TxnID is the ID of the transaction that hit the row count limit. | no | | `SessionID` | SessionID is the ID of the session that initiated the transaction. | no | @@ -2251,7 +2251,7 @@ the "slow query" condition. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `ExecMode` | How the statement was being executed (exec/prepare, etc.) | no | | `NumRows` | Number of rows returned. For mutation statements (INSERT, etc) that do not produce result rows, this field reports the number of rows affected. | no | @@ -2284,7 +2284,7 @@ mutation statements within the transaction that haven't been executed yet. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `TxnID` | TxnID is the ID of the transaction that hit the row count limit. | no | | `SessionID` | SessionID is the ID of the session that initiated the transaction. | no | @@ -2312,7 +2312,7 @@ mutation statements within the transaction that haven't been executed yet. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `TxnID` | TxnID is the ID of the transaction that hit the row count limit. | no | | `SessionID` | SessionID is the ID of the session that initiated the transaction. | no | @@ -2352,7 +2352,7 @@ An event of type `alter_role` is recorded when a role is altered. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `create_role` @@ -2375,7 +2375,7 @@ An event of type `create_role` is recorded when a role is created. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `drop_role` @@ -2398,7 +2398,7 @@ An event of type `drop_role` is recorded when a role is dropped. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `grant_role` @@ -2422,7 +2422,7 @@ An event of type `grant_role` is recorded when a role is granted. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | ### `password_hash_converted` @@ -2556,6 +2556,7 @@ logged whenever a BACKUP and RESTORE job completes or fails. | `OnExecutionFailure` | OnExecutionFailure describes the desired behavior if the schedule fails to execute. | no | | `OnPreviousRunning` | OnPreviousRunning describes the desired behavior if the previously scheduled BACKUP is still running. | no | | `IgnoreExistingBackup` | IgnoreExistingBackup is true iff the BACKUP schedule should still be created even if a backup is already present in its destination. | no | +| `ApplicationName` | The application name for the session where recovery event was created. | no | #### Common fields @@ -2625,7 +2626,7 @@ contains common SQL event/execution details. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `ExecMode` | How the statement was being executed (exec/prepare, etc.) | no | | `NumRows` | Number of rows returned. For mutation statements (INSERT, etc) that do not produce result rows, this field reports the number of rows affected. | no | @@ -2722,7 +2723,7 @@ An event of type `remove_zone_config` is recorded when a zone config is removed. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Target` | The target object of the zone config change. | yes | | `Config` | The applied zone config in YAML format. | yes | @@ -2745,7 +2746,7 @@ An event of type `set_zone_config` is recorded when a zone config is changed. | `Tag` | The statement tag. This is separate from the statement string, since the statement string can contain sensitive information. The tag is guaranteed not to. | no | | `User` | The user account that triggered the event. The special usernames `root` and `node` are not considered sensitive. | depends | | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | -| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. Application names starting with a dollar sign (`$`) are not considered sensitive. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | no | | `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | | `Target` | The target object of the zone config change. | yes | | `Config` | The applied zone config in YAML format. | yes | diff --git a/pkg/ccl/backupccl/backup_planning.go b/pkg/ccl/backupccl/backup_planning.go index a567d898c019..c8be4e9b6714 100644 --- a/pkg/ccl/backupccl/backup_planning.go +++ b/pkg/ccl/backupccl/backup_planning.go @@ -704,6 +704,7 @@ func backupPlanHook( EncryptionOptions: &encryptionParams, AsOfInterval: asOfInterval, Detached: detached, + ApplicationName: p.SessionData().ApplicationName, } if backupStmt.CreatedByInfo != nil && backupStmt.CreatedByInfo.Name == jobs.CreatedByScheduledJobs { initialDetails.ScheduleID = backupStmt.CreatedByInfo.ID diff --git a/pkg/ccl/backupccl/backup_telemetry.go b/pkg/ccl/backupccl/backup_telemetry.go index 9134f54eb4ec..0a50bcf8348f 100644 --- a/pkg/ccl/backupccl/backup_telemetry.go +++ b/pkg/ccl/backupccl/backup_telemetry.go @@ -167,6 +167,7 @@ func createBackupRecoveryEvent( JobID: uint64(jobID), AsOfInterval: initialDetails.AsOfInterval, Options: options, + ApplicationName: initialDetails.ApplicationName, } event.DestinationAuthTypes = make([]string, 0, len(authTypes)) @@ -318,6 +319,7 @@ func logRestoreTelemetry( descsByTablePattern map[tree.TablePattern]catalog.Descriptor, restoreDBs []catalog.DatabaseDescriptor, debugPauseOn string, + applicationName string, ) { var requestedTargets []descpb.Descriptor for _, desc := range descsByTablePattern { @@ -417,6 +419,7 @@ func logRestoreTelemetry( DebugPauseOn: debugPauseOn, JobID: uint64(jobID), Options: options, + ApplicationName: applicationName, } event.DestinationAuthTypes = make([]string, 0, len(authTypes)) diff --git a/pkg/ccl/backupccl/backup_test.go b/pkg/ccl/backupccl/backup_test.go index af2de50b8c60..dc81a223e0e9 100644 --- a/pkg/ccl/backupccl/backup_test.go +++ b/pkg/ccl/backupccl/backup_test.go @@ -9926,6 +9926,7 @@ func TestBackupRestoreTelemetryEvents(t *testing.T) { } } + sqlDB.Exec(t, `SET application_name = 'backup_test'`) sqlDB.Exec(t, `CREATE DATABASE r1`) sqlDB.Exec(t, `CREATE TABLE r1.foo (id INT)`) sqlDB.Exec(t, `CREATE DATABASE r2`) @@ -9950,6 +9951,7 @@ func TestBackupRestoreTelemetryEvents(t *testing.T) { IsLocalityAware: true, AsOfInterval: -1 * time.Millisecond.Nanoseconds(), WithRevisionHistory: true, + ApplicationName: "backup_test", } // Also verify that there's a telemetry event corresponding to the completion @@ -9984,6 +9986,7 @@ func TestBackupRestoreTelemetryEvents(t *testing.T) { IsLocalityAware: true, AsOfInterval: 0, Options: []string{telemetryOptionIntoDB, telemetryOptionSkipMissingFK}, + ApplicationName: "backup_test", } // Also verify that there's a telemetry event corresponding to the completion diff --git a/pkg/ccl/backupccl/create_scheduled_backup_test.go b/pkg/ccl/backupccl/create_scheduled_backup_test.go index dc5d587cac13..7ac6d58dc134 100644 --- a/pkg/ccl/backupccl/create_scheduled_backup_test.go +++ b/pkg/ccl/backupccl/create_scheduled_backup_test.go @@ -1311,6 +1311,7 @@ WITH SCHEDULE OPTIONS on_execution_failure = 'pause', ignore_existing_backups, f beforeBackup := th.env.Now() firstRun := th.env.Now().Add(time.Minute).Round(time.Microsecond) + th.sqlDB.Exec(t, `SET application_name = 'backup_test'`) schedules, err := th.createBackupSchedule(t, query, loc, firstRun) if err != nil { t.Fatal(err) @@ -1335,6 +1336,7 @@ WITH SCHEDULE OPTIONS on_execution_failure = 'pause', ignore_existing_backups, f OnPreviousRunning: "WAIT", IgnoreExistingBackup: true, CustomFirstRunTime: firstRun.UnixNano(), + ApplicationName: "backup_test", } requireRecoveryEvent(t, beforeBackup.UnixNano(), createdScheduleEventType, expectedCreateSchedule) diff --git a/pkg/ccl/backupccl/restore_planning.go b/pkg/ccl/backupccl/restore_planning.go index 3972e7af05e1..6bf69b352460 100644 --- a/pkg/ccl/backupccl/restore_planning.go +++ b/pkg/ccl/backupccl/restore_planning.go @@ -1867,7 +1867,7 @@ func doRestorePlan( } resultsCh <- tree.Datums{tree.NewDInt(tree.DInt(jobID))} collectRestoreTelemetry(ctx, jobID, restoreDetails, intoDB, newDBName, subdir, restoreStmt, - descsByTablePattern, restoreDBs, asOfInterval, debugPauseOn) + descsByTablePattern, restoreDBs, asOfInterval, debugPauseOn, p.SessionData().ApplicationName) return nil } @@ -1901,7 +1901,7 @@ func doRestorePlan( return err } collectRestoreTelemetry(ctx, sj.ID(), restoreDetails, intoDB, newDBName, subdir, restoreStmt, - descsByTablePattern, restoreDBs, asOfInterval, debugPauseOn) + descsByTablePattern, restoreDBs, asOfInterval, debugPauseOn, p.SessionData().ApplicationName) if err := sj.Start(ctx); err != nil { return err } @@ -1923,6 +1923,7 @@ func collectRestoreTelemetry( restoreDBs []catalog.DatabaseDescriptor, asOfInterval int64, debugPauseOn string, + applicationName string, ) { telemetry.Count("restore.total.started") if restoreStmt.DescriptorCoverage == tree.AllDescriptors { @@ -1935,7 +1936,7 @@ func collectRestoreTelemetry( } logRestoreTelemetry(ctx, jobID, details, intoDB, newDBName, subdir, asOfInterval, restoreStmt.Options, - descsByTablePattern, restoreDBs, debugPauseOn) + descsByTablePattern, restoreDBs, debugPauseOn, applicationName) } func filteredUserCreatedDescriptors( diff --git a/pkg/jobs/jobspb/jobs.proto b/pkg/jobs/jobspb/jobs.proto index f2a884c32e12..6b64d77d7810 100644 --- a/pkg/jobs/jobspb/jobs.proto +++ b/pkg/jobs/jobspb/jobs.proto @@ -260,6 +260,10 @@ message BackupDetails { // timestamp and the timestamp resolved by the AS OF SYSTEM TIME expression. // The interval is expressed in nanoseconds. int64 as_of_interval = 22; + + // ApplicationName is the application name in the session where the backup was + // invoked. + string application_name = 23; } message BackupProgress { diff --git a/pkg/sql/BUILD.bazel b/pkg/sql/BUILD.bazel index 56d9b18a051c..633b452ca5a8 100644 --- a/pkg/sql/BUILD.bazel +++ b/pkg/sql/BUILD.bazel @@ -537,6 +537,7 @@ go_test( "comment_on_constraint_test.go", "comment_on_database_test.go", "comment_on_index_test.go", + "comment_on_schema_test.go", "comment_on_table_test.go", "conn_executor_internal_test.go", "conn_executor_savepoints_test.go", diff --git a/pkg/sql/comment_on_column_test.go b/pkg/sql/comment_on_column_test.go index cb8b85518233..fdb264c88460 100644 --- a/pkg/sql/comment_on_column_test.go +++ b/pkg/sql/comment_on_column_test.go @@ -181,7 +181,7 @@ func TestCommentOnColumnWhenDropColumn(t *testing.T) { t.Fatal(err) } - t.Fatal("comment remain") + t.Fatal("comment remaining in system.comments despite drop") } } diff --git a/pkg/sql/comment_on_database_test.go b/pkg/sql/comment_on_database_test.go index 9600951d8f4e..7f690d5b1d41 100644 --- a/pkg/sql/comment_on_database_test.go +++ b/pkg/sql/comment_on_database_test.go @@ -104,6 +104,6 @@ func TestCommentOnDatabaseWhenDrop(t *testing.T) { t.Fatal(err) } - t.Fatal("dropped comment remain comment") + t.Fatal("comment remaining in system.comments despite drop") } } diff --git a/pkg/sql/comment_on_schema_test.go b/pkg/sql/comment_on_schema_test.go new file mode 100644 index 000000000000..d376789d1ebd --- /dev/null +++ b/pkg/sql/comment_on_schema_test.go @@ -0,0 +1,109 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package sql_test + +import ( + "context" + gosql "database/sql" + "testing" + + "github.com/cockroachdb/cockroach/pkg/sql/tests" + "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" + "github.com/cockroachdb/cockroach/pkg/util/leaktest" + "github.com/cockroachdb/cockroach/pkg/util/log" + "github.com/cockroachdb/errors" +) + +func TestCommentOnSchema(t *testing.T) { + defer leaktest.AfterTest(t)() + defer log.Scope(t).Close(t) + + params, _ := tests.CreateTestServerParams() + s, db, _ := serverutils.StartServer(t, params) + defer s.Stopper().Stop(context.Background()) + + if _, err := db.Exec(` + CREATE SCHEMA d; + `); err != nil { + t.Fatal(err) + } + + testCases := []struct { + exec string + query string + expect gosql.NullString + }{ + { + `COMMENT ON SCHEMA d IS 'foo'`, + `SELECT obj_description(oid, 'pg_namespace') FROM pg_namespace WHERE nspname = 'd'`, + gosql.NullString{String: `foo`, Valid: true}, + }, + { + `ALTER SCHEMA d RENAME TO d2`, + `SELECT obj_description(oid, 'pg_namespace') FROM pg_namespace WHERE nspname = 'd2'`, + gosql.NullString{String: `foo`, Valid: true}, + }, + { + `COMMENT ON SCHEMA d2 IS NULL`, + `SELECT obj_description(oid, 'pg_namespace') FROM pg_namespace WHERE nspname = 'd2'`, + gosql.NullString{Valid: false}, + }, + } + + for _, tc := range testCases { + if _, err := db.Exec(tc.exec); err != nil { + t.Fatal(err) + } + + row := db.QueryRow(tc.query) + var comment gosql.NullString + if err := row.Scan(&comment); err != nil { + t.Fatal(err) + } + if tc.expect != comment { + t.Fatalf("expected comment %v, got %v", tc.expect, comment) + } + } +} + +func TestCommentOnSchemaWhenDrop(t *testing.T) { + defer leaktest.AfterTest(t)() + defer log.Scope(t).Close(t) + + params, _ := tests.CreateTestServerParams() + s, db, _ := serverutils.StartServer(t, params) + defer s.Stopper().Stop(context.Background()) + + if _, err := db.Exec(` + CREATE SCHEMA d; + `); err != nil { + t.Fatal(err) + } + + if _, err := db.Exec(`COMMENT ON SCHEMA d IS 'foo'`); err != nil { + t.Fatal(err) + } + + if _, err := db.Exec(`DROP SCHEMA d`); err != nil { + t.Fatal(err) + } + + row := db.QueryRow(`SELECT comment FROM system.comments LIMIT 1`) + var comment string + err := row.Scan(&comment) + if !errors.Is(err, gosql.ErrNoRows) { + if err != nil { + t.Fatal(err) + } + + t.Fatal("comment remaining in system.comments despite drop") + } +} diff --git a/pkg/sql/comment_on_table_test.go b/pkg/sql/comment_on_table_test.go index d418cfea9c69..6e380852e904 100644 --- a/pkg/sql/comment_on_table_test.go +++ b/pkg/sql/comment_on_table_test.go @@ -108,6 +108,6 @@ func TestCommentOnTableWhenDrop(t *testing.T) { t.Fatal(err) } - t.Fatal("dropped comment remain comment") + t.Fatal("comment remaining in system.comments despite drop") } } diff --git a/pkg/sql/sem/builtins/pg_builtins.go b/pkg/sql/sem/builtins/pg_builtins.go index cccc124495bf..8523ffd9ec01 100644 --- a/pkg/sql/sem/builtins/pg_builtins.go +++ b/pkg/sql/sem/builtins/pg_builtins.go @@ -2176,6 +2176,8 @@ func getCatalogOidForComments(catalogName string) (id int, ok bool) { return catconstants.PgCatalogDescriptionTableID, true case "pg_constraint": return catconstants.PgCatalogConstraintTableID, true + case "pg_namespace": + return catconstants.PgCatalogNamespaceTableID, true default: // We currently only support comments on pg_class objects // (columns, tables) in this context. diff --git a/pkg/util/log/eventpb/events.proto b/pkg/util/log/eventpb/events.proto index 5cd2a76d484e..13a616fdeb00 100644 --- a/pkg/util/log/eventpb/events.proto +++ b/pkg/util/log/eventpb/events.proto @@ -46,7 +46,6 @@ message CommonSQLEventDetails { // The application name for the session where the event was emitted. // This is included in the event to ease filtering of logging output // by application. - // Application names starting with a dollar sign (`$`) are not considered sensitive. string application_name = 4 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "redact:\"nonsensitive\""]; // The mapping of SQL placeholders to their values, for prepared statements. diff --git a/pkg/util/log/eventpb/json_encode_generated.go b/pkg/util/log/eventpb/json_encode_generated.go index e5ccee19e33d..46b5057e4f21 100644 --- a/pkg/util/log/eventpb/json_encode_generated.go +++ b/pkg/util/log/eventpb/json_encode_generated.go @@ -3213,6 +3213,16 @@ func (m *RecoveryEvent) AppendJSONFields(printComma bool, b redact.RedactableByt b = append(b, "\"IgnoreExistingBackup\":true"...) } + if m.ApplicationName != "" { + if printComma { + b = append(b, ',') + } + printComma = true + b = append(b, "\"ApplicationName\":\""...) + b = redact.RedactableBytes(jsonbytes.EncodeString([]byte(b), string(m.ApplicationName))) + b = append(b, '"') + } + return printComma, b } diff --git a/pkg/util/log/eventpb/telemetry.proto b/pkg/util/log/eventpb/telemetry.proto index 5355e44bb47c..13806ec1b32f 100644 --- a/pkg/util/log/eventpb/telemetry.proto +++ b/pkg/util/log/eventpb/telemetry.proto @@ -341,6 +341,8 @@ message RecoveryEvent { // created even if a backup is already present in its destination. bool ignore_existing_backup = 29 [(gogoproto.jsontag) = ",omitempty"]; + // The application name for the session where recovery event was created. + string application_name = 30 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "redact:\"nonsensitive\""]; } // SchemaDescriptor is an event for schema telemetry, whose purpose is