summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorkostja@bodhi.(none) <>2008-05-20 20:36:26 +0400
committerkostja@bodhi.(none) <>2008-05-20 20:36:26 +0400
commit6ae3bca94ed387b58d768aaf3f686a1353a906dd (patch)
treed253d230a92a5e5b0cd4824c58c4baef794fb3b0 /sql/sql_prepare.cc
parent2c0ce2a832be070b27d88a4815e1c555a8f4e8f5 (diff)
downloadmariadb-git-6ae3bca94ed387b58d768aaf3f686a1353a906dd.tar.gz
Bug#27430 "Crash in subquery code when in PS and table DDL changed after
PREPARE", review fixes: - make the patch follow the specification of WL#4166 and remove the new error that was originally introduced. Now the client never gets an error from reprepare, unless it failed. I.e. even if the statement at hand returns a completely different result set, this is not considered a server error. The C API library, that can not handle this situation, was modified to return a client error. Added additional test coverage.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 3036b36f8fa..ca72d1c1613 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -3315,7 +3315,7 @@ Prepared_statement::reprepare()
@param[in] copy the re-prepared prepared statement to verify
the metadata of
- @retval TRUE error, ER_PS_NEED_REBIND is reported
+ @retval TRUE error, ER_PS_REBIND is reported
@retval FALSE statement return no or compatible metadata
*/
@@ -3333,9 +3333,8 @@ bool Prepared_statement::validate_metadata(Prepared_statement *copy)
if (lex->select_lex.item_list.elements !=
copy->lex->select_lex.item_list.elements)
{
- /** Column counts mismatch. */
- my_error(ER_PS_REBIND, MYF(0));
- return TRUE;
+ /** Column counts mismatch, update the client */
+ thd->server_status|= SERVER_STATUS_METADATA_CHANGED;
}
return FALSE;