~ubuntu-branches/ubuntu/lucid/phpmyadmin/lucid

« back to all changes in this revision

Viewing changes to db_operations.php

  • Committer: Bazaar Package Importer
  • Author(s): Michal Čihař
  • Date: 2010-03-08 15:25:00 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100308152500-6e8hmuqc5co39de5
Tags: 4:3.3.0-1
* New upstream version.
* Rediff debian/patches.
* Fix permissions on mediawiki export extension.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 *  - adding tables
10
10
 *  - viewing PDF schemas
11
11
 *
12
 
 * @version $Id: db_operations.php 13203 2010-01-01 22:41:29Z lem9 $
 
12
 * @version $Id: db_operations.php 13260 2010-01-20 08:00:47Z helmo $
13
13
 * @package phpMyAdmin
14
14
 */
15
15
 
53
53
            }
54
54
            $local_query .= ';';
55
55
            $sql_query = $local_query;
 
56
            // save the original db name because Tracker.class.php which
 
57
            // may be called under PMA_DBI_query() changes $GLOBALS['db']
 
58
            // for some statements, one of which being CREATE DATABASE
 
59
            $original_db = $db;
56
60
            PMA_DBI_query($local_query);
 
61
            $db = $original_db;
 
62
            unset($original_db);
57
63
 
58
64
            // rebuild the database list because PMA_Table::moveCopy
59
65
            // checks in this list if the target db exists
73
79
            $sql_constraints = '';
74
80
            $sql_drop_foreign_keys = '';
75
81
            $sql_structure = PMA_getTableDef($db, $each_table, "\n", '', false, false);
76
 
            if (! empty($sql_drop_foreign_keys)) {
 
82
            if ($move && ! empty($sql_drop_foreign_keys)) {
77
83
                PMA_DBI_query($sql_drop_foreign_keys);
78
84
            }
79
85
            // keep the constraint we just dropped
138
144
                unset($triggers); 
139
145
 
140
146
                // this does not apply to a rename operation
141
 
                if (isset($GLOBALS['add_constraints'])) {
 
147
                if (isset($GLOBALS['add_constraints']) && !empty($GLOBALS['sql_constraints_query'])) {
142
148
                    $GLOBALS['sql_constraints_query_full_db'][] = $GLOBALS['sql_constraints_query'];
143
149
                    unset($GLOBALS['sql_constraints_query']);
144
150
                }
452
458
            'structure' => $strStrucOnly,
453
459
            'data'      => $strStrucData,
454
460
            'dataonly'  => $strDataOnly);
455
 
        PMA_generate_html_radio('what', $choices, 'data', true);
 
461
        PMA_display_html_radio('what', $choices, 'data', true);
456
462
        unset($choices);
457
463
?>
458
464
        <input type="checkbox" name="create_database_before_copying" value="1"
527
533
                    <?php echo PMA_getIcon('b_edit.png', $strBLOBRepository, false, true); ?>
528
534
                    </legend>
529
535
 
530
 
                    <?php echo $strBLOBRepositoryStatus; ?>:
 
536
                    <?php echo $strStatus; ?>:
531
537
 
532
538
                    <?php
533
539
 
623
629
         SELECT *
624
630
           FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']) . '
625
631
          WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
626
 
    $test_rs    = PMA_query_as_cu($test_query, null, PMA_DBI_QUERY_STORE);
 
632
    $test_rs    = PMA_query_as_controluser($test_query, null, PMA_DBI_QUERY_STORE);
627
633
 
628
634
    if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
629
635
    <!-- PDF schema -->