subsource-resolution-duplicates.td 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 FROM MYSQL CONNECTION mysql_conn;
  28. > CREATE TABLE t FROM SOURCE mz_source (REFERENCE public.t);
  29. ! CREATE TABLE t FROM SOURCE mz_source (REFERENCE other.t);
  30. contains:catalog item 't' already exists
  31. # multiple tables on the same source table
  32. > CREATE TABLE x FROM SOURCE mz_source (REFERENCE public.t);
  33. > CREATE TABLE y FROM SOURCE mz_source (REFERENCE public.t);
  34. > SHOW sources
  35. mz_source mysql quickstart ""
  36. mz_source_progress progress <null> ""
  37. $ mysql-execute name=mysql
  38. DROP DATABASE other;
  39. # TODO: database-issues#8708
  40. # > SET statement_timeout = '5s'
  41. # ! SELECT * FROM t
  42. # contains:statement timeout