fix Special Query for views in mysqli
authorAlan Knowles <alan@roojs.com>
Mon, 18 Feb 2019 03:54:40 +0000 (11:54 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 18 Feb 2019 03:54:40 +0000 (11:54 +0800)
DB/mysqli.php

index 7f394f4..70a3f41 100644 (file)
@@ -1122,6 +1122,11 @@ class DB_mysqli extends DB_common
      * @access protected
      * @see DB_common::getListOf()
      */
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+     
     function getSpecialQuery($type)
     {
         switch ($type) {
@@ -1131,10 +1136,22 @@ class DB_mysqli extends DB_common
                 return 'SELECT DISTINCT User FROM mysql.user';
             case 'databases':
                 return 'SHOW DATABASES';
+            case 'views':
+                return "SELECT
+                        distinct(TABLE_NAME)
+                    FROM
+                        information_schema.TABLES
+                    WHERE
+                        table_type = 'VIEW'
+                        AND
+                        TABLE_SCHEMA=DATABASE()
+                    ";
+            
             default:
                 return null;
         }
     }
+    
 
     // }}}