From 70cb820e2d0bd0a1d1970a312591e87edf3b38ae Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Wed, 5 Dec 2012 16:53:33 +0400 Subject: Bug #15948123: SERVER WORKS INCORRECT WITH LONG TABLE ALIASES Code in MDL subsystem assumes that identifiers of objects can't be longer than NAME_LEN characters. This assumption was broken when one tried to construct MDL_key based on table alias, which can have arbitrary length. Since MDL_key's (and MDL locks) are not really used for table aliases this patch changes code to not initialize MDL_key object for table list element representing aliases. --- sql/mdl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/mdl.h') diff --git a/sql/mdl.h b/sql/mdl.h index d30d30ac2fa..6d29ad968c6 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -246,6 +246,8 @@ public: } void mdl_key_init(const MDL_key *rhs) { + DBUG_ASSERT(rhs->m_length <= NAME_LEN); + DBUG_ASSERT(rhs->m_db_name_length <= NAME_LEN); memcpy(m_ptr, rhs->m_ptr, rhs->m_length); m_length= rhs->m_length; m_db_name_length= rhs->m_db_name_length; -- cgit v1.2.1 From 46cfbf35f86a6ff63bdfcd85297bd8269efc2826 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Wed, 5 Dec 2012 20:41:29 +0400 Subject: Bug #15948123: SERVER WORKS INCORRECT WITH LONG TABLE ALIASES Post-push cleanup: removal of unneeded assertions. --- sql/mdl.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'sql/mdl.h') diff --git a/sql/mdl.h b/sql/mdl.h index 6d29ad968c6..d30d30ac2fa 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -246,8 +246,6 @@ public: } void mdl_key_init(const MDL_key *rhs) { - DBUG_ASSERT(rhs->m_length <= NAME_LEN); - DBUG_ASSERT(rhs->m_db_name_length <= NAME_LEN); memcpy(m_ptr, rhs->m_ptr, rhs->m_length); m_length= rhs->m_length; m_db_name_length= rhs->m_db_name_length; -- cgit v1.2.1