-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathmetadata
42 lines (36 loc) · 1.08 KB
/
metadata
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
new-cluster name=s
----
# Make sure that the presence of forecasted stats doesn't break
# metadata SST writing. This is a regression test for #86806.
#
# We create 3 statistics manually which is the minimum needed to
# create a forecast. Automatic collection is disabled to avoid
# flakiness.
exec-sql
SET CLUSTER SETTING kv.bulkio.write_metadata_sst.enabled = true;
----
exec-sql
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
----
exec-sql
CREATE DATABASE db1;
USE db1;
CREATE TABLE tab (a INT PRIMARY KEY, b INT);
----
exec-sql
CREATE STATISTICS __auto__ ON a FROM tab;
CREATE STATISTICS __auto__ ON b FROM tab;
CREATE STATISTICS __auto__ ON a FROM tab;
CREATE STATISTICS __auto__ ON b FROM tab;
CREATE STATISTICS __auto__ ON a FROM tab;
CREATE STATISTICS __auto__ ON b FROM tab;
----
# The previous bug occurs when there are two or more forecasts since
# forecasts do not hava a statistics ID.
query-sql
SELECT COUNT(1) FROM [ SHOW STATISTICS FOR TABLE tab WITH FORECAST ] WHERE statistics_name = '__forecast__'
----
2
exec-sql
BACKUP DATABASE db1 INTO 'nodelocal://0/test/'
----