Skip to content

Commit

Permalink
Add test cases to validate new refresh statement
Browse files Browse the repository at this point in the history
  • Loading branch information
rjobanp committed Oct 9, 2024
1 parent 9500cf9 commit f550ee4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/testdrive/source-tables.td
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,41 @@ var1 5678 <null>
var0 5555 6666
var1 4444 12

# Validate that the available source references table reflects the state of the upstream
# when the create source was run
> SELECT u.name, u.namespace, u.columns
FROM mz_sources s
JOIN mz_internal.mz_source_references u ON s.id = u.source_id
WHERE
s.name = 'mysql_source'
ORDER BY u.name;
mysql_table public {a,b}

# Create a new table in MySQL and refresh to see if the new available reference is picked up
$ mysql-execute name=mysql
USE public;
CREATE TABLE mysql_table_new (foo INTEGER, bar INTEGER);

> REFRESH SOURCE REFERENCES mysql_source;

> SELECT u.name, u.namespace, u.columns
FROM mz_sources s
JOIN mz_internal.mz_source_references u ON s.id = u.source_id
WHERE
s.name = 'mysql_source'
ORDER BY u.name;
mysql_table public {a,b,c}
mysql_table_new public {foo,bar}

> DROP SOURCE mysql_source CASCADE;

# ensure that CASCADE propagates to the tables
! SELECT * FROM mysql_table_3;
contains:unknown catalog item 'mysql_table_3'

> SELECT count(*) FROM mz_internal.mz_source_references;
0

#
# Kafka source using source-fed tables
#
Expand Down

0 comments on commit f550ee4

Please sign in to comment.