should be it
This commit is contained in:
79
external/duckdb/test/sql/index/art/issues/test_art_fuzzer.test
vendored
Normal file
79
external/duckdb/test/sql/index/art/issues/test_art_fuzzer.test
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# name: test/sql/index/art/issues/test_art_fuzzer.test
|
||||
# description: Test different ART fuzzer issues
|
||||
# group: [issues]
|
||||
|
||||
# issue 5984, number 21
|
||||
statement ok
|
||||
CREATE TABLE t1 (c1 DECIMAL(4, 3));
|
||||
|
||||
statement ok
|
||||
INSERT INTO t1(c1) VALUES (1), (-0.505);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i1 ON t1 (TRY_CAST(c1 AS USMALLINT));
|
||||
|
||||
statement ok
|
||||
INSERT INTO t1(c1) VALUES (2), (3);
|
||||
|
||||
# issue 5984, number 22
|
||||
statement ok
|
||||
CREATE TABLE t2 (c1 VARCHAR);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i2 ON t2 (c1);
|
||||
|
||||
statement ok
|
||||
INSERT INTO t2 VALUES (decode('g\x00'::BLOB)::VARCHAR),('g');
|
||||
|
||||
statement ok
|
||||
INSERT INTO t2 VALUES ('\0');
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i22 ON t2 (c1);
|
||||
|
||||
# issue 5984, number 32
|
||||
|
||||
statement ok
|
||||
CREATE TABLE t3(c1 INT);
|
||||
|
||||
statement ok
|
||||
INSERT INTO t3 VALUES (0), (85491);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i3 ON t3 (c1, (TRY_CAST(c1 AS USMALLINT)));
|
||||
|
||||
# issue 5984, number 44
|
||||
|
||||
statement ok
|
||||
CREATE TABLE t4 (c1 BOOLEAN);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i4 ON t4 (c1);
|
||||
|
||||
statement ok
|
||||
INSERT INTO t4 VALUES (1), (0), (1), (1);
|
||||
|
||||
statement ok
|
||||
UPDATE t4 SET c1 = NULL;
|
||||
|
||||
# issue 5984, number 19
|
||||
statement ok
|
||||
CREATE TABLE t_leak (c1 INT);
|
||||
|
||||
statement ok
|
||||
INSERT INTO t_leak VALUES (2), (1), (1), (540000);
|
||||
|
||||
statement error
|
||||
CREATE UNIQUE INDEX i_leak ON t_leak (c1);
|
||||
----
|
||||
Constraint Error: Data contains duplicates on indexed column(s)
|
||||
|
||||
# issue 5984, number 22
|
||||
statement ok
|
||||
CREATE TABLE t21 (c1 INT);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i21 ON t21 (c1, "decode"('\x00'::BLOB));
|
||||
|
||||
statement ok
|
||||
INSERT INTO t21 VALUES (1);
|
||||
23
external/duckdb/test/sql/index/art/issues/test_art_fuzzer_persisted.test
vendored
Normal file
23
external/duckdb/test/sql/index/art/issues/test_art_fuzzer_persisted.test
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# name: test/sql/index/art/issues/test_art_fuzzer_persisted.test
|
||||
# description: Test ART fuzzer issue with persisted database
|
||||
# group: [issues]
|
||||
|
||||
# issue 5984, number 41
|
||||
|
||||
# load the DB from disk
|
||||
load __TEST_DIR__/create_idx.db
|
||||
|
||||
statement ok
|
||||
CREATE TABLE t1 AS (SELECT 1 c1, 'a' c2);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i1 ON t1 (c1);
|
||||
|
||||
statement ok
|
||||
PRAGMA MEMORY_LIMIT='4MB';
|
||||
|
||||
statement ok
|
||||
CHECKPOINT;
|
||||
|
||||
statement ok
|
||||
INSERT INTO t1(c2) (SELECT DISTINCT 'b');
|
||||
70
external/duckdb/test/sql/index/art/issues/test_art_internal_issue_4742.test
vendored
Normal file
70
external/duckdb/test/sql/index/art/issues/test_art_internal_issue_4742.test
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# name: test/sql/index/art/issues/test_art_internal_issue_4742.test
|
||||
# description: Test that Index Scan is triggered even when there is a nested conjunction filter on the index column
|
||||
# group: [issues]
|
||||
|
||||
# needs this vector size otherwise the sample is somehow not repeatable
|
||||
require vector_size 2048
|
||||
|
||||
statement ok
|
||||
create or replace table test as select 9223372036854776 + range * 9223372036854776 i from range(100);
|
||||
|
||||
statement ok
|
||||
create index my_index on test(i);
|
||||
|
||||
# this already worked properly, uses an index scan
|
||||
query II
|
||||
explain analyze select i from test SEMI JOIN (select i from test using sample reservoir(10) repeatable (42)) USING (i);
|
||||
----
|
||||
analyzed_plan <REGEX>:.*Index Scan.*
|
||||
|
||||
# should return exactly 10 values, as we join with a sample of size 10 of itself
|
||||
query I
|
||||
select count(*) from test SEMI JOIN (select i from test using sample reservoir(10) repeatable (42)) USING (i);
|
||||
----
|
||||
10
|
||||
|
||||
# given the seed, the return values should be stable
|
||||
query I
|
||||
select i from test SEMI JOIN (select i from test using sample reservoir(10) repeatable (42)) USING (i) order by all;
|
||||
----
|
||||
36893488147419104
|
||||
138350580552821640
|
||||
184467440737095520
|
||||
249031044995078952
|
||||
295147905179352832
|
||||
433498485732174472
|
||||
682529530727253424
|
||||
700976274800962976
|
||||
839326855353784616
|
||||
903890459611768048
|
||||
|
||||
# this did not work properly before the fix: doing the same join with a table
|
||||
statement ok
|
||||
create or replace table sample as select i from test using sample reservoir(10) repeatable (42);
|
||||
|
||||
# should also use an index scan now
|
||||
query II
|
||||
explain analyze select i from test SEMI JOIN sample USING (i);
|
||||
----
|
||||
analyzed_plan <REGEX>:.*Index Scan.*
|
||||
|
||||
# again should be 10 values
|
||||
query I
|
||||
select count(*) from test SEMI JOIN sample USING (i);
|
||||
----
|
||||
10
|
||||
|
||||
# values should be exactly the same as before
|
||||
query I
|
||||
select i from test SEMI JOIN sample USING (i) order by all;
|
||||
----
|
||||
36893488147419104
|
||||
138350580552821640
|
||||
184467440737095520
|
||||
249031044995078952
|
||||
295147905179352832
|
||||
433498485732174472
|
||||
682529530727253424
|
||||
700976274800962976
|
||||
839326855353784616
|
||||
903890459611768048
|
||||
15
external/duckdb/test/sql/index/art/issues/test_art_issue_4976.test
vendored
Normal file
15
external/duckdb/test/sql/index/art/issues/test_art_issue_4976.test
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# name: test/sql/index/art/issues/test_art_issue_4976.test
|
||||
# description: Test CREATE INDEX on default timestamp column
|
||||
# group: [issues]
|
||||
|
||||
statement ok
|
||||
CREATE TABLE t0(c0 DOUBLE, c1 TIMESTAMP DEFAULT(TIMESTAMP '1970-01-04 12:58:32'));
|
||||
|
||||
statement ok
|
||||
INSERT INTO t0(c1, c0) VALUES (TIMESTAMP '1969-12-28 23:02:08', 1);
|
||||
|
||||
statement ok
|
||||
INSERT INTO t0(c0) VALUES (DEFAULT);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i2 ON t0(c1, c0);
|
||||
44
external/duckdb/test/sql/index/art/issues/test_art_issue_6603.test
vendored
Normal file
44
external/duckdb/test/sql/index/art/issues/test_art_issue_6603.test
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# name: test/sql/index/art/issues/test_art_issue_6603.test
|
||||
# description: Test index join issue 6603
|
||||
# group: [issues]
|
||||
|
||||
statement ok
|
||||
BEGIN;
|
||||
|
||||
statement ok
|
||||
CREATE TABLE path (
|
||||
it INTEGER,
|
||||
x0 TEXT NOT NULL,
|
||||
x1 TEXT NOT NULL
|
||||
);
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE seq;
|
||||
|
||||
statement ok
|
||||
CREATE TABLE edge (
|
||||
id INTEGER DEFAULT nextval('seq'),
|
||||
it INTEGER DEFAULT 0,
|
||||
x0 TEXT,
|
||||
x1 TEXT
|
||||
);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX edge1_idx ON edge (x1);
|
||||
|
||||
statement ok
|
||||
INSERT INTO edge (x0, x1) VALUES ('n2880','n3966');
|
||||
|
||||
statement ok
|
||||
COMMIT;
|
||||
|
||||
statement ok
|
||||
BEGIN;
|
||||
|
||||
statement ok
|
||||
INSERT INTO path SELECT 1, y0, y1 FROM (SELECT DISTINCT edge0.x0 AS y0, edge0.x1 AS y1 FROM edge AS edge0 WHERE edge0.it = 0 AND true AND NOT EXISTS (SELECT * from path AS pre WHERE pre.x0 = edge0.x0 AND pre.x1 = edge0.x1));
|
||||
|
||||
query III
|
||||
SELECT 1, y0, y1 FROM (SELECT DISTINCT edge0.x0 AS y0, path1.x1 AS y1 FROM edge AS edge0,path AS path1 WHERE edge0.it = 0 AND edge0.x1 = path1.x0 AND NOT EXISTS (SELECT * from path AS pre WHERE pre.x0 = edge0.x0 AND pre.x1 = path1.x1));
|
||||
----
|
||||
|
||||
29
external/duckdb/test/sql/index/art/issues/test_art_issue_6799.test
vendored
Normal file
29
external/duckdb/test/sql/index/art/issues/test_art_issue_6799.test
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# name: test/sql/index/art/issues/test_art_issue_6799.test
|
||||
# description: Test index join issue 6799
|
||||
# group: [issues]
|
||||
|
||||
statement ok
|
||||
CREATE TABLE key_value_pairs (key VARCHAR PRIMARY KEY, value VARCHAR)
|
||||
|
||||
statement ok
|
||||
INSERT INTO key_value_pairs
|
||||
SELECT concat('key_', i::VARCHAR), concat('value_', i::VARCHAR)
|
||||
FROM range(10000) t(i)
|
||||
WHERE random() < 0.5
|
||||
|
||||
statement ok
|
||||
CREATE TABLE keys_to_lookup (key VARCHAR PRIMARY KEY)
|
||||
|
||||
statement ok
|
||||
INSERT INTO keys_to_lookup
|
||||
SELECT concat('key_', i::VARCHAR)
|
||||
FROM range(100) t(i)
|
||||
|
||||
statement ok
|
||||
SELECT COUNT(*) FROM
|
||||
(
|
||||
SELECT key, value
|
||||
FROM
|
||||
keys_to_lookup
|
||||
JOIN key_value_pairs USING(key)
|
||||
)
|
||||
80
external/duckdb/test/sql/index/art/issues/test_art_issue_7349.test
vendored
Normal file
80
external/duckdb/test/sql/index/art/issues/test_art_issue_7349.test
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
# name: test/sql/index/art/issues/test_art_issue_7349.test
|
||||
# description: Test ensuring that we do not rollback twice when throwing an exception during commit
|
||||
# group: [issues]
|
||||
|
||||
# setting up the different tables and the UNIQUE index
|
||||
|
||||
statement ok
|
||||
CREATE TABLE td(tz VARCHAR(30) NOT NULL);
|
||||
|
||||
statement ok
|
||||
CREATE UNIQUE INDEX sqlsim0 ON td(tz);
|
||||
|
||||
statement ok
|
||||
CREATE TABLE tab0(c2 DATE NOT NULL);
|
||||
|
||||
statement ok
|
||||
CREATE TABLE tab1(c2 DATE NOT NULL);
|
||||
|
||||
statement ok
|
||||
INSERT INTO td VALUES (date '2008-02-29');
|
||||
|
||||
# testing different orders of appending values
|
||||
|
||||
# interleaved (original issue example)
|
||||
|
||||
statement ok
|
||||
START TRANSACTION;
|
||||
|
||||
statement ok
|
||||
INSERT INTO td VALUES('2006-12-25');
|
||||
|
||||
statement ok
|
||||
INSERT INTO tab0 VALUES('2006-12-25');
|
||||
|
||||
statement error
|
||||
INSERT INTO td VALUES (date '2008-02-29');
|
||||
----
|
||||
<REGEX>:Constraint Error.*violates unique constraint.*
|
||||
|
||||
statement ok
|
||||
COMMIT TRANSACTION;
|
||||
|
||||
# three tables
|
||||
|
||||
statement ok
|
||||
START TRANSACTION;
|
||||
|
||||
statement ok
|
||||
INSERT INTO tab0 VALUES('2006-12-25');
|
||||
|
||||
statement error
|
||||
INSERT INTO td VALUES (date '2008-02-29');
|
||||
----
|
||||
<REGEX>:Constraint Error.*violates unique constraint.*
|
||||
|
||||
statement ok
|
||||
COMMIT TRANSACTION;
|
||||
|
||||
statement ok
|
||||
INSERT INTO tab1 VALUES('2006-12-25');
|
||||
|
||||
# other table first
|
||||
|
||||
statement ok
|
||||
START TRANSACTION;
|
||||
|
||||
statement ok
|
||||
INSERT INTO tab0 VALUES('2006-12-25');
|
||||
|
||||
statement ok
|
||||
INSERT INTO td VALUES('2006-12-25');
|
||||
|
||||
statement ok
|
||||
COMMIT TRANSACTION;
|
||||
|
||||
query I
|
||||
SELECT tz FROM td ORDER BY tz;
|
||||
----
|
||||
2006-12-25
|
||||
2008-02-29
|
||||
15
external/duckdb/test/sql/index/art/issues/test_art_issue_7530.test
vendored
Normal file
15
external/duckdb/test/sql/index/art/issues/test_art_issue_7530.test
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# name: test/sql/index/art/issues/test_art_issue_7530.test
|
||||
# description: Test to ensure correct multi-value leaf deletions
|
||||
# group: [issues]
|
||||
|
||||
statement ok
|
||||
CREATE TABLE t14(c0 BIGINT);
|
||||
|
||||
statement ok
|
||||
INSERT INTO t14(c0) VALUES ((1)), ((1)), ((1));
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i1 ON t14(c0 );
|
||||
|
||||
statement ok
|
||||
DELETE FROM t14 WHERE t14.rowid;
|
||||
13
external/duckdb/test/sql/index/art/issues/test_art_issue_8066.test_slow
vendored
Normal file
13
external/duckdb/test/sql/index/art/issues/test_art_issue_8066.test_slow
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# name: test/sql/index/art/issues/test_art_issue_8066.test_slow
|
||||
# description: Test CREATE INDEX on a lot of duplicate values with a persistent DB
|
||||
# group: [issues]
|
||||
|
||||
load __TEST_DIR__/test_index.db
|
||||
|
||||
statement ok
|
||||
CREATE TABLE t AS SELECT now() AS d FROM generate_series(1, 218165);
|
||||
|
||||
statement ok
|
||||
CREATE INDEX i ON t(d);
|
||||
|
||||
restart
|
||||
48
external/duckdb/test/sql/index/art/issues/test_art_view_col_binding.test
vendored
Normal file
48
external/duckdb/test/sql/index/art/issues/test_art_view_col_binding.test
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
# name: test/sql/index/art/issues/test_art_view_col_binding.test
|
||||
# description: Test Index Scan push down against views with reordered projections (issue #17290)
|
||||
# group: [issues]
|
||||
|
||||
statement ok
|
||||
create or replace table test as (
|
||||
select
|
||||
cast(unnest(range(1000)) as varchar) as x,
|
||||
cast(unnest(range(2000,3000)) as varchar) as y,
|
||||
cast(unnest(range(3000,4000)) as varchar) as z
|
||||
);
|
||||
|
||||
# test simple permutation of initial table projection
|
||||
statement ok
|
||||
create index test_x on test(x);
|
||||
|
||||
statement ok
|
||||
create view test_view as (select z, y, x from test);
|
||||
|
||||
query II
|
||||
explain analyze select * from test_view where x = '525';
|
||||
----
|
||||
analyzed_plan <REGEX>:.*Index Scan.*
|
||||
|
||||
query III
|
||||
select z, y, x from test_view where x = '525';
|
||||
----
|
||||
3525 2525 525
|
||||
|
||||
statement ok
|
||||
drop index test_x;
|
||||
|
||||
# test columnref as a child of function
|
||||
statement ok
|
||||
create index test_upper_x on test(upper(x));
|
||||
|
||||
query II
|
||||
explain analyze select * from test_view where upper(x) = '526';
|
||||
----
|
||||
analyzed_plan <REGEX>:.*Index Scan.*
|
||||
|
||||
query III
|
||||
select z, y, x from test_view where upper(x) = '526';
|
||||
----
|
||||
3526 2526 526
|
||||
|
||||
statement ok
|
||||
drop index test_upper_x;
|
||||
Reference in New Issue
Block a user