huor
发布于

Unexpected internal error (cdbpathtoplan.c)

SQL:

INSERT INTO VPDM_ST_PER_ACCT_SPLIT_TMP2
SELECT  T.DATA_DT
       ,T1.ACCT_NO_PK ACCT_NO
       ,T.ACCT_NAME
       ,T1.CUST_NO
       ,T1.CUST_NAME
       ,T.CM_CODE
       ,T.CM_NAME
       ,T.BRAN_CODE
       ,T1.BRAN_CODE ORG_CODE
       ,T2.ORG_CORPORATE
       ,T.SHARE_RATE
       ,CAST(T1.BUY_DATE AS DATE) START_DATE
       ,date'9999-12-31'
       ,T1.CARD_NO
       ,'0'
       ,null
       ,date'9999-12-31'
       ,T.ACCT_ATTRIBUTE
       ,null
       ,''
       ,'0'
       ,'0'
       ,null
       ,T.BRAN_NAME
       ,T.DEPART_ID
       ,T.DEPART_NAME
       ,T2.ORG_NAME
       ,'0' YJX_FLAG
       ,'1' HQ_FLAG
       ,T1.MASTER_CARD_NO
       ,T.EMP_ID
FROM VPDM_ST_PER_ACCT_SPLIT_TMP1 T
INNER JOIN
(
	SELECT  A.ACCT_NO||A.ACCT_SEQNO ACCT_NO_PK
	       ,A.CARD_NO
	       ,A.CUST_NO
	       ,A.BUY_DATE
	       ,B.MASTER_CARD_NO
	       ,C.BRAN_CODE
	       ,C.CUST_NAME
	FROM EXT_TRANSFER_INTF A
	INNER JOIN EXT_CARD_BOOK_INTF B
	ON A.CARD_NO=B.CARD_CODE
	INNER JOIN ODW_DEP_ACCT_INF C
	ON B.MASTER_CARD_NO=C.ACCT_NO AND C.DT='2021-01-02'
	WHERE A.TRANSFER_NUM>0
	AND A.BUY_DATE='2021-01-02'
	AND A.DT='2021-01-02' 
) T1
ON T.CURRENT_ACCT_NO=T1.MASTER_CARD_NO
LEFT JOIN T_ST_PB_ORG_INF_HIS_TMP T2
ON T1.BRAN_CODE=T2.ORG_ID
WHERE T.START_DATE<='2021-01-02'
AND T.END_DATE>'2021-01-02'
AND T.ACCT_TYPE='0'
AND T.CURRENT_ACCT_NO=SUBSTR(T.ACCT_NO, 1, LENGTH(T.CURRENT_ACCT_NO));

Call stack:

1    0x100e1c01e postgres errstart + 0x2fe
2    0x100e1bc8b postgres elog_internalerror + 0x1b
3    0x100f24ce1 postgres cdbpathtoplan_create_motion_plan + 0x1e1
4    0x100ca0a4d postgres create_subplan + 0x43d
5    0x100ca069c postgres create_subplan + 0x8c
6    0x100ca05c8 postgres create_plan + 0x38
7    0x100cb356d postgres grouping_planner + 0x10cd
8    0x100cb1bb4 postgres subquery_planner + 0x994
9    0x100cb06bb postgres standard_planner + 0x17b
10   0x100cb0b98 postgres planner + 0x148
11   0x100d3bea0 postgres pg_plan_query + 0x60
12   0x100d42741 postgres exec_simple_query + 0x5e1
13   0x100d3e1e5 postgres PostgresMain + 0x1875
14   0x100cf6d28 postgres ServerLoop + 0x2828
15   0x100cf3950 postgres PostmasterMain + 0x13a0
16   0x100c4d8f4 postgres main + 0x144
17   0x7fff69b7fcc9 libdyld.dylib start + 0x1
18   0x9 0x00000009 (in postgres)

临时处理方案:

数据存在空串,剔除即可
评论(1)
  • fy
    fy 回复

    在多表关联遇到过,当时采用 coalesce(字段,'') 绕过去的

test