Bug #30129 mysql_install_db appears to run normally, but the databases are not created
Submitted: 30 Jul 2007 22:45 Modified: 21 Oct 2008 19:37
Reporter: Lee Obringer
Status: Closed
Category:Server: Packaging Severity:S1 (Critical)
Version:5.0.45, 5.1.21 OS:Novell NetWare
Assigned to: Bugs System Target Version:5.0+
Tags: unscheduled
Triage: D1 (Critical)

[30 Jul 2007 22:45] Lee Obringer
Description:
After installing version 5.0.45 of MySQL on a Novell Netware file server with Netware 6.5
SP 5 installed I try to run the mysql_install_db and it exits normally indicating that the
databases have been created, but no new database files are created in the SYS:mysql\data
directory.

No errors are logged.

How to repeat:
Install (copy) MySQL 5.0.45 then try to run mysql_install_db.  

Suggested fix:
I tried running the mysql_install_db.nlm from the previous version of MySQL and it created
new databases.  I'm just not sure if they are current or not.
[6 Aug 2007 11:01] Shane Bester
I wonder if the init_db.sql and test_db.sql are missing. Checking now.
[24 Aug 2007 19:49] Michael Bell
I can confirm these 2 files are missing in the bin directory. Having someone test if the
ones from 5.0.27 (which is I think the previous community server release on netware)
placed in the bin directory fix the issue.
[7 Sep 2007 5:43] Michael Bell
Although Shane Bester appears to have fallen on a rock when he tried to look for the
files, indeed it DOES work to use the previous community server version's sql files.
[28 Sep 2007 20:09] Michael Bell
Files taken from 5.0.27 netware bin directory

Attachment: missingfiles.zip (application/zip, text), 7.15 KiB.

[28 Sep 2007 20:12] Shane Bester
this is verified since I tested the 5.0.45 binaries.
csc 10143, note 76 contains details.
[8 Dec 2007 5:26] Guenter K
new mysql_install_db.nlm

Attachment: mysql_install_db.zip (application/zip, text), 4.42 KiB.

[8 Dec 2007 5:27] Guenter K
Hi,
I think since the mysql_install_db.nlm can also take an option for the *.sql script it
should in any case be tested if it can be accessed.
The current the mysql_install_db.nlm instead does report success with creating databases
although nothing was created!
I did a quick hack to the source and patched mysql_install_db.c to error out if the sql
script was not not:

--- mysql_install_db.c.orig	Thu Nov 15 15:06:52 2007
+++ mysql_install_db.c	Sat Dec 08 04:49:36 2007
@@ -363,6 +363,15 @@
 	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);
 
I've also attached the new NLM for others to try.
[18 Dec 2007 16:08] Trudy Pelzer
The comments on this bug indicate the problem is not
only found on Netware. Restoring I1.

Danny: Please note that the triage guidelines do not
allow for leads to change triage values. If you disagree
with a decision, you may ask for it to be reconsidered
but you may not simply change triage values.
[2 Aug 2008 7:58] Shane Bester
bug #38525 was marked as a duplicate of this.
[6 Aug 2008 15:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51002

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.
[8 Aug 2008 19:40] Magnus Blaudd
Good job, patch looks fine and we should finally get rid of the "init_db.sql" does not
exist in netware package problem since you have added double checks they are now created.
[18 Aug 2008 17:31] Chad MILLER
Queued to 5.0-bugteam, 5.1-bugteam, and 6.0-bugteam.
[21 Aug 2008 20:13] Bugs System
Pushed into 5.1.28  (revid:chad@mysql.com-20080806132503-7nlk40nfondnv116) (version source
revid:sergefp@mysql.com-20080819132519-eimtstp3bx89ya9d) (pib:3)
[27 Aug 2008 3:57] Paul DuBois
Noted in 5.1.28 changelog.

On NetWare, mysql_install_db could appear to execute normally even if
it failed to create the initial databases.

Setting report to NDI pending push into 5.0.x, 6.0.x.
[12 Sep 2008 3:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53909

2682 He Zhenxing	2008-09-12 [merge]
      Auto merge
      Update plugin.h.pp for WL#4398
[14 Sep 2008 0:16] Bugs System
Pushed into 6.0.6-alpha  (revid:chad@mysql.com-20080806132503-7nlk40nfondnv116) (version
source revid:hakan@mysql.com-20080716105246-eg0utbybp122n2w9) (pib:3)
[16 Sep 2008 6:40] Paul DuBois
Noted in 6.0.6 changelog.

Setting report to NDI pending push into 5.0.x.
[30 Sep 2008 15:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54774

2667 He Zhenxing	2008-09-29 [merge]
      Auto Merge
[21 Oct 2008 17:07] Chad MILLER
This is in v5.0.68.

$ cd 5.0; bzr log -m30129
[21 Oct 2008 19:37] Paul DuBois
Noted in 5.0.68 changelog.