diff options
author | unknown <monty@narttu.mysql.fi> | 2003-03-21 18:53:55 +0200 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-03-21 18:53:55 +0200 |
commit | e4ae47ff36894c6c776a26b16141cec5eddb34b0 (patch) | |
tree | ce48d336533b0ff442f6fd114d61fffcfbdc1941 | |
parent | 75ad5e96e1d7b504e7a0372fd8632c047ac2336f (diff) | |
download | mariadb-git-e4ae47ff36894c6c776a26b16141cec5eddb34b0.tar.gz |
Fixes for fill_help_tables.sql
innobase/ha/ha0ha.c:
Removed compiler warnings
mysql-test/t/innodb.test:
Another fix for cardinality
scripts/Makefile.am:
Install fill_help_tables.sql in prefix/share/mysql
Don't install make_binary_distribution
scripts/fill_help_tables.sh:
use INSERT IGNORE to avoid errors
scripts/make_binary_distribution.sh:
Install and use fill_help_tables.sql
scripts/mysql_install_db.sh:
Search for and use fill_help_tables.sql
sql/mysqld.cc:
Don't write shutdown message when called from mysql_install_db
support-files/Makefile.am:
Don't install binary-configure
support-files/binary-configure.sh:
Don't use config files
-rw-r--r-- | innobase/ha/ha0ha.c | 6 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 2 | ||||
-rw-r--r-- | scripts/Makefile.am | 19 | ||||
-rw-r--r-- | scripts/fill_help_tables.sh | 9 | ||||
-rw-r--r-- | scripts/make_binary_distribution.sh | 5 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 75 | ||||
-rw-r--r-- | sql/mysqld.cc | 2 | ||||
-rw-r--r-- | support-files/Makefile.am | 6 | ||||
-rw-r--r-- | support-files/binary-configure.sh | 4 |
9 files changed, 85 insertions, 43 deletions
diff --git a/innobase/ha/ha0ha.c b/innobase/ha/ha0ha.c index 4489b25ec2b..b847798586d 100644 --- a/innobase/ha/ha0ha.c +++ b/innobase/ha/ha0ha.c @@ -294,10 +294,10 @@ ha_print_info( { hash_cell_t* cell; /* ha_node_t* node; */ - ulint nodes = 0; +/* ulint nodes = 0; */ ulint cells = 0; - ulint len = 0; - ulint max_len = 0; +/* ulint len = 0; */ +/* ulint max_len = 0; */ ulint n_bufs; ulint i; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 0a10df52412..4d1a620d67f 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -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,parent_id from t1 where level=1; 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; drop table t1; diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 3b4d19b7eed..88f561e0e6d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -58,10 +58,9 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ - mysqlbug \ - fill_help_tables.sql + mysqlbug -pkgdata_DATA = make_binary_distribution +pkgdata_DATA = fill_help_tables.sql # mysqlbug should be distributed built so that people can report build # failures with it. @@ -81,8 +80,8 @@ CLEANFILES = @server_scripts@ \ mysqlhotcopy \ mysqldumpslow \ mysqld_multi \ - fill_help_tables \ - fill_help_tables.sql + fill_help_tables \ + fill_help_tables.sql SUPERCLEANFILES = mysqlbug @@ -103,6 +102,7 @@ SUFFIXES = .sh -e 's!@''libexecdir''@!$(libexecdir)!g' \ -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ + -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ -e 's!@''CC''@!@CC@!'\ -e 's!@''CXX''@!@CXX@!'\ -e 's!@''GXX''@!@GXX@!'\ @@ -137,7 +137,12 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::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 < ../Docs/manual.texi > fill_help_tables.sql + -./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql + echo "" >> fill_help_tables.sql diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 52dfa018d6e..e21b0ff2bb0 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -111,12 +111,12 @@ sub flush_all $example= prepare_example($example); 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 "'$text',"; print "'$example'"; 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= ""; @@ -131,11 +131,11 @@ sub new_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 "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 "USE mysql;\n"; @@ -236,4 +236,3 @@ print "DELETE help_category "; print "FROM help_category "; 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;" - diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 2fff531c4c8..5ed76cefdb4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -160,6 +160,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi $CP support-files/* $BASE/support-files +$CP scripts/fill_help_tables.sql $BASE/support-files if [ $BASE_SYSTEM = "netware" ] ; then rm -f $BASE/support-files/magic \ @@ -183,14 +184,14 @@ do done $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/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 if [ $BASE_SYSTEM != "netware" ] ; then $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 /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 7249a095195..1a969895f7f 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,5 +1,5 @@ #!/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. # This scripts creates the privilege tables db, host, user, tables_priv, @@ -43,6 +43,7 @@ parse_arguments() { --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --verbose) verbose=1 ;; *) if test -n "$pick_args" then @@ -76,6 +77,8 @@ execdir= bindir= basedir= force=0 +verbose=0 +fill_help_tables="" parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" @@ -85,17 +88,37 @@ then basedir=@prefix@ bindir=@bindir@ execdir=@libexecdir@ + pkgdatadir=@pkgdatadir@ else bindir="$basedir/bin" -if test -x "$basedir/libexec/mysqld" -then - execdir="$basedir/libexec" -elif test -x "@libexecdir@/mysqld" + if test -x "$basedir/libexec/mysqld" + then + execdir="$basedir/libexec" + 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 - execdir="@libexecdir@" + fill_help_tables=$pkgdatadir/fill_help_tables.sql else - execdir="$basedir/bin" -fi + if test $verbose -eq 1 + then + echo "Could not find help file 'fill_help_tables.sql'". + fi fi mdata=$ldata/mysql @@ -160,8 +183,9 @@ c_t="" c_c="" # Check for old tables if test ! -f $mdata/db.frm then - echo "Preparing db table" - + if test $verbose -eq 1 ; then + echo "Preparing db table" + fi # mysqld --bootstrap wants one command/line c_d="$c_d CREATE TABLE db (" c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," @@ -190,7 +214,9 @@ fi if test ! -f $mdata/host.frm 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 Host char(60) binary DEFAULT '' NOT NULL," @@ -214,7 +240,9 @@ fi if test ! -f $mdata/user.frm 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 Host char(60) binary DEFAULT '' NOT NULL," @@ -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); - INSERT INTO user (host,user) values ('localhost','');" + INSERT INTO user (host,user) values ('localhost',''); +" if test "$windows" -eq 0 then @@ -270,7 +299,9 @@ fi if test ! -f $mdata/func.frm 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 name char(64) binary DEFAULT '' NOT NULL," @@ -284,7 +315,9 @@ fi if test ! -f $mdata/tables_priv.frm 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 Host char(60) binary DEFAULT '' NOT NULL," @@ -303,7 +336,9 @@ fi if test ! -f $mdata/columns_priv.frm 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 Host char(60) binary DEFAULT '' NOT NULL," @@ -318,7 +353,7 @@ then c_c="$c_c comment='Column privileges';" fi -echo "Installing all prepared tables" +echo "Installing privilege tables" if ( cat << END_OF_DATA use mysql; @@ -337,7 +372,10 @@ $i_f $c_t $c_c 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 \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" then @@ -377,7 +415,6 @@ then echo "The latest information about MySQL is available on the web at" echo "http://www.mysql.com" echo "Support MySQL by buying support/licenses at https://order.mysql.com" - echo exit 0 else echo "Installation of grant tables failed!" diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 2298ae7b9ea..bb2214f3c14 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -894,7 +894,7 @@ extern "C" void unireg_abort(int exit_code) DBUG_ENTER("unireg_abort"); if (exit_code) 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")); my_thread_end(); clean_up_mutexes(); diff --git a/support-files/Makefile.am b/support-files/Makefile.am index 4aadd98bd1b..ec88972c821 100644 --- a/support-files/Makefile.am +++ b/support-files/Makefile.am @@ -34,8 +34,7 @@ pkgdata_DATA = my-small.cnf \ my-large.cnf \ my-huge.cnf \ mysql-log-rotate \ - mysql-@VERSION@.spec \ - binary-configure + mysql-@VERSION@.spec pkgdata_SCRIPTS = mysql.server @@ -48,7 +47,6 @@ CLEANFILES = my-small.cnf \ mysql-log-rotate \ mysql.server \ binary-configure - mysql-@VERSION@.spec: mysql.spec rm -f $@ @@ -98,5 +96,7 @@ SUFFIXES = .sh $< > $@-t @MV@ $@-t $@ +all: binary-configure + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/support-files/binary-configure.sh b/support-files/binary-configure.sh index 107f468bffc..884a8363e22 100644 --- a/support-files/binary-configure.sh +++ b/support-files/binary-configure.sh @@ -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 "" -./scripts/mysql_install_db +./scripts/mysql_install_db --no-defaults if [ $? = 0 ] then echo "Starting the mysqld server. You can test that it is up and running" echo "with the command:" echo "./bin/mysqladmin version" - ./bin/mysqld_safe & + ./bin/mysqld_safe --no-defaults & fi |