File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1616 *
1717 * Copyright (c) 2001, PostgreSQL Global Development Group
1818 *
19- * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.16 2001/12/03 19:02:58 tgl Exp $
19+ * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.17 2002/02/07 22:20:26 tgl Exp $
2020 * ----------
2121 */
2222#include "postgres.h"
3838#include "catalog/pg_shadow.h"
3939#include "catalog/pg_database.h"
4040#include "libpq/pqsignal.h"
41+ #ifdef MULTIBYTE
42+ #include "mb/pg_wchar.h"
43+ #endif
4144#include "miscadmin.h"
4245#include "utils/memutils.h"
4346#include "storage/backendid.h"
@@ -424,8 +427,12 @@ pgstat_report_activity(char *what)
424427 return ;
425428
426429 len = strlen (what );
430+ #ifdef MULTIBYTE
431+ len = pg_mbcliplen ((const unsigned char * )what , len , PGSTAT_ACTIVITY_SIZE - 1 );
432+ #else
427433 if (len >= PGSTAT_ACTIVITY_SIZE )
428434 len = PGSTAT_ACTIVITY_SIZE - 1 ;
435+ #endif
429436
430437 memcpy (msg .m_what , what , len );
431438 msg .m_what [len ] = '\0' ;
You can’t perform that action at this time.
0 commit comments