From: SourceForge.net <no...@so...> - 2009-02-04 03:54:44
|
Bugs item #2555949, was opened at 2009-02-01 21:57 Message generated for change (Settings changed) made by ioguix You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=2555949&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: Tables Group: 4.2 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Limo Driver (l-s) >Assigned to: Guillaume `ioguix` de Rorthais (ioguix) Summary: Invalid insert into no-columns table Initial Comment: When trying to insert a row into a table that contains no columns, two notices appear: Notice: Undefined index: format in .../phppgadmin/tables.php on line 577 Notice: Undefined index: types in .../phppgadmin/tables.php on line 577 phppgadmin should issue a notice / trigger an error similar to this: "You cannot insert a row into a table with no columns." --- Steps needed to recreate: Create a table with no columns "CREATE TABLE no_cols();" Click on the table and select "Insert" In the "Insert row" dialog, choose either the "Insert" or the "Insert & Repeat" option. Two notices wil be thrown at this poinc: Notice: Undefined index: format in .../phppgadmin/tables.php on line 577 Notice: Undefined index: types in .../phppgadmin/tables.php on line 577 occuring in: $status = $data->insertRow($_POST['table'], $_POST['values'], $_POST['nulls'], $_POST['format'], $_POST['types']); I did a quick patch by defaulting the undefined $_POST variables to null. if (!isset($_POST['format'])) $_POST['format'] = null; if (!isset($_POST['types'])) $_POST['types'] = null; That way, the insertRow function in Postgres.php will return an error value (-1) and promptly exit. But it would be better if someone introduced a better no-columns check. ---------------------------------------------------------------------- >Comment By: Guillaume `ioguix` de Rorthais (ioguix) Date: 2009-02-04 04:54 Message: Thank you for this report. I'll try to fix that in the next few days if possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=2555949&group_id=37132 |