Escape identifiers in table column metrics
Otherwise some queries may fail if reserved words were used as field, table or database names.
This commit is contained in:
parent
42a9586aaf
commit
ece5671292
1 changed files with 2 additions and 2 deletions
|
@ -5994,7 +5994,7 @@ sub mysql_tables {
|
||||||
my $current_type =
|
my $current_type =
|
||||||
uc($ctype) . ( $isnull eq 'NO' ? " NOT NULL" : "" );
|
uc($ctype) . ( $isnull eq 'NO' ? " NOT NULL" : "" );
|
||||||
my $optimal_type = select_str_g( "Optimal_fieldtype",
|
my $optimal_type = select_str_g( "Optimal_fieldtype",
|
||||||
"SELECT $_ FROM $dbname.$tbname PROCEDURE ANALYSE(100000)"
|
"SELECT \\`$_\\` FROM \\`$dbname\\`.\\`$tbname\\` PROCEDURE ANALYSE(100000)"
|
||||||
);
|
);
|
||||||
if ( not defined($optimal_type) or $optimal_type eq '' ) {
|
if ( not defined($optimal_type) or $optimal_type eq '' ) {
|
||||||
infoprint " Current Fieldtype: $current_type";
|
infoprint " Current Fieldtype: $current_type";
|
||||||
|
@ -6006,7 +6006,7 @@ sub mysql_tables {
|
||||||
badprint
|
badprint
|
||||||
"Consider changing type for column $_ in table $dbname.$tbname";
|
"Consider changing type for column $_ in table $dbname.$tbname";
|
||||||
push( @generalrec,
|
push( @generalrec,
|
||||||
"ALTER TABLE $dbname.$tbname MODIFY $_ $optimal_type;"
|
"ALTER TABLE \`$dbname\`.\`$tbname\` MODIFY \`$_\` $optimal_type;"
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue