From e2908f68fcdd26ff387224afcf8b109253f3031c Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 9 Sep 2016 10:37:19 +0200 Subject: [PATCH] view sql bug fix --- lib/php/db/table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 2a3afd02..1a0d0ba6 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -147,7 +147,7 @@ Class Table extends nb { if ($from_sql) return $sql_replace($this->sql()); if ($this->type() == 'view') { - return $sql_replace('CREATE VIEW '.$this->sql_name().' AS SELECT'.preg_replace('/^CREATE\s+.*?\s+AS\s+.*?SELECT/i','',$this->sql())); + return $sql_replace('CREATE VIEW '.$this->sql_name().' AS '.preg_replace('/^CREATE\s+.*?\s+AS\s+.*?SELECT/i','SELECT',$this->sql())); } // Specific function for fields if return something use it instead of default -- 2.47.3