rfe #1741101, patch #1798184 UUID default for CHAR(36) PRIMARY KEY, thanks to Gert Palok - gert_p

This commit is contained in:
Sebastian Mendel
2007-12-13 17:25:59 +00:00
parent 2609789026
commit bb70f2d7b6
3 changed files with 29 additions and 25 deletions

View File

@@ -21,6 +21,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
+ [config] new parameter $cfg['CheckConfigurationPermissions'] + [config] new parameter $cfg['CheckConfigurationPermissions']
+ rfe #1775288 [transformation] proper display if IP-address stored as INT + rfe #1775288 [transformation] proper display if IP-address stored as INT
+ rfe #1758177 [core] Add the Geometry DataTypes + rfe #1758177 [core] Add the Geometry DataTypes
+ rfe #1741101, patch #1798184 UUID default for CHAR(36) PRIMARY KEY,
thanks to Gert Palok - gert_p
2.11.4.0 (not yet released) 2.11.4.0 (not yet released)
- bug #1843428 [GUI] Space issue with DROP/DELETE/ALTER TABLE - bug #1843428 [GUI] Space issue with DROP/DELETE/ALTER TABLE

View File

@@ -2613,6 +2613,7 @@ if ($cfg['ShowFunctionFields']) {
'FUNC_DATE' => '', 'FUNC_DATE' => '',
'FUNC_NUMBER' => '', 'FUNC_NUMBER' => '',
'first_timestamp' => 'NOW', 'first_timestamp' => 'NOW',
'pk_char36' => 'UUID',
); );

View File

@@ -488,9 +488,7 @@ foreach ($rows as $row_id => $vrow) {
// garvin: Find the current type in the RestrictColumnTypes. Will result in 'FUNC_CHAR' // garvin: Find the current type in the RestrictColumnTypes. Will result in 'FUNC_CHAR'
// or something similar. Then directly look up the entry in the RestrictFunctions array, // or something similar. Then directly look up the entry in the RestrictFunctions array,
// which will then reveal the available dropdown options // which will then reveal the available dropdown options
if (isset($cfg['RestrictFunctions']) if (isset($cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])])
&& isset($cfg['RestrictColumnTypes'])
&& isset($cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])])
&& isset($cfg['RestrictFunctions'][$cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])]])) { && isset($cfg['RestrictFunctions'][$cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])]])) {
$current_func_type = $cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])]; $current_func_type = $cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])];
$dropdown = $cfg['RestrictFunctions'][$current_func_type]; $dropdown = $cfg['RestrictFunctions'][$current_func_type];
@@ -502,30 +500,33 @@ foreach ($rows as $row_id => $vrow) {
$dropdown_built = array(); $dropdown_built = array();
$op_spacing_needed = FALSE; $op_spacing_needed = FALSE;
// garvin: loop on the dropdown array and print all available options for that field.
$cnt_dropdown = count($dropdown);
for ($j = 0; $j < $cnt_dropdown; $j++) {
// Is current function defined as default?
// For MySQL < 4.1.2, for the first timestamp we set as
// default function the one defined in config (which
// should be NOW()).
// For MySQL >= 4.1.2, we don't set the default function
// if there is a default value for the timestamp
// (not including CURRENT_TIMESTAMP)
// and the column does not have the
// ON UPDATE DEFAULT TIMESTAMP attribute.
if (!($field['True_Type'] == 'timestamp' // what function defined as default?
&& !empty($field['Default']) // for the first timestamp we don't set the default function
&& !isset($analyzed_sql[0]['create_table_fields'][$field['Field']]['on_update_current_timestamp']))) { // if there is a default value for the timestamp
$selected = ($field['first_timestamp'] && $dropdown[$j] == $cfg['DefaultFunctions']['first_timestamp']) // (not including CURRENT_TIMESTAMP)
|| (!$field['first_timestamp'] && $dropdown[$j] == $default_function) // and the column does not have the
? ' selected="selected"' // ON UPDATE DEFAULT TIMESTAMP attribute.
: '';
if ($field['True_Type'] == 'timestamp'
&& empty($field['Default'])
&& ! isset($analyzed_sql[0]['create_table_fields'][$field['Field']]['on_update_current_timestamp'])) {
$default_function = $cfg['DefaultFunctions']['first_timestamp'];
} }
echo ' ';
echo '<option' . $selected . '>' . $dropdown[$j] . '</option>' . "\n"; if ($field['Key'] == 'PRI'
$dropdown_built[$dropdown[$j]] = 'TRUE'; && ($field['Type'] == 'char(36)' || $field['Type'] == 'varchar(36)')) {
$default_function = $cfg['DefaultFunctions']['pk_char36'];
}
// garvin: loop on the dropdown array and print all available options for that field.
foreach ($dropdown as $each_dropdown){
echo '<option';
if ($default_function === $each_dropdown) {
echo ' selected="selected"';
}
echo '>' . $each_dropdown . '</option>' . "\n";
$dropdown_built[$each_dropdown] = 'TRUE';
$op_spacing_needed = TRUE; $op_spacing_needed = TRUE;
} }