提交 d97dfc1e 编写于 作者: A Ashwin Agrawal 提交者: Xin Zhang

Remove tests for cross check between gp_relation_node and pg_aoseg

Since now gp_relation_node table no more exists, no point testing if ERROR is
reported if pg_aoseg and gp_relation_node are not in sync.
上级 629b7b3f
set allow_system_table_mods='DML';
SET
--pgaocsseg has more entries than gp_relation_node
begin;
BEGIN
insert into pg_aoseg.pg_aocsseg_17608 values(5, 6, 7, '0'::bytea, 1, 1, 1);
INSERT 0 1
select * from co1;
psql:/path/sql_file:1: ERROR: Index 0 exceed size of vpinfo array size 0 (aocssegfiles.h:116)
abort;
ROLLBACK
--pgaocsseg has less entries than gp_relation_node
begin;
BEGIN
delete from pg_aoseg.pg_aocsseg_17608;
DELETE 1
select * from co1;
psql:/path/sql_file:1: ERROR: gp_relation_node (2) has more entries than pg_aocsseg (0) for relation co1 (aocssegfiles.c:1860)
abort;
ROLLBACK
--pgaocsseg has same number of entries but mistmatch with gp_relation_node
begin;
BEGIN
update pg_aoseg.pg_aocsseg_17608 set segno = 3 where segno = 1;
UPDATE 1
select * from co1;
psql:/path/sql_file:1: ERROR: Missing gp_relation_node entry 1 in pg_aocsseg for relation co1 (aocssegfiles.c:1882)
abort;
ROLLBACK
select * from co1; --Make sure we can still select from co1
a | b
------+------
1 | 1
3 | 3
5 | 5
7 | 7
9 | 9
11 | 11
13 | 13
15 | 15
17 | 17
19 | 19
21 | 21
23 | 23
25 | 25
27 | 27
29 | 29
31 | 31
33 | 33
35 | 35
37 | 37
39 | 39
41 | 41
43 | 43
45 | 45
47 | 47
49 | 49
51 | 51
53 | 53
55 | 55
57 | 57
59 | 59
61 | 61
63 | 63
65 | 65
67 | 67
69 | 69
71 | 71
73 | 73
75 | 75
77 | 77
79 | 79
81 | 81
83 | 83
85 | 85
87 | 87
89 | 89
91 | 91
93 | 93
95 | 95
97 | 97
99 | 99
101 | 101
103 | 103
105 | 105
107 | 107
109 | 109
111 | 111
113 | 113
115 | 115
117 | 117
119 | 119
121 | 121
123 | 123
125 | 125
127 | 127
129 | 129
131 | 131
133 | 133
135 | 135
137 | 137
139 | 139
141 | 141
143 | 143
145 | 145
147 | 147
149 | 149
151 | 151
153 | 153
155 | 155
157 | 157
159 | 159
161 | 161
163 | 163
165 | 165
167 | 167
169 | 169
171 | 171
173 | 173
175 | 175
177 | 177
179 | 179
181 | 181
183 | 183
185 | 185
187 | 187
189 | 189
191 | 191
193 | 193
195 | 195
197 | 197
199 | 199
201 | 201
203 | 203
205 | 205
207 | 207
209 | 209
211 | 211
213 | 213
215 | 215
217 | 217
219 | 219
221 | 221
223 | 223
225 | 225
227 | 227
229 | 229
231 | 231
233 | 233
235 | 235
237 | 237
239 | 239
241 | 241
243 | 243
245 | 245
247 | 247
249 | 249
251 | 251
253 | 253
255 | 255
256 | 256
258 | 258
260 | 260
262 | 262
264 | 264
266 | 266
268 | 268
270 | 270
272 | 272
274 | 274
276 | 276
278 | 278
280 | 280
282 | 282
284 | 284
286 | 286
288 | 288
290 | 290
292 | 292
294 | 294
296 | 296
298 | 298
300 | 300
302 | 302
304 | 304
306 | 306
308 | 308
310 | 310
312 | 312
314 | 314
316 | 316
318 | 318
320 | 320
322 | 322
324 | 324
326 | 326
328 | 328
330 | 330
332 | 332
334 | 334
336 | 336
338 | 338
340 | 340
342 | 342
344 | 344
346 | 346
348 | 348
350 | 350
352 | 352
354 | 354
356 | 356
358 | 358
360 | 360
362 | 362
364 | 364
366 | 366
368 | 368
370 | 370
372 | 372
374 | 374
376 | 376
378 | 378
380 | 380
382 | 382
384 | 384
386 | 386
388 | 388
390 | 390
392 | 392
394 | 394
396 | 396
398 | 398
400 | 400
402 | 402
404 | 404
406 | 406
408 | 408
410 | 410
412 | 412
414 | 414
416 | 416
418 | 418
420 | 420
422 | 422
424 | 424
426 | 426
428 | 428
430 | 430
432 | 432
434 | 434
436 | 436
438 | 438
440 | 440
442 | 442
444 | 444
446 | 446
448 | 448
450 | 450
452 | 452
454 | 454
456 | 456
458 | 458
460 | 460
462 | 462
464 | 464
466 | 466
468 | 468
470 | 470
472 | 472
474 | 474
476 | 476
478 | 478
480 | 480
482 | 482
484 | 484
486 | 486
488 | 488
490 | 490
492 | 492
494 | 494
496 | 496
498 | 498
500 | 500
502 | 502
504 | 504
506 | 506
508 | 508
510 | 510
513 | 513
515 | 515
517 | 517
519 | 519
521 | 521
523 | 523
525 | 525
527 | 527
529 | 529
531 | 531
533 | 533
535 | 535
537 | 537
539 | 539
541 | 541
543 | 543
545 | 545
547 | 547
549 | 549
551 | 551
553 | 553
555 | 555
557 | 557
559 | 559
561 | 561
563 | 563
565 | 565
567 | 567
569 | 569
571 | 571
573 | 573
575 | 575
577 | 577
579 | 579
581 | 581
583 | 583
585 | 585
587 | 587
589 | 589
591 | 591
593 | 593
595 | 595
597 | 597
599 | 599
601 | 601
603 | 603
605 | 605
607 | 607
609 | 609
611 | 611
613 | 613
615 | 615
617 | 617
619 | 619
621 | 621
623 | 623
625 | 625
627 | 627
629 | 629
631 | 631
633 | 633
635 | 635
637 | 637
639 | 639
641 | 641
643 | 643
645 | 645
647 | 647
649 | 649
651 | 651
653 | 653
655 | 655
657 | 657
659 | 659
661 | 661
663 | 663
665 | 665
667 | 667
669 | 669
671 | 671
673 | 673
675 | 675
677 | 677
679 | 679
681 | 681
683 | 683
685 | 685
687 | 687
689 | 689
691 | 691
693 | 693
695 | 695
697 | 697
699 | 699
701 | 701
703 | 703
705 | 705
707 | 707
709 | 709
711 | 711
713 | 713
715 | 715
717 | 717
719 | 719
721 | 721
723 | 723
725 | 725
727 | 727
729 | 729
731 | 731
733 | 733
735 | 735
737 | 737
739 | 739
741 | 741
743 | 743
745 | 745
747 | 747
749 | 749
751 | 751
753 | 753
755 | 755
757 | 757
759 | 759
761 | 761
763 | 763
765 | 765
767 | 767
768 | 768
770 | 770
772 | 772
774 | 774
776 | 776
778 | 778
780 | 780
782 | 782
784 | 784
786 | 786
788 | 788
790 | 790
792 | 792
794 | 794
796 | 796
798 | 798
800 | 800
802 | 802
804 | 804
806 | 806
808 | 808
810 | 810
812 | 812
814 | 814
816 | 816
818 | 818
820 | 820
822 | 822
824 | 824
826 | 826
828 | 828
830 | 830
832 | 832
834 | 834
836 | 836
838 | 838
840 | 840
842 | 842
844 | 844
846 | 846
848 | 848
850 | 850
852 | 852
854 | 854
856 | 856
858 | 858
860 | 860
862 | 862
864 | 864
866 | 866
868 | 868
870 | 870
872 | 872
874 | 874
876 | 876
878 | 878
880 | 880
882 | 882
884 | 884
886 | 886
888 | 888
890 | 890
892 | 892
894 | 894
896 | 896
898 | 898
900 | 900
902 | 902
904 | 904
906 | 906
908 | 908
910 | 910
912 | 912
914 | 914
916 | 916
918 | 918
920 | 920
922 | 922
924 | 924
926 | 926
928 | 928
930 | 930
932 | 932
934 | 934
936 | 936
938 | 938
940 | 940
942 | 942
944 | 944
946 | 946
948 | 948
950 | 950
952 | 952
954 | 954
956 | 956
958 | 958
960 | 960
962 | 962
964 | 964
966 | 966
968 | 968
970 | 970
972 | 972
974 | 974
976 | 976
978 | 978
980 | 980
982 | 982
984 | 984
986 | 986
988 | 988
990 | 990
992 | 992
994 | 994
996 | 996
998 | 998
1000 | 1000
(501 rows)
set allow_system_table_mods='DML';
SET
--pgaoseg has more entries than gp_relation_node
begin;
BEGIN
insert into pg_aoseg.pg_aoseg_16545 values(5, 6, 7, 8, 9, 10, 11, 12);
INSERT 0 1
select * from ao1;
psql:/path/sql_file:1: ERROR: Missing pg_aoseg entry 5 in gp_relation_node for ao1 (aosegfiles.c:2269)
abort;
ROLLBACK
--pgaoseg has less entries than gp_relation_node
begin;
BEGIN
delete from pg_aoseg.pg_aoseg_17638;
DELETE 1
select * from ao1;
psql:/path/sql_file:1: ERROR: gp_relation_node (2) has more entries than pg_aoseg (0) for relation ao1 (aosegfiles.c:2211)
abort;
ROLLBACK
--pgaoseg has same number of entries but mismatch with gp_relation_node
begin;
BEGIN
update pg_aoseg.pg_aoseg_17638 set segno = 3 where segno = 1;
UPDATE 1
select * from ao1;
psql:/path/sql_file:1: ERROR: Missing pg_aoseg entry 3 in gp_relation_node for ao1 (aosegfiles.c:2239)
abort;
ROLLBACK
select * from ao1; --Make sure we can still select from ao1
a | b
------+------
1 | 1
3 | 3
5 | 5
7 | 7
9 | 9
11 | 11
13 | 13
15 | 15
17 | 17
19 | 19
21 | 21
23 | 23
25 | 25
27 | 27
29 | 29
31 | 31
33 | 33
35 | 35
37 | 37
39 | 39
41 | 41
43 | 43
45 | 45
47 | 47
49 | 49
51 | 51
53 | 53
55 | 55
57 | 57
59 | 59
61 | 61
63 | 63
65 | 65
67 | 67
69 | 69
71 | 71
73 | 73
75 | 75
77 | 77
79 | 79
81 | 81
83 | 83
85 | 85
87 | 87
89 | 89
91 | 91
93 | 93
95 | 95
97 | 97
99 | 99
101 | 101
103 | 103
105 | 105
107 | 107
109 | 109
111 | 111
113 | 113
115 | 115
117 | 117
119 | 119
121 | 121
123 | 123
125 | 125
127 | 127
129 | 129
131 | 131
133 | 133
135 | 135
137 | 137
139 | 139
141 | 141
143 | 143
145 | 145
147 | 147
149 | 149
151 | 151
153 | 153
155 | 155
157 | 157
159 | 159
161 | 161
163 | 163
165 | 165
167 | 167
169 | 169
171 | 171
173 | 173
175 | 175
177 | 177
179 | 179
181 | 181
183 | 183
185 | 185
187 | 187
189 | 189
191 | 191
193 | 193
195 | 195
197 | 197
199 | 199
201 | 201
203 | 203
205 | 205
207 | 207
209 | 209
211 | 211
213 | 213
215 | 215
217 | 217
219 | 219
221 | 221
223 | 223
225 | 225
227 | 227
229 | 229
231 | 231
233 | 233
235 | 235
237 | 237
239 | 239
241 | 241
243 | 243
245 | 245
247 | 247
249 | 249
251 | 251
253 | 253
255 | 255
256 | 256
258 | 258
260 | 260
262 | 262
264 | 264
266 | 266
268 | 268
270 | 270
272 | 272
274 | 274
276 | 276
278 | 278
280 | 280
282 | 282
284 | 284
286 | 286
288 | 288
290 | 290
292 | 292
294 | 294
296 | 296
298 | 298
300 | 300
302 | 302
304 | 304
306 | 306
308 | 308
310 | 310
312 | 312
314 | 314
316 | 316
318 | 318
320 | 320
322 | 322
324 | 324
326 | 326
328 | 328
330 | 330
332 | 332
334 | 334
336 | 336
338 | 338
340 | 340
342 | 342
344 | 344
346 | 346
348 | 348
350 | 350
352 | 352
354 | 354
356 | 356
358 | 358
360 | 360
362 | 362
364 | 364
366 | 366
368 | 368
370 | 370
372 | 372
374 | 374
376 | 376
378 | 378
380 | 380
382 | 382
384 | 384
386 | 386
388 | 388
390 | 390
392 | 392
394 | 394
396 | 396
398 | 398
400 | 400
402 | 402
404 | 404
406 | 406
408 | 408
410 | 410
412 | 412
414 | 414
416 | 416
418 | 418
420 | 420
422 | 422
424 | 424
426 | 426
428 | 428
430 | 430
432 | 432
434 | 434
436 | 436
438 | 438
440 | 440
442 | 442
444 | 444
446 | 446
448 | 448
450 | 450
452 | 452
454 | 454
456 | 456
458 | 458
460 | 460
462 | 462
464 | 464
466 | 466
468 | 468
470 | 470
472 | 472
474 | 474
476 | 476
478 | 478
480 | 480
482 | 482
484 | 484
486 | 486
488 | 488
490 | 490
492 | 492
494 | 494
496 | 496
498 | 498
500 | 500
502 | 502
504 | 504
506 | 506
508 | 508
510 | 510
513 | 513
515 | 515
517 | 517
519 | 519
521 | 521
523 | 523
525 | 525
527 | 527
529 | 529
531 | 531
533 | 533
535 | 535
537 | 537
539 | 539
541 | 541
543 | 543
545 | 545
547 | 547
549 | 549
551 | 551
553 | 553
555 | 555
557 | 557
559 | 559
561 | 561
563 | 563
565 | 565
567 | 567
569 | 569
571 | 571
573 | 573
575 | 575
577 | 577
579 | 579
581 | 581
583 | 583
585 | 585
587 | 587
589 | 589
591 | 591
593 | 593
595 | 595
597 | 597
599 | 599
601 | 601
603 | 603
605 | 605
607 | 607
609 | 609
611 | 611
613 | 613
615 | 615
617 | 617
619 | 619
621 | 621
623 | 623
625 | 625
627 | 627
629 | 629
631 | 631
633 | 633
635 | 635
637 | 637
639 | 639
641 | 641
643 | 643
645 | 645
647 | 647
649 | 649
651 | 651
653 | 653
655 | 655
657 | 657
659 | 659
661 | 661
663 | 663
665 | 665
667 | 667
669 | 669
671 | 671
673 | 673
675 | 675
677 | 677
679 | 679
681 | 681
683 | 683
685 | 685
687 | 687
689 | 689
691 | 691
693 | 693
695 | 695
697 | 697
699 | 699
701 | 701
703 | 703
705 | 705
707 | 707
709 | 709
711 | 711
713 | 713
715 | 715
717 | 717
719 | 719
721 | 721
723 | 723
725 | 725
727 | 727
729 | 729
731 | 731
733 | 733
735 | 735
737 | 737
739 | 739
741 | 741
743 | 743
745 | 745
747 | 747
749 | 749
751 | 751
753 | 753
755 | 755
757 | 757
759 | 759
761 | 761
763 | 763
765 | 765
767 | 767
768 | 768
770 | 770
772 | 772
774 | 774
776 | 776
778 | 778
780 | 780
782 | 782
784 | 784
786 | 786
788 | 788
790 | 790
792 | 792
794 | 794
796 | 796
798 | 798
800 | 800
802 | 802
804 | 804
806 | 806
808 | 808
810 | 810
812 | 812
814 | 814
816 | 816
818 | 818
820 | 820
822 | 822
824 | 824
826 | 826
828 | 828
830 | 830
832 | 832
834 | 834
836 | 836
838 | 838
840 | 840
842 | 842
844 | 844
846 | 846
848 | 848
850 | 850
852 | 852
854 | 854
856 | 856
858 | 858
860 | 860
862 | 862
864 | 864
866 | 866
868 | 868
870 | 870
872 | 872
874 | 874
876 | 876
878 | 878
880 | 880
882 | 882
884 | 884
886 | 886
888 | 888
890 | 890
892 | 892
894 | 894
896 | 896
898 | 898
900 | 900
902 | 902
904 | 904
906 | 906
908 | 908
910 | 910
912 | 912
914 | 914
916 | 916
918 | 918
920 | 920
922 | 922
924 | 924
926 | 926
928 | 928
930 | 930
932 | 932
934 | 934
936 | 936
938 | 938
940 | 940
942 | 942
944 | 944
946 | 946
948 | 948
950 | 950
952 | 952
954 | 954
956 | 956
958 | 958
960 | 960
962 | 962
964 | 964
966 | 966
968 | 968
970 | 970
972 | 972
974 | 974
976 | 976
978 | 978
980 | 980
982 | 982
984 | 984
986 | 986
988 | 988
990 | 990
992 | 992
994 | 994
996 | 996
998 | 998
1000 | 1000
(501 rows)
set allow_system_table_mods='DML';
--pgaocsseg has more entries than gp_relation_node
begin;
insert into pg_aoseg.pg_aocsseg_<oid> values(5, 6, 7, '0'::bytea, 1, 1, 1);
select * from co1;
abort;
--pgaocsseg has less entries than gp_relation_node
begin;
delete from pg_aoseg.pg_aocsseg_<oid>;
select * from co1;
abort;
--pgaocsseg has same number of entries but mistmatch with gp_relation_node
begin;
update pg_aoseg.pg_aocsseg_<oid> set segno = 3 where segno = 1;
select * from co1;
abort;
select * from co1; --Make sure we can still select from co1
set allow_system_table_mods='DML';
--pgaoseg has more entries than gp_relation_node
begin;
insert into pg_aoseg.pg_aoseg_<oid> values(5, 6, 7, 8, 9, 10, 11, 12);
select * from ao1;
abort;
--pgaoseg has less entries than gp_relation_node
begin;
delete from pg_aoseg.pg_aoseg_<oid>;
select * from ao1;
abort;
--pgaoseg has same number of entries but mismatch with gp_relation_node
begin;
update pg_aoseg.pg_aoseg_<oid> set segno = 3 where segno = 1;
select * from ao1;
abort;
select * from ao1; --Make sure we can still select from ao1
drop table if exists ao1;
create table ao1(a int, b int) with (appendonly=true);
-- test insert and select from within same transaction
begin;
insert into ao1 select i, i from generate_series(1, 1000) i;
select * from ao1;
abort;
insert into ao1 select i, i from generate_series(1, 1000) i;
-- start_ignore
set optimizer_print_missing_stats=off;
-- end_ignore
select * from ao1;
drop table if exists co1;
create table co1(a int, b int) with (appendonly=true, orientation=column);
-- test insert and select within same transaction
begin;
insert into co1 select i, i from generate_series(1, 1000) i;
select * from co1;
abort;
insert into co1 select i, i from generate_series(1, 1000) i;
-- start_ignore
set optimizer_print_missing_stats=off;
-- end_ignore
select * from co1;
-- start_matchsubs
m/.*insert into pg_aoseg.pg_aoseg_*/
s/.*insert into pg_aoseg.pg_aoseg_[0-9]+/insert into pg_aoseg.pg_aoseg_X/
m/.*delete from pg_aoseg.pg_aoseg_*/
s/.*delete from pg_aoseg.pg_aoseg_[0-9]+/delete from pg_aoseg.pg_aoseg_X/
m/.*delete from pg_aoseg.pg_aoseg_*/
s/.*delete from pg_aoseg.pg_aoseg_[0-9]+/delete from pg_aoseg.pg_aoseg_X/
m/.*update pg_aoseg.pg_aoseg_*/
s/.*update pg_aoseg.pg_aoseg_[0-9]+/update pg_aoseg.pg_aoseg_X/
m/.*insert into pg_aoseg.pg_aocsseg_*/
s/.*insert into pg_aoseg.pg_aocsseg_[0-9]+/insert into pg_aoseg.pg_aocsseg_X/
m/.*delete from pg_aoseg.pg_aocsseg_*/
s/.*delete from pg_aoseg.pg_aocsseg_[0-9]+/delete from pg_aoseg.pg_aocsseg_X/
m/.*update pg_aoseg.pg_aocsseg_*/
s/.*update pg_aoseg.pg_aocsseg_[0-9]+/update pg_aoseg.pg_aocsseg_X/
-- end_matchsubs
-- Mask line number in the expected error:
-- ERROR: Index 0 exceed size of vpinfo array size 0 (aocssegfiles.h:116)
-- atmsort.pl has a general rule for masking out such line numbers, but it's
-- not working for this case for some reason. Not sure why; perhaps because
-- this error comes from master, and the atmsort.pl rule only catches the
-- cases that contain the segment information in the error.
-- start_matchsubs
m/.*\s\(.*\.[ch]:\d+\)/
s/.*\s\(.*\.[ch]:\d+\)/ (SOMEFILE:SOMEFUNC)/
-- end_matchsubs
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import os
import sys
import tinctest
from tinctest.lib import local_path
from mpp.lib.config import GPDBConfig
from mpp.models import MPPTestCase
from mpp.lib.PSQL import PSQL
from gppylib.db import dbconn
from gppylib.commands.base import Command, ExecutionError
from tinctest.lib import Gpdiff
class AppendOnlyReadCheckTests(MPPTestCase):
"""
@product_version gpdb: [4.3.5.0-]
"""
def __init__(self, methodName):
super(AppendOnlyReadCheckTests, self).__init__(methodName)
self.base_dir = os.path.dirname(sys.modules[self.__module__].__file__)
#Create the output directory
self.output_dir = os.path.join(self.base_dir, 'output')
if not os.path.exists(self.output_dir):
os.makedirs(self.output_dir)
self.sql_dir = os.path.join(self.base_dir, 'sql')
self.ans_dir = os.path.join(self.base_dir, 'expected')
def create_appendonly_tables(self, row=True):
sql_file_name = 'create_ao_table' if row else 'create_co_table'
sql_file = os.path.join(self.sql_dir, '%s.sql' % sql_file_name)
out_file = os.path.join(self.output_dir, '%s.out' % sql_file_name)
ans_file = os.path.join(self.ans_dir, '%s.ans' % sql_file_name)
PSQL.run_sql_file(sql_file, out_file=out_file)
if not Gpdiff.are_files_equal(out_file, ans_file):
raise Exception('Unable to create tables')
def get_oid(self, tablename):
OID_QUERY = """ SELECT oid
FROM pg_class
WHERE relname='%s'
""" % tablename
with dbconn.connect(dbconn.DbURL()) as conn:
oid = dbconn.execSQLForSingleton(conn, OID_QUERY)
return oid
def transform_sql_file(self, sql_file, tablename):
oid = self.get_oid(tablename)
new_sql_file = sql_file.strip('.t')
with open(new_sql_file, 'w') as fp1:
with open(sql_file, 'r') as fp2:
for line in fp2:
if '<oid>' in line:
line = line.replace('<oid>', str(oid))
fp1.write(line)
def test_pg_aoseg_corruption(self):
self.create_appendonly_tables()
config = GPDBConfig()
host, port = config.get_hostandport_of_segment()
self.transform_sql_file(os.path.join(self.sql_dir, 'corrupt_pg_aoseg.sql.t'), 'ao1')
out_file = os.path.join(self.output_dir, 'corrupt_pg_aoseg.out')
ans_file = os.path.join(self.ans_dir, 'corrupt_pg_aoseg.ans')
sql_file = os.path.join(self.sql_dir, 'corrupt_pg_aoseg.sql')
PSQL.run_sql_file_utility_mode(sql_file, out_file=out_file, host=host,
port=port, dbname=os.environ['PGDATABASE'])
if not Gpdiff.are_files_equal(out_file, ans_file, match_sub=[local_path('sql/init_file')]):
raise Exception('Corruption test of pg_aoseg failed for appendonly tables !')
def test_pg_aocsseg_corruption(self):
self.create_appendonly_tables(row=False)
config = GPDBConfig()
host, port = config.get_hostandport_of_segment()
self.transform_sql_file(os.path.join(self.sql_dir, 'corrupt_pg_aocsseg.sql.t'), 'co1')
out_file = os.path.join(self.output_dir, 'corrupt_pg_aocsseg.out')
ans_file = os.path.join(self.ans_dir, 'corrupt_pg_aocsseg.ans')
sql_file = os.path.join(self.sql_dir, 'corrupt_pg_aocsseg.sql')
PSQL.run_sql_file_utility_mode(sql_file, out_file=out_file, host=host,
port=port, dbname=os.environ['PGDATABASE'])
if not Gpdiff.are_files_equal(out_file, ans_file, match_sub=[local_path('sql/init_file')]):
raise Exception('Corruption test of pg_aocsseg failed for appendonly tables !')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册