Adjust view production for stupid mysql
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / MySQL.pm
index 2214e8a..f261a9f 100644 (file)
@@ -364,7 +364,9 @@ sub create_view {
       $create .= " ( ${list} )";
     }
     if( my $sql = $view->sql ){
-      $create .= " AS (\n    ${sql}\n  )";
+      # do not wrap parenthesis around the selector, mysql doesn't like this
+      # http://bugs.mysql.com/bug.php?id=9198
+      $create .= " AS\n    ${sql}\n";
     }
 #    $create .= "";
     return $create;