copy-from-null.pt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. send
  2. Query {"query": "DROP TABLE IF EXISTS t"}
  3. ----
  4. until ignore=NoticeResponse
  5. ReadyForQuery
  6. ----
  7. CommandComplete {"tag":"DROP TABLE"}
  8. ReadyForQuery {"status":"I"}
  9. send
  10. Query {"query": "DROP TABLE IF EXISTS t"}
  11. ----
  12. until ignore=NoticeResponse
  13. ReadyForQuery
  14. ----
  15. CommandComplete {"tag":"DROP TABLE"}
  16. ReadyForQuery {"status":"I"}
  17. send
  18. Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
  19. ----
  20. until
  21. ReadyForQuery
  22. ----
  23. CommandComplete {"tag":"CREATE TABLE"}
  24. ReadyForQuery {"status":"I"}
  25. send
  26. Query {"query": "COPY t FROM STDIN WITH (NULL '')"}
  27. CopyData "\t\n"
  28. CopyData "1\t\n"
  29. CopyData "\ttext\n"
  30. CopyDone
  31. ----
  32. until
  33. ReadyForQuery
  34. ----
  35. CopyIn {"format":"text","column_formats":["text","text"]}
  36. CommandComplete {"tag":"COPY 3"}
  37. ReadyForQuery {"status":"I"}
  38. # Our NULL ordering differs from postgres, so use some tricks to
  39. # make the results identical between mz and postgres.
  40. send
  41. Query {"query": "SELECT * FROM (select case when i is null then 'NULL' else i::text end as i, case when t is null then 'NULL' else t end as t from t) as t ORDER BY i, t"}
  42. ----
  43. until ignore=RowDescription
  44. ReadyForQuery
  45. ----
  46. DataRow {"fields":["1","NULL"]}
  47. DataRow {"fields":["NULL","NULL"]}
  48. DataRow {"fields":["NULL","text"]}
  49. CommandComplete {"tag":"SELECT 3"}
  50. ReadyForQuery {"status":"I"}
  51. send
  52. Query {"query": "DROP TABLE IF EXISTS t"}
  53. ----
  54. until ignore=NoticeResponse
  55. ReadyForQuery
  56. ----
  57. CommandComplete {"tag":"DROP TABLE"}
  58. ReadyForQuery {"status":"I"}