drop_table.slt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright 2015 - 2019 The Cockroach Authors. All rights reserved.
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. #
  11. # This file is derived from the logic test suite in CockroachDB. The
  12. # original file was retrieved on June 10, 2019 from:
  13. #
  14. # https://github.com/cockroachdb/cockroach/blob/d2f7fbf5dd1fc1a099bbad790a2e1f7c60a66cc3/pkg/sql/logictest/testdata/logic_test/drop_table
  15. #
  16. # The original source code is subject to the terms of the Apache
  17. # 2.0 license, a copy of which can be found in the LICENSE file at the
  18. # root of this repository.
  19. # not supported yet
  20. halt
  21. mode cockroach
  22. statement ok
  23. CREATE TABLE a (id INT PRIMARY KEY)
  24. statement ok
  25. CREATE TABLE b (id INT PRIMARY KEY)
  26. query T
  27. SHOW TABLES FROM test
  28. ----
  29. a
  30. b
  31. statement ok
  32. INSERT INTO a VALUES (3),(7),(2)
  33. query I rowsort
  34. SELECT * FROM a
  35. ----
  36. 2
  37. 3
  38. 7
  39. statement ok
  40. DROP TABLE a
  41. query TT
  42. SELECT status, running_status FROM [SHOW JOBS] WHERE job_type = 'SCHEMA CHANGE'
  43. ----
  44. running waiting for GC TTL
  45. query T
  46. SHOW TABLES FROM test
  47. ----
  48. b
  49. statement error pgcode 42P01 relation "a" does not exist
  50. SELECT * FROM a
  51. statement error pq: \[53 AS a\]: table is being dropped
  52. SELECT * FROM [53 AS a]
  53. statement error pgcode 42P01 relation "a" does not exist
  54. DROP TABLE a
  55. statement ok
  56. DROP TABLE IF EXISTS a
  57. statement ok
  58. CREATE TABLE a (id INT PRIMARY KEY)
  59. query I
  60. SELECT * FROM a
  61. ----