You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use of uninitialized value $field in string eq at Sympa/DatabaseDriver/PostgreSQL.pm line 155
Version
Sympa: v6.2.72
PostgreSQL: v14
OS: Ubuntu-24.04
Installation method
Installed via: [ source code ]
Expected behavior
The is_autoinc function should correctly check whether a database field is an autoincrement column without causing warnings, even on the first database migration.
Actual behavior
Sympa logs the following warning when checking for autoincrement fields:
Use of uninitialized value $fieldin string eq at /opt/sympa/share/sympa/lib/Sympa/DatabaseDriver/PostgreSQL.pm line 155.
However, if a second migration is attempted, the error does not appear again.
This suggests that the required database sequences might not exist or be detected properly during the initial migration but are available afterward.
Steps to reproduce
Perform the first database migration for Sympa with PostgreSQL.
Observe the warning in the logs.
Perform a second migration.
Notice that the warning does not appear again.
Additional information
The issue is located in Sympa/DatabaseDriver/PostgreSQL.pm, specifically in the is_autoinc function.
A possible fix is to check if $field is defined before performing the comparison:
my $field = $sth->fetchrow();
return (defined $field&&$field eq $seqname);
Since this only happens during the first migration, it is possible that some tables or sequences are not created yet at the moment this function runs. Adding a debug log before executing the SQL query could help confirm this hypothesis.
The text was updated successfully, but these errors were encountered:
Use of uninitialized value $field in string eq at Sympa/DatabaseDriver/PostgreSQL.pm line 155
Version
Installation method
Installed via: [ source code ]
Expected behavior
The
is_autoinc
function should correctly check whether a database field is an autoincrement column without causing warnings, even on the first database migration.Actual behavior
Sympa logs the following warning when checking for autoincrement fields:
However, if a second migration is attempted, the error does not appear again.
This suggests that the required database sequences might not exist or be detected properly during the initial migration but are available afterward.
Steps to reproduce
Additional information
The issue is located in
Sympa/DatabaseDriver/PostgreSQL.pm
, specifically in theis_autoinc
function.A possible fix is to check if
$field
is defined before performing the comparison:Since this only happens during the first migration, it is possible that some tables or sequences are not created yet at the moment this function runs. Adding a debug log before executing the SQL query could help confirm this hypothesis.
The text was updated successfully, but these errors were encountered: