*-------------------------------------------------------------------------
*/
#include "postgres.h"
+#include <string.h>
#include "executor/executor.h"
#include "executor/execdebug.h"
if (keycount <= 0)
elog(ERROR, "FormSortKeys: keycount <= 0");
sortkeys = (ScanKey) palloc(keycount * sizeof(ScanKeyData));
+ MemSet((char *) sortkeys, 0, keycount * sizeof(ScanKeyData));
/* ----------------
* form each scan key from the resdom info in the target list
reskey = resdom->reskey;
reskeyop = resdom->reskeyop;
- if (reskey > 0)
+ if (reskey > 0) /* ignore TLEs that are not sort keys */
{
ScanKeyEntryInitialize(&sortkeys[reskey - 1],
0,