Fixed bug #15396: [scheduler] Wrong query - crashes with DBAL