[#86030] Work around Oracle's "IN" clause limit

A couple notes:
* Though this is only necessary when using Oracle, this patch applies a 1000 `IN` clause workaround for all. Should it?
* The test I added takes 1-2 minutes on my machine. Mark it pending now, or after we've seen it succeed in CI?

There is a separate PR for the NU fork coming up.