Fixed CID-10721: Uninitialized pointer read

This codepath is however highly unlikely as if cursor->special is set we
are pretty much guranteed to have $query