-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport #59606 to 24.1: Fix distributed table with a constant shardi…
…ng key
- Loading branch information
1 parent
50ce0f2
commit 4b0ad9d
Showing
3 changed files
with
33 additions
and
3 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
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,7 @@ | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 |
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,26 @@ | ||
-- Tags: distributed, no-parallel | ||
|
||
DROP DATABASE IF EXISTS shard_0; | ||
DROP DATABASE IF EXISTS shard_1; | ||
DROP TABLE IF EXISTS t_distr; | ||
|
||
CREATE DATABASE IF NOT EXISTS shard_0; | ||
CREATE DATABASE IF NOT EXISTS shard_1; | ||
|
||
CREATE TABLE shard_0.t_local (a Int) ENGINE = Memory; | ||
CREATE TABLE shard_1.t_local (a Int) ENGINE = Memory; | ||
CREATE TABLE t_distr (a Int) ENGINE = Distributed(test_cluster_two_shards_different_databases, '', 't_local', 1000); | ||
|
||
SET distributed_foreground_insert=0; | ||
INSERT INTO t_distr VALUES (1), (2), (3); | ||
|
||
SET distributed_foreground_insert=1; | ||
INSERT INTO t_distr VALUES (4), (5), (6), (7); | ||
|
||
SYSTEM FLUSH DISTRIBUTED t_distr; | ||
|
||
SELECT * FROM t_distr ORDER BY a; | ||
|
||
DROP TABLE t_distr; | ||
DROP DATABASE shard_0; | ||
DROP DATABASE shard_1; |