|
9 | 9 | *
|
10 | 10 | *
|
11 | 11 | * IDENTIFICATION
|
12 |
| - * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.40 2000/08/01 18:29:29 tgl Exp $ |
| 12 | + * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.41 2000/09/22 15:34:31 tgl Exp $ |
13 | 13 | *
|
14 | 14 | *-------------------------------------------------------------------------
|
15 | 15 | */
|
@@ -592,28 +592,33 @@ reset_random_seed(void)
|
592 | 592 | void
|
593 | 593 | SetPGVariable(constchar*name,constchar*value)
|
594 | 594 | {
|
| 595 | +char*mvalue=value ?pstrdup(value) : ((char*)NULL); |
| 596 | + |
595 | 597 | /*
|
596 | 598 | * Special cases ought to be removed and handled separately
|
597 | 599 | * by TCOP
|
598 | 600 | */
|
599 | 601 | if (strcasecmp(name,"datestyle")==0)
|
600 |
| -parse_date(pstrdup(value)); |
| 602 | +parse_date(mvalue); |
601 | 603 | elseif (strcasecmp(name,"timezone")==0)
|
602 |
| -parse_timezone(pstrdup(value)); |
| 604 | +parse_timezone(mvalue); |
603 | 605 | elseif (strcasecmp(name,"DefaultXactIsoLevel")==0)
|
604 |
| -parse_DefaultXactIsoLevel(pstrdup(value)); |
| 606 | +parse_DefaultXactIsoLevel(mvalue); |
605 | 607 | elseif (strcasecmp(name,"XactIsoLevel")==0)
|
606 |
| -parse_XactIsoLevel(pstrdup(value)); |
| 608 | +parse_XactIsoLevel(mvalue); |
607 | 609 | #ifdefMULTIBYTE
|
608 | 610 | elseif (strcasecmp(name, "client_encoding")==0)
|
609 |
| -parse_client_encoding(pstrdup(value)); |
| 611 | +parse_client_encoding(mvalue); |
610 | 612 | elseif (strcasecmp(name, "server_encoding")==0)
|
611 |
| -parse_server_encoding(pstrdup(value)); |
| 613 | +parse_server_encoding(mvalue); |
612 | 614 | #endif
|
613 | 615 | elseif (strcasecmp(name, "random_seed")==0)
|
614 |
| -parse_random_seed(pstrdup(value)); |
| 616 | +parse_random_seed(mvalue); |
615 | 617 | else
|
616 | 618 | SetConfigOption(name,value,superuser() ?PGC_SUSET :PGC_USERSET);
|
| 619 | + |
| 620 | +if (mvalue) |
| 621 | +pfree(mvalue); |
617 | 622 | }
|
618 | 623 |
|
619 | 624 |
|
|