Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/generated/settings/settings-for-tenants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -447,4 +447,4 @@ trace.zipkin.collector string the address of a Zipkin instance to receive trace
ui.database_locality_metadata.enabled boolean true if enabled shows extended locality data about databases and tables in DB Console which can be expensive to compute application
ui.default_timezone string the default timezone used to format timestamps in the ui application
ui.display_timezone enumeration etc/utc the timezone used to format timestamps in the ui. This setting is deprecatedand will be removed in a future version. Use the 'ui.default_timezone' setting instead. 'ui.default_timezone' takes precedence over this setting. [etc/utc = 0, america/new_york = 1] application
version version 1000026.2-upgrading-to-1000026.3-step-010 set the active cluster version in the format '<major>.<minor>' application
version version 1000026.2-upgrading-to-1000026.3-step-012 set the active cluster version in the format '<major>.<minor>' application
2 changes: 1 addition & 1 deletion docs/generated/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,6 @@
<tr><td><div id="setting-ui-database-locality-metadata-enabled" class="anchored"><code>ui.database_locality_metadata.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>if enabled shows extended locality data about databases and tables in DB Console which can be expensive to compute</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
<tr><td><div id="setting-ui-default-timezone" class="anchored"><code>ui.default_timezone</code></div></td><td>string</td><td><code></code></td><td>the default timezone used to format timestamps in the ui</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
<tr><td><div id="setting-ui-display-timezone" class="anchored"><code>ui.display_timezone</code></div></td><td>enumeration</td><td><code>etc/utc</code></td><td>the timezone used to format timestamps in the ui. This setting is deprecatedand will be removed in a future version. Use the &#39;ui.default_timezone&#39; setting instead. &#39;ui.default_timezone&#39; takes precedence over this setting. [etc/utc = 0, america/new_york = 1]</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000026.2-upgrading-to-1000026.3-step-010</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000026.2-upgrading-to-1000026.3-step-012</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
</tbody>
</table>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ upsert descriptor #104
+ version: "2"
upsert descriptor #105
function:
canMutate: CANNOT_MUTATE
+ dependedOnBy:
+ - id: 104
+ triggerIds:
Expand Down Expand Up @@ -168,6 +169,7 @@ upsert descriptor #104
+ version: "2"
upsert descriptor #105
function:
canMutate: CANNOT_MUTATE
+ declarativeSchemaChangerState:
+ authorization:
+ userName: root
Expand Down Expand Up @@ -246,6 +248,7 @@ upsert descriptor #104
+ version: "3"
upsert descriptor #105
function:
canMutate: CANNOT_MUTATE
- declarativeSchemaChangerState:
- authorization:
- userName: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ upsert descriptor #104
+ version: "4"
upsert descriptor #105
function:
canMutate: CANNOT_MUTATE
- dependedOnBy:
- - id: 104
- triggerIds:
Expand Down Expand Up @@ -137,6 +138,7 @@ upsert descriptor #104
+ version: "4"
upsert descriptor #105
function:
canMutate: CANNOT_MUTATE
- dependedOnBy:
- - id: 104
- triggerIds:
Expand Down Expand Up @@ -195,6 +197,7 @@ upsert descriptor #104
+ version: "5"
upsert descriptor #105
function:
canMutate: CANNOT_MUTATE
- declarativeSchemaChangerState:
- authorization:
- userName: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ upsert descriptor #104
+ version: "4"
upsert descriptor #105
function:
canMutate: CANNOT_MUTATE
- dependedOnBy:
- - id: 104
- triggerIds:
Expand Down Expand Up @@ -114,6 +115,7 @@ upsert descriptor #104
+ version: "4"
upsert descriptor #105
function:
canMutate: CANNOT_MUTATE
- dependedOnBy:
- - id: 104
- triggerIds:
Expand Down
7 changes: 7 additions & 0 deletions pkg/clusterversion/cockroach_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ const (
// to persist per-tenant resource group configurations.
V26_3_AddResourceGroupsTable

// V26_3_FunctionDescCanMutate adds the can_mutate field to function
// descriptors, computed at CREATE FUNCTION time to indicate whether the
// routine body contains mutation statements.
V26_3_FunctionDescCanMutate

// *************************************************
// Step (1) Add new versions above this comment.
// Do not add new versions to a patch release.
Expand Down Expand Up @@ -380,6 +385,8 @@ var versionTable = [numKeys]roachpb.Version{
V26_3_AlterStatementsTablePK: {Major: 26, Minor: 2, Internal: 8},

V26_3_AddResourceGroupsTable: {Major: 26, Minor: 2, Internal: 10},

V26_3_FunctionDescCanMutate: {Major: 26, Minor: 2, Internal: 12},
// *************************************************
// Step (2): Add new versions above this comment.
// *************************************************
Expand Down
8 changes: 4 additions & 4 deletions pkg/sql/catalog/bootstrap/testdata/testdata
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# The --rewrite flag only updates output blocks, not command arguments, so
# the hash must be corrected manually first.

system hash=3ac34768496a5bfbccdfbd20fdc6e5b6560d55a3ab807403e9c6f01059e971e2
system hash=bb983c5bcb8b3142c5a9b22e89e1466a17623f569c7a4b42f154970112091904
----
[{"key":"8b"}
,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08da843d10021800200a7000"}
,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08da843d10021800200c7000"}
,{"key":"8b898b8a89","value":"030aac030a0a64657363726970746f721803200128013a0042270a02696410011a0c0801104018002a005014600020003000680070007800800100880100980100422f0a0a64657363726970746f7210021a0c0808100018002a0050116000200130006800700078008001008801009801004803527a0a077072696d61727910011801220269642a0a64657363726970746f72300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f20100f8010080020060026a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b201240a1066616d5f325f64657363726970746f7210021a0a64657363726970746f7220022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400b00400b80400"}
,{"key":"8b898c8a89","value":"030a91070a0575736572731804200128013a00422d0a08757365726e616d6510011a0c0807100018002a00501960002000300068007000780080010088010098010042330a0e68617368656450617373776f726410021a0c0808100018002a00501160002001300068007000780080010088010098010042320a066973526f6c6510031a0c0800100018002a005010600020002a0566616c73653000680070007800800100880100980100422c0a07757365725f696410041a0c080c100018002a00501a600020003000680070007800800100880100980100423f0a19657374696d617465645f6c6173745f6c6f67696e5f74696d6510051a0d0809100018002a0050a009600020013000680070007800800100880100980100480652b6010a077072696d617279100118012208757365726e616d652a0e68617368656450617373776f72642a066973526f6c652a07757365725f69642a19657374696d617465645f6c6173745f6c6f67696e5f74696d65300140004a10080010001a00200028003000380040005a0070027003700470057a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e00100e9010000000000000000f20100f801008002005a7d0a1175736572735f757365725f69645f696478100218012207757365725f69643004380140004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f20100f8010080020060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201240a077072696d61727910001a08757365726e616d651a07757365725f6964200120042804b2012c0a1466616d5f325f68617368656450617373776f726410021a0e68617368656450617373776f726420022802b2011c0a0c66616d5f335f6973526f6c6510031a066973526f6c6520032803b201420a1f66616d5f355f657374696d617465645f6c6173745f6c6f67696e5f74696d6510051a19657374696d617465645f6c6173745f6c6f67696e5f74696d6520052805b80106c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300d00300d80300e00300f80300880400980400a00400a80400b00400b80400"}
,{"key":"8b898d8a89","value":"030a9b030a057a6f6e65731805200128013a0042270a02696410011a0c0801104018002a005014600020003000680070007800800100880100980100422b0a06636f6e66696710021a0c0808100018002a005011600020013000680070007800800100880100980100480352760a077072696d61727910011801220269642a06636f6e666967300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f20100f8010080020060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b2011c0a0c66616d5f325f636f6e66696710021a06636f6e66696720022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400b00400b80400"}
Expand Down Expand Up @@ -251,10 +251,10 @@ system hash=3ac34768496a5bfbccdfbd20fdc6e5b6560d55a3ab807403e9c6f01059e971e2
,{"key":"da898888","value":"0120"}
]

tenant hash=4e47b77f3ef655a61c1cc468ba6eb30b9da4cc0c2539b2e9bf0f625316390ebd
tenant hash=6af446ad5d05545c395b80c7764b40c0a5a75928f22b43441aff42ab960ac301
----
[{"key":""}
,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08da843d10021800200a7000"}
,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08da843d10021800200c7000"}
,{"key":"8b898b8a89","value":"030aac030a0a64657363726970746f721803200128013a0042270a02696410011a0c0801104018002a005014600020003000680070007800800100880100980100422f0a0a64657363726970746f7210021a0c0808100018002a0050116000200130006800700078008001008801009801004803527a0a077072696d61727910011801220269642a0a64657363726970746f72300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f20100f8010080020060026a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b201240a1066616d5f325f64657363726970746f7210021a0a64657363726970746f7220022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400b00400b80400"}
,{"key":"8b898c8a89","value":"030a91070a0575736572731804200128013a00422d0a08757365726e616d6510011a0c0807100018002a00501960002000300068007000780080010088010098010042330a0e68617368656450617373776f726410021a0c0808100018002a00501160002001300068007000780080010088010098010042320a066973526f6c6510031a0c0800100018002a005010600020002a0566616c73653000680070007800800100880100980100422c0a07757365725f696410041a0c080c100018002a00501a600020003000680070007800800100880100980100423f0a19657374696d617465645f6c6173745f6c6f67696e5f74696d6510051a0d0809100018002a0050a009600020013000680070007800800100880100980100480652b6010a077072696d617279100118012208757365726e616d652a0e68617368656450617373776f72642a066973526f6c652a07757365725f69642a19657374696d617465645f6c6173745f6c6f67696e5f74696d65300140004a10080010001a00200028003000380040005a0070027003700470057a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e00100e9010000000000000000f20100f801008002005a7d0a1175736572735f757365725f69645f696478100218012207757365725f69643004380140004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f20100f8010080020060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201240a077072696d61727910001a08757365726e616d651a07757365725f6964200120042804b2012c0a1466616d5f325f68617368656450617373776f726410021a0e68617368656450617373776f726420022802b2011c0a0c66616d5f335f6973526f6c6510031a066973526f6c6520032803b201420a1f66616d5f355f657374696d617465645f6c6173745f6c6f67696e5f74696d6510051a19657374696d617465645f6c6173745f6c6f67696e5f74696d6520052805b80106c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300d00300d80300e00300f80300880400980400a00400a80400b00400b80400"}
,{"key":"8b898d8a89","value":"030a9b030a057a6f6e65731805200128013a0042270a02696410011a0c0801104018002a005014600020003000680070007800800100880100980100422b0a06636f6e66696710021a0c0808100018002a005011600020013000680070007800800100880100980100480352760a077072696d61727910011801220269642a06636f6e666967300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f20100f8010080020060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b2011c0a0c66616d5f325f636f6e66696710021a06636f6e66696720022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400b00400b80400"}
Expand Down
6 changes: 6 additions & 0 deletions pkg/sql/catalog/catpb/function.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ message Function {
INVOKER = 0;
DEFINER = 1;
}

enum CanMutate {
UNKNOWN_CAN_MUTATE = 0;
CAN_MUTATE = 1;
CANNOT_MUTATE = 2;
}
}

// These wrappers are for the convenience of referencing the enum types from a
Expand Down
17 changes: 16 additions & 1 deletion pkg/sql/catalog/descpb/structured.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,22 @@ message FunctionDescriptor {
optional uint32 replicated_pcr_version = 24 [(gogoproto.nullable) = false,
(gogoproto.customname) = "ReplicatedPCRVersion", (gogoproto.casttype) = "DescriptorVersion"];

// Next field id is 25
// CanMutate indicates whether the routine body can perform mutations.
// This includes direct DML statements (INSERT, UPDATE, DELETE, UPSERT),
// mutations inside CTEs or subqueries, and calls to other routines that
// themselves can mutate. It is computed at CREATE FUNCTION time by
// inspecting the CanMutate logical property of the built body
// statements, and persisted so that it is available at execution time
// without needing to build the routine body.
//
// UNKNOWN_CAN_MUTATE (the zero value) indicates that the mutation status
// has not been determined. This is the case for function descriptors
// created before this field was introduced. When unknown, consumers must
// fall back to inspecting the body RelExprs to determine whether the
// routine can mutate.
optional cockroach.sql.catalog.catpb.Function.CanMutate can_mutate = 25 [(gogoproto.nullable) = false];

// Next field id is 26
}

// Descriptor is a union type for descriptors for tables, schemas, databases,
Expand Down
Loading
Loading