diff options
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index e36ed0c425f..6fd11e340be 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -177,7 +177,8 @@ THD::THD() rand_used(0), time_zone_used(0), last_insert_id_used(0), last_insert_id_used_bin_log(0), insert_id_used(0), clear_next_insert_id(0), in_lock_tables(0), bootstrap(0), - derived_tables_processing(FALSE), spcont(NULL), m_lip(NULL) + derived_tables_processing(FALSE), spcont(NULL), + m_parser_state(NULL) { ulong tmp; @@ -622,6 +623,13 @@ void THD::cleanup_after_query() { clear_next_insert_id= 0; next_insert_id= 0; + + /* + BUG#33029, if one statement in a SP set this member to 1, all + statment after this statement in the SP would be considered used + INSERT_ID value, reset this member after each query to fix this. + */ + insert_id_used= 0; } /* Reset rand_used so that detection of calls to rand() will save random |