table-in-mysql-schema.td 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. DROP DATABASE IF EXISTS other;
  25. CREATE DATABASE IF NOT EXISTS mysql;
  26. USE mysql;
  27. # Insert data pre-snapshot
  28. CREATE TABLE mysql.t_in_mysql (f1 INT);
  29. INSERT INTO mysql.t_in_mysql VALUES (1), (2);
  30. ! CREATE SOURCE mz_source
  31. FROM MYSQL CONNECTION mysql_conn
  32. FOR ALL TABLES;
  33. contains:MySQL source must ingest at least one table, but FOR ALL TABLES matched none
  34. ! CREATE SOURCE mz_source
  35. FROM MYSQL CONNECTION mysql_conn
  36. FOR TABLES (mysql.timezone);
  37. contains:reference to mysql.timezone not found in source
  38. > CREATE SOURCE mz_source
  39. FROM MYSQL CONNECTION mysql_conn
  40. FOR TABLES (mysql.t_in_mysql);
  41. > SELECT * FROM t_in_mysql;
  42. 1
  43. 2
  44. > DROP SOURCE mz_source CASCADE;
  45. ! CREATE SOURCE mz_source
  46. FROM MYSQL CONNECTION mysql_conn
  47. FOR SCHEMAS (mysql);
  48. contains:referenced tables use unsupported types
  49. $ mysql-execute name=mysql
  50. DROP TABLE t_in_mysql;