Skip to content
Newer
Older
100644 880 lines (809 sloc) 32.2 KB
173a482 @lem9 operations
lem9 authored Apr 28, 2002
1 <?php
817e790 synced/fixed vim line
Sebastian Mendel authored Mar 19, 2007
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
374abd5 fixed/added page level docblock
Sebastian Mendel authored Mar 20, 2007
3 /**
4 *
e56949f @nijel Use package name PhpMyAdmin
nijel authored Oct 25, 2011
5 * @package PhpMyAdmin
374abd5 fixed/added page level docblock
Sebastian Mendel authored Mar 20, 2007
6 */
173a482 @lem9 operations
lem9 authored Apr 28, 2002
7
374abd5 fixed/added page level docblock
Sebastian Mendel authored Mar 20, 2007
8 /**
9 *
10 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
11 require_once 'libraries/common.inc.php';
fcf387b common.lib.php should REALLY REALLY and ALWAYS be the first include
Sebastian Mendel authored Nov 18, 2005
12
ecc793b make use of PMA_Table object for renaming tables (added also some req…
Sebastian Mendel authored Feb 21, 2006
13 $pma_table = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
14
56e9d5d message is now displayed if a query had been submitted to sort the table
Loïc Chapeaux authored May 3, 2002
15 /**
16 * Runs common work
17 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
18 require 'libraries/tbl_common.php';
ad06b4a @nijel Rename tbl_* files to drop useless _properties part.
nijel authored Oct 25, 2006
19 $url_query .= '&amp;goto=tbl_operations.php&amp;back=tbl_operations.php';
20 $url_params['goto'] = $url_params['back'] = 'tbl_operations.php';
cca4a66 changes to move to central PMA DB: check for referential integrity wo…
Mike Beck authored Jun 15, 2002
21
c5d319a coding standards
Loïc Chapeaux authored Jul 5, 2002
22 /**
23 * Gets relation settings
24 */
cca4a66 changes to move to central PMA DB: check for referential integrity wo…
Mike Beck authored Jun 15, 2002
25 $cfgRelation = PMA_getRelationsParam();
26
7810355 @lem9 remove Options tab
lem9 authored Jun 5, 2003
27 /**
c505e1c @derrabus - BerkeleyDB version information.
derrabus authored Jan 18, 2005
28 * Gets available MySQL charsets and storage engines
a1875b0 @derrabus Improved MySQL 4.1 support
derrabus authored Jun 7, 2003
29 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
30 require_once 'libraries/mysql_charsets.lib.php';
31 require_once 'libraries/StorageEngine.class.php';
a1875b0 @derrabus Improved MySQL 4.1 support
derrabus authored Jun 7, 2003
32
b37d10c @bestben Feature Request #3187076
bestben authored Mar 27, 2011
33 // add a javascript file for jQuery functions to handle Ajax actions
34 // also add jQueryUI
4a5cb00 @Crack Fix jQuery UI version number
Crack authored Oct 11, 2011
35 $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.16.custom.js';
b37d10c @bestben Feature Request #3187076
bestben authored Mar 27, 2011
36
518cb59 @lem9 more partition stuff
lem9 authored Oct 26, 2007
37 /**
bd501a3 removed obsolete PMA_ENGINE_KEYWORD
Sebastian Mendel authored Jan 21, 2008
38 * Class for partition management
518cb59 @lem9 more partition stuff
lem9 authored Oct 26, 2007
39 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
40 require_once 'libraries/Partition.class.php';
518cb59 @lem9 more partition stuff
lem9 authored Oct 26, 2007
41
09180e0 @lem9 bug #1035524
lem9 authored Sep 29, 2004
42 // reselect current db (needed in some cases probably due to
43 // the calling of relation.lib.php)
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
44 PMA_DBI_select_db($GLOBALS['db']);
45
46 /**
47 * Gets tables informations
48 */
09180e0 @lem9 bug #1035524
lem9 authored Sep 29, 2004
49
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
50 require 'libraries/tbl_info.inc.php';
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
51
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
52 // define some globals here, for improved syntax in the conditionals
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
53 $is_myisam_or_aria = $is_isam = $is_innodb = $is_berkeleydb = $is_aria = $is_pbxt = false;
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
54 // set initial value of these globals, based on the current table engine
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
55 PMA_set_global_variables_for_engine($tbl_storage_engine);
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
56
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
57 if ($is_aria) {
e8248f8 @lem9 MARIA: TRANSACTIONAL create option (in Operations)
lem9 authored Mar 17, 2008
58 // the value for transactional can be implicit
59 // (no create option found, in this case it means 1)
60 // or explicit (option found with a value of 0 or 1)
61 // ($transactional may have been set by libraries/tbl_info.inc.php,
62 // from the $create_options)
63 $transactional = (isset($transactional) && $transactional == '0') ? '0' : '1';
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
64 $page_checksum = (isset($page_checksum)) ? $page_checksum : '';
e8248f8 @lem9 MARIA: TRANSACTIONAL create option (in Operations)
lem9 authored Mar 17, 2008
65 }
66
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
67 $reread_info = false;
68 $table_alters = array();
2678154 @nijel Reread table information after change, so that rendered page contains…
nijel authored Oct 25, 2005
69
a1875b0 @derrabus Improved MySQL 4.1 support
derrabus authored Jun 7, 2003
70 /**
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
71 * If the table has to be moved to some other database
72 */
219ec73 @nijel Spacing around if
nijel authored Jul 22, 2011
73 if (isset($_REQUEST['submit_move']) || isset($_REQUEST['submit_copy'])) {
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
74 $_message = '';
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
75 include_once 'tbl_move_copy.php';
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
76 }
77 /**
78 * If the table has to be maintained
79 */
219ec73 @nijel Spacing around if
nijel authored Jul 22, 2011
80 if (isset($_REQUEST['table_maintenance'])) {
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
81 include_once 'sql.php';
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
82 unset($result);
83 }
84 /**
7810355 @lem9 remove Options tab
lem9 authored Jun 5, 2003
85 * Updates table comment, type and options if required
86 */
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
87 if (isset($_REQUEST['submitoptions'])) {
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
88 $_message = '';
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
89 $warning_messages = array();
90
ecc793b make use of PMA_Table object for renaming tables (added also some req…
Sebastian Mendel authored Feb 21, 2006
91 if (isset($_REQUEST['new_name'])) {
92 if ($pma_table->rename($_REQUEST['new_name'])) {
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
93 $_message .= $pma_table->getLastMessage();
94 $result = true;
95 $GLOBALS['table'] = $pma_table->getName();
ecc793b make use of PMA_Table object for renaming tables (added also some req…
Sebastian Mendel authored Feb 21, 2006
96 $reread_info = true;
97 $reload = true;
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
98 } else {
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
99 $_message .= $pma_table->getLastError();
100 $result = false;
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
101 }
7810355 @lem9 remove Options tab
lem9 authored Jun 5, 2003
102 }
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
103 if (isset($_REQUEST['comment'])
104 && urldecode($_REQUEST['prev_comment']) !== $_REQUEST['comment']) {
c9c9fdf @nijel Consistent capitalisation of PMA_sqlAddSlashes
nijel authored Jun 27, 2011
105 $table_alters[] = 'COMMENT = \'' . PMA_sqlAddSlashes($_REQUEST['comment']) . '\'';
713355f @nijel Allow to change auto_increment for InnoDB, supported since MySQL 5.0.…
nijel authored Oct 25, 2005
106 }
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
107 if (! empty($_REQUEST['new_tbl_storage_engine'])
108 && strtolower($_REQUEST['new_tbl_storage_engine']) !== strtolower($tbl_storage_engine)) {
109 $table_alters[] = 'ENGINE = ' . $_REQUEST['new_tbl_storage_engine'];
110 $tbl_storage_engine = $_REQUEST['new_tbl_storage_engine'];
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
111 // reset the globals for the new engine
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
112 PMA_set_global_variables_for_engine($tbl_storage_engine);
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
113 if ($is_aria) {
769aec9 [engines] Fix warnings when changing table engine to Maria.
Madhura Jayaratne authored Apr 20, 2010
114 $transactional = (isset($transactional) && $transactional == '0') ? '0' : '1';
115 $page_checksum = (isset($page_checksum)) ? $page_checksum : '';
116 }
713355f @nijel Allow to change auto_increment for InnoDB, supported since MySQL 5.0.…
nijel authored Oct 25, 2005
117 }
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
118
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
119 if (! empty($_REQUEST['tbl_collation'])
120 && $_REQUEST['tbl_collation'] !== $tbl_collation) {
121 $table_alters[] = 'DEFAULT ' . PMA_generateCharsetQueryPart($_REQUEST['tbl_collation']);
122 }
123
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
124 if (($is_myisam_or_aria || $is_isam)
45b04ab replaced $dblist with new PMA_List_Database class
Sebastian Mendel authored Sep 20, 2006
125 && isset($_REQUEST['new_pack_keys'])
f4e8e08 @nijel Reload language file after switch to utf-8 translation (bug #1442605).
nijel authored Apr 27, 2006
126 && $_REQUEST['new_pack_keys'] != (string)$pack_keys) {
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
127 $table_alters[] = 'pack_keys = ' . $_REQUEST['new_pack_keys'];
128 }
129
130 $checksum = empty($checksum) ? '0' : '1';
131 $_REQUEST['new_checksum'] = empty($_REQUEST['new_checksum']) ? '0' : '1';
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
132 if ($is_myisam_or_aria
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
133 && $_REQUEST['new_checksum'] !== $checksum) {
134 $table_alters[] = 'checksum = ' . $_REQUEST['new_checksum'];
135 }
136
e8248f8 @lem9 MARIA: TRANSACTIONAL create option (in Operations)
lem9 authored Mar 17, 2008
137 $_REQUEST['new_transactional'] = empty($_REQUEST['new_transactional']) ? '0' : '1';
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
138 if ($is_aria
e8248f8 @lem9 MARIA: TRANSACTIONAL create option (in Operations)
lem9 authored Mar 17, 2008
139 && $_REQUEST['new_transactional'] !== $transactional) {
140 $table_alters[] = 'TRANSACTIONAL = ' . $_REQUEST['new_transactional'];
141 }
142
d7e690e @lem9 MARIA: PAGE_CHECKSUM (does not currently work in 5.1.23a-maria)
lem9 authored Mar 18, 2008
143 $_REQUEST['new_page_checksum'] = empty($_REQUEST['new_page_checksum']) ? '0' : '1';
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
144 if ($is_aria
d7e690e @lem9 MARIA: PAGE_CHECKSUM (does not currently work in 5.1.23a-maria)
lem9 authored Mar 18, 2008
145 && $_REQUEST['new_page_checksum'] !== $page_checksum) {
146 $table_alters[] = 'PAGE_CHECKSUM = ' . $_REQUEST['new_page_checksum'];
147 }
148
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
149 $delay_key_write = empty($delay_key_write) ? '0' : '1';
150 $_REQUEST['new_delay_key_write'] = empty($_REQUEST['new_delay_key_write']) ? '0' : '1';
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
151 if ($is_myisam_or_aria
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
152 && $_REQUEST['new_delay_key_write'] !== $delay_key_write) {
153 $table_alters[] = 'delay_key_write = ' . $_REQUEST['new_delay_key_write'];
154 }
155
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
156 if (($is_myisam_or_aria || $is_innodb || $is_pbxt)
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
157 && ! empty($_REQUEST['new_auto_increment'])
158 && (! isset($auto_increment) || $_REQUEST['new_auto_increment'] !== $auto_increment)) {
c9c9fdf @nijel Consistent capitalisation of PMA_sqlAddSlashes
nijel authored Jun 27, 2011
159 $table_alters[] = 'auto_increment = ' . PMA_sqlAddSlashes($_REQUEST['new_auto_increment']);
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
160 }
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
161
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
162 if (($is_myisam_or_aria || $is_innodb || $is_pbxt)
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
163 && ! empty($_REQUEST['new_row_format'])
3815405 @lem9 bug #2461735 [operations] Table operations adds "row_format"
lem9 authored Dec 23, 2008
164 && (! isset($row_format) || strtolower($_REQUEST['new_row_format']) !== strtolower($row_format))) {
c9c9fdf @nijel Consistent capitalisation of PMA_sqlAddSlashes
nijel authored Jun 27, 2011
165 $table_alters[] = 'ROW_FORMAT = ' . PMA_sqlAddSlashes($_REQUEST['new_row_format']);
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
166 }
167
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
168 if (count($table_alters) > 0) {
169 $sql_query = 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']);
170 $sql_query .= "\r\n" . implode("\r\n", $table_alters);
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
171 $result .= PMA_DBI_query($sql_query) ? true : false;
0a9c4fc never rush a checkin - its allways trouble
Sebastian Mendel authored Apr 11, 2006
172 $reread_info = true;
173 unset($table_alters);
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
174 foreach (PMA_DBI_get_warnings() as $warning) {
ad71c5b @nijel Standard look to forms on table operations page.
nijel authored May 31, 2010
175 // In MariaDB 5.1.44, when altering a table from Maria to MyISAM
e9ee6cf @lem9 bug #2983065 Error when changing from Maria to MyISAM engine
lem9 authored Apr 25, 2010
176 // and if TRANSACTIONAL was set, the system reports an error;
177 // I discussed with a Maria developer and he agrees that this
178 // should not be reported with a Level of Error, so here
179 // I just ignore it. But there are other 1478 messages
180 // that it's better to show.
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
181 if (! ($_REQUEST['new_tbl_storage_engine'] == 'MyISAM' && $warning['Code'] == '1478' && $warning['Level'] == 'Error')) {
e9ee6cf @lem9 bug #2983065 Error when changing from Maria to MyISAM engine
lem9 authored Apr 25, 2010
182 $warning_messages[] = $warning['Level'] . ': #' . $warning['Code']
183 . ' ' . $warning['Message'];
184 }
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
185 }
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
186 }
187 }
12d4167 Start "stay on the sub-pages" work for table properties
Loïc Chapeaux authored May 1, 2002
188 /**
189 * Reordering the table has been requested by the user
190 */
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
191 if (isset($_REQUEST['submitorderby']) && ! empty($_REQUEST['order_field'])) {
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
192 $sql_query = '
193 ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . '
194 ORDER BY ' . PMA_backquote(urldecode($_REQUEST['order_field']));
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
195 if (isset($_REQUEST['order_order']) && $_REQUEST['order_order'] === 'desc') {
fc4ba26 @nijel Define sort order for sorting tables (RFE #971314).
nijel authored Jun 15, 2004
196 $sql_query .= ' DESC';
197 }
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
198 $result = PMA_DBI_query($sql_query);
12d4167 Start "stay on the sub-pages" work for table properties
Loïc Chapeaux authored May 1, 2002
199 } // end if
200
5eb4fee @lem9 partition maintenance
lem9 authored Nov 1, 2007
201 /**
202 * A partition operation has been requested by the user
203 */
204 if (isset($_REQUEST['submit_partition']) && ! empty($_REQUEST['partition_operation'])) {
205 $sql_query = 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' ' . $_REQUEST['partition_operation'] . ' PARTITION ' . $_REQUEST['partition_name'];
206 $result = PMA_DBI_query($sql_query);
207 } // end if
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
208
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
209 if ($reread_info) {
226d9f7 @lem9 patch #2677091 tbl_operations shows old AI value, thanks to Virsacer …
lem9 authored Mar 22, 2009
210 // to avoid showing the old value (for example the AUTO_INCREMENT) after
211 // a change, clear the cache
ad71c5b @nijel Standard look to forms on table operations page.
nijel authored May 31, 2010
212 PMA_Table::$cache = array();
d7e690e @lem9 MARIA: PAGE_CHECKSUM (does not currently work in 5.1.23a-maria)
lem9 authored Mar 18, 2008
213 $page_checksum = $checksum = $delay_key_write = 0;
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
214 include 'libraries/tbl_info.inc.php';
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
215 }
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
216 unset($reread_info);
5e472df Moved tables comments and type fetaure and referential integrity chec…
Loïc Chapeaux authored Apr 28, 2002
217
3f258cf @nijel Cleanup of message displaying and navigation reloading.
nijel authored Oct 21, 2004
218 /**
1635c5c @lgtkaushalya Ajaxify the Alter table order in Table operations
lgtkaushalya authored Jul 25, 2011
219 * Displays top menu links in non ajax requests
3f258cf @nijel Cleanup of message displaying and navigation reloading.
nijel authored Oct 21, 2004
220 */
1635c5c @lgtkaushalya Ajaxify the Alter table order in Table operations
lgtkaushalya authored Jul 25, 2011
221 if (!isset($_REQUEST['ajax_request'])) {
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
222 include_once 'libraries/tbl_links.inc.php';
1635c5c @lgtkaushalya Ajaxify the Alter table order in Table operations
lgtkaushalya authored Jul 25, 2011
223 }
98a5ba7 @lem9 misleading variable name
lem9 authored Sep 4, 2010
224 if (isset($result) && empty($message_to_show)) {
84ae042 @nijel Adding @package, third part.
nijel authored Nov 24, 2008
225 // set to success by default, because result set could be empty
51ea0c9 @lem9 undefined $_type on successful table rename
lem9 authored May 4, 2008
226 // (for example, a table rename)
227 $_type = 'success';
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
228 if (empty($_message)) {
1635c5c @lgtkaushalya Ajaxify the Alter table order in Table operations
lgtkaushalya authored Jul 25, 2011
229 $_message = $result ? $message = PMA_Message::success(__('Your SQL query has been executed successfully')) : PMA_Message::error(__('Error'));
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
230 // $result should exist, regardless of $_message
231 $_type = $result ? 'success' : 'error';
66fbb2d @lgtkaushalya Fixed the bugs in table copy of table operations
lgtkaushalya authored Jul 31, 2011
232 if ( $_REQUEST['ajax_request'] == true) {
13adb5a @madhuracj Use lower case for true, false and null
madhuracj authored Sep 23, 2011
233 $extra_data['sql_query'] = PMA_showMessage(null, $sql_query);
e67a0a2 @madhuracj Spaces between parameters in function calls
madhuracj authored Sep 23, 2011
234 PMA_ajaxResponse($_message, $_message->isSuccess(), $extra_data);
1635c5c @lgtkaushalya Ajaxify the Alter table order in Table operations
lgtkaushalya authored Jul 25, 2011
235 }
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
236 }
237 if (! empty($warning_messages)) {
238 $_message = new PMA_Message;
239 $_message->addMessages($warning_messages);
73c57b0 @lem9 Continue to replace warning level with error level
lem9 authored May 3, 2011
240 $_message->isError(true);
66fbb2d @lgtkaushalya Fixed the bugs in table copy of table operations
lgtkaushalya authored Jul 31, 2011
241 if ( $_REQUEST['ajax_request'] == true) {
1635c5c @lgtkaushalya Ajaxify the Alter table order in Table operations
lgtkaushalya authored Jul 25, 2011
242 PMA_ajaxResponse($_message, false);
243 }
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
244 unset($warning_messages);
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
245 }
1635c5c @lgtkaushalya Ajaxify the Alter table order in Table operations
lgtkaushalya authored Jul 25, 2011
246
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
247 PMA_showMessage($_message, $sql_query, $_type);
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
248 unset($_message, $_type);
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
249 }
250
ad06b4a @nijel Rename tbl_* files to drop useless _properties part.
nijel authored Oct 25, 2006
251 $url_params['goto'] = 'tbl_operations.php';
252 $url_params['back'] = 'tbl_operations.php';
7e5b651 fixed undefined variables (moved table related output after possible …
Sebastian Mendel authored Dec 8, 2005
253
12d4167 Start "stay on the sub-pages" work for table properties
Loïc Chapeaux authored May 1, 2002
254 /**
255 * Get columns names
256 */
183c0f4 @nijel Use PMA_DBI_get_columns
nijel authored Aug 4, 2011
257 $columns = PMA_DBI_get_columns($GLOBALS['db'], $GLOBALS['table']);
12d4167 Start "stay on the sub-pages" work for table properties
Loïc Chapeaux authored May 1, 2002
258
259 /**
260 * Displays the page
261 */
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
262 ?>
263 <!-- Order the table -->
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
264 <div class="operations_half_width">
1635c5c @lgtkaushalya Ajaxify the Alter table order in Table operations
lgtkaushalya authored Jul 25, 2011
265 <form method="post" id="alterTableOrderby" action="tbl_operations.php" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
266 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
267 <fieldset id="fieldset_table_order">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
268 <legend><?php echo __('Alter table order by'); ?></legend>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
269 <select name="order_field">
270 <?php
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
271 foreach ($columns as $fieldname) {
183c0f4 @nijel Use PMA_DBI_get_columns
nijel authored Aug 4, 2011
272 echo ' <option value="' . htmlspecialchars($fieldname['Field']) . '">'
273 . htmlspecialchars($fieldname['Field']) . '</option>' . "\n";
5e472df Moved tables comments and type fetaure and referential integrity chec…
Loïc Chapeaux authored Apr 28, 2002
274 }
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
275 unset($columns);
5e472df Moved tables comments and type fetaure and referential integrity chec…
Loïc Chapeaux authored Apr 28, 2002
276 ?>
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
277 </select> <?php echo __('(singly)'); ?>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
278 <select name="order_order">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
279 <option value="asc"><?php echo __('Ascending'); ?></option>
280 <option value="desc"><?php echo __('Descending'); ?></option>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
281 </select>
ad71c5b @nijel Standard look to forms on table operations page.
nijel authored May 31, 2010
282 </fieldset>
283 <fieldset class="tblFooters">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
284 <input type="submit" name="submitorderby" value="<?php echo __('Go'); ?>" />
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
285 </fieldset>
286 </form>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
287 </div>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
288
289 <!-- Move table -->
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
290 <div class="operations_half_width">
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
291 <form method="post" action="tbl_operations.php"
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
292 onsubmit="return emptyFormElements(this, 'new_name')">
293 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
294 <input type="hidden" name="reload" value="1" />
295 <input type="hidden" name="what" value="data" />
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
296 <fieldset id="fieldset_table_rename">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
297 <legend><?php echo __('Move table to (database<b>.</b>table):'); ?></legend>
fa21fe3 make the database list more magic:
Sebastian Mendel authored May 9, 2008
298 <?php if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {
683a3e0 @lem9 bug #1859460 [display] Operations and many databases
lem9 authored Dec 30, 2007
299 ?>
823687a @lem9 bug #1859460, prevent an empty target_db field to produce a failure, …
lem9 authored Dec 30, 2007
300 <input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/>
683a3e0 @lem9 bug #1859460 [display] Operations and many databases
lem9 authored Dec 30, 2007
301 <?php
302 } else {
303 ?>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
304 <select name="target_db">
fa21fe3 make the database list more magic:
Sebastian Mendel authored May 9, 2008
305 <?php echo $GLOBALS['pma']->databases->getHtmlOptions(true, false); ?>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
306 </select>
bd501a3 removed obsolete PMA_ENGINE_KEYWORD
Sebastian Mendel authored Jan 21, 2008
307 <?php
683a3e0 @lem9 bug #1859460 [display] Operations and many databases
lem9 authored Dec 30, 2007
308 } // end if
309 ?>
fe78d24 @lem9 b to strong, and remove bold for MySQL charset
lem9 authored Jul 9, 2008
310 &nbsp;<strong>.</strong>&nbsp;
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
311 <input type="text" size="20" name="new_name" onfocus="this.select()"
c0e3385 @lem9 bug #1526000, copying table to another db (MYSQL 5.0.24)
lem9 authored Aug 4, 2006
312 value="<?php echo htmlspecialchars($GLOBALS['table']); ?>" /><br />
6aa454a @lem9 auto_increment next value is included since MySQL 5.0.23
lem9 authored Jul 30, 2006
313 <?php
c0e3385 @lem9 bug #1526000, copying table to another db (MYSQL 5.0.24)
lem9 authored Aug 4, 2006
314 // starting with MySQL 5.0.24, SHOW CREATE TABLE includes the AUTO_INCREMENT
45b04ab replaced $dblist with new PMA_List_Database class
Sebastian Mendel authored Sep 20, 2006
315 // next value but users can decide if they want it or not for the operation
316 ?>
fb9a3a5 @nijel Check before commit!
nijel authored Nov 17, 2006
317 <input type="checkbox" name="sql_auto_increment" value="1" id="checkbox_auto_increment_mv" checked="checked" />
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
318 <label for="checkbox_auto_increment_mv"><?php echo __('Add AUTO_INCREMENT value'); ?></label><br />
c0e3385 @lem9 bug #1526000, copying table to another db (MYSQL 5.0.24)
lem9 authored Aug 4, 2006
319 </fieldset>
320 <fieldset class="tblFooters">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
321 <input type="submit" name="submit_move" value="<?php echo __('Go'); ?>" />
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
322 </fieldset>
323 </form>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
324 </div>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
325
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
326 <?php
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
327 if (strstr($show_comment, '; InnoDB free') === false) {
328 if (strstr($show_comment, 'InnoDB free') === false) {
329 // only user entered comment
330 $comment = $show_comment;
331 } else {
332 // here we have just InnoDB generated part
333 $comment = '';
334 }
335 } else {
336 // remove InnoDB comment from end, just the minimal part (*? is non greedy)
0ae8842 (not complete) PEAR coding standard
Sebastian Mendel authored Jan 17, 2006
337 $comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
338 }
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
339
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
340 // PACK_KEYS: MyISAM or ISAM
341 // DELAY_KEY_WRITE, CHECKSUM, : MyISAM only
c37b5df @lem9 [engines] PBXT: table options
lem9 authored May 2, 2008
342 // AUTO_INCREMENT: MyISAM and InnoDB since 5.0.3, PBXT
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
343
819324e @lem9 remove author names, as discussed at the 2010 developer meeting and a…
lem9 authored Mar 6, 2010
344 // Here should be version check for InnoDB, however it is supported
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
345 // in >5.0.4, >4.1.12 and >4.0.11, so I decided not to
346 // check for version
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
347 ?>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
348
349 <!-- Table options -->
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
350 <div class="operations_half_width clearfloat">
ad06b4a @nijel Rename tbl_* files to drop useless _properties part.
nijel authored Oct 25, 2006
351 <form method="post" action="tbl_operations.php">
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
352 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
353 <input type="hidden" name="reload" value="1" />
354 <fieldset>
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
355 <legend><?php echo __('Table options'); ?></legend>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
356
357 <table>
358 <!-- Change table name -->
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
359 <tr><td><?php echo __('Rename table to'); ?></td>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
360 <td><input type="text" size="20" name="new_name" onfocus="this.select()"
361 value="<?php echo htmlspecialchars($GLOBALS['table']); ?>" />
362 </td>
363 </tr>
364
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
365 <!-- Table comments -->
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
366 <tr><td><?php echo __('Table comments'); ?></td>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
367 <td><input type="text" name="comment" maxlength="60" size="30"
368 value="<?php echo htmlspecialchars($comment); ?>" onfocus="this.select()" />
e5458c0 do not use urlencode() in forms
Sebastian Mendel authored May 6, 2008
369 <input type="hidden" name="prev_comment" value="<?php echo htmlspecialchars($comment); ?>" />
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
370 </td>
371 </tr>
372
dc649ba @lem9 bug #1349262, use Storage Engine
lem9 authored Dec 21, 2005
373 <!-- Storage engine -->
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
374 <tr><td><?php echo __('Storage Engine'); ?>
dc649ba @lem9 bug #1349262, use Storage Engine
lem9 authored Dec 21, 2005
375 <?php echo PMA_showMySQLDocu('Storage_engines', 'Storage_engines'); ?>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
376 </td>
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
377 <td><?php echo PMA_StorageEngine::getHtmlSelect('new_tbl_storage_engine', null, $tbl_storage_engine); ?>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
378 </td>
379 </tr>
380
381 <!-- Table character set -->
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
382 <tr><td><?php echo __('Collation'); ?></td>
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
383 <td><?php echo PMA_generateCharsetDropdownBox(
384 PMA_CSDROPDOWN_COLLATION,
385 'tbl_collation', null, $tbl_collation, false, 3
386 ); ?>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
387 </td>
388 </tr>
7955d51 removed MySQL < 5 code
Sebastian Mendel authored Oct 2, 2007
389 <?php
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
390 if ($is_myisam_or_aria || $is_isam) {
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
391 ?>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
392 <tr>
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
393 <td><label for="new_pack_keys">PACK_KEYS</label></td>
f4e8e08 @nijel Reload language file after switch to utf-8 translation (bug #1442605).
nijel authored Apr 27, 2006
394 <td><select name="new_pack_keys" id="new_pack_keys">
395 <option value="DEFAULT"
396 <?php if ($pack_keys == 'DEFAULT') echo 'selected="selected"'; ?>
397 >DEFAULT</option>
398 <option value="0"
399 <?php if ($pack_keys == '0') echo 'selected="selected"'; ?>
400 >0</option>
401 <option value="1"
402 <?php if ($pack_keys == '1') echo 'selected="selected"'; ?>
403 >1</option>
404 </select>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
405 </td>
406 </tr>
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
407 <?php
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
408 } // end if (MYISAM|ISAM)
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
409
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
410 if ($is_myisam_or_aria) {
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
411 ?>
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
412 <tr><td><label for="new_checksum">CHECKSUM</label></td>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
413 <td><input type="checkbox" name="new_checksum" id="new_checksum"
414 value="1"
415 <?php echo (isset($checksum) && $checksum == 1)
416 ? ' checked="checked"'
417 : ''; ?> />
418 </td>
419 </tr>
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
420
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
421 <tr><td><label for="new_delay_key_write">DELAY_KEY_WRITE</label></td>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
422 <td><input type="checkbox" name="new_delay_key_write" id="new_delay_key_write"
423 value="1"
424 <?php echo (isset($delay_key_write) && $delay_key_write == 1)
425 ? ' checked="checked"'
426 : ''; ?> />
427 </td>
428 </tr>
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
429
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
430 <?php
431 } // end if (MYISAM)
432
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
433 if ($is_aria) {
e8248f8 @lem9 MARIA: TRANSACTIONAL create option (in Operations)
lem9 authored Mar 17, 2008
434 ?>
435 <tr><td><label for="new_transactional">TRANSACTIONAL</label></td>
436 <td><input type="checkbox" name="new_transactional" id="new_transactional"
437 value="1"
438 <?php echo (isset($transactional) && $transactional == 1)
439 ? ' checked="checked"'
440 : ''; ?> />
441 </td>
442 </tr>
443
d7e690e @lem9 MARIA: PAGE_CHECKSUM (does not currently work in 5.1.23a-maria)
lem9 authored Mar 18, 2008
444 <tr><td><label for="new_page_checksum">PAGE_CHECKSUM</label></td>
445 <td><input type="checkbox" name="new_page_checksum" id="new_page_checksum"
446 value="1"
447 <?php echo (isset($page_checksum) && $page_checksum == 1)
448 ? ' checked="checked"'
449 : ''; ?> />
450 </td>
451 </tr>
452
e8248f8 @lem9 MARIA: TRANSACTIONAL create option (in Operations)
lem9 authored Mar 17, 2008
453 <?php
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
454 } // end if (ARIA)
e8248f8 @lem9 MARIA: TRANSACTIONAL create option (in Operations)
lem9 authored Mar 17, 2008
455
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
456 if (isset($auto_increment) && strlen($auto_increment) > 0
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
457 && ($is_myisam_or_aria || $is_innodb || $is_pbxt)) {
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
458 ?>
e8248f8 @lem9 MARIA: TRANSACTIONAL create option (in Operations)
lem9 authored Mar 17, 2008
459 <tr><td><label for="auto_increment_opt">AUTO_INCREMENT</label></td>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
460 <td><input type="text" name="new_auto_increment" id="auto_increment_opt"
461 value="<?php echo $auto_increment; ?>" /></td>
d9a2161 @lem9 redesign part 3
lem9 authored Jun 13, 2004
462 </tr>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
463 <?php
464 } // end if (MYISAM|INNODB)
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
465
e2bea40 @lem9 use PMA_generate_html_dropdown() for the display direction
lem9 authored Jun 7, 2009
466 // the outer array is for engines, the inner array contains the dropdown
467 // option values as keys then the dropdown option labels
2fbe820 @lem9 rfe #2839504 [engines] Support InnoDB plugin new row formats
lem9 authored Aug 23, 2009
468
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
469 $possible_row_formats = array(
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
470 'ARIA' => array(
471 'FIXED' => 'FIXED',
472 'DYNAMIC' => 'DYNAMIC',
473 'PAGE' => 'PAGE'
474 ),
e2bea40 @lem9 use PMA_generate_html_dropdown() for the display direction
lem9 authored Jun 7, 2009
475 'MARIA' => array(
476 'FIXED' => 'FIXED',
477 'DYNAMIC' => 'DYNAMIC',
478 'PAGE' => 'PAGE'
479 ),
480 'MYISAM' => array(
481 'FIXED' => 'FIXED',
482 'DYNAMIC' => 'DYNAMIC'
483 ),
484 'PBXT' => array(
485 'FIXED' => 'FIXED',
486 'DYNAMIC' => 'DYNAMIC'
487 ),
488 'INNODB' => array(
489 'COMPACT' => 'COMPACT',
490 'REDUNDANT' => 'REDUNDANT')
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
491 );
2fbe820 @lem9 rfe #2839504 [engines] Support InnoDB plugin new row formats
lem9 authored Aug 23, 2009
492
493 $innodb_engine_plugin = PMA_StorageEngine::getEngine('innodb');
494 $innodb_plugin_version = $innodb_engine_plugin->getInnodbPluginVersion();
495 if (!empty($innodb_plugin_version)) {
496 $innodb_file_format = $innodb_engine_plugin->getInnodbFileFormat();
97daa89 @nijel Remove double spaces around else
nijel authored Jul 21, 2011
497 } else {
2fbe820 @lem9 rfe #2839504 [engines] Support InnoDB plugin new row formats
lem9 authored Aug 23, 2009
498 $innodb_file_format = '';
499 }
500 if ('Barracuda' == $innodb_file_format && $innodb_engine_plugin->supportsFilePerTable()) {
501 $possible_row_formats['INNODB']['DYNAMIC'] = 'DYNAMIC';
502 $possible_row_formats['INNODB']['COMPRESSED'] = 'COMPRESSED';
503 }
504 unset($innodb_engine_plugin, $innodb_plugin_version, $innodb_file_format);
505
32bb3ab @lem9 support ROW_FORMAT and PAGE_CHECKSUM table option; verify warnings co…
lem9 authored Mar 21, 2008
506 // for MYISAM there is also COMPRESSED but it can be set only by the
507 // myisampack utility, so don't offer here the choice because if we
508 // try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria)
509 // does not return a warning
510 // (if the table was compressed, it can be seen on the Structure page)
511
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
512 if (isset($possible_row_formats[$tbl_storage_engine])) {
f11915a @lem9 bug 1941020 undefined index
lem9 authored Apr 14, 2008
513 $current_row_format = strtoupper($showtable['Row_format']);
514 echo '<tr><td><label for="new_row_format">ROW_FORMAT</label></td>';
515 echo '<td>';
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
516 echo PMA_generate_html_dropdown('new_row_format', $possible_row_formats[$tbl_storage_engine], $current_row_format, 'new_row_format');
f11915a @lem9 bug 1941020 undefined index
lem9 authored Apr 14, 2008
517 unset($possible_row_formats, $current_row_format);
518 echo '</td>';
519 echo '</tr>';
520 }
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
521 ?>
522 </table>
523 </fieldset>
524 <fieldset class="tblFooters">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
525 <input type="submit" name="submitoptions" value="<?php echo __('Go'); ?>" />
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
526 </fieldset>
527 </form>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
528 </div>
529
530 <!-- Copy table -->
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
531 <div class="operations_half_width">
2784695 @lgtkaushalya Ajaxify the table coppy option in table operations
lgtkaushalya authored Jul 31, 2011
532 <form method="post" action="tbl_operations.php" name="copyTable" id="copyTable" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
533 onsubmit="return emptyFormElements(this, 'new_name')">
534 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
535 <input type="hidden" name="reload" value="1" />
536 <fieldset>
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
537 <legend><?php echo __('Copy table to (database<b>.</b>table):'); ?></legend>
fa21fe3 make the database list more magic:
Sebastian Mendel authored May 9, 2008
538 <?php if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {
683a3e0 @lem9 bug #1859460 [display] Operations and many databases
lem9 authored Dec 30, 2007
539 ?>
823687a @lem9 bug #1859460, prevent an empty target_db field to produce a failure, …
lem9 authored Dec 30, 2007
540 <input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/>
683a3e0 @lem9 bug #1859460 [display] Operations and many databases
lem9 authored Dec 30, 2007
541 <?php
542 } else {
543 ?>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
544 <select name="target_db">
fa21fe3 make the database list more magic:
Sebastian Mendel authored May 9, 2008
545 <?php echo $GLOBALS['pma']->databases->getHtmlOptions(true, false); ?>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
546 </select>
bd501a3 removed obsolete PMA_ENGINE_KEYWORD
Sebastian Mendel authored Jan 21, 2008
547 <?php
683a3e0 @lem9 bug #1859460 [display] Operations and many databases
lem9 authored Dec 30, 2007
548 } // end if
549 ?>
fe78d24 @lem9 b to strong, and remove bold for MySQL charset
lem9 authored Jul 9, 2008
550 &nbsp;<strong>.</strong>&nbsp;
31217bf @helmo patch #2952353 [interface] Prefill "Copy table to" in tbl_operations.php
helmo authored Feb 16, 2010
551 <input type="text" size="20" name="new_name" onfocus="this.select()" value="<?php echo htmlspecialchars($GLOBALS['table']); ?>"/><br />
5f1d0bb @lem9 use PMA_generate_html_radio()
lem9 authored Dec 28, 2007
552 <?php
553 $choices = array(
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
554 'structure' => __('Structure only'),
555 'data' => __('Structure and data'),
556 'dataonly' => __('Data only'));
8480ffb @lem9 improve function names
lem9 authored Jun 7, 2009
557 PMA_display_html_radio('what', $choices, 'data', true);
5f1d0bb @lem9 use PMA_generate_html_radio()
lem9 authored Dec 28, 2007
558 unset($choices);
559 ?>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
560
561 <input type="checkbox" name="drop_if_exists" value="true" id="checkbox_drop" />
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
562 <label for="checkbox_drop"><?php echo sprintf(__('Add %s'), 'DROP TABLE'); ?></label><br />
fb9a3a5 @nijel Check before commit!
nijel authored Nov 17, 2006
563 <input type="checkbox" name="sql_auto_increment" value="1" id="checkbox_auto_increment_cp" />
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
564 <label for="checkbox_auto_increment_cp"><?php echo __('Add AUTO_INCREMENT value'); ?></label><br />
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
565 <?php
566 // display "Add constraints" choice only if there are
567 // foreign keys
7c5d5c4 @lem9 PBXT: foreign key support
lem9 authored May 4, 2008
568 if (PMA_getForeigners($GLOBALS['db'], $GLOBALS['table'], '', 'foreign')) {
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
569 ?>
029a63a @lem9 single-table copy did not copy the constraints
lem9 authored Jul 4, 2006
570 <input type="checkbox" name="add_constraints" value="1" id="checkbox_constraints" />
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
571 <label for="checkbox_constraints"><?php echo __('Add constraints'); ?></label><br />
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
572 <?php
573 } // endif
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
574 if (isset($_COOKIE['pma_switch_to_new'])
575 && $_COOKIE['pma_switch_to_new'] == 'true') {
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
576 $pma_switch_to_new = 'true';
577 }
578 ?>
579 <input type="checkbox" name="switch_to_new" value="true"
580 id="checkbox_switch"<?php echo
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
581 isset($pma_switch_to_new) && $pma_switch_to_new == 'true'
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
582 ? ' checked="checked"'
583 : ''; ?> />
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
584 <label for="checkbox_switch"><?php echo __('Switch to copied table'); ?></label>
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
585 </fieldset>
586 <fieldset class="tblFooters">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
587 <input type="submit" name="submit_copy" value="<?php echo __('Go'); ?>" />
d275d8d styled table operations dialog
Sebastian Mendel authored Dec 12, 2005
588 </fieldset>
589 </form>
590 </div>
591
592 <br class="clearfloat"/>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
593
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
594 <div class="operations_half_width">
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
595 <fieldset>
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
596 <legend><?php echo __('Table maintenance'); ?></legend>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
597
48a95cb @lgtkaushalya Ajaxify table maintenance in table operations
lgtkaushalya authored Aug 7, 2011
598 <ul id="tbl_maintenance" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>>
173a482 @lem9 operations
lem9 authored Apr 28, 2002
599 <?php
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
600 // Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
601 if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
602 if ($is_myisam_or_aria || $is_innodb) {
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
603 $this_url_params = array_merge(
604 $url_params,
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
605 array(
606 'sql_query' => 'CHECK TABLE ' . PMA_backquote($GLOBALS['table']),
607 'table_maintenance' => 'Go',
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
608 )
609 );
173a482 @lem9 operations
lem9 authored Apr 28, 2002
610 ?>
90c010f @lgtkaushalya Fixed the issue of not showing the Docuemnts
lgtkaushalya authored Aug 13, 2011
611 <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
612 <?php echo __('Check table'); ?></a>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
613 <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'CHECK_TABLE'); ?>
614 </li>
173a482 @lem9 operations
lem9 authored Apr 28, 2002
615 <?php
c2b46ac Final batch of PHP3-Compatibility fixes. Please test. :-)
Garvin Hicking authored Nov 22, 2003
616 }
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
617 if ($is_innodb) {
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
618 $this_url_params = array_merge(
619 $url_params,
620 array('sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' ENGINE = InnoDB')
621 );
4a539df @lem9 defragment
lem9 authored May 9, 2004
622 ?>
90c010f @lgtkaushalya Fixed the issue of not showing the Docuemnts
lgtkaushalya authored Aug 13, 2011
623 <li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
624 <?php echo __('Defragment table'); ?></a>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
625 <?php echo PMA_showMySQLDocu('Table_types', 'InnoDB_File_Defragmenting'); ?>
626 </li>
4a539df @lem9 defragment
lem9 authored May 9, 2004
627 <?php
628 }
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
629 if ($is_myisam_or_aria || $is_berkeleydb) {
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
630 $this_url_params = array_merge(
631 $url_params,
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
632 array(
633 'sql_query' => 'ANALYZE TABLE ' . PMA_backquote($GLOBALS['table']),
634 'table_maintenance' => 'Go',
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
635 )
636 );
c2b46ac Final batch of PHP3-Compatibility fixes. Please test. :-)
Garvin Hicking authored Nov 22, 2003
637 ?>
90c010f @lgtkaushalya Fixed the issue of not showing the Docuemnts
lgtkaushalya authored Aug 13, 2011
638 <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
639 <?php echo __('Analyze table'); ?></a>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
640 <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'ANALYZE_TABLE');?>
641 </li>
c2b46ac Final batch of PHP3-Compatibility fixes. Please test. :-)
Garvin Hicking authored Nov 22, 2003
642 <?php
643 }
c2b06f0 @Crack Don't use OPTIMIZE TABLE and REPAIR TABLE with Drizzle
Crack authored Jun 19, 2011
644 if ($is_myisam_or_aria && !PMA_DRIZZLE) {
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
645 $this_url_params = array_merge(
646 $url_params,
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
647 array(
648 'sql_query' => 'REPAIR TABLE ' . PMA_backquote($GLOBALS['table']),
649 'table_maintenance' => 'Go',
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
650 )
651 );
c2b46ac Final batch of PHP3-Compatibility fixes. Please test. :-)
Garvin Hicking authored Nov 22, 2003
652 ?>
90c010f @lgtkaushalya Fixed the issue of not showing the Docuemnts
lgtkaushalya authored Aug 13, 2011
653 <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
654 <?php echo __('Repair table'); ?></a>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
655 <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'REPAIR_TABLE'); ?>
656 </li>
c2b46ac Final batch of PHP3-Compatibility fixes. Please test. :-)
Garvin Hicking authored Nov 22, 2003
657 <?php
658 }
c2b06f0 @Crack Don't use OPTIMIZE TABLE and REPAIR TABLE with Drizzle
Crack authored Jun 19, 2011
659 if (($is_myisam_or_aria || $is_innodb || $is_berkeleydb) && !PMA_DRIZZLE) {
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
660 $this_url_params = array_merge(
661 $url_params,
6acf4ac @zixtor auto get back to the Table Operations tab
zixtor authored Mar 27, 2011
662 array(
663 'sql_query' => 'OPTIMIZE TABLE ' . PMA_backquote($GLOBALS['table']),
664 'table_maintenance' => 'Go',
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
665 )
666 );
c2b46ac Final batch of PHP3-Compatibility fixes. Please test. :-)
Garvin Hicking authored Nov 22, 2003
667 ?>
90c010f @lgtkaushalya Fixed the issue of not showing the Docuemnts
lgtkaushalya authored Aug 13, 2011
668 <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
669 <?php echo __('Optimize table'); ?></a>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
670 <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE'); ?>
671 </li>
c2b46ac Final batch of PHP3-Compatibility fixes. Please test. :-)
Garvin Hicking authored Nov 22, 2003
672 <?php
673 }
674 } // end MYISAM or BERKELEYDB case
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
675 $this_url_params = array_merge(
676 $url_params,
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
677 array(
678 'sql_query' => 'FLUSH TABLE ' . PMA_backquote($GLOBALS['table']),
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
679 'message_to_show' => sprintf(
680 __('Table %s has been flushed'),
681 htmlspecialchars($GLOBALS['table'])
682 ),
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
683 'reload' => 1,
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
684 )
685 );
c2b46ac Final batch of PHP3-Compatibility fixes. Please test. :-)
Garvin Hicking authored Nov 22, 2003
686 ?>
90c010f @lgtkaushalya Fixed the issue of not showing the Docuemnts
lgtkaushalya authored Aug 13, 2011
687 <li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
688 <?php echo __('Flush the table (FLUSH)'); ?></a>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
689 <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'FLUSH'); ?>
690 </li>
691 </ul>
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
692 </fieldset>
693 </div>
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
694 <?php if (! (isset($db_is_information_schema) && $db_is_information_schema)) { ?>
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
695 <div class="operations_half_width">
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
696 <fieldset class="caution">
2816b87 @lem9 new labels for table operations; fix CSS
lem9 authored Jul 28, 2010
697 <legend><?php echo __('Delete data or table'); ?></legend>
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
698
699 <ul>
700 <?php
701 if (! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema)) {
702 $this_sql_query = 'TRUNCATE TABLE ' . PMA_backquote($GLOBALS['table']);
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
703 $this_url_params = array_merge(
704 $url_params,
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
705 array(
706 'sql_query' => $this_sql_query,
707 'goto' => 'tbl_structure.php',
708 'reload' => '1',
98a5ba7 @lem9 misleading variable name
lem9 authored Sep 4, 2010
709 'message_to_show' => sprintf(__('Table %s has been emptied'), htmlspecialchars($table)),
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
710 )
711 );
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
712 ?>
3fdf5dd @lgtkaushalya Changed the logic of truncate table in table operations
lgtkaushalya authored Aug 8, 2011
713 <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="truncate_tbl_anchor" class="ajax"' : ''); ?>>
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
714 <?php echo __('Empty the table (TRUNCATE)'); ?></a>
715 <?php echo PMA_showMySQLDocu('SQL-Syntax', 'TRUNCATE_TABLE'); ?>
716 </li>
717 <?php
718 }
719 if (! (isset($db_is_information_schema) && $db_is_information_schema)) {
720 $this_sql_query = 'DROP TABLE ' . PMA_backquote($GLOBALS['table']);
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
721 $this_url_params = array_merge(
722 $url_params,
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
723 array(
724 'sql_query' => $this_sql_query,
725 'goto' => 'db_operations.php',
726 'reload' => '1',
727 'purge' => '1',
98a5ba7 @lem9 misleading variable name
lem9 authored Sep 4, 2010
728 'message_to_show' => sprintf(($tbl_is_view ? __('View %s has been dropped') : __('Table %s has been dropped')), htmlspecialchars($table)),
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
729 // table name is needed to avoid running
bda213a @lem9 bug #3042706 [pmadb] Relations, bookmarks, etc deleted after table drop
lem9 authored Aug 11, 2010
730 // PMA_relationsCleanupDatabase() on the whole db later
731 'table' => $GLOBALS['table'],
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
732 )
733 );
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
734 ?>
b37d10c @bestben Feature Request #3187076
bestben authored Mar 27, 2011
735 <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="drop_tbl_anchor"' : ''); ?>>
2816b87 @lem9 new labels for table operations; fix CSS
lem9 authored Jul 28, 2010
736 <?php echo __('Delete the table (DROP)'); ?></a>
659bd9c @nijel Add trop/empty links to table operations tab.
nijel authored Jul 27, 2010
737 <?php echo PMA_showMySQLDocu('SQL-Syntax', 'DROP_TABLE'); ?>
738 </li>
739 <?php
740 }
741 ?>
742 </ul>
743 </fieldset>
744 </div>
745 <?php
746 }
747 ?>
2d1b7bf @madhuracj Proper layout for table maintenance page
madhuracj authored Oct 10, 2011
748 <br class="clearfloat">
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
749 <?php if (PMA_Partition::havePartitioning()) {
05a83a0 @lem9 do not display Partition maintenance if there are no partitions
lem9 authored Nov 13, 2007
750 $partition_names = PMA_Partition::getPartitionNames($db, $table);
751 // show the Partition maintenance section only if we detect a partition
752 if (! is_null($partition_names[0])) {
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
753 ?>
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
754 <div class="operations_half_width">
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
755 <form method="post" action="tbl_operations.php">
756 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
757 <fieldset>
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
758 <legend><?php echo __('Partition maintenance'); ?></legend>
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
759 <?php
05a83a0 @lem9 do not display Partition maintenance if there are no partitions
lem9 authored Nov 13, 2007
760 $html_select = '<select name="partition_name">' . "\n";
48e9af4 @nijel Add missing space after foreach calls
nijel authored Jul 21, 2011
761 foreach ($partition_names as $one_partition) {
05a83a0 @lem9 do not display Partition maintenance if there are no partitions
lem9 authored Nov 13, 2007
762 $one_partition = htmlspecialchars($one_partition);
763 $html_select .= '<option value="' . $one_partition . '">' . $one_partition . '</option>' . "\n";
764 }
765 $html_select .= '</select>' . "\n";
2182098 @lem9 strings to gettext, second batch
lem9 authored May 4, 2010
766 printf(__('Partition %s'), $html_select);
05a83a0 @lem9 do not display Partition maintenance if there are no partitions
lem9 authored Nov 13, 2007
767 unset($partition_names, $one_partition, $html_select);
768 $choices = array(
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
769 'ANALYZE' => __('Analyze'),
770 'CHECK' => __('Check'),
771 'OPTIMIZE' => __('Optimize'),
772 'REBUILD' => __('Rebuild'),
773 'REPAIR' => __('Repair'));
8480ffb @lem9 improve function names
lem9 authored Jun 7, 2009
774 PMA_display_html_radio('partition_operation', $choices, '', false);
05a83a0 @lem9 do not display Partition maintenance if there are no partitions
lem9 authored Nov 13, 2007
775 unset($choices);
776 echo PMA_showMySQLDocu('partitioning_maintenance', 'partitioning_maintenance');
bff82c6 @lem9 support for REMOVE PARTITIONING
lem9 authored Nov 13, 2007
777 // I'm not sure of the best way to display that; this link does
778 // not depend on the Go button
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
779 $this_url_params = array_merge(
780 $url_params,
bff82c6 @lem9 support for REMOVE PARTITIONING
lem9 authored Nov 13, 2007
781 array(
782 'sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' REMOVE PARTITIONING'
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
783 )
784 );
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
785 ?>
bff82c6 @lem9 support for REMOVE PARTITIONING
lem9 authored Nov 13, 2007
786 <br /><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
787 <?php echo __('Remove partitioning'); ?></a>
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
788 </fieldset>
5eb4fee @lem9 partition maintenance
lem9 authored Nov 1, 2007
789 <fieldset class="tblFooters">
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
790 <input type="submit" name="submit_partition" value="<?php echo __('Go'); ?>" />
5eb4fee @lem9 partition maintenance
lem9 authored Nov 1, 2007
791 </fieldset>
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
792 </form>
793 </div>
6729583 @nijel Reorganised layout a bit, added CHECK link for InnoDB, use correct ta…
nijel authored Jun 30, 2003
794 <?php
05a83a0 @lem9 do not display Partition maintenance if there are no partitions
lem9 authored Nov 13, 2007
795 } // end if
766ca28 @lem9 partition stuff (in progress)
lem9 authored Oct 30, 2007
796 } // end if
5eb4fee @lem9 partition maintenance
lem9 authored Nov 1, 2007
797
5e472df Moved tables comments and type fetaure and referential integrity chec…
Loïc Chapeaux authored Apr 28, 2002
798 // Referential integrity check
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored Nov 26, 2003
799 // The Referential integrity check was intended for the non-InnoDB
273df26 @lem9 referential integrity and InnoDB
lem9 authored Jul 20, 2003
800 // tables for which the relations are defined in pmadb
801 // so I assume that if the current table is InnoDB, I don't display
802 // this choice (InnoDB maintains integrity by itself)
803
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
804 if ($cfgRelation['relwork'] && ! $is_innodb) {
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
805 PMA_DBI_select_db($GLOBALS['db']);
806 $foreign = PMA_getForeigners($GLOBALS['db'], $GLOBALS['table']);
5e472df Moved tables comments and type fetaure and referential integrity chec…
Loïc Chapeaux authored Apr 28, 2002
807
cca4a66 changes to move to central PMA DB: check for referential integrity wo…
Mike Beck authored Jun 15, 2002
808 if ($foreign) {
5e472df Moved tables comments and type fetaure and referential integrity chec…
Loïc Chapeaux authored Apr 28, 2002
809 ?>
810 <!-- Referential integrity check -->
be14efa @madhuracj Database operations tab made more compact. Table operations altered t…
madhuracj authored Apr 24, 2011
811 <div class="operations_half_width">
da6fee5 @lem9 bug #1834368 Referential integrity check breaks page look
lem9 authored Nov 22, 2007
812 <fieldset>
f55823f @lem9 strings to gettext, first batch
lem9 authored May 3, 2010
813 <legend><?php echo __('Check referential integrity:'); ?></legend>
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
814 <ul>
815 <?php
816 echo "\n";
817 foreach ($foreign AS $master => $arr) {
818 $join_query = 'SELECT ' . PMA_backquote($GLOBALS['table']) . '.* FROM '
819 . PMA_backquote($GLOBALS['table']) . ' LEFT JOIN '
820 . PMA_backquote($arr['foreign_table']);
821 if ($arr['foreign_table'] == $GLOBALS['table']) {
822 $foreign_table = $GLOBALS['table'] . '1';
823 $join_query .= ' AS ' . PMA_backquote($foreign_table);
824 } else {
825 $foreign_table = $arr['foreign_table'];
826 }
827 $join_query .= ' ON '
828 . PMA_backquote($GLOBALS['table']) . '.' . PMA_backquote($master)
829 . ' = ' . PMA_backquote($foreign_table) . '.' . PMA_backquote($arr['foreign_field'])
830 . ' WHERE '
831 . PMA_backquote($foreign_table) . '.' . PMA_backquote($arr['foreign_field'])
832 . ' IS NULL AND '
833 . PMA_backquote($GLOBALS['table']) . '.' . PMA_backquote($master)
834 . ' IS NOT NULL';
4a5e871 @ruleant fix coding style
ruleant authored Jan 26, 2012
835 $this_url_params = array_merge(
836 $url_params,
837 array('sql_query' => $join_query)
838 );
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
839 echo ' <li>'
840 . '<a href="sql.php'
f341c72 merged libraries\tbl_move_copy.php in class PMA_Table
Sebastian Mendel authored Feb 21, 2006
841 . PMA_generate_common_url($this_url_params)
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
842 . '">' . $master . '&nbsp;->&nbsp;' . $arr['foreign_table'] . '.' . $arr['foreign_field']
843 . '</a></li>' . "\n";
844 } // foreach $foreign
845 unset($foreign_table, $join_query);
846 ?>
847 </ul>
da6fee5 @lem9 bug #1834368 Referential integrity check breaks page look
lem9 authored Nov 22, 2007
848 </fieldset>
849 </div>
5e472df Moved tables comments and type fetaure and referential integrity chec…
Loïc Chapeaux authored Apr 28, 2002
850 <?php
ec7a30f make use of new third 'class' parameter for PMA_showMessage()
Sebastian Mendel authored Oct 9, 2007
851 } // end if ($foreign)
5e472df Moved tables comments and type fetaure and referential integrity chec…
Loïc Chapeaux authored Apr 28, 2002
852
853 } // end if (!empty($cfg['Server']['relation']))
42c1128 complete revise (xhtml output, fieldsets, forms merged)
Sebastian Mendel authored Dec 8, 2005
854
173a482 @lem9 operations
lem9 authored Apr 28, 2002
855
856 /**
857 * Displays the footer
858 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored Mar 16, 2012
859 require 'libraries/footer.inc.php';
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
860
861
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
862 function PMA_set_global_variables_for_engine($tbl_storage_engine)
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
863 {
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
864 global $is_myisam_or_aria, $is_innodb, $is_isam, $is_berkeleydb, $is_aria, $is_pbxt;
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
865
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
866 $is_myisam_or_aria = $is_isam = $is_innodb = $is_berkeleydb = $is_aria = $is_pbxt = false;
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
867 $upper_tbl_storage_engine = strtoupper($tbl_storage_engine);
84ae042 @nijel Adding @package, third part.
nijel authored Nov 24, 2008
868
2d4b9e2 @lem9 support ARIA storage engine as well as its previous name MARIA
lem9 authored Oct 9, 2010
869 //Options that apply to MYISAM usually apply to ARIA
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
870 $is_myisam_or_aria = ($upper_tbl_storage_engine == 'MYISAM' || $upper_tbl_storage_engine == 'ARIA' || $upper_tbl_storage_engine == 'MARIA');
871 $is_aria = ($upper_tbl_storage_engine == 'ARIA');
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
872
1a5adbb @lem9 Table type is an older term for storage engine
lem9 authored Apr 8, 2012
873 $is_isam = ($upper_tbl_storage_engine == 'ISAM');
874 $is_innodb = ($upper_tbl_storage_engine == 'INNODB');
875 $is_berkeleydb = ($upper_tbl_storage_engine == 'BERKELEYDB');
876 $is_pbxt = ($upper_tbl_storage_engine == 'PBXT');
b11306d @lem9 start work on Maria table options
lem9 authored Mar 16, 2008
877 }
878
6729583 @nijel Reorganised layout a bit, added CHECK link for InnoDB, use correct ta…
nijel authored Jun 30, 2003
879 ?>
Something went wrong with that request. Please try again.