readysettech / readyset

Readyset is a MySQL and Postgres wire-compatible caching layer that sits in front of existing databases to speed up queries and horizontally scale read throughput. Under the hood, ReadySet caches the results of cached select statements and incrementally updates these results over time as the underlying data changes.
https://readyset.io
Other
4.54k stars 125 forks source link

DDL Vertical Test - MySQL Views are not updated when underlining column changes #1271

Closed altmannmarcelo closed 5 months ago

altmannmarcelo commented 5 months ago

Description

When a MySQL table changes its columns, all the views that point to referring the old column become invalid:

CREATE TABLE t1 (ID INT, n varchar(10));
CREATE VIEW mv AS SELECT * FROM t1;
ALTER TABLE t1 RENAME COLUMN n TO m;

This triggers:

mysql> SELECT * FROM mv;
ERROR 1356 (HY000): View 'test.mv' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
mysql>

This causes DDL Vertical tests to fail as Readyset only refer the columns by its index and since the column has not changed it continues valid, while querying the database directly yields and error in the query.

Change in user-visible behavior

Requires documentation change