mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-17 19:30:00 +08:00
Fix a dozen or so places that were passing unpredictable data strings
as elog format strings. Hai-Chen Tu pointed out the problem in contrib/dbmirror, but it wasn't the only such error.
This commit is contained in:
parent
eeec0a6775
commit
95c9c22633
@ -200,7 +200,7 @@ int cube_yyerror ( char *msg ) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
reset_parse_buffer();
|
reset_parse_buffer();
|
||||||
elog(ERROR, buf);
|
elog(ERROR, "%s", buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* pending.c
|
* pending.c
|
||||||
* $Id: pending.c,v 1.8 2002/11/22 16:04:41 momjian Exp $
|
* $Id: pending.c,v 1.9 2002/11/22 16:25:29 tgl Exp $
|
||||||
*
|
*
|
||||||
* This file contains a trigger for Postgresql-7.x to record changes to tables
|
* This file contains a trigger for Postgresql-7.x to record changes to tables
|
||||||
* to a pending table for mirroring.
|
* to a pending table for mirroring.
|
||||||
@ -253,7 +253,7 @@ storeKeyInfo(char *cpTableName, HeapTuple tTupleData,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#if defined DEBUG_OUTPUT
|
#if defined DEBUG_OUTPUT
|
||||||
elog(NOTICE, "%s", cpKeyData);
|
elog(NOTICE, "KeyData: %s", cpKeyData);
|
||||||
#endif
|
#endif
|
||||||
saPlanData[0] = PointerGetDatum(cpKeyData);
|
saPlanData[0] = PointerGetDatum(cpKeyData);
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ storeKeyInfo(char *cpTableName, HeapTuple tTupleData,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#if defined DEBUG_OUTPUT
|
#if defined DEBUG_OUTPUT
|
||||||
elog(NOTICE, "INSERT SUCCESFULL");
|
elog(NOTICE, "Insert successful");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -351,7 +351,7 @@ storeData(char *cpTableName, HeapTuple tTupleData, TupleDesc tTupleDesc,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#if defined DEBUG_OUTPUT
|
#if defined DEBUG_OUTPUT
|
||||||
elog(NOTICE, "INSERT SUCCESFULL");
|
elog(NOTICE, "Insert successful");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -437,7 +437,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc,
|
|||||||
cpFieldName = DatumGetPointer(NameGetDatum(&tTupleDesc->attrs
|
cpFieldName = DatumGetPointer(NameGetDatum(&tTupleDesc->attrs
|
||||||
[iColumnCounter - 1]->attname));
|
[iColumnCounter - 1]->attname));
|
||||||
#if defined DEBUG_OUTPUT
|
#if defined DEBUG_OUTPUT
|
||||||
elog(NOTICE, "%s", cpFieldName);
|
elog(NOTICE, "FieldName: %s", cpFieldName);
|
||||||
#endif
|
#endif
|
||||||
while (iDataBlockSize - iUsedDataBlock < strlen(cpFieldName) + 6)
|
while (iDataBlockSize - iUsedDataBlock < strlen(cpFieldName) + 6)
|
||||||
{
|
{
|
||||||
@ -465,7 +465,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc,
|
|||||||
|
|
||||||
}
|
}
|
||||||
#if defined DEBUG_OUTPUT
|
#if defined DEBUG_OUTPUT
|
||||||
elog(NOTICE, "%s", cpFieldData);
|
elog(NOTICE, "FieldData: %s", cpFieldData);
|
||||||
elog(NOTICE, "Starting format loop");
|
elog(NOTICE, "Starting format loop");
|
||||||
#endif
|
#endif
|
||||||
while (*cpUnFormatedPtr != 0)
|
while (*cpUnFormatedPtr != 0)
|
||||||
@ -499,7 +499,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc,
|
|||||||
sprintf(cpFormatedPtr, "' ");
|
sprintf(cpFormatedPtr, "' ");
|
||||||
iUsedDataBlock = iUsedDataBlock + 2;
|
iUsedDataBlock = iUsedDataBlock + 2;
|
||||||
#if defined DEBUG_OUTPUT
|
#if defined DEBUG_OUTPUT
|
||||||
elog(NOTICE, "%s", cpDataBlock);
|
elog(NOTICE, "DataBlock: %s", cpDataBlock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} /* for iColumnCounter */
|
} /* for iColumnCounter */
|
||||||
|
@ -132,7 +132,7 @@ _rserv_log_()
|
|||||||
GetCurrentTransactionId(), deleted, rel->rd_id, okey);
|
GetCurrentTransactionId(), deleted, rel->rd_id, okey);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
elog(DEBUG3, sql);
|
elog(DEBUG3, "sql: %s", sql);
|
||||||
|
|
||||||
ret = SPI_exec(sql, 0);
|
ret = SPI_exec(sql, 0);
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ _rserv_log_()
|
|||||||
deleted, okey);
|
deleted, okey);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
elog(DEBUG3, sql);
|
elog(DEBUG3, "sql: %s", sql);
|
||||||
|
|
||||||
ret = SPI_exec(sql, 0);
|
ret = SPI_exec(sql, 0);
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ _rserv_log_()
|
|||||||
rel->rd_id, GetCurrentTransactionId(), okey);
|
rel->rd_id, GetCurrentTransactionId(), okey);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
elog(DEBUG3, sql);
|
elog(DEBUG3, "sql: %s", sql);
|
||||||
|
|
||||||
ret = SPI_exec(sql, 0);
|
ret = SPI_exec(sql, 0);
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ float seg_atof ( char *value ) {
|
|||||||
if ( errno ) {
|
if ( errno ) {
|
||||||
snprintf(buf, 256, "numeric value %s unrepresentable", value);
|
snprintf(buf, 256, "numeric value %s unrepresentable", value);
|
||||||
reset_parse_buffer();
|
reset_parse_buffer();
|
||||||
elog(ERROR, buf);
|
elog(ERROR, "%s", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -175,7 +175,7 @@ int seg_yyerror ( char *msg ) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
reset_parse_buffer();
|
reset_parse_buffer();
|
||||||
elog(ERROR, buf);
|
elog(ERROR, "%s", buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.26 2002/10/19 22:10:58 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.27 2002/11/22 16:25:30 tgl Exp $
|
||||||
*
|
*
|
||||||
*********************************************************************
|
*********************************************************************
|
||||||
*/
|
*/
|
||||||
@ -2733,7 +2733,7 @@ PLy_output(volatile int level, PyObject * self, PyObject * args)
|
|||||||
RERAISE_EXC();
|
RERAISE_EXC();
|
||||||
}
|
}
|
||||||
|
|
||||||
elog(level, sv);
|
elog(level, "%s", sv);
|
||||||
|
|
||||||
RESTORE_EXC();
|
RESTORE_EXC();
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* ENHANCEMENTS, OR MODIFICATIONS.
|
* ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.66 2002/10/19 22:10:58 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.67 2002/11/22 16:25:32 tgl Exp $
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
@ -1303,7 +1303,7 @@ pltcl_elog(ClientData cdata, Tcl_Interp *interp,
|
|||||||
* and return to the caller (if not catched)
|
* and return to the caller (if not catched)
|
||||||
************************************************************/
|
************************************************************/
|
||||||
UTF_BEGIN;
|
UTF_BEGIN;
|
||||||
elog(level, UTF_U2E(argv[2]));
|
elog(level, "%s", UTF_U2E(argv[2]));
|
||||||
UTF_END;
|
UTF_END;
|
||||||
memcpy(&Warn_restart, &save_restart, sizeof(Warn_restart));
|
memcpy(&Warn_restart, &save_restart, sizeof(Warn_restart));
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user