Fix cursor creation when MR's db output option is used