dolthub / doltgresql

DoltgreSQL - Version Controlled PostgreSQL
Apache License 2.0
1.12k stars 25 forks source link

support multi-alter statements #919

Closed jycor closed 2 weeks ago

jycor commented 2 weeks ago

We support multi alter statements, so we shouldn't error.

github-actions[bot] commented 2 weeks ago
Main PR
Total 42090 42090
Successful 13813 13845
Failures 28277 28245
Partial Successes[^1] 4785 4781
Main PR
Successful 32.8178% 32.8938%
Failures 67.1822% 67.1062%

${\color{lightgreen}Progressions}$

alter_table

QUERY: alter table atacc1
  add column b float8 not null default random(),
  add primary key(a);
QUERY: alter table atacc1 alter test_a drop not null, alter test_b drop not null;
QUERY: alter table anothertab
  alter column f2 type bigint,
  alter column f3 type bigint,
  alter column f4 type bigint;
QUERY: ALTER TABLE ataddindex
  ADD UNIQUE (id),
  ADD FOREIGN KEY (ref_id) REFERENCES ataddindex (id);

create_table

QUERY: ALTER TABLE parted DROP CONSTRAINT check_a, DROP CONSTRAINT check_b;

event_trigger

QUERY: alter table rewriteme
 add column onemore int default 0,
 add column another int default -1,
 alter column foo type numeric(10,4);

fast_default

QUERY: ALTER TABLE T ALTER COLUMN c_text SET DEFAULT 'world',
              ALTER COLUMN c_int  SET DEFAULT 1;

foreign_key

QUERY: ALTER TABLE fk_notpartitioned_pk DROP COLUMN fdrop1, DROP COLUMN fdrop2;
QUERY: ALTER TABLE fk_partitioned_fk_1 DROP COLUMN fdrop1, DROP COLUMN fdrop2, DROP COLUMN fdrop3;
QUERY: ALTER TABLE fk_partitioned_fk_2 DROP COLUMN fdrop1, DROP COLUMN fdrop2;
QUERY: ALTER TABLE fk_partitioned_fk_3 DROP COLUMN fdrop1, DROP COLUMN fdrop2,
    DROP COLUMN fdrop3, DROP COLUMN fdrop4;
QUERY: INSERT INTO fk_notpartitioned_pk VALUES (500, 501), (1500, 1501),
  (2500, 2502), (2501, 2503);
QUERY: ALTER TABLE pk5 DROP COLUMN b, DROP COLUMN c;

indexing

QUERY: alter table idxpart drop column col1, drop column col2;
QUERY: alter table idxpart drop column col1, drop column col2;
QUERY: alter table idxpart drop column col1, drop column col3;

insert

QUERY: alter table mlparted add d int, add e int;
QUERY: alter table mlparted drop e;
QUERY: insert into mlparted values (1, 2, 'a', 1);
QUERY: insert into mlparted values (1, 40, 'a', 1);
QUERY: insert into mlparted values (1, 45, 'b', 1);
QUERY: alter table mlparted drop d;
QUERY: alter table mlparted add e int, add d int;
QUERY: alter table mlparted drop e;
QUERY: insert into mlparted values (1, 2, 'a', 1);
QUERY: insert into mlparted values (1, 40, 'a', 1);
QUERY: insert into mlparted values (1, 45, 'b', 1);
QUERY: alter table mlparted drop d;

insert_conflict

QUERY: alter table dropcol drop column drop1, drop column drop2;

tablespace

QUERY: ALTER TABLE testschema.test_tab ALTER b TYPE bigint, ADD UNIQUE (c);

triggers

QUERY: alter table parted_irreg_ancestor drop column fd,
  drop column fd2, drop column fd3;
QUERY: alter table parted_irreg drop column fd, drop column fd2;
QUERY: insert into parted_irreg values (1, 'aardvark'), (2, 'aanimals');
QUERY: insert into parted_irreg_ancestor values ('aasvogel', 3);

[^1]: These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.