-
anozdrin/alik@ibm.opbmk authored
The problem was that THD::db_access variable was not restored after database switch in stored-routine-execution code. The fix is to restore THD::db_access in this case. Unfortunately, this fix requires additional changes, because in prepare_schema_table(), called on the parsing stage, we checked privileges. That was wrong according to our design, but this flaw haven't struck so far, because it was masked. All privilege checkings must be done on the execution stage in order to be compatible with prepared statements and stored routines. So, this patch also contains patch for prepare_schema_table(), which moves the checkings to the execution phase.
5441aefd