Commit 112dfa59 authored by monty@narttu.mysql.fi's avatar monty@narttu.mysql.fi

Fixes for fill_help_tables.sql

parent 543bcba8
...@@ -294,10 +294,10 @@ ha_print_info( ...@@ -294,10 +294,10 @@ ha_print_info(
{ {
hash_cell_t* cell; hash_cell_t* cell;
/* ha_node_t* node; */ /* ha_node_t* node; */
ulint nodes = 0; /* ulint nodes = 0; */
ulint cells = 0; ulint cells = 0;
ulint len = 0; /* ulint len = 0; */
ulint max_len = 0; /* ulint max_len = 0; */
ulint n_bufs; ulint n_bufs;
ulint i; ulint i;
......
...@@ -54,7 +54,7 @@ explain select level,id,parent_id from t1 where level=1; ...@@ -54,7 +54,7 @@ explain select level,id,parent_id from t1 where level=1;
select level,id from t1 where level=1; select level,id from t1 where level=1;
select level,id,parent_id from t1 where level=1; select level,id,parent_id from t1 where level=1;
optimize table t1; optimize table t1;
--replace_result 87 # 48 # 43 # 24 # 6 # 3 # --replace_result 87 # 50 # 48 # 43 # 25 # 24 # 6 # 3 #
show keys from t1; show keys from t1;
drop table t1; drop table t1;
......
...@@ -58,10 +58,9 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ ...@@ -58,10 +58,9 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
EXTRA_DIST = $(EXTRA_SCRIPTS) \ EXTRA_DIST = $(EXTRA_SCRIPTS) \
mysqlaccess.conf \ mysqlaccess.conf \
mysqlbug \ mysqlbug
fill_help_tables.sql
pkgdata_DATA = make_binary_distribution pkgdata_DATA = fill_help_tables.sql
# mysqlbug should be distributed built so that people can report build # mysqlbug should be distributed built so that people can report build
# failures with it. # failures with it.
...@@ -81,8 +80,8 @@ CLEANFILES = @server_scripts@ \ ...@@ -81,8 +80,8 @@ CLEANFILES = @server_scripts@ \
mysqlhotcopy \ mysqlhotcopy \
mysqldumpslow \ mysqldumpslow \
mysqld_multi \ mysqld_multi \
fill_help_tables \ fill_help_tables \
fill_help_tables.sql fill_help_tables.sql
SUPERCLEANFILES = mysqlbug SUPERCLEANFILES = mysqlbug
...@@ -103,6 +102,7 @@ SUFFIXES = .sh ...@@ -103,6 +102,7 @@ SUFFIXES = .sh
-e 's!@''libexecdir''@!$(libexecdir)!g' \ -e 's!@''libexecdir''@!$(libexecdir)!g' \
-e 's!@''pkglibdir''@!$(pkglibdir)!g' \ -e 's!@''pkglibdir''@!$(pkglibdir)!g' \
-e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \
-e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \
-e 's!@''CC''@!@CC@!'\ -e 's!@''CC''@!@CC@!'\
-e 's!@''CXX''@!@CXX@!'\ -e 's!@''CXX''@!@CXX@!'\
-e 's!@''GXX''@!@GXX@!'\ -e 's!@''GXX''@!@GXX@!'\
...@@ -137,7 +137,12 @@ SUFFIXES = .sh ...@@ -137,7 +137,12 @@ SUFFIXES = .sh
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
all: fill_help_tables.sql make_win_src_distribution all: fill_help_tables.sql make_win_src_distribution make_binary_distribution
# The following rule is here to ensure that build will continue
# even if we don't have perl installed. In this case the help tables
# will be empty
fill_help_tables.sql: fill_help_tables ../Docs/manual.texi fill_help_tables.sql: fill_help_tables ../Docs/manual.texi
./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql -./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql
echo "" >> fill_help_tables.sql
...@@ -111,12 +111,12 @@ sub flush_all ...@@ -111,12 +111,12 @@ sub flush_all
$example= prepare_example($example); $example= prepare_example($example);
if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){
print "INSERT INTO help_topic (name,description,example) VALUES ("; print "INSERT IGNORE INTO help_topic (name,description,example) VALUES (";
print "'$func_name',"; print "'$func_name',";
print "'$text',"; print "'$text',";
print "'$example'"; print "'$example'";
print ");\n"; print ");\n";
print "INSERT INTO help_relation (help_category_id,help_topic_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; print "INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (\@cur_category,LAST_INSERT_ID());\n";
} }
$func_name= ""; $func_name= "";
...@@ -131,11 +131,11 @@ sub new_category ...@@ -131,11 +131,11 @@ sub new_category
$category= prepare_text($category); $category= prepare_text($category);
print "INSERT INTO help_category (name) VALUES (\'$category\');\n"; print "INSERT IGNORE INTO help_category (name) VALUES (\'$category\');\n";
print "SET \@cur_category=LAST_INSERT_ID();\n"; print "SET \@cur_category=LAST_INSERT_ID();\n";
} }
#print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; #print "INSERT IGNORE INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n";
#print "CREATE DATABASE mysql_help;\n"; #print "CREATE DATABASE mysql_help;\n";
print "USE mysql;\n"; print "USE mysql;\n";
...@@ -236,4 +236,3 @@ print "DELETE help_category "; ...@@ -236,4 +236,3 @@ print "DELETE help_category ";
print "FROM help_category "; print "FROM help_category ";
print "LEFT JOIN help_relation ON help_category.help_category_id=help_relation.help_category_id "; print "LEFT JOIN help_relation ON help_category.help_category_id=help_relation.help_category_id ";
print "WHERE help_relation.help_category_id is null;" print "WHERE help_relation.help_category_id is null;"
...@@ -160,6 +160,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then ...@@ -160,6 +160,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then
fi fi
$CP support-files/* $BASE/support-files $CP support-files/* $BASE/support-files
$CP scripts/fill_help_tables.sql $BASE/support-files
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
rm -f $BASE/support-files/magic \ rm -f $BASE/support-files/magic \
...@@ -183,14 +184,14 @@ do ...@@ -183,14 +184,14 @@ do
done done
$CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/include/*.inc $BASE/mysql-test/include
$CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data
$CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data
$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t
$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r
if [ $BASE_SYSTEM != "netware" ] ; then if [ $BASE_SYSTEM != "netware" ] ; then
$CP scripts/* $BASE/bin $CP scripts/* $BASE/bin
$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
mv $BASE/support-files/binary-configure $BASE/configure mv $BASE/support-files/binary-configure $BASE/configure
......
#!/bin/sh #!/bin/sh
# Copyright (C) 2002 MySQL AB # Copyright (C) 2002-2003 MySQL AB
# For a more info consult the file COPYRIGHT distributed with this file. # For a more info consult the file COPYRIGHT distributed with this file.
# This scripts creates the privilege tables db, host, user, tables_priv, # This scripts creates the privilege tables db, host, user, tables_priv,
...@@ -43,6 +43,7 @@ parse_arguments() { ...@@ -43,6 +43,7 @@ parse_arguments() {
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--verbose) verbose=1 ;;
*) *)
if test -n "$pick_args" if test -n "$pick_args"
then then
...@@ -76,6 +77,8 @@ execdir= ...@@ -76,6 +77,8 @@ execdir=
bindir= bindir=
basedir= basedir=
force=0 force=0
verbose=0
fill_help_tables=""
parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments `$print_defaults $defaults mysqld mysql_install_db`
parse_arguments PICK-ARGS-FROM-ARGV "$@" parse_arguments PICK-ARGS-FROM-ARGV "$@"
...@@ -85,17 +88,37 @@ then ...@@ -85,17 +88,37 @@ then
basedir=@prefix@ basedir=@prefix@
bindir=@bindir@ bindir=@bindir@
execdir=@libexecdir@ execdir=@libexecdir@
pkgdatadir=@pkgdatadir@
else else
bindir="$basedir/bin" bindir="$basedir/bin"
if test -x "$basedir/libexec/mysqld" if test -x "$basedir/libexec/mysqld"
then then
execdir="$basedir/libexec" execdir="$basedir/libexec"
elif test -x "@libexecdir@/mysqld" elif test -x "@libexecdir@/mysqld"
then
execdir="@libexecdir@"
else
execdir="$basedir/bin"
fi
# find fill_help_tables.sh
for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts @pkgdatadir@
do
if test -f $i/fill_help_tables.sql
then
pkgdatadir=$i
fi
done
fi
if test -f $pkgdatadir/fill_help_tables.sql
then then
execdir="@libexecdir@" fill_help_tables=$pkgdatadir/fill_help_tables.sql
else else
execdir="$basedir/bin" if test $verbose -eq 1
fi then
echo "Could not find help file 'fill_help_tables.sql'".
fi
fi fi
mdata=$ldata/mysql mdata=$ldata/mysql
...@@ -160,8 +183,9 @@ c_t="" c_c="" ...@@ -160,8 +183,9 @@ c_t="" c_c=""
# Check for old tables # Check for old tables
if test ! -f $mdata/db.frm if test ! -f $mdata/db.frm
then then
echo "Preparing db table" if test $verbose -eq 1 ; then
echo "Preparing db table"
fi
# mysqld --bootstrap wants one command/line # mysqld --bootstrap wants one command/line
c_d="$c_d CREATE TABLE db (" c_d="$c_d CREATE TABLE db ("
c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL,"
...@@ -190,7 +214,9 @@ fi ...@@ -190,7 +214,9 @@ fi
if test ! -f $mdata/host.frm if test ! -f $mdata/host.frm
then then
echo "Preparing host table" if test $verbose -eq 1 ; then
echo "Preparing host table"
fi
c_h="$c_h CREATE TABLE host (" c_h="$c_h CREATE TABLE host ("
c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL,"
...@@ -214,7 +240,9 @@ fi ...@@ -214,7 +240,9 @@ fi
if test ! -f $mdata/user.frm if test ! -f $mdata/user.frm
then then
echo "Preparing user table" if test $verbose -eq 1 ; then
echo "Preparing user table"
fi
c_u="$c_u CREATE TABLE user (" c_u="$c_u CREATE TABLE user ("
c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL,"
...@@ -256,7 +284,8 @@ then ...@@ -256,7 +284,8 @@ then
REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user (host,user) values ('localhost','');" INSERT INTO user (host,user) values ('localhost','');
"
if test "$windows" -eq 0 if test "$windows" -eq 0
then then
...@@ -270,7 +299,9 @@ fi ...@@ -270,7 +299,9 @@ fi
if test ! -f $mdata/func.frm if test ! -f $mdata/func.frm
then then
echo "Preparing func table" if test $verbose -eq 1 ; then
echo "Preparing func table"
fi
c_f="$c_f CREATE TABLE func (" c_f="$c_f CREATE TABLE func ("
c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," c_f="$c_f name char(64) binary DEFAULT '' NOT NULL,"
...@@ -284,7 +315,9 @@ fi ...@@ -284,7 +315,9 @@ fi
if test ! -f $mdata/tables_priv.frm if test ! -f $mdata/tables_priv.frm
then then
echo "Preparing tables_priv table" if test $verbose -eq 1 ; then
echo "Preparing tables_priv table"
fi
c_t="$c_t CREATE TABLE tables_priv (" c_t="$c_t CREATE TABLE tables_priv ("
c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL,"
...@@ -303,7 +336,9 @@ fi ...@@ -303,7 +336,9 @@ fi
if test ! -f $mdata/columns_priv.frm if test ! -f $mdata/columns_priv.frm
then then
echo "Preparing columns_priv table" if test $verbose -eq 1 ; then
echo "Preparing columns_priv table"
fi
c_c="$c_c CREATE TABLE columns_priv (" c_c="$c_c CREATE TABLE columns_priv ("
c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL," c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL,"
...@@ -318,7 +353,7 @@ then ...@@ -318,7 +353,7 @@ then
c_c="$c_c comment='Column privileges';" c_c="$c_c comment='Column privileges';"
fi fi
echo "Installing all prepared tables" echo "Installing privilege tables"
if ( if (
cat << END_OF_DATA cat << END_OF_DATA
use mysql; use mysql;
...@@ -337,7 +372,10 @@ $i_f ...@@ -337,7 +372,10 @@ $i_f
$c_t $c_t
$c_c $c_c
END_OF_DATA END_OF_DATA
cat fill_help_tables.sql if test -n "$fill_help_tables"
then
cat $fill_help_tables
fi
) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ ) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \
--basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args"
then then
...@@ -377,7 +415,6 @@ then ...@@ -377,7 +415,6 @@ then
echo "The latest information about MySQL is available on the web at" echo "The latest information about MySQL is available on the web at"
echo "http://www.mysql.com" echo "http://www.mysql.com"
echo "Support MySQL by buying support/licenses at https://order.mysql.com" echo "Support MySQL by buying support/licenses at https://order.mysql.com"
echo
exit 0 exit 0
else else
echo "Installation of grant tables failed!" echo "Installation of grant tables failed!"
......
...@@ -894,7 +894,7 @@ extern "C" void unireg_abort(int exit_code) ...@@ -894,7 +894,7 @@ extern "C" void unireg_abort(int exit_code)
DBUG_ENTER("unireg_abort"); DBUG_ENTER("unireg_abort");
if (exit_code) if (exit_code)
sql_print_error("Aborting\n"); sql_print_error("Aborting\n");
clean_up(1); /* purecov: inspected */ clean_up(exit_code || !opt_bootstrap); /* purecov: inspected */
DBUG_PRINT("quit",("done with cleanup in unireg_abort")); DBUG_PRINT("quit",("done with cleanup in unireg_abort"));
my_thread_end(); my_thread_end();
clean_up_mutexes(); clean_up_mutexes();
......
...@@ -34,8 +34,7 @@ pkgdata_DATA = my-small.cnf \ ...@@ -34,8 +34,7 @@ pkgdata_DATA = my-small.cnf \
my-large.cnf \ my-large.cnf \
my-huge.cnf \ my-huge.cnf \
mysql-log-rotate \ mysql-log-rotate \
mysql-@VERSION@.spec \ mysql-@VERSION@.spec
binary-configure
pkgdata_SCRIPTS = mysql.server pkgdata_SCRIPTS = mysql.server
...@@ -48,7 +47,6 @@ CLEANFILES = my-small.cnf \ ...@@ -48,7 +47,6 @@ CLEANFILES = my-small.cnf \
mysql-log-rotate \ mysql-log-rotate \
mysql.server \ mysql.server \
binary-configure binary-configure
mysql-@VERSION@.spec: mysql.spec mysql-@VERSION@.spec: mysql.spec
rm -f $@ rm -f $@
...@@ -98,5 +96,7 @@ SUFFIXES = .sh ...@@ -98,5 +96,7 @@ SUFFIXES = .sh
$< > $@-t $< > $@-t
@MV@ $@-t $@ @MV@ $@-t $@
all: binary-configure
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
...@@ -14,11 +14,11 @@ echo "and start the MySQL server for you. If you run into any trouble, please" ...@@ -14,11 +14,11 @@ echo "and start the MySQL server for you. If you run into any trouble, please"
echo "consult the MySQL manual, that you can find in the Docs directory." echo "consult the MySQL manual, that you can find in the Docs directory."
echo "" echo ""
./scripts/mysql_install_db ./scripts/mysql_install_db --no-defaults
if [ $? = 0 ] if [ $? = 0 ]
then then
echo "Starting the mysqld server. You can test that it is up and running" echo "Starting the mysqld server. You can test that it is up and running"
echo "with the command:" echo "with the command:"
echo "./bin/mysqladmin version" echo "./bin/mysqladmin version"
./bin/mysqld_safe & ./bin/mysqld_safe --no-defaults &
fi fi
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