Commit 5d001d13 authored by Daniel Black's avatar Daniel Black Committed by holyfoot

MDEV-10832 - Out of tree build: mysql_install_db to see all .sql files (#237)

* Out of tree build: mysql_install_db to see all .sql files

Since MDEV-7875 (da0991c6), not all sql source files are in the source
directory, maria_add_gis_sp_bootstrap.sql is in the build directory.

This corrects mysql_install_db{.sh} to be aware of the differing
locations.
Signed-off-by: default avatarDaniel Black <daniel.black@au.ibm.com>

* Out of tree build: scripts/mysql_install_db.pl.in
Signed-off-by: default avatarDaniel Black <daniel.black@au.ibm.com>
parent e136aa1b
...@@ -297,17 +297,19 @@ parse_arguments($opt, 'PICK-ARGS-FROM-ARGV', @ARGV); ...@@ -297,17 +297,19 @@ parse_arguments($opt, 'PICK-ARGS-FROM-ARGV', @ARGV);
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# FIXME $extra_bindir is not used # FIXME $extra_bindir is not used
my ($bindir,$extra_bindir,$mysqld,$pkgdatadir,$mysqld_opt,$scriptdir); my ($bindir,$extra_bindir,$mysqld,$srcpkgdatadir,$buildpkgdatadir,$mysqld_opt,
$scriptdir);
if ( $opt->{srcdir} ) if ( $opt->{srcdir} )
{ {
$opt->{basedir} = $opt->{builddir}; $opt->{basedir} = $opt->{builddir};
$bindir = "$opt->{basedir}/client"; $bindir = "$opt->{basedir}/client";
$extra_bindir = "$opt->{basedir}/extra"; $extra_bindir = "$opt->{basedir}/extra";
$mysqld = "$opt->{basedir}/sql/mysqld"; $mysqld = "$opt->{basedir}/sql/mysqld";
$mysqld_opt = "--language=$opt->{srcdir}/sql/share/english"; $mysqld_opt = "--language=$opt->{srcdir}/sql/share/english";
$pkgdatadir = "$opt->{srcdir}/scripts"; $srcpkgdatadir = "$opt->{srcdir}/scripts";
$scriptdir = "$opt->{srcdir}/scripts"; $buildpkgdatadir = "$opt->{builddir}/scripts";
$scriptdir = "$opt->{srcdir}/scripts";
} }
elsif ( $opt->{basedir} ) elsif ( $opt->{basedir} )
{ {
...@@ -317,18 +319,20 @@ elsif ( $opt->{basedir} ) ...@@ -317,18 +319,20 @@ elsif ( $opt->{basedir} )
"libexec","sbin","bin") || # ,"sql" "libexec","sbin","bin") || # ,"sql"
find_in_basedir($opt,"file","mysqld-nt", find_in_basedir($opt,"file","mysqld-nt",
"bin"); # ,"sql" "bin"); # ,"sql"
$pkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql", $srcpkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql",
"share","share/mysql"); # ,"scripts" "share","share/mysql"); # ,"scripts"
$buildpkgdir = $srcpkgdatadir;
$scriptdir = "$opt->{basedir}/scripts"; $scriptdir = "$opt->{basedir}/scripts";
} }
else else
{ {
$opt->{basedir} = '@prefix@'; $opt->{basedir} = '@prefix@';
$bindir = '@bindir@'; $bindir = '@bindir@';
$extra_bindir = $bindir; $extra_bindir = $bindir;
$mysqld = '@libexecdir@/mysqld'; $mysqld = '@libexecdir@/mysqld';
$pkgdatadir = '@pkgdatadir@'; $srcpkgdatadir = '@pkgdatadir@';
$scriptdir = '@scriptdir@'; $buildpkgdatadir = '@pkgdatadir@';
$scriptdir = '@scriptdir@';
} }
unless ( $opt->{ldata} ) unless ( $opt->{ldata} )
...@@ -336,19 +340,15 @@ unless ( $opt->{ldata} ) ...@@ -336,19 +340,15 @@ unless ( $opt->{ldata} )
$opt->{ldata} = '@localstatedir@'; $opt->{ldata} = '@localstatedir@';
} }
if ( $opt->{srcdir} )
{
$pkgdatadir = "$opt->{srcdir}/scripts";
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Set up paths to SQL scripts required for bootstrap # Set up paths to SQL scripts required for bootstrap
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
my $fill_help_tables = "$pkgdatadir/fill_help_tables.sql"; my $fill_help_tables = "$srcpkgdatadir/fill_help_tables.sql";
my $create_system_tables = "$pkgdatadir/mysql_system_tables.sql"; my $create_system_tables = "$srcpkgdatadir/mysql_system_tables.sql";
my $fill_system_tables = "$pkgdatadir/mysql_system_tables_data.sql"; my $fill_system_tables = "$srcpkgdatadir/mysql_system_tables_data.sql";
my $maria_add_gis_sp = "$pkgdatadir/maria_add_gis_sp_bootstrap.sql"; my $maria_add_gis_sp = "$buildpkgdatadir/maria_add_gis_sp_bootstrap.sql";
foreach my $f ( $fill_help_tables,$create_system_tables,$fill_system_tables,$maria_add_gis_sp ) foreach my $f ( $fill_help_tables,$create_system_tables,$fill_system_tables,$maria_add_gis_sp )
{ {
......
...@@ -270,7 +270,8 @@ then ...@@ -270,7 +270,8 @@ then
extra_bindir="$basedir/extra" extra_bindir="$basedir/extra"
mysqld="$basedir/sql/mysqld" mysqld="$basedir/sql/mysqld"
langdir="$basedir/sql/share/english" langdir="$basedir/sql/share/english"
pkgdatadir="$srcdir/scripts" srcpkgdatadir="$srcdir/scripts"
buildpkgdatadir="$builddir/scripts"
scriptdir="$srcdir/scripts" scriptdir="$srcdir/scripts"
elif test -n "$basedir" elif test -n "$basedir"
then then
...@@ -288,7 +289,8 @@ then ...@@ -288,7 +289,8 @@ then
cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english
exit 1 exit 1
fi fi
pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql` srcpkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`
buildpkgdatadir=$srcpkgdatadir
if test -z "$pkgdatadir" if test -z "$pkgdatadir"
then then
cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql
...@@ -300,16 +302,17 @@ else ...@@ -300,16 +302,17 @@ else
bindir="@bindir@" bindir="@bindir@"
extra_bindir="$bindir" extra_bindir="$bindir"
mysqld="@libexecdir@/mysqld" mysqld="@libexecdir@/mysqld"
pkgdatadir="@pkgdatadir@" srcpkgdatadir="@pkgdatadir@"
buildpkgdatadir="@pkgdatadir@"
scriptdir="@scriptdir@" scriptdir="@scriptdir@"
fi fi
# Set up paths to SQL scripts required for bootstrap # Set up paths to SQL scripts required for bootstrap
fill_help_tables="$pkgdatadir/fill_help_tables.sql" fill_help_tables="$srcpkgdatadir/fill_help_tables.sql"
create_system_tables="$pkgdatadir/mysql_system_tables.sql" create_system_tables="$srcpkgdatadir/mysql_system_tables.sql"
create_system_tables2="$pkgdatadir/mysql_performance_tables.sql" create_system_tables2="$srcpkgdatadir/mysql_performance_tables.sql"
fill_system_tables="$pkgdatadir/mysql_system_tables_data.sql" fill_system_tables="$srcpkgdatadir/mysql_system_tables_data.sql"
maria_add_gis_sp="$pkgdatadir/maria_add_gis_sp_bootstrap.sql" maria_add_gis_sp="$buildpkgdatadir/maria_add_gis_sp_bootstrap.sql"
for f in "$fill_help_tables" "$create_system_tables" "$create_system_tables2" "$fill_system_tables" "$maria_add_gis_sp" for f in "$fill_help_tables" "$create_system_tables" "$create_system_tables2" "$fill_system_tables" "$maria_add_gis_sp"
do do
......
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