View | Details | Raw Unified | Return to bug 40292
Collapse All | Expand All

(-)a/Koha/Devel/Files.pm (+16 lines)
Lines 213-218 sub ls_perl_files { Link Here
213
    return @files;
213
    return @files;
214
}
214
}
215
215
216
=head2 ls_dbrev_files
217
218
    my @dbrev_files = $file_manager->ls_dbrev_files;
219
220
Lists all dbrevs files.
221
222
=cut
223
224
sub ls_dbrev_files {
225
    my ($self) = @_;
226
    my $cmd    = q{git ls-files installer/data/mysql/db_revs/*.pl};
227
    my @files  = qx{$cmd};
228
    chomp for @files;
229
    return @files;
230
}
231
216
=head2 ls_js_files
232
=head2 ls_js_files
217
233
218
    my @js_files = $file_manager->ls_js_files();
234
    my @js_files = $file_manager->ls_js_files();
(-)a/xt/check_db_revs_sql_syntax.t (-24 / +6 lines)
Lines 15-21 Link Here
15
# GNU General Public License for more details.
15
# GNU General Public License for more details.
16
#
16
#
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <https://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
Lines 23-57 use Test::More; Link Here
23
use File::Find;
23
use File::Find;
24
use File::Slurp;
24
use File::Slurp;
25
use Test::NoWarnings;
25
use Test::NoWarnings;
26
use Koha::Devel::Files;
26
27
27
# Test for Bug 40292: Prevent SQL syntax error when upgrading to 25.05 on MariaDB 10.3
28
# Test for Bug 40292: Prevent SQL syntax error when upgrading to 25.05 on MariaDB 10.3
28
# This test ensures that database revision files don't use SQL syntax that is incompatible
29
# This test ensures that database revision files don't use SQL syntax that is incompatible
29
# with older MariaDB versions (specifically MariaDB 10.3)
30
# with older MariaDB versions (specifically MariaDB 10.3)
30
31
31
my @db_rev_files;
32
my $dev_files   = Koha::Devel::Files->new;
32
my $db_revs_dir = 'installer/data/mysql/db_revs';
33
my @dbrev_files = $dev_files->ls_dbrev_files;
33
34
34
# Skip test if db_revs directory doesn't exist
35
plan tests => scalar @dbrev_files + 1;
35
if ( !-d $db_revs_dir ) {
36
    plan skip_all => "Database revisions directory ($db_revs_dir) not found";
37
}
38
39
# Find all .pl files in the db_revs directory
40
find(
41
    sub {
42
        push @db_rev_files, $File::Find::name if /\.pl$/;
43
    },
44
    $db_revs_dir
45
);
46
47
# Skip test if no database revision files found
48
if ( !@db_rev_files ) {
49
    plan skip_all => "No database revision files found in $db_revs_dir";
50
}
51
52
plan tests => scalar @db_rev_files + 1;
53
36
54
foreach my $file (@db_rev_files) {
37
foreach my $file (@dbrev_files) {
55
    my $content = read_file($file);
38
    my $content = read_file($file);
56
39
57
    # Check for incompatible RENAME COLUMN syntax
40
    # Check for incompatible RENAME COLUMN syntax
58
- 

Return to bug 40292