Exemplo n.º 1
0
/**
 * Delete related tranformatioinformationn information
 *
 * @param String $db           current database
 * @param String $table        current table
 * @param array  $analyzed_sql analyzed sql query
 *
 * @return void
 */
function PMA_deleteTransformationInfo($db, $table, $analyzed_sql)
{
    include_once 'libraries/transformations.lib.php';
    if ($analyzed_sql[0]['querytype'] == 'ALTER') {
        $posDrop = mb_stripos($analyzed_sql[0]['unsorted_query'], 'DROP');
        if ($posDrop !== false) {
            $drop_column = PMA_getColumnNameInColumnDropSql($analyzed_sql[0]['unsorted_query']);
            if ($drop_column != '') {
                PMA_clearTransformations($db, $table, $drop_column);
            }
        }
    } else {
        if ($analyzed_sql[0]['querytype'] == 'DROP' && $table != '') {
            PMA_clearTransformations($db, $table);
        }
    }
}
Exemplo n.º 2
0
        include_once 'libraries/relation_cleanup.lib.php';
        PMA_relationsCleanupColumn($db, $table, $dropped_column);
        // to refresh the list of indexes (Ajax mode)
        $extra_data['indexes_list'] = PMA_Index::getView($table, $db);
    }
    // end if column was dropped
}
// end else "didn't ask to see php code"
// No rows returned -> move back to the calling page
if (0 == $num_rows && 0 == $unlim_num_rows || $is_affected) {
    // Delete related tranformation information
    if (!empty($analyzed_sql[0]['querytype']) && ($analyzed_sql[0]['querytype'] == 'ALTER' || $analyzed_sql[0]['querytype'] == 'DROP')) {
        include_once 'libraries/transformations.lib.php';
        if ($analyzed_sql[0]['querytype'] == 'ALTER') {
            if (stripos($analyzed_sql[0]['unsorted_query'], 'DROP') !== false) {
                $drop_column = PMA_getColumnNameInColumnDropSql($analyzed_sql[0]['unsorted_query']);
                if ($drop_column != '') {
                    PMA_clearTransformations($db, $table, $drop_column);
                }
            }
        } else {
            if ($analyzed_sql[0]['querytype'] == 'DROP' && $table != '') {
                PMA_clearTransformations($db, $table);
            }
        }
    }
    if ($is_delete) {
        $message = PMA_Message::getMessageForDeletedRows($num_rows);
    } elseif ($is_insert) {
        if ($is_replace) {
            // For replace we get DELETED + INSERTED row count,