From 09a4be3b740cfd39975c5b0984a536fd0a3d937d Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 8 Sep 2008 16:43:36 +0000 Subject: [PATCH] bug #2090002 [display] Cannot edit row in VIEW --- ChangeLog | 1 + libraries/common.lib.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fb3c30e5a..5654501e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA + rfe #1778908 [auth] arbitrary server auth can now also accept port - patch #2089240 [export] handle correctly switching SQL modes + rfe #1612724 [export] add option to export without comments +- bug #2090002 [display] Cannot edit row in VIEW 3.0.0.0 (not yet released) + [export] properly handle line breaks for YAML, thanks to Dan Barry - diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 9cb76a4e4..928db7e88 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1935,7 +1935,11 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force // // But orgtable is present only with mysqli extension so the // fix is only for mysqli. - if (isset($meta->orgtable) && $meta->table != $meta->orgtable) { + // Also, do not use the original table name if we are dealing with + // a view because this view might be updatable. + // (The isView() verification should not be costly in most cases + // because there is some caching in the function). + if (isset($meta->orgtable) && $meta->table != $meta->orgtable && ! PMA_Table::isView($GLOBALS['db'], $meta->table)) { $meta->table = $meta->orgtable; }