1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
kostja@bodhi.(none)
2008-05-20 20:36:26 +04:00
parent 2c0ce2a832
commit 6ae3bca94e
8 changed files with 229 additions and 64 deletions

View File

@@ -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;