From 7c1df1f1a392b55efdb578259af17e33d29c1118 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 11 Jan 2011 13:56:33 +0000 Subject: [PATCH] interface with delimitcol routine for updateschema git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8604 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Table.pm | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index dacf6f166..b6aa06090 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -442,9 +442,9 @@ sub buildcreatestmt $datatype = "VARCHAR(128) "; } } - # build the columns of the table - $delimitedcol= &delimitcol($col); - $retv .= $delimitedcol . " $datatype"; # mysql change + # delimit the columns of the table + $delimitedcol= &delimitcol($col); + $retv .= $delimitedcol . " $datatype"; # mysql change if (grep /^$col$/, @{$descr->{required}}) @@ -996,15 +996,9 @@ sub updateschema { $datatype .= " NOT NULL"; } - my $tmpcol=$dcol; # for sqlite - if (($xcatcfg =~ /^DB2:/) || ($xcatcfg =~ /^Pg:/)) { - $tmpcol="\"$dcol\""; - - } else { - if ($xcatcfg =~ /^mysql:/) { - $tmpcol="\`$dcol\`"; - } - } + # delimit the columns of the table + my $tmpcol= &delimitcol($dcol); + my $tablespace; my $stmt = "ALTER TABLE " . $self->{tabname} . " ADD $tmpcol $datatype"; @@ -1082,17 +1076,13 @@ sub updateschema } } - my $tmpkey=$dbkey; # for sqlite + # delimit the columns + my $tmpkey= &delimitcol($dbkey); if (($xcatcfg =~ /^DB2:/) || ($xcatcfg =~ /^Pg:/)) { - $tmpkey="\"$dbkey\""; # get rid of NOT NULL, cannot modify with NOT NULL my ($tmptype,$nullvalue)= split('NOT NULL',$datatype ); $datatype=$tmptype; - } else { - if ($xcatcfg =~ /^mysql:/) { - $tmpkey="\`$dbkey\`"; - } } my $stmt; if ($xcatcfg =~ /^DB2:/){