|
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 |
- |
|
|