Fix saving of field options, like binary mode https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3600417&group_id=17457
This commit is contained in:
+10
-4
@@ -79,9 +79,11 @@ else {
|
||||
|
||||
if ($type =~ /int$/) {
|
||||
# Display unsigned/zerofill option
|
||||
$opts = $extra =~ /unsigned/ ? 'unsigned' :
|
||||
$extra =~ /zerofill/ ? 'zerofill' : '';
|
||||
print &ui_hidden("oldopts", $opts);
|
||||
print &ui_table_row($text{'field_opts'},
|
||||
&ui_radio("opts", $extra =~ /unsigned/ ? 'unsigned' :
|
||||
$extra =~ /zerofill/ ? 'zerofill' : '',
|
||||
&ui_radio("opts", $opts,
|
||||
[ [ '', $text{'field_none'} ],
|
||||
[ 'unsigned', $text{'field_unsigned'} ],
|
||||
[ 'zerofill', $text{'field_zerofill'} ] ]));
|
||||
@@ -95,15 +97,19 @@ if ($type =~ /int$/) {
|
||||
}
|
||||
elsif ($type eq 'float' || $type eq 'double' || $type eq 'decimal') {
|
||||
# Display zerofill option
|
||||
$opts = $extra =~ /zerofill/ ? 'zerofill' : '';
|
||||
print &ui_hidden("oldopts", $opts);
|
||||
print &ui_table_row($text{'field_opts'},
|
||||
&ui_radio("opts", $extra =~ /zerofill/ ? 'zerofill' : '',
|
||||
&ui_radio("opts", $opts,
|
||||
[ [ '', $text{'field_none'} ],
|
||||
[ 'zerofill', $text{'field_zerofill'} ] ]));
|
||||
}
|
||||
elsif ($type eq 'char' || $type eq 'varchar') {
|
||||
# Display binary option
|
||||
$opts = $extra =~ /binary/ ? 'binary' : '';
|
||||
print &ui_hidden("oldopts", $opts);
|
||||
print &ui_table_row($text{'field_opts'},
|
||||
&ui_radio("opts", $extra =~ /binary/ ? 'binary' : '',
|
||||
&ui_radio("opts", $opts,
|
||||
[ [ '', $text{'field_ascii'} ],
|
||||
[ 'binary', $text{'field_binary'} ] ]));
|
||||
}
|
||||
|
||||
@@ -54,9 +54,11 @@ else {
|
||||
$in{'ext'};
|
||||
&execute_sql_logged($in{'db'}, $sql);
|
||||
if ($in{'old'} ne $in{'field'} ||
|
||||
$in{'type'} ne $in{'newtype'}) {
|
||||
$in{'type'} ne $in{'newtype'} ||
|
||||
$in{'oldopts'} ne $in{'opts'}) {
|
||||
# Rename or retype field as well
|
||||
if ($in{'type'} ne $in{'newtype'}) {
|
||||
if ($in{'type'} ne $in{'newtype'} ||
|
||||
$in{'oldopts'} ne $in{'opts'}) {
|
||||
# Type has changed .. fix size
|
||||
if ($in{'newtype'} eq 'enum' ||
|
||||
$in{'newtype'} eq 'set') {
|
||||
|
||||
Reference in New Issue
Block a user