table-in-mysql-schema.td 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #
  11. # Test that tables in the mysql schema are not replicated
  12. #
  13. > DROP SOURCE IF EXISTS mz_source;
  14. > CREATE SECRET mysqlpass AS '${arg.mysql-root-password}'
  15. > CREATE CONNECTION mysql_conn TO MYSQL (
  16. HOST mysql,
  17. USER root,
  18. PASSWORD SECRET mysqlpass
  19. )
  20. $ mysql-connect name=mysql url=mysql://root@mysql password=${arg.mysql-root-password}
  21. $ mysql-execute name=mysql
  22. DROP DATABASE IF EXISTS public;
  23. DROP DATABASE IF EXISTS another_schema;
  24. USE mysql;
  25. CREATE TABLE t_in_mysql (f1 INT);
  26. INSERT INTO t_in_mysql VALUES (1), (2);
  27. CREATE DATABASE public;
  28. USE public;
  29. CREATE TABLE time_zone (f1 INT);
  30. > CREATE SOURCE mz_source FROM MYSQL CONNECTION mysql_conn;
  31. ! CREATE TABLE timezone FROM SOURCE mz_source (REFERENCE public.timezone);
  32. contains:reference to public.timezone not found in source
  33. > CREATE TABLE t_in_mysql FROM SOURCE mz_source (REFERENCE mysql.t_in_mysql);
  34. > SELECT * FROM t_in_mysql;
  35. 1
  36. 2
  37. > DROP SOURCE mz_source CASCADE;
  38. > CREATE SOURCE mz_source FROM MYSQL CONNECTION mysql_conn;
  39. ! CREATE TABLE t_in_mysql FROM SOURCE mz_source (REFERENCE mysql.time_zone);
  40. contains:referenced tables use unsupported types
  41. $ mysql-execute name=mysql
  42. USE mysql;
  43. DROP TABLE t_in_mysql;
  44. USE public;
  45. DROP TABLE time_zone;