Bug #30492 Inconsistent handling of the shebang/magic line of the perl interpreter
Submitted: 18 Aug 2007 20:53 Modified: 7 Dec 2016 14:38
Reporter: Joerg Behrens Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.1.22, 4.1, 5.0, 5.1, 6.0 bzr OS:Any (IRIX 6.5.30, all UNIX)
Assigned to: Assigned Account CPU Architecture:Any
Tags: IRIX, path, perl, scripts, Shebang

[18 Aug 2007 20:53] Joerg Behrens
Description:
If a user have more than one version of PERL installed in various locations the helper and test scripts pick up different pathes for the shebang/magic line. I tested it only on my IRIX machine but i thing its related to more UNIX like systems.

How to repeat:
Install more than one PERL version on a given host and compile mysql.
This ends up that half of the perl scripts uses the perl which comes with the system and exits on the standard location and the others use the alternativ location which is found earlier in the $PATH.

$ type perl
perl is /usr/nekoware/bin/perl
# env | grep PERL
PERL=/usr/nekoware/bin/perl

Compile mysql and install it. A small number of scrips use the default path
$ grep -rn "/bin/perl" *  | grep ":1:" | grep -v nekoware
bin/ndb_size.pl:1:#!/usr/bin/perl -w
bin/ndb_error_reporter:1:#!/usr/bin/perl -w
mysql-test/suite/funcs_1/lib/DataGen_local.pl:1:#!/usr/bin/perl
mysql-test/suite/funcs_1/lib/DataGen_modify.pl:1:#!/usr/bin/perl
mysql-test/suite/funcs_2/lib/gen_charset_utf8.pl:1:#!/usr/bin/perl
mysql-test/mysql-test-run:1:#!/usr/bin/perl
mysql-test/mtr:1:#!/usr/bin/perl
mysql-test/mysql-test-run.pl:1:#!/usr/bin/perl

and the rest 

$ grep -rn "/bin/perl" *  | grep ":1:" | grep nekoware
bin/mysql_fix_extensions:1:#!/usr/nekoware/bin/perl
bin/mysql_setpermission:1:#!/usr/nekoware/bin/perl
bin/mysql_zap:1:#!/usr/nekoware/bin/perl
bin/mysqlaccess:1:#!/usr/nekoware/bin/perl
bin/mysql_convert_table_format:1:#!/usr/nekoware/bin/perl
bin/mysql_find_rows:1:#!/usr/nekoware/bin/perl
bin/mysqlhotcopy:1:#!/usr/nekoware/bin/perl -w
bin/mysqldumpslow:1:#!/usr/nekoware/bin/perl
bin/mysql_explain_log:1:#!/usr/nekoware/bin/perl
bin/mysql_tableinfo:1:#!/usr/nekoware/bin/perl -w
bin/mysqld_multi:1:#!/usr/nekoware/bin/perl
sql-bench/test-ATIS:1:#!/usr/nekoware/bin/perl
sql-bench/test-connect:1:#!/usr/nekoware/bin/perl
sql-bench/test-create:1:#!/usr/nekoware/bin/perl
sql-bench/test-insert:1:#!/usr/nekoware/bin/perl
sql-bench/test-big-tables:1:#!/usr/nekoware/bin/perl
sql-bench/test-select:1:#!/usr/nekoware/bin/perl
sql-bench/test-wisconsin:1:#!/usr/nekoware/bin/perl
sql-bench/test-alter-table:1:#!/usr/nekoware/bin/perl
sql-bench/test-transactions:1:#!/usr/nekoware/bin/perl
sql-bench/bench-init.pl:1:#!/usr/nekoware/bin/perl
sql-bench/compare-results:1:#!/usr/nekoware/bin/perl
sql-bench/run-all-tests:1:#!/usr/nekoware/bin/perl
sql-bench/server-cfg:1:#!/usr/nekoware/bin/perl
sql-bench/crash-me:1:#!/usr/nekoware/bin/perl
sql-bench/copy-db:1:#!/usr/nekoware/bin/perl
sql-bench/innotest1:1:#!/usr/nekoware/bin/perl
sql-bench/innotest1a:1:#!/usr/nekoware/bin/perl
sql-bench/innotest1b:1:#!/usr/nekoware/bin/perl
sql-bench/innotest2:1:#!/usr/nekoware/bin/perl
sql-bench/innotest2a:1:#!/usr/nekoware/bin/perl
sql-bench/innotest2b:1:#!/usr/nekoware/bin/perl
sql-bench/bench-count-distinct:1:#!/usr/nekoware/bin/perl

Suggested fix:
A more consistent behaviour.
[10 Dec 2007 5:04] Valeriy Kravchuk
Thank you for a problem report. Please, check with a newer version, 5.0.51.
[11 Jan 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[9 Feb 2008 19:19] Joerg Behrens
Same behaviour in 5.1.22-rc.

[o3k]:/usr/nekoware-build/mysql5 $ grep -rn "/bin/perl" *  | grep ":1:" | grep nekoware | wc -l
     33

Stuff from the mysql-test directory use the system perl and all the rest the one which comes first in $PATH.

[o3k]:/usr/nekoware-build/mysql5 $ grep -rn "/bin/perl" *  | grep ":1:" | grep -v nekoware
mysql-test/suite/funcs_1/lib/DataGen_local.pl:1:#!/usr/bin/perl
mysql-test/suite/funcs_1/lib/DataGen_modify.pl:1:#!/usr/bin/perl
mysql-test/suite/funcs_2/lib/gen_charset_utf8.pl:1:#!/usr/bin/perl
mysql-test/mtr:1:#!/usr/bin/perl
mysql-test/mysql-test-run:1:#!/usr/bin/perl
mysql-test/mysql-test-run.pl:1:#!/usr/bin/perl
mysql-test/mysql-stress-test.pl:1:#!/usr/bin/perl
[6 Aug 2008 22:19] Sveta Smirnova
Thank you for the report.

Verified as described.  #!/usr/bin/perl is really hardcoded in several places.
[7 Dec 2016 14:38] Yngve Svendsen
Posted by developer:
 
This relates to EOL (no longer supported) versions of MySQL Server. Thus closing.