Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every time users were loaded via include_sql_query Sympa would raise warnings #941

Merged

Conversation

salaun-urennes1
Copy link
Collaborator

Obviously the issue was introduced back in 2015, as mentionned in https://listes.renater.fr/sympa/arc/sympa-users/2015-12/msg00002.html.

Here is an example of the issue :

/usr/local/sympa/bin/sympa.pl --sync_include=mylist-with-included-members@listes.etudiant.univ-rennes1.fr
...
Use of uninitialized value $value in printf at /usr/local/sympa/bin/Sympa/DataSource/SQL.pm line 91, <GEN1> line 1.
Use of uninitialized value $value in printf at /usr/local/sympa/bin/Sympa/DataSource/SQL.pm line 91, <GEN1> line 1.
Use of uninitialized value $value in printf at /usr/local/sympa/bin/Sympa/DataSource/SQL.pm line 91, <GEN1> line 1.
include [notice] Subscribers were included from data source "mysource" into list mylist-with-included-members.
include [notice] Inclusion succeeded (69 added, 15 deleted, 2175 updated).

…warnings : Use of uninitialized value in printf at /usr/local/sympa/bin/Sympa/DataSource/SQL.pm line 91. Obviously the issue was introduced back in 2015, as mentionned in https://listes.renater.fr/sympa/arc/sympa-users/2015-12/msg00002.html.
@racke
Copy link
Contributor

racke commented May 18, 2020

Why not:

printf $tmpfh "%s\t%s\n", $email, defined $value ? $value : '';

It might need parenthesis, but it is shorter and with correct indentation.

@salaun-urennes1
Copy link
Collaborator Author

It's probably a matter of taste, but I'm in favor of code readability and I don't find the single line version easy to read. But feel free to patch the code that way, no problem.

Regarding indentation, I think it's a problem with my Vim setup, sorry about that. I'll try to fix that...

@racke
Copy link
Contributor

racke commented May 18, 2020

It's probably a matter of taste, but I'm in favor of code readability and I don't find the single line version easy to read. But feel free to patch the code that way, no problem.

Yeah fair enough.

Regarding indentation, I think it's a problem with my Vim setup, sorry about that. I'll try to fix that...

Tip: Use "git diff --cached" before commit or "git show" before push.

At any rate, I definitely appreciate the fix 👍

@ikedas ikedas changed the title Every time users were loaded via include8sql_query Sympa would raise warnings Every time users were loaded via include_sql_query Sympa would raise warnings May 18, 2020
@ikedas
Copy link
Member

ikedas commented May 18, 2020

Now we support Perl 5.10.1 or later and may also do

printf $tmpfh "%s\t%s\n", $email, $value // '';

…d raise warnings : Use of uninitialized value in printf at /usr/local/sympa/bin/Sympa/DataSource/SQL.pm line 91. Obviously the issue was introduced back in 2015, as mentionned in https://listes.renater.fr/sympa/arc/sympa-users/2015-12/msg00002.html."

This reverts commit 067e92a.
@ikedas ikedas added the bug label May 25, 2020
@ikedas ikedas added this to the 6.2.58 milestone May 25, 2020
@ikedas ikedas merged commit ebe7837 into sympa-community:sympa-6.2 May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants