提交 45cc0e9b 编写于 作者: T Tom Lane

plpgsql RAISE statement was careless about the possibility of a NULL

field value being displayed; produced coredump instead of the expected
<NULL> display.
上级 f1067792
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* procedural language * procedural language
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.20 2000/04/12 17:17:19 momjian Exp $ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.21 2000/04/28 00:12:44 tgl Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
...@@ -1587,6 +1587,8 @@ exec_stmt_raise(PLpgSQL_execstate * estate, PLpgSQL_stmt_raise * stmt) ...@@ -1587,6 +1587,8 @@ exec_stmt_raise(PLpgSQL_execstate * estate, PLpgSQL_stmt_raise * stmt)
if (fno == SPI_ERROR_NOATTRIBUTE) if (fno == SPI_ERROR_NOATTRIBUTE)
elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname); elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname);
extval = SPI_getvalue(rec->tup, rec->tupdesc, fno); extval = SPI_getvalue(rec->tup, rec->tupdesc, fno);
if (extval == NULL)
extval = "<NULL>";
} }
plpgsql_dstring_append(&ds, extval); plpgsql_dstring_append(&ds, extval);
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册