Skip to content

Instantly share code, notes, and snippets.

@d
Created June 4, 2016 08:01
Show Gist options
  • Select an option

  • Save d/988543e973c9fbf0704821a7ccfb20ab to your computer and use it in GitHub Desktop.

Select an option

Save d/988543e973c9fbf0704821a7ccfb20ab to your computer and use it in GitHub Desktop.
external_table failure
*** ./expected/external_table.out Sat Jun 4 01:57:38 2016
--- ./results/external_table.out Sat Jun 4 01:57:39 2016
***************
*** 1452,1465 ****
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 10) e2
WHERE e1.i = e2.i;
! NOTICE: Found 4 data formatting errors (4 or more input rows). Rejected related input data.
! i | j
! ---+----------
! 1 | 1_number
! 2 | 2_number
! 4 | 4_number
! (3 rows)
!
-- should have written rows into error log
SELECT count(*) FROM
(
--- 1443,1449 ----
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 10) e2
WHERE e1.i = e2.i;
! ERROR: could not find block containing chunk 0x1618650 (context 'SrehMemCtxt') (mcxt.c:477)
-- should have written rows into error log
SELECT count(*) FROM
(
***************
*** 1467,1504 ****
UNION ALL
SELECT * FROM gp_read_error_log('exttab_subtxs_2')
) FOO;
! count
! -------
! 4
! (1 row)
!
savepoint s2;
SELECT e1.i, e2.j FROM
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 10) e2
WHERE e1.i = e2.i;
! NOTICE: Found 4 data formatting errors (4 or more input rows). Rejected related input data.
! i | j
! ---+----------
! 1 | 1_number
! 2 | 2_number
! 4 | 4_number
! (3 rows)
!
savepoint s3;
SELECT e1.i, e2.j FROM
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 10) e2
WHERE e1.i = e2.i;
! NOTICE: Found 4 data formatting errors (4 or more input rows). Rejected related input data.
! i | j
! ---+----------
! 1 | 1_number
! 2 | 2_number
! 4 | 4_number
! (3 rows)
!
ROLLBACK TO s2;
-- rollback should not rollback the error rows written from within the transaction
SELECT count(*) FROM
(
--- 1451,1473 ----
UNION ALL
SELECT * FROM gp_read_error_log('exttab_subtxs_2')
) FOO;
! ERROR: current transaction is aborted, commands ignored until end of transaction block
savepoint s2;
+ ERROR: current transaction is aborted, commands ignored until end of transaction block
SELECT e1.i, e2.j FROM
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 10) e2
WHERE e1.i = e2.i;
! ERROR: current transaction is aborted, commands ignored until end of transaction block
savepoint s3;
+ ERROR: current transaction is aborted, commands ignored until end of transaction block
SELECT e1.i, e2.j FROM
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 10) e2
WHERE e1.i = e2.i;
! ERROR: current transaction is aborted, commands ignored until end of transaction block
ROLLBACK TO s2;
+ ERROR: no such savepoint
-- rollback should not rollback the error rows written from within the transaction
SELECT count(*) FROM
(
***************
*** 1506,1523 ****
UNION ALL
SELECT * FROM gp_read_error_log('exttab_subtxs_2')
) FOO;
! count
! -------
! 12
! (1 row)
!
-- Make the tx fail, segment reject limit reaches here
SELECT e1.i, e2.j FROM
(SELECT i, j FROM exttab_subtxs_2 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_2 WHERE i < 10) e2
WHERE e1.i = e2.i;
! ERROR: Segment reject limit reached. Aborting operation. Last error was: missing data for column "j"
! DETAIL: External table DUMMY_EX, line DUMMY_LINE of DUMMY_LOCATION
COMMIT;
-- Error logs should not have been rolled back.
-- Check that number of errors is greater than 12 instead of checking for
--- 1475,1487 ----
UNION ALL
SELECT * FROM gp_read_error_log('exttab_subtxs_2')
) FOO;
! ERROR: current transaction is aborted, commands ignored until end of transaction block
-- Make the tx fail, segment reject limit reaches here
SELECT e1.i, e2.j FROM
(SELECT i, j FROM exttab_subtxs_2 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_2 WHERE i < 10) e2
WHERE e1.i = e2.i;
! ERROR: current transaction is aborted, commands ignored until end of transaction block
COMMIT;
-- Error logs should not have been rolled back.
-- Check that number of errors is greater than 12 instead of checking for
***************
*** 1532,1538 ****
) FOO;
?column?
----------
! t
(1 row)
-- TRUNCATE error logs within tx , abort transaction
--- 1496,1502 ----
) FOO;
?column?
----------
! f
(1 row)
-- TRUNCATE error logs within tx , abort transaction
======================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment