Bug #18888 Trying to overwrite sql/lex_hash.h during build
Submitted: 7 Apr 2006 14:45 Modified: 6 Nov 2006 14:30
Reporter: Olsen Morten Werner Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.1.18 OS:Solaris (Solaris 8)
Assigned to: Magnus Blåudd CPU Architecture:Any

[7 Apr 2006 14:45] Olsen Morten Werner
Description:
Our software-distribution system symlinks all source-files from another location (read-only filesystem) before build. During build of MySQL 4.1.18 on Solaris 8, I get an error when gen_lex_hash tries to overwrite lex_hash.h because lex_hash.h is a symlink to a read-only file. From sql/Makefile:

lex_hash.h:     gen_lex_hash$(EXEEXT)
                ./gen_lex_hash$(EXEEXT) > $@

You should not overwrite the source-files during build.

How to repeat:
Unpack the MySQL source tar.gz-file and make all the file read-only. Create a source-tree where all the files (not directories) are symlinks to the original unpacked read-only source-tree. Now try to build MySQL.

Suggested fix:
If it is neccessary to create a new file for lex_hash.h during build, create it with a name that is not an existing file already.
[25 Sep 2006 18:01] 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/12490

ChangeSet@1.2538, 2006-09-25 20:01:39+02:00, msvensson@neptunus.(none) +1 -0
  Bug#18888 Trying to overwrite sql/lex_hash.h during build
   -Backport fix for bug19738 to 4.1
[3 Oct 2006 20:02] Chad MILLER
Available in 5.0.26.
[3 Oct 2006 20:10] Chad MILLER
Available in 5.1.12-beta.
[4 Oct 2006 13:57] Chad MILLER
Available in 4.1.22.
[4 Oct 2006 17:39] Magnus Blåudd
This was first fixed in 5.0 and up. Then we discovered it was better to do it in 4.1 as weel. Thus the null merge of backport. Sorry for the confusion.
[4 Oct 2006 20:32] Paul Dubois
Noted in 4.1.22, 5.0.26, 5.1.12 changelogs.

The build process incorrectly tried to overwrite sql/lex_hash.h. This
caused the build to fail when using a shadow link tree pointing to
original sources that were owned by another account.
[14 Oct 2006 18:05] 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/13702

ChangeSet@1.2319, 2006-10-14 20:03:49+02:00, kent@mysql.com +1 -0
  Makefile.am:
    Configure flags makes "lex_hash.h" differ, don't distribute
    pregenerated file, build it after configure (bug#18888).
[25 Oct 2006 14:55] 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/14367

ChangeSet@1.2323, 2006-10-25 16:39:19+02:00, msvensson@shellback.(none) +6 -0
  Bug#18888 Trying to overwrite sql/lex_hash.h during build
   - As a sideeffect of the patch to generate lex_hash.h only once
  on the machine where the source dist was produced, a problem
  was found when compiling a mysqld without partition support - it 
  would crash when looking up the lex symbols due to mismatch between
  lex.h and the generated lex_hash.h
  
   - Remove the ifdef for partition in lex.h 
   - Fix minor problem with"EXPLAIN PARTITION" when not compiled with
     partition(existed also without the above patch)
   - Add test case that will be run when we don't have partition
     support compiled into mysqld
[26 Oct 2006 17:11] 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/14436

ChangeSet@1.2323, 2006-10-26 19:11:09+02:00, msvensson@shellback.(none) +7 -0
  Bug#18888 Trying to overwrite sql/lex_hash.h during build
   - As a sideeffect of the patch to generate lex_hash.h only once
  on the machine where the source dist was produced, a problem
  was found when compiling a mysqld without partition support - it 
  would crash when looking up the lex symbols due to mismatch between
  lex.h and the generated lex_hash.h
  
   - Remove the ifdef for partition in lex.h 
   - Fix minor problem with"EXPLAIN PARTITION" when not compiled with
     partition(existed also without the above patch)
   - Add test case that will be run when we don't have partition
     support compiled into mysqld
   - Return error ER_FEATURE_DISABLED if user tries to use PARTITION
     when there is no support for it.
[6 Nov 2006 14:30] MC Brown
Already documented in changelog, no additional documentation needed.