Issue #21869:incorporate patch

The `cust` view is evil and should be avoided in favor of the `custinfo` table. Same with lines 49, 66, 73, ... below.