-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
120674: sql: allow procedures to call other procedures r=mgartner a=mgartner #### sql/logictest: add more tests for UDFs calling UDFs This commit rearranges some existing tests and adds a few new tests for UDFs that invoke other UDFs. Release note: None #### sql: allow procedures to call other procedures Fixes #88198 Release note (sql change): Stored procedures can now invoke other stored procedures via `CALL` statements. 120767: go.mod: bump Pebble to 7b8b3d5a8211 r=RaduBerinde a=jbowens Changes: * [`7b8b3d5a`](cockroachdb/pebble@7b8b3d5a) *,sstable: upgrade zstd to v1.5.6 * [`3a7021c5`](cockroachdb/pebble@3a7021c5) db: reuse backings for external ingestions This commit bumps the zstd dependency as well, working around #105568 by disabling the assembly routines for now. Informs #105568. Release note: none. Epic: none. 120776: cli: add support for remote files in debug range-data r=RaduBerinde a=itsbilal Previously, if a Checkpoint was created due to a storage-level replica corruption, we wouldn't be able to read the checkpoint if it contained any remote (shared or external) files as the pebble instance opened with `debug range-data` would not be started with the relevant RemoteStorageFactory. This change adds the same SharedStorage/RemoteStorageFactory params as the usual Pebble start in pkg/server/config.go, so that these checkpoints can be opened. Fixes #119960. Epic: None. Release note: None Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: Jackson Owens <[email protected]> Co-authored-by: Bilal Akhtar <[email protected]>
- Loading branch information
Showing
21 changed files
with
291 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1693,10 +1693,10 @@ def go_deps(): | |
patches = [ | ||
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch", | ||
], | ||
sha256 = "cb1e1504fc2d8548b1dbae787425fa923dfd87310733ddc3e1d99b42b2b42482", | ||
strip_prefix = "github.com/cockroachdb/[email protected]20240319202935-9d0109cfee7a", | ||
sha256 = "e258498e380ea2266386054a1277c98dc58f58bbe5df29f5f91d3c163a9e5231", | ||
strip_prefix = "github.com/cockroachdb/[email protected]20240320172852-7b8b3d5a8211", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20240319202935-9d0109cfee7a.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20240320172852-7b8b3d5a8211.zip", | ||
], | ||
) | ||
go_repository( | ||
|
@@ -2233,10 +2233,14 @@ def go_deps(): | |
name = "com_github_datadog_zstd", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/DataDog/zstd", | ||
sha256 = "00989c1f3f3426aa6ed41f641193ff6a0d81031ba0b7fd81250e7e923d2f18a4", | ||
strip_prefix = "github.com/DataDog/[email protected]", | ||
patch_args = ["-p1"], | ||
patches = [ | ||
"@com_github_cockroachdb_cockroach//build/patches:com_github_datadog_zstd.patch", | ||
], | ||
sha256 = "e4924158bd1abf765a016d2c728fc367b32d20b86a268ef25743ba404c55e097", | ||
strip_prefix = "github.com/DataDog/[email protected]", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/DataDog/zstd/com_github_datadog_zstd-v1.5.0.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/DataDog/zstd/com_github_datadog_zstd-v1.5.6-0.20230824185856-869dae002e5e.zip", | ||
], | ||
) | ||
go_repository( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -urN a/BUILD.bazel b/BUILD.bazel | ||
--- a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500 | ||
+++ b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 | ||
@@ -98,7 +98,7 @@ | ||
"zstdmt_compress.h", | ||
], | ||
cgo = True, | ||
- copts = ["-DZSTD_LEGACY_SUPPORT=4 -DZSTD_MULTITHREAD=1"], | ||
+ copts = ["-DZSTD_LEGACY_SUPPORT=4 -DZSTD_MULTITHREAD=1 -DZSTD_DISABLE_ASM=1"], | ||
importpath = "github.com/DataDog/zstd", | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# LogicTest: !local-mixed-23.1 !local-mixed-23.2 | ||
|
||
statement ok | ||
CREATE PROCEDURE a() LANGUAGE SQL AS $$ | ||
SELECT 1; | ||
$$ | ||
|
||
statement ok | ||
CREATE PROCEDURE b() LANGUAGE SQL AS $$ | ||
CALL a(); | ||
$$ | ||
|
||
# Mutual recursion is not currently allowed. | ||
statement error pgcode 42P13 cannot add dependency from descriptor \d+ to function b \(\d+\) because there will be a dependency cycle | ||
CREATE OR REPLACE PROCEDURE a() LANGUAGE SQL AS $$ | ||
CALL b(); | ||
$$ | ||
|
||
statement error pgcode 2BP01 cannot drop function \"a\" because other objects \(\[test.public.b\]\) still depend on it | ||
DROP PROCEDURE a | ||
|
||
statement ok | ||
DROP PROCEDURE b; | ||
DROP PROCEDURE a; | ||
|
||
statement ok | ||
CREATE TYPE e AS ENUM ('foo', 'bar'); | ||
|
||
statement ok | ||
CREATE PROCEDURE a() LANGUAGE SQL AS $$ | ||
SELECT 'foo'::e; | ||
$$ | ||
|
||
statement ok | ||
CREATE PROCEDURE b() LANGUAGE SQL AS $$ | ||
CALL a(); | ||
$$ | ||
|
||
statement error pgcode 2BP01 cannot drop type \"e\" because other objects \(\[test.public.a\]\) still depend on it | ||
DROP TYPE e | ||
|
||
statement ok | ||
DROP PROCEDURE b; | ||
DROP PROCEDURE a; | ||
DROP TYPE e; | ||
|
||
statement ok | ||
CREATE TABLE ab ( | ||
a INT PRIMARY KEY, | ||
b INT | ||
) | ||
|
||
statement ok | ||
CREATE PROCEDURE ins_ab(new_a INT, new_b INT) LANGUAGE SQL AS $$ | ||
INSERT INTO ab VALUES (new_a, new_b); | ||
$$ | ||
|
||
statement ok | ||
CREATE PROCEDURE ins3() LANGUAGE SQL AS $$ | ||
CALL ins_ab(1, 10); | ||
CALL ins_ab(2, 20); | ||
CALL ins_ab(3, 30); | ||
$$ | ||
|
||
statement ok | ||
CALL ins_ab(4, 40) | ||
|
||
statement ok | ||
CALL ins3() | ||
|
||
statement error pgcode 23505 duplicate key value violates unique constraint \"ab_pkey\" | ||
CALL ins3() | ||
|
||
query II rowsort | ||
SELECT * FROM ab | ||
---- | ||
1 10 | ||
2 20 | ||
3 30 | ||
4 40 | ||
|
||
# TODO(#102771): Add dependency tracking that causes this to error. | ||
# statement error pgcode 2BP01 cannot drop table ab because other objects depend on it | ||
# DROP TABLE ab; | ||
|
||
statement error pgcode 2BP01 cannot drop function \"ins_ab\" because other objects \(\[test.public.ins3\]\) still depend on it | ||
DROP PROCEDURE ins_ab | ||
|
||
statement ok | ||
DROP PROCEDURE ins3; | ||
DROP PROCEDURE ins_ab; | ||
DROP TABLE ab; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.