mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-19 20:24:46 +08:00
This fixes a bug that caused the wrong column to be referenced when scanning the partition_epoch table. The bug did not usually manifest itself because the referenced (hypertable) ID was typically incremented in unison with the desired (partition epoch) ID.
23 lines
823 B
SQL
23 lines
823 B
SQL
\ir include/create_single_db.sql
|
|
|
|
SELECT * from _timescaledb_catalog.hypertable;
|
|
SELECT * from _timescaledb_catalog.partition_epoch;
|
|
|
|
CREATE TABLE should_drop (time timestamp, temp float8);
|
|
SELECT create_hypertable('should_drop', 'time');
|
|
|
|
-- Calling create hypertable again will increment hypertable ID
|
|
-- although no new hypertable is created. Make sure we can handle this.
|
|
SELECT create_hypertable('should_drop', 'time', if_not_exists => true);
|
|
SELECT * from _timescaledb_catalog.hypertable;
|
|
SELECT * from _timescaledb_catalog.partition_epoch;
|
|
DROP TABLE should_drop;
|
|
|
|
CREATE TABLE should_drop (time timestamp, temp float8);
|
|
SELECT create_hypertable('should_drop', 'time');
|
|
|
|
INSERT INTO should_drop VALUES (now(), 1.0);
|
|
SELECT * from _timescaledb_catalog.hypertable;
|
|
SELECT * from _timescaledb_catalog.partition_epoch;
|
|
|