merge in stpcpy patch from mysql (Bug 48864)