empty-table.td 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 an empty table
  12. #
  13. > CREATE SECRET mysqlpass AS '${arg.mysql-root-password}'
  14. > CREATE CONNECTION mysql_conn TO MYSQL (
  15. HOST mysql,
  16. USER root,
  17. PASSWORD SECRET mysqlpass
  18. )
  19. $ mysql-connect name=mysql url=mysql://root@mysql password=${arg.mysql-root-password}
  20. $ mysql-execute name=mysql
  21. DROP DATABASE IF EXISTS public;
  22. CREATE DATABASE public;
  23. USE public;
  24. # Insert data pre-snapshot
  25. CREATE TABLE empty_table (f1 BOOLEAN);
  26. > CREATE SOURCE mz_source
  27. FROM MYSQL CONNECTION mysql_conn
  28. FOR ALL TABLES;
  29. > SELECT COUNT(*) FROM empty_table;
  30. 0
  31. # TODO: database-issues#7690 (subsource remains starting)
  32. > SELECT name, type, status FROM mz_internal.mz_source_statuses WHERE name in ('empty_table', 'mz_source');
  33. empty_table subsource running
  34. mz_source mysql running