github-2235.slt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # Regression test for https://github.com/MaterializeInc/database-issues/issues/2235.
  10. #
  11. # The shape of this table would reliably trigger memory unsafety. The datums
  12. # were exactly the right length to corrupt the stack given the bug. It's
  13. # unlikely that these specific datums will do much to prevent memory unsafety in
  14. # the future, but keeping this test doesn't hurt.
  15. statement ok
  16. CREATE TABLE t (
  17. killmail text,
  18. ship text,
  19. cost text,
  20. solarsystem text,
  21. hi text,
  22. med text,
  23. low text,
  24. rig text,
  25. sub text,
  26. items text
  27. )
  28. statement ok
  29. INSERT INTO t VALUES (
  30. 93457529,
  31. 596,
  32. 9911,
  33. 30001389,
  34. '[3634, 3651]',
  35. '[21857]',
  36. 'null',
  37. 'null',
  38. 'null',
  39. '[596, 21857, 3634, 3651]'
  40. )
  41. query IIIITTTTTT
  42. SELECT
  43. killmail::int4,
  44. ship::int4,
  45. cost::int8,
  46. solarsystem::int4,
  47. hi::jsonb,
  48. med::jsonb,
  49. low::jsonb,
  50. rig::jsonb,
  51. sub::jsonb,
  52. items::jsonb
  53. FROM t
  54. ----
  55. 93457529
  56. 596
  57. 9911
  58. 30001389
  59. [3634,3651]
  60. [21857]
  61. null
  62. null
  63. null
  64. [596,21857,3634,3651]