vars.pt 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Test status codes for errors related to setting session variables.
  2. # FixedValueParameter and InvalidParameterValue are covered
  3. # in pgtest-mz/vars.pt
  4. # ConstrainedParameter maps to 22023
  5. send
  6. Query {"query": "SET TIMEZONE TO bad"}
  7. ----
  8. until
  9. ReadyForQuery
  10. ----
  11. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"22023"},{"typ":"M","value":"invalid value for parameter \"TimeZone\": \"bad\""}]}
  12. ReadyForQuery {"status":"I"}
  13. # ReadOnlyParameter maps to 55P02
  14. send
  15. Query {"query": "SET SERVER_VERSION TO 10.0"}
  16. ----
  17. until
  18. ReadyForQuery
  19. ----
  20. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"55P02"},{"typ":"M","value":"parameter \"server_version\" cannot be changed"}]}
  21. ReadyForQuery {"status":"I"}
  22. # InvalidParameterType maps to 22023
  23. send
  24. Query {"query": "SET STANDARD_CONFORMING_STRINGS TO nonbool"}
  25. ----
  26. # Our message differs from Postgres, so skip it
  27. until err_field_typs=SC
  28. ReadyForQuery
  29. ----
  30. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"22023"}]}
  31. ReadyForQuery {"status":"I"}
  32. # UnknownParameter maps to 42704
  33. send
  34. Query {"query": "SET I_DONT_EXIST TO any_value"}
  35. ----
  36. until
  37. ReadyForQuery
  38. ----
  39. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"42704"},{"typ":"M","value":"unrecognized configuration parameter \"i_dont_exist\""}]}
  40. ReadyForQuery {"status":"I"}
  41. # client_min_messages sends hint
  42. send
  43. Query {"query": "SET client_min_messages TO bad"}
  44. ----
  45. until err_field_typs=SCMH
  46. ReadyForQuery
  47. ----
  48. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"22023"},{"typ":"M","value":"invalid value for parameter \"client_min_messages\": \"bad\""},{"typ":"H","value":"Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error."}]}
  49. ReadyForQuery {"status":"I"}
  50. # TimeZone does not send hint
  51. send
  52. Query {"query": "SET TimeZone TO bad"}
  53. ----
  54. until err_field_typs=SCMH
  55. ReadyForQuery
  56. ----
  57. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"22023"},{"typ":"M","value":"invalid value for parameter \"TimeZone\": \"bad\""}]}
  58. ReadyForQuery {"status":"I"}