Commit 361b89ee authored by Leigh Stoller's avatar Leigh Stoller

More changes to deal with mysql 5.0 differences.

parent 7db96389
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2004, 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -36,17 +36,23 @@ my $exitcode = 0;
# We sort(1) the text files so that we don't pick up differences in ordering,
# which could be pretty random.
#
if (system("perl $export_tables | sort > $tempoldfile")) {
if (system("perl $export_tables | ".
"grep -E -v -e '^--.*\$' -e '^\\/\\*.*\\*\\/;\$' | ".
"sed -e 's/INTO `\\(.*\\)`/INTO \\1/' | ".
"sort > $tempoldfile")) {
unlink($tempoldfile);
die("*** $0:\n".
" $export_tables failed!\n");
}
if (system("grep -E -v '^(LOCK|UNLOCK|DELETE) ' $master_fill | sort > $tempnewfile")) {
if (system("grep -E -v '^(LOCK|UNLOCK|DELETE) ' $master_fill | ".
"grep -E -v -e '^--.*\$' -e '^\\/\\*.*\\*\\/;\$' | ".
"sed -e 's/INTO `\\(.*\\)`/INTO \\1/' | ".
"sort > $tempnewfile")) {
unlink($tempoldfile);
die("*** $0:\n".
" sort $master_fill failed!\n");
}
if (system("diff -b -B -I '^--.*\$' $tempoldfile $tempnewfile > $tempdifffile")
if (system("diff -b -B $tempoldfile $tempnewfile > $tempdifffile")
== 2) {
unlink($tempdifffile);
die("*** $0:\n".
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -30,11 +30,14 @@ my $DBNAME = "@TBDBNAME@";
my $master_sitevars = "$testbed_srcdir/sql/sitevars-create.sql";
my $sitevarsdiff = "$testbed_srcdir/utils/sitevarsdiff";
my $isvers5 = system("mysql -V | egrep 'Distrib 5.'") == 0;
my $extraopts = ($isvers5 ? "--skip-opt" : "");
#
# XXX: Requires that mysqldump be in caller's $PATH - probably an OK
# assumption, but maybe not always
#
my $mysqldump = "mysqldump -t $DBNAME sitevariables";
my $mysqldump = "mysqldump $extraopts -t $DBNAME sitevariables";
#
# We use Mysql module instead of the testbed libraries, so that we can get
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# Copyright (c) 2000-2002, 2006 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -132,7 +132,7 @@ sub read_sitevars($$) {
while(<FH>) {
my ($name, $val, $dval, $desc);
if (/^INSERT INTO sitevariables/) {
if (/^INSERT INTO `?sitevariables`?/) {
#
# Either match NULL, or
# a quote followed by some number of:
......@@ -141,7 +141,7 @@ sub read_sitevars($$) {
# followed by a closed quote.
#
my $match = "^(('([^\\']|(\\\\.))*')|(NULL))";
s/^INSERT INTO sitevariables VALUES \(//;
s/^INSERT INTO `?sitevariables`? VALUES \(//;
($name) = /${match},/;
s/${match},// or die "bad parse $_";
($val) = /${match},/;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment