List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:August 6 2008 3:31pm
Subject:bzr commit into mysql-5.0 branch (chad:2650) Bug#30129
View as plain text  
#At file:///Users/cmiller/work/mysqlbzr/mysql-5.0-bugteam--bug30129/

 2650 Chad MILLER	2008-08-06
      Bug#30129: mysql_install_db appears to run normally, but the databases \
      	are not created  {Netware}
      
      The init and test sql files were not created at cross-compilation time.
      
      Now, make them in the default build rule.  Additionally, remove the "fix" 
      SQL instructions, which are unnecessary for newly initialized databases.
      Also, clean up the english in an error message, and BZRify nwbootstrap.
modified:
  netware/BUILD/compile-linux-tools
  netware/BUILD/nwbootstrap
  netware/Makefile.am
  netware/mysql_install_db.c

=== modified file 'netware/BUILD/compile-linux-tools'
--- a/netware/BUILD/compile-linux-tools	2006-04-03 15:54:09 +0000
+++ b/netware/BUILD/compile-linux-tools	2008-08-06 13:25:03 +0000
@@ -53,6 +53,9 @@ make
 # so the file will be linked
 (cd sql; make sql_yacc.cc)
 
+# we need initilizing SQL files.
+(cd netware; make test_db.sql init_db.sql)
+
 # copying required linux tools
 cp extra/comp_err extra/comp_err.linux
 cp libmysql/conf_to_src libmysql/conf_to_src.linux

=== modified file 'netware/BUILD/nwbootstrap'
--- a/netware/BUILD/nwbootstrap	2006-11-28 17:36:53 +0000
+++ b/netware/BUILD/nwbootstrap	2008-08-06 13:25:03 +0000
@@ -91,8 +91,8 @@ done
 echo "starting build..."
 
 # check for bk and repo_dir
-bk help > /dev/null
-repo_dir=`bk root $repo_dir`
+bzr help > /dev/null
+repo_dir=`bzr root $repo_dir`
 cd $repo_dir
 doc_dir="$repo_dir/../mysqldoc"
 
@@ -100,7 +100,7 @@ doc_dir="$repo_dir/../mysqldoc"
 temp_dir="$build_dir/mysql-$$.tmp"
 
 # export the bk tree
-command="bk export";
+command="bzr export";
 if test $revision; then command="$command -r$revision"; fi
 command="$command $temp_dir"
 echo "exporting $repo_dir..."
@@ -178,6 +178,8 @@ awk 'BEGIN{x=0;}  END{printf("\n");} x==
 # build linux tools
 echo "compiling linux tools..."
 ./netware/BUILD/compile-linux-tools
+test -f ./netware/init_db.sql  # this must exist
+test -f ./netware/test_db.sql  # this must exist
 
 # compile
 if test $build

=== modified file 'netware/Makefile.am'
--- a/netware/Makefile.am	2007-08-24 21:40:36 +0000
+++ b/netware/Makefile.am	2008-08-06 13:25:03 +0000
@@ -103,8 +103,7 @@ init_db.sql: $(top_srcdir)/scripts/mysql
 	@echo "CREATE DATABASE mysql;" > $@;
 	@echo "CREATE DATABASE test;" >> $@;
 	@echo "use mysql;" >> $@;
-	@cat $(top_srcdir)/scripts/mysql_system_tables.sql \
-	     $(top_srcdir)/scripts/mysql_system_tables_fix.sql >> $@;
+	@cat $(top_srcdir)/scripts/mysql_system_tables.sql >> $@;
 
 # Build test_db.sql from init_db.sql plus
 # some test data

=== modified file 'netware/mysql_install_db.c'
--- a/netware/mysql_install_db.c	2006-04-03 01:37:43 +0000
+++ b/netware/mysql_install_db.c	2008-08-06 13:25:03 +0000
@@ -324,9 +324,10 @@ void create_paths()
 ******************************************************************************/
 int mysql_install_db(int argc, char *argv[])
 {
-	arg_list_t al;
-	int i, j, err;
-	char skip;
+  arg_list_t al;
+  int i, j, err;
+  char skip;
+  struct stat info;
   
   // private options
   static char *private_options[] =
@@ -363,6 +364,15 @@ int mysql_install_db(int argc, char *arg
 	add_arg(&al, "--skip-innodb");
 	add_arg(&al, "--skip-bdb");
 
+  if ((err = stat(sql_file, &info)) != 0)
+  {
+    printf("ERROR - %s:\n", strerror(errno));
+    printf("\t%s\n\n", sql_file);
+    // free args
+    free_args(&al);
+    exit(-1);
+  }
+
   // spawn mysqld
   err = spawn(mysqld, &al, TRUE, sql_file, out_log, err_log);
 
@@ -395,9 +405,9 @@ int main(int argc, char **argv)
 	// install the database
   if (mysql_install_db(argc, argv))
   {
-    printf("ERROR - The database creation failed!\n");
+    printf("ERROR - Failed to create the database!\n");
     printf("        %s\n", strerror(errno));
-    printf("See the following log for more infomration:\n");
+    printf("See the following log for more information:\n");
     printf("\t%s\n\n", err_log);
     exit(-1);
   }

Thread
bzr commit into mysql-5.0 branch (chad:2650) Bug#30129Chad MILLER6 Aug