Bug #82217 SED errors when running generate_sql_file
Submitted: 13 Jul 2016 14:35 Modified: 27 Feb 11:10
Reporter: Hugo Palma Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: SYS Schema Severity:S3 (Non-critical)
Version:1.5.1 OS:Ubuntu
Assigned to: Marc ALFF CPU Architecture:Any

[13 Jul 2016 14:35] Hugo Palma
Description:
I just downloaded sys schema version 1.5.1 from here https://github.com/mysql/mysql-sys/archive/1.5.1.zip and when running:

./generate_sql_file.sh -v 57 -m

i get the following output:

sed: can't read : No such file or directory
sed: can't read : No such file or directory
sed: can't read : No such file or directory

    Wrote file: /home/hpalma/mysql-sys-1.5.1/gen/mysql_sys_schema.sql
Object Definer: 'mysql.sys'@'localhost'
   sql_log_bin: enabled

Notice the sed errors.
This also happens for version 56.
I've filtered the error down to the last three seds after:

# Remove final leading and trailing spaces

This problem could be os specific as it seems to work on osx.

How to repeat:
./generate_sql_file.sh -v 57 -m

or

./generate_sql_file.sh -v 56 -m

On a linux box.
[14 Jul 2016 4:21] MySQL Verification Team
Hello Hugo Palma,

Thank you for the report.

Thanks,
Umesh
[21 Jul 2016 22:47] Jesper wisborg Krogh
Posted by developer:
 
Hi Hugo,

Thank you for the bug report.

I believe the generated SQL file should still be correct. Can you confirm that?

Thanks,
Jesper
[22 Jul 2016 1:21] Tsubasa Tanaka
I seem this causes these lines.
https://github.com/mysql/mysql-sys/blob/1.5.1/generate_sql_file.sh#L207-L210

`-i ''` raises error, because sed interprets '' as filename(not prefix).
If what you need is telling "-i with blank prefix", you have to set it `-i''` (without space character).

But I found the other places where using sed with -i option, they don't give any arguments to `-i`.

https://github.com/mysql/mysql-sys/blob/1.5.1/generate_sql_file.sh#L152-L160
https://github.com/mysql/mysql-sys/blob/1.5.1/generate_sql_file.sh#L195

So, is `-i ''` a typo?
[25 Jul 2016 13:36] Hugo Palma
@Jesper,
the sql file seems to be just fine.

In fact, the only difference i see by comparing with a file generated with no error is that the one with the errors has an extra new line at the end.
[27 Feb 11:09] Marc ALFF
The sed scripts used by the sys_schema in 5.7 are no longer used,
and have been removed already by:

commit 8d530d67227b3ee85c11439311353ea27a9e12b8
Author: Marc Alff <marc.alff@oracle.com>
Date:   Wed Nov 15 16:41:08 2023 +0100

    Bug#36012737 Dead code in sys_schema
    
    The source code for the sys_schema contains old scripts and views
    used in MySQL 5.7, that are no longer used in MySQL 8.0.
    
    This is confusing and hinders maintenance.
    
    Removed unused scripts.
    
    Change-Id: I107e23672e54d0b1b286a405cbdce21404c336f5

This issue is no longer relevant,
closing as can't repeat.