|
1 | 1 | /**********************************************************************
|
2 | 2 | * plperl.c - perl as a procedural language for PostgreSQL
|
3 | 3 | *
|
4 |
| - * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.146 2009/02/20 10:39:19 petere Exp $ |
| 4 | + * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.147 2009/06/04 15:59:55 adunstan Exp $ |
5 | 5 | *
|
6 | 6 | **********************************************************************/
|
7 | 7 |
|
@@ -399,6 +399,8 @@ plperl_init_interp(void)
|
399 | 399 | "","-e",PERLBOOT
|
400 | 400 | };
|
401 | 401 |
|
| 402 | +intnargs=3; |
| 403 | + |
402 | 404 | #ifdefWIN32
|
403 | 405 |
|
404 | 406 | /*
|
@@ -442,13 +444,19 @@ plperl_init_interp(void)
|
442 | 444 | #endif
|
443 | 445 |
|
444 | 446 |
|
| 447 | +#ifdefPERL_SYS_INIT3 |
| 448 | +/* only call this the first time through, as per perlembed man page */ |
| 449 | +if (interp_state==INTERP_NONE) |
| 450 | +PERL_SYS_INIT3(&nargs, (char***)&embedding,NULL); |
| 451 | +#endif |
| 452 | + |
445 | 453 | plperl_held_interp=perl_alloc();
|
446 | 454 | if (!plperl_held_interp)
|
447 | 455 | elog(ERROR,"could not allocate Perl interpreter");
|
448 | 456 |
|
449 | 457 | perl_construct(plperl_held_interp);
|
450 | 458 | perl_parse(plperl_held_interp,plperl_init_shared_libs,
|
451 |
| -3,embedding,NULL); |
| 459 | +nargs,embedding,NULL); |
452 | 460 | perl_run(plperl_held_interp);
|
453 | 461 |
|
454 | 462 | if (interp_state==INTERP_NONE)
|
|