diff options
author | unknown <knielsen@knielsen-hq.org> | 2009-11-13 22:26:08 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2009-11-13 22:26:08 +0100 |
commit | 898f6f48b79d1f2c334fb559225b2b0fade5ea93 (patch) | |
tree | 84df8eecd942b650f172cbd67050ee8984c0d52b /storage/xtradb/eval | |
parent | 275c0a7f96502b33f763fb9388dcc1c289e4792b (diff) | |
parent | 2bde0c5e6d31583e5197e3b513f572a693161f62 (diff) | |
download | mariadb-git-898f6f48b79d1f2c334fb559225b2b0fade5ea93.tar.gz |
Merge XtraDB 8 into MariaDB.
Diffstat (limited to 'storage/xtradb/eval')
-rw-r--r-- | storage/xtradb/eval/eval0eval.c | 83 | ||||
-rw-r--r-- | storage/xtradb/eval/eval0proc.c | 51 |
2 files changed, 68 insertions, 66 deletions
diff --git a/storage/xtradb/eval/eval0eval.c b/storage/xtradb/eval/eval0eval.c index a2590c63c38..589b0fa1576 100644 --- a/storage/xtradb/eval/eval0eval.c +++ b/storage/xtradb/eval/eval0eval.c @@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ -/****************************************************** +/**************************************************//** +@file eval/eval0eval.c SQL evaluator: evaluates simple data structures, like expressions, in a query graph @@ -32,29 +33,29 @@ Created 12/29/1997 Heikki Tuuri #include "data0data.h" #include "row0sel.h" -/* The RND function seed */ +/** The RND function seed */ static ulint eval_rnd = 128367121; -/* Dummy adress used when we should allocate a buffer of size 0 in -the function below */ +/** Dummy adress used when we should allocate a buffer of size 0 in +eval_node_alloc_val_buf */ static byte eval_dummy; -/********************************************************************* +/*****************************************************************//** Allocate a buffer from global dynamic memory for a value of a que_node. NOTE that this memory must be explicitly freed when the query graph is freed. If the node already has an allocated buffer, that buffer is freed here. NOTE that this is the only function where dynamic memory should be -allocated for a query node val field. */ +allocated for a query node val field. +@return pointer to allocated buffer */ UNIV_INTERN byte* eval_node_alloc_val_buf( /*====================*/ - /* out: pointer to allocated buffer */ - que_node_t* node, /* in: query graph node; sets the val field + que_node_t* node, /*!< in: query graph node; sets the val field data field to point to the new buffer, and len field equal to size */ - ulint size) /* in: buffer size */ + ulint size) /*!< in: buffer size */ { dfield_t* dfield; byte* data; @@ -83,7 +84,7 @@ eval_node_alloc_val_buf( return(data); } -/********************************************************************* +/*****************************************************************//** Free the buffer from global dynamic memory for a value of a que_node, if it has been allocated in the above function. The freeing for pushed column values is done in sel_col_prefetch_buf_free. */ @@ -91,7 +92,7 @@ UNIV_INTERN void eval_node_free_val_buf( /*===================*/ - que_node_t* node) /* in: query graph node */ + que_node_t* node) /*!< in: query graph node */ { dfield_t* dfield; byte* data; @@ -110,14 +111,14 @@ eval_node_free_val_buf( } } -/********************************************************************* -Evaluates a comparison node. */ +/*****************************************************************//** +Evaluates a comparison node. +@return the result of the comparison */ UNIV_INTERN ibool eval_cmp( /*=====*/ - /* out: the result of the comparison */ - func_node_t* cmp_node) /* in: comparison node */ + func_node_t* cmp_node) /*!< in: comparison node */ { que_node_t* arg1; que_node_t* arg2; @@ -169,13 +170,13 @@ eval_cmp( return(val); } -/********************************************************************* +/*****************************************************************//** Evaluates a logical operation node. */ UNIV_INLINE void eval_logical( /*=========*/ - func_node_t* logical_node) /* in: logical operation node */ + func_node_t* logical_node) /*!< in: logical operation node */ { que_node_t* arg1; que_node_t* arg2; @@ -210,13 +211,13 @@ eval_logical( eval_node_set_ibool_val(logical_node, val); } -/********************************************************************* +/*****************************************************************//** Evaluates an arithmetic operation node. */ UNIV_INLINE void eval_arith( /*=======*/ - func_node_t* arith_node) /* in: arithmetic operation node */ + func_node_t* arith_node) /*!< in: arithmetic operation node */ { que_node_t* arg1; que_node_t* arg2; @@ -254,13 +255,13 @@ eval_arith( eval_node_set_int_val(arith_node, val); } -/********************************************************************* +/*****************************************************************//** Evaluates an aggregate operation node. */ UNIV_INLINE void eval_aggregate( /*===========*/ - func_node_t* node) /* in: aggregate operation node */ + func_node_t* node) /*!< in: aggregate operation node */ { que_node_t* arg; lint val; @@ -288,14 +289,14 @@ eval_aggregate( eval_node_set_int_val(node, val); } -/********************************************************************* +/*****************************************************************//** Evaluates a predefined function node where the function is not relevant in benchmarks. */ static void eval_predefined_2( /*==============*/ - func_node_t* func_node) /* in: predefined function node */ + func_node_t* func_node) /*!< in: predefined function node */ { que_node_t* arg; que_node_t* arg1; @@ -375,13 +376,13 @@ eval_predefined_2( } } -/********************************************************************* +/*****************************************************************//** Evaluates a notfound-function node. */ UNIV_INLINE void eval_notfound( /*==========*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg1; que_node_t* arg2; @@ -417,13 +418,13 @@ eval_notfound( eval_node_set_ibool_val(func_node, ibool_val); } -/********************************************************************* +/*****************************************************************//** Evaluates a substr-function node. */ UNIV_INLINE void eval_substr( /*========*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg1; que_node_t* arg2; @@ -450,13 +451,13 @@ eval_substr( dfield_set_data(dfield, str1 + len1, len2); } -/********************************************************************* +/*****************************************************************//** Evaluates a replstr-procedure node. */ static void eval_replstr( /*=========*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg1; que_node_t* arg2; @@ -490,13 +491,13 @@ eval_replstr( ut_memcpy(str1 + len1, str2, len2); } -/********************************************************************* +/*****************************************************************//** Evaluates an instr-function node. */ static void eval_instr( /*=======*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg1; que_node_t* arg2; @@ -562,13 +563,13 @@ match_found: eval_node_set_int_val(func_node, int_val); } -/********************************************************************* +/*****************************************************************//** Evaluates a predefined function node. */ UNIV_INLINE void eval_binary_to_number( /*==================*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg1; dfield_t* dfield; @@ -600,13 +601,13 @@ eval_binary_to_number( eval_node_copy_and_alloc_val(func_node, str2, 4); } -/********************************************************************* +/*****************************************************************//** Evaluates a predefined function node. */ static void eval_concat( /*========*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg; dfield_t* dfield; @@ -642,7 +643,7 @@ eval_concat( } } -/********************************************************************* +/*****************************************************************//** Evaluates a predefined function node. If the first argument is an integer, this function looks at the second argument which is the integer length in bytes, and converts the integer to a VARCHAR. @@ -652,7 +653,7 @@ UNIV_INLINE void eval_to_binary( /*===========*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg1; que_node_t* arg2; @@ -690,13 +691,13 @@ eval_to_binary( dfield_set_data(dfield, str1 + (4 - len1), len1); } -/********************************************************************* +/*****************************************************************//** Evaluates a predefined function node. */ UNIV_INLINE void eval_predefined( /*============*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg1; lint int_val; @@ -782,13 +783,13 @@ eval_predefined( eval_node_set_int_val(func_node, int_val); } -/********************************************************************* +/*****************************************************************//** Evaluates a function node. */ UNIV_INTERN void eval_func( /*======*/ - func_node_t* func_node) /* in: function node */ + func_node_t* func_node) /*!< in: function node */ { que_node_t* arg; ulint class; diff --git a/storage/xtradb/eval/eval0proc.c b/storage/xtradb/eval/eval0proc.c index 9c7563e8c7d..3a4218d92bf 100644 --- a/storage/xtradb/eval/eval0proc.c +++ b/storage/xtradb/eval/eval0proc.c @@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ -/****************************************************** +/**************************************************//** +@file eval/eval0proc.c Executes SQL stored procedures and their control structures Created 1/20/1998 Heikki Tuuri @@ -28,14 +29,14 @@ Created 1/20/1998 Heikki Tuuri #include "eval0proc.ic" #endif -/************************************************************************** -Performs an execution step of an if-statement node. */ +/**********************************************************************//** +Performs an execution step of an if-statement node. +@return query thread to run next or NULL */ UNIV_INTERN que_thr_t* if_step( /*====*/ - /* out: query thread to run next or NULL */ - que_thr_t* thr) /* in: query thread */ + que_thr_t* thr) /*!< in: query thread */ { if_node_t* node; elsif_node_t* elsif_node; @@ -104,14 +105,14 @@ if_step( return(thr); } -/************************************************************************** -Performs an execution step of a while-statement node. */ +/**********************************************************************//** +Performs an execution step of a while-statement node. +@return query thread to run next or NULL */ UNIV_INTERN que_thr_t* while_step( /*=======*/ - /* out: query thread to run next or NULL */ - que_thr_t* thr) /* in: query thread */ + que_thr_t* thr) /*!< in: query thread */ { while_node_t* node; @@ -140,14 +141,14 @@ while_step( return(thr); } -/************************************************************************** -Performs an execution step of an assignment statement node. */ +/**********************************************************************//** +Performs an execution step of an assignment statement node. +@return query thread to run next or NULL */ UNIV_INTERN que_thr_t* assign_step( /*========*/ - /* out: query thread to run next or NULL */ - que_thr_t* thr) /* in: query thread */ + que_thr_t* thr) /*!< in: query thread */ { assign_node_t* node; @@ -167,14 +168,14 @@ assign_step( return(thr); } -/************************************************************************** -Performs an execution step of a for-loop node. */ +/**********************************************************************//** +Performs an execution step of a for-loop node. +@return query thread to run next or NULL */ UNIV_INTERN que_thr_t* for_step( /*=====*/ - /* out: query thread to run next or NULL */ - que_thr_t* thr) /* in: query thread */ + que_thr_t* thr) /*!< in: query thread */ { for_node_t* node; que_node_t* parent; @@ -229,14 +230,14 @@ for_step( return(thr); } -/************************************************************************** -Performs an execution step of an exit statement node. */ +/**********************************************************************//** +Performs an execution step of an exit statement node. +@return query thread to run next or NULL */ UNIV_INTERN que_thr_t* exit_step( /*======*/ - /* out: query thread to run next or NULL */ - que_thr_t* thr) /* in: query thread */ + que_thr_t* thr) /*!< in: query thread */ { exit_node_t* node; que_node_t* loop_node; @@ -261,14 +262,14 @@ exit_step( return(thr); } -/************************************************************************** -Performs an execution step of a return-statement node. */ +/**********************************************************************//** +Performs an execution step of a return-statement node. +@return query thread to run next or NULL */ UNIV_INTERN que_thr_t* return_step( /*========*/ - /* out: query thread to run next or NULL */ - que_thr_t* thr) /* in: query thread */ + que_thr_t* thr) /*!< in: query thread */ { return_node_t* node; que_node_t* parent; |