In CVS tip, if you run "make installcheck" in src/pl/plpython, the test
fails with a number of diffs between the expected and actual output.
I'm not sure if plpython is broken, or if it's just that someone changed
the behavior and didn't bother to update the test's expected files (the
test files don't seem to have been maintained since they were first
installed).

Comments?

			regards, tom lane

Thu, 30 Jan 2003 17:39:28 -0500
Tom Lane <tgl@sss.pgh.pa.us>
plpython fails its regression test
On Thu, 2003-01-30 at 16:39, Tom Lane wrote:
> In CVS tip, if you run "make installcheck" in src/pl/plpython, the test
> fails with a number of diffs between the expected and actual output.
> I'm not sure if plpython is broken, or if it's just that someone changed
> the behavior and didn't bother to update the test's expected files (the
> test files don't seem to have been maintained since they were first
> installed).
> 
> Comments?
> 
> 

Could this have anything to do with the changes I made to the python
stuff to get it to support longs (IIRC)?  It's been a while now so I
don't recall exactly what got changed.  I do remember that I chanced
some test code to ensure it tested the newly fixed data type.


Regards,


-- 
Greg Copeland <greg@copelandconsulting.net>
Copeland Computer Consulting


30 Jan 2003 16:53:10 -0600
Greg Copeland <greg@CopelandConsulting.Net>
Re: plpython fails its regression test
Greg Copeland <greg@copelandconsulting.net> writes:
> On Thu, 2003-01-30 at 16:39, Tom Lane wrote:
>> In CVS tip, if you run "make installcheck" in src/pl/plpython, the test
>> fails with a number of diffs between the expected and actual output.

> Could this have anything to do with the changes I made to the python
> stuff to get it to support longs (IIRC)?

The diffs seem to have more to do with error handling --- see attached.

None of the plpython files have changed since November, btw, so I would
imagine you'll see the same behavior in 7.3 or 7.3.1; but I haven't
rebuilt that branch to confirm it.

			regards, tom lane


--- error.expected	2002-03-06 13:50:31.000000000 -0500
+++ error.output	2003-01-30 17:18:23.000000000 -0500
@@ -1,12 +1,15 @@
 SELECT invalid_type_uncaught('rick');
-WARNING:  plpython: in function __plpython_procedure_invalid_type_uncaught_49801:
-plpy.SPIError: Cache lookup for type `test' failed.
+WARNING:  plpython: in function __plpython_procedure_invalid_type_uncaught_154373:
+plpy.SPIError: Unknown error in PLy_spi_prepare.
+ERROR:  Type "test" does not exist
 SELECT invalid_type_caught('rick');
-WARNING:  plpython: in function __plpython_procedure_invalid_type_caught_49802:
-plpy.SPIError: Cache lookup for type `test' failed.
+WARNING:  plpython: in function __plpython_procedure_invalid_type_caught_154374:
+plpy.SPIError: Unknown error in PLy_spi_prepare.
+ERROR:  Type "test" does not exist
 SELECT invalid_type_reraised('rick');
-WARNING:  plpython: in function __plpython_procedure_invalid_type_reraised_49803:
-plpy.SPIError: Cache lookup for type `test' failed.
+WARNING:  plpython: in function __plpython_procedure_invalid_type_reraised_154375:
+plpy.SPIError: Unknown error in PLy_spi_prepare.
+ERROR:  Type "test" does not exist
 SELECT valid_type('rick');
  valid_type 
 ------------
@@ -14,20 +17,20 @@
 (1 row)
 
 SELECT read_file('/etc/passwd');
-ERROR:  plpython: Call of function `__plpython_procedure_read_file_49809' failed.
+ERROR:  plpython: Call of function `__plpython_procedure_read_file_154381' failed.
 exceptions.IOError: can't open files in restricted mode
 SELECT write_file('/tmp/plpython','This is very bad');
-ERROR:  plpython: Call of function `__plpython_procedure_write_file_49810' failed.
+ERROR:  plpython: Call of function `__plpython_procedure_write_file_154382' failed.
 exceptions.IOError: can't open files in restricted mode
 SELECT getpid();
-ERROR:  plpython: Call of function `__plpython_procedure_getpid_49811' failed.
-exceptions.AttributeError: getpid
+ERROR:  plpython: Call of function `__plpython_procedure_getpid_154383' failed.
+exceptions.AttributeError: 'module' object has no attribute 'getpid'
 SELECT uname();
-ERROR:  plpython: Call of function `__plpython_procedure_uname_49812' failed.
-exceptions.AttributeError: uname
+ERROR:  plpython: Call of function `__plpython_procedure_uname_154384' failed.
+exceptions.AttributeError: 'module' object has no attribute 'uname'
 SELECT sys_exit();
-ERROR:  plpython: Call of function `__plpython_procedure_sys_exit_49813' failed.
-exceptions.AttributeError: exit
+ERROR:  plpython: Call of function `__plpython_procedure_sys_exit_154385' failed.
+exceptions.AttributeError: 'module' object has no attribute 'exit'
 SELECT sys_argv();
     sys_argv    
 ----------------


--- feature.expected	2002-10-15 11:24:17.000000000 -0400
+++ feature.output	2003-01-30 17:18:23.000000000 -0500
@@ -36,9 +36,10 @@
 (1 row)
 
 SELECT import_succeed();
-     import_succeed     
-------------------------
- succeeded, as expected
+NOTICE:  ('import failed -- No module named _sre',)
+             import_succeed             
+----------------------------------------
+ failed, that wasn't supposed to happen
 (1 row)
 
 SELECT import_test_one('sha hash of this string');
@@ -56,9 +57,9 @@
 select argument_test_one(users, fname, lname) from users where lname = 'doe' order by 1;
                                   argument_test_one                                  
 -------------------------------------------------------------------------------------
- jane doe => {'fname': 'jane', 'userid': 1, 'lname': 'doe', 'username': 'j_doe'}
- john doe => {'fname': 'john', 'userid': 2, 'lname': 'doe', 'username': 'johnd'}
- willem doe => {'fname': 'willem', 'userid': 3, 'lname': 'doe', 'username': 'w_doe'}
+ jane doe => {'lname': 'doe', 'username': 'j_doe', 'userid': 1, 'fname': 'jane'}
+ john doe => {'lname': 'doe', 'username': 'johnd', 'userid': 2, 'fname': 'john'}
+ willem doe => {'lname': 'doe', 'username': 'w_doe', 'userid': 3, 'fname': 'willem'}
 (3 rows)
 
 select nested_call_one('pass this along');

Thu, 30 Jan 2003 18:09:19 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: plpython fails its regression test 
On Thu, 2003-01-30 at 17:09, Tom Lane wrote:
> The diffs seem to have more to do with error handling --- see attached.
> 
> None of the plpython files have changed since November, btw, so I would
> imagine you'll see the same behavior in 7.3 or 7.3.1; but I haven't
> rebuilt that branch to confirm it.


Ouch.  Nope, I don't think that's my finger prints.  ;)


Greg


-- 
Greg Copeland <greg@copelandconsulting.net>
Copeland Computer Consulting


30 Jan 2003 17:28:06 -0600
Greg Copeland <greg@CopelandConsulting.Net>
Re: plpython fails its regression test