take descending indexes into account when generating a query also fixes MDEV-27617
Attach a file by drag & drop or click to upload