forked from greenplum-db/gpdb-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
105 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
-- | ||
-- Tests for functions that return set PYTHONPATH guc only for gpdb6 plpython3 | ||
-- | ||
LOAD 'plpython3'; | ||
show plpython3.python_path; | ||
plpython3.python_path | ||
----------------------- | ||
|
||
(1 row) | ||
|
||
set plpython3.python_path='/foo'; | ||
show plpython3.python_path; | ||
plpython3.python_path | ||
----------------------- | ||
/foo | ||
(1 row) | ||
|
||
-- Set up test path functions first. | ||
CREATE FUNCTION test_path_added() | ||
RETURNS text AS $$ | ||
import sys | ||
return str(sys.path[0]) | ||
$$ language plpython3u; | ||
SELECT test_path_added(); | ||
test_path_added | ||
----------------- | ||
/foo | ||
(1 row) | ||
|
||
-- when the plpython init can not set again -- | ||
set plpython3.python_path='/bar'; | ||
ERROR: SET PYTHONPATH failed, the GUC value can only be changed before initializing the python interpreter. | ||
-- run again the path will not change still /foo -- | ||
SELECT test_path_added(); | ||
test_path_added | ||
----------------- | ||
/foo | ||
(1 row) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- | ||
-- Tests for functions that return set PYTHONPATH guc only for gpdb6 plpython3 | ||
-- | ||
LOAD 'plpython3'; | ||
show plpython3.python_path; | ||
|
||
set plpython3.python_path='/foo'; | ||
show plpython3.python_path; | ||
|
||
-- Set up test path functions first. | ||
CREATE FUNCTION test_path_added() | ||
RETURNS text AS $$ | ||
import sys | ||
return str(sys.path[0]) | ||
$$ language plpython3u; | ||
|
||
SELECT test_path_added(); | ||
|
||
-- when the plpython init can not set again -- | ||
set plpython3.python_path='/bar'; | ||
|
||
-- run again the path will not change still /foo -- | ||
SELECT test_path_added(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters