40-check-smoke.td 1.5 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. $ schema-registry-wait topic=mysql.test.t1
  10. $ mysql-connect name=mysql url=mysql://root@mysql password=${arg.mysql-root-password}
  11. $ mysql-execute name=mysql
  12. USE test;
  13. INSERT INTO t1 VALUES (345, 345, 345);
  14. COMMIT;
  15. $ schema-registry-wait topic=mysql.transaction
  16. > CREATE CONNECTION IF NOT EXISTS kafka_conn TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  17. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  18. URL '${testdrive.schema-registry-url}'
  19. );
  20. > CREATE SOURCE t1
  21. FROM KAFKA CONNECTION kafka_conn (TOPIC 'mysql.test.t1');
  22. > CREATE TABLE t1_tbl FROM SOURCE t1 (REFERENCE "mysql.test.t1")
  23. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  24. ENVELOPE DEBEZIUM;
  25. > SELECT * FROM t1_tbl;
  26. 123 123 123
  27. 234 234 234
  28. 345 345 345
  29. $ mysql-execute name=mysql
  30. INSERT INTO t1 VALUES (456, 456, 456);
  31. COMMIT;
  32. > SELECT * FROM t1_tbl;
  33. 123 123 123
  34. 234 234 234
  35. 345 345 345
  36. 456 456 456
  37. $ mysql-execute name=mysql
  38. UPDATE t1 SET f2 = f2 * 100
  39. COMMIT;
  40. > SELECT * FROM t1_tbl;
  41. 123 12300 123
  42. 234 23400 234
  43. 345 34500 345
  44. 456 45600 456
  45. $ mysql-execute name=mysql
  46. DELETE FROM t1;
  47. COMMIT;
  48. > SELECT COUNT(*) FROM t1_tbl;
  49. 0