From: SourceForge.net <no...@so...> - 2008-01-02 10:56:44
|
Bugs item #1859642, was opened at 2007-12-28 12:08 Message generated for change (Comment added) made by laurenz_albe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=1859642&group_id=37132 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Functions Group: CVS >Status: Open Resolution: Works For Me Priority: 7 Private: No Submitted By: Laurenz Albe (laurenz_albe) Assigned to: Guillaume `ioguix` de Rorthais (ioguix) Summary: Function argument data type turns garbage after error Initial Comment: I select "Create SQL/PL function". Name: test Returns: integer Programming language: plpgsql There is one argument: Name: param Type: integer Definition: BEGIN RETURN nonsense; END; When I hit "Create", I get an error message, which is fine. Problem: The data type of the function argument "param" turns to "p", and the drop-down list contains only garbage. ---------------------------------------------------------------------- >Comment By: Laurenz Albe (laurenz_albe) Date: 2008-01-02 11:56 Message: Logged In: YES user_id=1318811 Originator: YES I investigated and post more details here. First, ALL my versions: PostgreSQL 8.3 Beta 4, Apache 2.0.55, PHP 4.4.1 The steps to reproduce are exactly as indicated in the original report, EXCEPT the function definition should be slightly different so that it produces an error at function creation time: BEGIN NONSENSE; END; I tried to find the problem in the source code, and it is at or near line 741 in function buildJSData() in webdb/functions.php. I know too little PHP to be able to say what exactly is wrong and how it should be fixed, but here is what I see happen: - The database query to select the types in line 737 works fine and returns the correct results. - The iteration in line 741 is somehow wrong and fills arrayPTypes with garbage (compare with the previous use in lines 437 and 456ff). - g_main_types is consequently assigned the same garbage in line 747, and this shows up in the HTTP code of the response page as follows: <script type="text/javascript">g_main_types = new Array('p','n','abstime','','','S','','&','&','','','','','','','','','','','','','','','','','','','','','');g_main_modes = new Array('IN','OUT','INOUT');</script> - g_main_types is used by function RebuildArgTR from webdb/functions.js, invoked from the following line of the HTTP code of the response page: <script type="text/javascript">RebuildArgTR('IN','param','integer',new Boolean(false));</script> ---------------------------------------------------------------------- Comment By: Robert Treat (xzilla) Date: 2007-12-29 07:44 Message: Logged In: YES user_id=204589 Originator: NO i also cannot reproduce this after playing around a bit with latest cvs. Laurenz, if you can reproduce against latest cvs, please provide us a test case, but i think this may have been corrected. ---------------------------------------------------------------------- Comment By: Guillaume `ioguix` de Rorthais (ioguix) Date: 2007-12-28 21:10 Message: Logged In: YES user_id=1489394 Originator: NO I can't reproduce this bug presently... could you give us some more info or confirm it has been fixed (when I fixed the #1859646?) ---------------------------------------------------------------------- Comment By: Laurenz Albe (laurenz_albe) Date: 2007-12-28 12:11 Message: Logged In: YES user_id=1318811 Originator: YES I forgot to add that the database is PostgreSQL 8.3 beta 4. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=1859642&group_id=37132 |