Support CAST expressions, taking care to avoid SQL injection.