Test case for MySQL "WL#4179 - Stored programs: validation of stored program statements" fails in 10.0.
Test diff attached. Please try to apply test case as is unless it is applicable.
Changes introduced by the task
Main logic of SP instructions processing is modified to support handling of tables metadata change the Stored routine's instructions depends on.
- On first execution of SP instruction the current version of metadata for tables used by SP statement is extracted from the data dictionary and remembered in SP instruction's context.
- Next time the same SP instruction is run the current version of underlying tables metadata is checked against their version loaded from data dictionary. In case these versions are different the statement for this SP instruction is re-parsed and actual metadata of underlying tables is reloaded from the data dictionary.
To invalidate current SP instruction on metadata change and force its re-parsing, the same approach that used for Prepared Statement is applied - an instance of the class Reprepare_observer installed before second and subsequent executions of SP instruction and in case underlying tables metadata be changed this fact will be notified to and SP instruction's statement be re-parsed.