public function matchingColumns($table1, $table2, $which_connection='')
    {
        if ($which_connection == '') {
            $which_connection=$this->default_db;
        }
        
        $definition1 = $this->tableDefinition($table1, $which_connection);
        $definition2 = $this->tableDefinition($table2, $which_connection);
        if (!is_array($definition1) || ! is_array($definition2)) {
            return array();
        }

        $matches = array_filter(array_keys($definition1),
            function ($col_name) use ($definition2) {
                return isset($definition2[$col_name]) ? true : false;
            }
        );

        return $matches;
    }