-
unknown authored
During statement prepare phase the tables were locked as if the statement is being executed, however this is not necessary. The solution is to not lock tables on statement prepare phase. Opening tables is enough to prevent DDL on them, and during statement prepare we do not access nor modify any data. mysql-test/r/ps.result: Add result for bug#18326: Do not lock table for writing during prepare of statement. mysql-test/t/ps.test: Add test case for bug#18326: Do not lock table for writing during prepare of statement. sql/sql_prepare.cc: Do not lock tables on statement prepare phase. Opening tables is enough to prevent DDL on them, and during statement prepare we do not access nor modify any data. Use open_normal_and_derived_tables() for table opening on prepare.
3b288b24