|
16 | 16 | * |
17 | 17 | *Copyright (c) 2001, PostgreSQL Global Development Group |
18 | 18 | * |
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 $ |
20 | 20 | * ---------- |
21 | 21 | */ |
22 | 22 | #include"postgres.h" |
|
38 | 38 | #include"catalog/pg_shadow.h" |
39 | 39 | #include"catalog/pg_database.h" |
40 | 40 | #include"libpq/pqsignal.h" |
| 41 | +#ifdefMULTIBYTE |
| 42 | +#include"mb/pg_wchar.h" |
| 43 | +#endif |
41 | 44 | #include"miscadmin.h" |
42 | 45 | #include"utils/memutils.h" |
43 | 46 | #include"storage/backendid.h" |
@@ -424,8 +427,12 @@ pgstat_report_activity(char *what) |
424 | 427 | return; |
425 | 428 |
|
426 | 429 | len=strlen(what); |
| 430 | +#ifdefMULTIBYTE |
| 431 | +len=pg_mbcliplen((constunsignedchar*)what,len,PGSTAT_ACTIVITY_SIZE-1); |
| 432 | +#else |
427 | 433 | if (len >=PGSTAT_ACTIVITY_SIZE) |
428 | 434 | len=PGSTAT_ACTIVITY_SIZE-1; |
| 435 | +#endif |
429 | 436 |
|
430 | 437 | memcpy(msg.m_what,what,len); |
431 | 438 | msg.m_what[len]='\0'; |
|