/**
  * Tests for PMA_getExistingTranformationData() method.
  *
  * @return void
  * @test
  */
 public function testPMAGetExistingTranformationData()
 {
     $db = "PMA_db";
     $ret = PMA_getExistingTranformationData($db);
     //validate that is the same as $GLOBALS['dbi']->tryQuery
     $this->assertEquals('executeResult2', $ret);
 }
Ejemplo n.º 2
0
            $sql_query .= $sep . ' WITH ' . implode(' ', $options);
        }
    }

    if (PMA_DBI_try_query($sql_query)) {
        
        require_once './libraries/tbl_views.lib.php';
        
        // If different column names defined for VIEW
        $view_columns = array();
        if (isset($_REQUEST['view']['column_names'])) {
            $view_columns = explode(',', $_REQUEST['view']['column_names']);
        }
        
        $column_map = PMA_getColumnMap($_REQUEST['view']['as'], $view_columns);        
        $pma_tranformation_data = PMA_getExistingTranformationData($GLOBALS['db']);
        
        if ($pma_tranformation_data !== false) {
            
            // SQL for store new transformation details of VIEW
            $new_transformations_sql = PMA_getNewTransformationDataSql(
                $pma_tranformation_data, $column_map, $_REQUEST['view']['name'],
                $GLOBALS['db']
            );            
            
            // Store new transformations
            if ($new_transformations_sql != '') {
                PMA_DBI_try_query($new_transformations_sql);
            }
            
        }