subsource-resolution-duplicates.td 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. $ set-sql-timeout duration=1s
  10. > CREATE SECRET mysqlpass AS '${arg.mysql-root-password}'
  11. > CREATE CONNECTION mysql_conn TO MYSQL (
  12. HOST mysql,
  13. USER root,
  14. PASSWORD SECRET mysqlpass
  15. )
  16. $ mysql-connect name=mysql url=mysql://root@mysql password=${arg.mysql-root-password}
  17. $ mysql-execute name=mysql
  18. DROP DATABASE IF EXISTS public;
  19. DROP DATABASE IF EXISTS other;
  20. CREATE DATABASE public;
  21. CREATE DATABASE other;
  22. USE public;
  23. CREATE TABLE t (f1 INT);
  24. INSERT INTO t VALUES (1);
  25. CREATE TABLE other.t (f1 INT);
  26. INSERT INTO other.t VALUES (1);
  27. ! CREATE SOURCE mz_source
  28. FROM MYSQL CONNECTION mysql_conn
  29. FOR ALL TABLES;
  30. contains:multiple subsources would be named t
  31. detail:referenced tables with duplicate name: other.t, public.t
  32. ! CREATE SOURCE mz_source
  33. FROM MYSQL CONNECTION mysql_conn
  34. FOR TABLES (public.t AS x, public.t as Y);
  35. contains:multiple subsources refer to table public.t
  36. detail: subsources referencing table: x, y
  37. > CREATE SOURCE mz_source
  38. FROM MYSQL CONNECTION mysql_conn
  39. FOR SCHEMAS (other);
  40. > SHOW sources
  41. mz_source mysql quickstart ""
  42. mz_source_progress progress <null> ""
  43. t subsource quickstart ""