1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Fixed the abort failure of a test case from vcol.vcol_misc.

The fix blocks execution of any constant sub-expressions of
the defining expressions for virtual columns when context
analysis if these expressions is performed.

Fixed a compiler warning.
This commit is contained in:
Igor Babaev
2011-05-28 22:07:56 -07:00
parent 1e1755be86
commit 8ce2e1bcbe
3 changed files with 10 additions and 1 deletions

View File

@@ -678,6 +678,12 @@ enabled by default, add OPTIMIZER_SWITCH_MATERIALIZATION
*/ */
#define CONTEXT_ANALYSIS_ONLY_DERIVED 4 #define CONTEXT_ANALYSIS_ONLY_DERIVED 4
/*
Don't evaluate constant sub-expressions of virtual column
expressions when opening tables
*/
#define CONTEXT_ANALYSIS_ONLY_VCOL_EXPR 8
/* /*
Uncachable causes: Uncachable causes:
@@ -1095,7 +1101,7 @@ struct Query_cache_query_flags
#define query_cache_resize(A) do { } while(0) #define query_cache_resize(A) do { } while(0)
#define query_cache_set_min_res_unit(A) do { } while(0) #define query_cache_set_min_res_unit(A) do { } while(0)
#define query_cache_invalidate3(A, B, C) do { } while(0) #define query_cache_invalidate3(A, B, C) do { } while(0)
#define query_cache_invalidate1(A) do { } while(0) #define query_cache_invalidate1(A,B) do { } while(0)
#define query_cache_send_result_to_client(A, B, C) 0 #define query_cache_send_result_to_client(A, B, C) 0
#define query_cache_invalidate_by_MyISAM_filename_ref NULL #define query_cache_invalidate_by_MyISAM_filename_ref NULL
#define query_cache_abort(A) do { } while(0) #define query_cache_abort(A) do { } while(0)

View File

@@ -1885,6 +1885,7 @@ typedef struct st_lex : public Query_tables_list
{ {
return (context_analysis_only & return (context_analysis_only &
(CONTEXT_ANALYSIS_ONLY_PREPARE | (CONTEXT_ANALYSIS_ONLY_PREPARE |
CONTEXT_ANALYSIS_ONLY_VCOL_EXPR |
CONTEXT_ANALYSIS_ONLY_VIEW)); CONTEXT_ANALYSIS_ONLY_VIEW));
} }

View File

@@ -1840,7 +1840,9 @@ bool fix_vcol_expr(THD *thd,
save_use_only_table_context= thd->lex->use_only_table_context; save_use_only_table_context= thd->lex->use_only_table_context;
thd->lex->use_only_table_context= TRUE; thd->lex->use_only_table_context= TRUE;
/* Fix fields referenced to by the virtual column function */ /* Fix fields referenced to by the virtual column function */
thd->lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VCOL_EXPR;
error= func_expr->fix_fields(thd, (Item**)0); error= func_expr->fix_fields(thd, (Item**)0);
thd->lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_VCOL_EXPR;
/* Restore the original context*/ /* Restore the original context*/
thd->lex->use_only_table_context= save_use_only_table_context; thd->lex->use_only_table_context= save_use_only_table_context;
context->table_list= save_table_list; context->table_list= save_table_list;