Skip to content

Conversation

@hvlad
Copy link
Member

@hvlad hvlad commented Jan 7, 2026

No description provided.

… deleting unused result variable from inner procedure
// ProcedureScan was created. Here it is not the right place to check if new format is
// compatible with caller's expectations, so we just use correct (possible new) format.

m_format = m_procedure->prc_record_format;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. ALTER should create a new procedure version inside the metadata cache, but the already compiled procedure SP2 keeps a reference to the older version of SP1 (with the old format). AFAIU, this means that m_procedure->prc_record_format should never change, but your patch implies that the old version of the procedure somehow gets the new record format. How does it happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RoutineManager::modifyRoutine() marks procedure with FLAG_OBSOLETE | FLAG_BEING_ALTERED and calls Routine::remove() which doesn't delete such routines, but clears its internals and marks it with FLAG_CLEARED.
Then RoutineManager::getDependencies() calls MET_procedure() which doesn't create new version of procedure marked with FLAG_OBSOLETE but re-uses existing instance instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Internal error' when calling outer procedure after deleting unused result variable from inner procedure

2 participants