diff options
author | marko@hundin.mysql.fi <> | 2004-03-31 10:30:14 +0300 |
---|---|---|
committer | marko@hundin.mysql.fi <> | 2004-03-31 10:30:14 +0300 |
commit | 3476db87a0d1f8c50a95bb36723e7569792941a0 (patch) | |
tree | 09b400115844ab4e220f1023f1f1fb05e9ef026d /innobase | |
parent | 80c37f6a920b56c8a4c664f07cc2fba9f000d904 (diff) | |
download | mariadb-git-3476db87a0d1f8c50a95bb36723e7569792941a0.tar.gz |
InnoDB: Remove unnecessary code, mostly related to stored procedures
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/data/data0data.c | 4 | ||||
-rw-r--r-- | innobase/dict/dict0dict.c | 143 | ||||
-rw-r--r-- | innobase/dict/dict0mem.c | 53 | ||||
-rw-r--r-- | innobase/include/dict0dict.h | 37 | ||||
-rw-r--r-- | innobase/include/dict0dict.ic | 31 | ||||
-rw-r--r-- | innobase/include/dict0mem.h | 30 | ||||
-rw-r--r-- | innobase/include/dict0types.h | 1 | ||||
-rw-r--r-- | innobase/include/pars0pars.h | 12 | ||||
-rw-r--r-- | innobase/include/pars0sym.h | 3 | ||||
-rw-r--r-- | innobase/include/pars0types.h | 1 |
10 files changed, 0 insertions, 315 deletions
diff --git a/innobase/data/data0data.c b/innobase/data/data0data.c index c3c2b135717..96c15643096 100644 --- a/innobase/data/data0data.c +++ b/innobase/data/data0data.c @@ -25,10 +25,6 @@ byte data_error; /* data pointers of tuple fields are initialized ulint data_dummy; /* this is used to fool the compiler in dtuple_validate */ -byte data_buf[8192]; /* used in generating test tuples */ -ulint data_rnd = 756511; - - /* Some non-inlined functions used in the MySQL interface: */ void dfield_set_data_noninline( diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index eb14d8bc80f..40697578cc5 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -43,9 +43,6 @@ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve #define DICT_HEAP_SIZE 100 /* initial memory heap size when creating a table or index object */ -#define DICT_POOL_PER_PROCEDURE_HASH 512 /* buffer pool max size per stored - procedure hash table fixed size in - bytes */ #define DICT_POOL_PER_TABLE_HASH 512 /* buffer pool max size per table hash table fixed size in bytes */ #define DICT_POOL_PER_COL_HASH 128 /* buffer pool max size per column @@ -667,9 +664,6 @@ dict_init(void) dict_sys->col_hash = hash_create(buf_pool_get_max_size() / (DICT_POOL_PER_COL_HASH * UNIV_WORD_SIZE)); - dict_sys->procedure_hash = hash_create(buf_pool_get_max_size() / - (DICT_POOL_PER_PROCEDURE_HASH * - UNIV_WORD_SIZE)); dict_sys->size = 0; UT_LIST_INIT(dict_sys->table_LRU); @@ -2499,35 +2493,6 @@ dict_skip_word( return(ptr); } -#ifdef currentlynotused -/************************************************************************* -Returns the number of opening brackets '(' subtracted by the number -of closing brackets ')' between string and ptr. */ -static -int -dict_bracket_count( -/*===============*/ - /* out: bracket count */ - char* string, /* in: start of string */ - char* ptr) /* in: end of string */ -{ - int count = 0; - - while (string != ptr) { - if (*string == '(') { - count++; - } - if (*string == ')') { - count--; - } - - string++; - } - - return(count); -} -#endif - /************************************************************************* Removes MySQL comments from an SQL string. A comment is either (a) '#' to the end of the line, @@ -3410,114 +3375,6 @@ syntax_error: /*==================== END OF FOREIGN KEY PROCESSING ====================*/ /************************************************************************** -Adds a stored procedure object to the dictionary cache. */ - -void -dict_procedure_add_to_cache( -/*========================*/ - dict_proc_t* proc) /* in: procedure */ -{ - ulint fold; - - mutex_enter(&(dict_sys->mutex)); - - fold = ut_fold_string(proc->name); - - /* Look for a procedure with the same name: error if such exists */ - { - dict_proc_t* proc2; - - HASH_SEARCH(name_hash, dict_sys->procedure_hash, fold, proc2, - (ut_strcmp(proc2->name, proc->name) == 0)); - ut_a(proc2 == NULL); - } - - /* Add the procedure to the hash table */ - - HASH_INSERT(dict_proc_t, name_hash, dict_sys->procedure_hash, fold, - proc); - mutex_exit(&(dict_sys->mutex)); -} - -/************************************************************************** -Reserves a parsed copy of a stored procedure to execute. If there are no -free parsed copies left at the moment, parses a new copy. Takes the copy off -the list of copies: the copy must be returned there with -dict_procedure_release_parsed_copy. */ - -que_t* -dict_procedure_reserve_parsed_copy( -/*===============================*/ - /* out: the query graph */ - dict_proc_t* proc) /* in: dictionary procedure node */ -{ - que_t* graph; - proc_node_t* proc_node; - -#ifdef UNIV_SYNC_DEBUG - ut_ad(!mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ - - mutex_enter(&(dict_sys->mutex)); - -#ifdef UNIV_DEBUG - UT_LIST_VALIDATE(graphs, que_t, proc->graphs); -#endif - graph = UT_LIST_GET_FIRST(proc->graphs); - - if (graph) { - UT_LIST_REMOVE(graphs, proc->graphs, graph); - -/* printf("Graph removed, list length %lu\n", - UT_LIST_GET_LEN(proc->graphs)); */ -#ifdef UNIV_DEBUG - UT_LIST_VALIDATE(graphs, que_t, proc->graphs); -#endif - } - - mutex_exit(&(dict_sys->mutex)); - - if (graph == NULL) { - graph = pars_sql(proc->sql_string); - - proc_node = que_fork_get_child(graph); - - proc_node->dict_proc = proc; - - printf("Parsed a new copy of graph %s\n", - proc_node->proc_id->name); - } - -/* printf("Returning graph %lu\n", (ulint)graph); */ - - return(graph); -} - -/************************************************************************** -Releases a parsed copy of an executed stored procedure. Puts the copy to the -list of copies. */ - -void -dict_procedure_release_parsed_copy( -/*===============================*/ - que_t* graph) /* in: query graph of a stored procedure */ -{ - proc_node_t* proc_node; - -#ifdef UNIV_SYNC_DEBUG - ut_ad(!mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ - - mutex_enter(&(dict_sys->mutex)); - - proc_node = que_fork_get_child(graph); - - UT_LIST_ADD_FIRST(graphs, (proc_node->dict_proc)->graphs, graph); - - mutex_exit(&(dict_sys->mutex)); -} - -/************************************************************************** Returns an index object if it is found in the dictionary cache. */ dict_index_t* diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c index c9eb7a9d8bd..f8c54022c9e 100644 --- a/innobase/dict/dict0mem.c +++ b/innobase/dict/dict0mem.c @@ -301,56 +301,3 @@ dict_mem_index_free( { mem_heap_free(index->heap); } - -/************************************************************************** -Creates a procedure memory object. */ - -dict_proc_t* -dict_mem_procedure_create( -/*======================*/ - /* out, own: procedure object */ - char* name, /* in: procedure name */ - char* sql_string, /* in: procedure definition as an SQL - string */ - que_fork_t* graph) /* in: parsed procedure graph */ -{ - dict_proc_t* proc; - proc_node_t* proc_node; - mem_heap_t* heap; - char* str; - - ut_ad(name); - - heap = mem_heap_create(128); - - proc = mem_heap_alloc(heap, sizeof(dict_proc_t)); - - proc->heap = heap; - - str = mem_heap_alloc(heap, 1 + ut_strlen(name)); - - ut_strcpy(str, name); - - proc->name = str; - - str = mem_heap_alloc(heap, 1 + ut_strlen(sql_string)); - - ut_strcpy(str, sql_string); - - proc->sql_string = str; - - UT_LIST_INIT(proc->graphs); - -/* UT_LIST_ADD_LAST(graphs, proc->graphs, graph); */ - -#ifdef UNIV_DEBUG - UT_LIST_VALIDATE(graphs, que_t, proc->graphs); -#endif - proc->mem_fix = 0; - - proc_node = que_fork_get_child(graph); - - proc_node->dict_proc = proc; - - return(proc); -} diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index be5d3b5b465..2e51fecdb8d 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -59,41 +59,6 @@ Inits the data dictionary module. */ void dict_init(void); /*===========*/ -/************************************************************************** -Returns a stored procedure object and memoryfixes it. */ -UNIV_INLINE -dict_proc_t* -dict_procedure_get( -/*===============*/ - /* out: procedure, NULL if does not exist */ - char* proc_name, /* in: table name */ - trx_t* trx); /* in: transaction handle or NULL */ -/************************************************************************** -Adds a stored procedure object to the dictionary cache. */ - -void -dict_procedure_add_to_cache( -/*========================*/ - dict_proc_t* proc); /* in: procedure */ -/************************************************************************** -Reserves a parsed copy of a stored procedure to execute. If there are no -free parsed copies left at the moment, parses a new copy. Takes the copy off -the list of copies: the copy must be returned there with -dict_procedure_release_parsed_copy. */ - -que_t* -dict_procedure_reserve_parsed_copy( -/*===============================*/ - /* out: the query graph */ - dict_proc_t* proc); /* in: dictionary procedure node */ -/************************************************************************** -Releases a parsed copy of an executed stored procedure. Puts the copy to the -list of copies. */ - -void -dict_procedure_release_parsed_copy( -/*===============================*/ - que_t* graph); /* in: query graph of a stored procedure */ /************************************************************************* Gets the column data type. */ UNIV_INLINE @@ -901,8 +866,6 @@ struct dict_sys_struct{ hash_table_t* table_id_hash; /* hash table of the tables, based on id */ hash_table_t* col_hash; /* hash table of the columns */ - hash_table_t* procedure_hash; /* hash table of the stored - procedures */ UT_LIST_BASE_NODE_T(dict_table_t) table_LRU; /* LRU list of tables */ ulint size; /* varying space in bytes occupied diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic index b70822e331f..57ef4b896f5 100644 --- a/innobase/include/dict0dict.ic +++ b/innobase/include/dict0dict.ic @@ -582,37 +582,6 @@ dict_table_get_low( } /************************************************************************** -Returns a stored procedure object and memoryfixes it. */ -UNIV_INLINE -dict_proc_t* -dict_procedure_get( -/*===============*/ - /* out: procedure, NULL if does not exist */ - char* proc_name, /* in: table name */ - trx_t* trx) /* in: transaction handle or NULL */ -{ - dict_proc_t* proc; - ulint name_fold; - - UT_NOT_USED(trx); - - mutex_enter(&(dict_sys->mutex)); - - /* Look for the table name in the hash table */ - name_fold = ut_fold_string(proc_name); - - HASH_SEARCH(name_hash, dict_sys->procedure_hash, name_fold, proc, - ut_strcmp(proc->name, proc_name) == 0); - if (proc != NULL) { - proc->mem_fix++; - } - - mutex_exit(&(dict_sys->mutex)); - - return(proc); -} - -/************************************************************************** Returns a table object, based on table id, and memoryfixes it. */ UNIV_INLINE dict_table_t* diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h index 1930825f601..439adf6f52e 100644 --- a/innobase/include/dict0mem.h +++ b/innobase/include/dict0mem.h @@ -132,18 +132,6 @@ dict_foreign_t* dict_mem_foreign_create(void); /*=========================*/ /* out, own: foreign constraint struct */ -/************************************************************************** -Creates a procedure memory object. */ - -dict_proc_t* -dict_mem_procedure_create( -/*======================*/ - /* out, own: procedure object */ - char* name, /* in: procedure name */ - char* sql_string, /* in: procedure definition as an SQL - string */ - que_fork_t* graph); /* in: parsed procedure graph */ - /* Data structure for a column in a table */ struct dict_col_struct{ @@ -420,24 +408,6 @@ struct dict_table_struct{ #endif /* UNIV_DEBUG */ }; -/* Data structure for a stored procedure */ -struct dict_proc_struct{ - mem_heap_t* heap; /* memory heap */ - char* name; /* procedure name */ - char* sql_string; - /* procedure definition as an SQL string: - we can produce more parsed instances of the - procedure by parsing this string */ - hash_node_t name_hash; - /* hash chain node */ - UT_LIST_BASE_NODE_T(que_fork_t) graphs; - /* list of parsed instances of the procedure: - there may be many of them, and they are - recycled */ - ulint mem_fix;/* count of how many times this struct - has been fixed in memory */ -}; - #ifndef UNIV_NONINL #include "dict0mem.ic" #endif diff --git a/innobase/include/dict0types.h b/innobase/include/dict0types.h index 498c6f46b7b..bd8a1a996d1 100644 --- a/innobase/include/dict0types.h +++ b/innobase/include/dict0types.h @@ -15,7 +15,6 @@ typedef struct dict_field_struct dict_field_t; typedef struct dict_index_struct dict_index_t; typedef struct dict_tree_struct dict_tree_t; typedef struct dict_table_struct dict_table_t; -typedef struct dict_proc_struct dict_proc_t; typedef struct dict_foreign_struct dict_foreign_t; /* A cluster object is a table object with the type field set to diff --git a/innobase/include/pars0pars.h b/innobase/include/pars0pars.h index 8ff226ebbd0..cad0942eeb1 100644 --- a/innobase/include/pars0pars.h +++ b/innobase/include/pars0pars.h @@ -456,18 +456,6 @@ struct proc_node_struct{ sym_node_t* param_list; /* input and output parameters */ que_node_t* stat_list; /* statement list */ sym_tab_t* sym_tab; /* symbol table of this procedure */ - dict_proc_t* dict_proc; /* stored procedure node in the - dictionary cache, if defined */ -}; - -/* Stored procedure call node */ -struct call_node_struct{ - que_common_t common; /* type: QUE_NODE_CALL */ - sym_node_t* proc_name; /* stored procedure name */ - dict_proc_t* procedure_def; /* pointer to a stored procedure graph - in the dictionary stored procedure - cache */ - sym_tab_t* sym_tab; /* symbol table of this query */ }; /* elsif-element node */ diff --git a/innobase/include/pars0sym.h b/innobase/include/pars0sym.h index 9fdeb1984a9..3060fd06c8f 100644 --- a/innobase/include/pars0sym.h +++ b/innobase/include/pars0sym.h @@ -127,9 +127,6 @@ struct sym_node_struct{ dict_table_t* table; /* table definition if a table id or a column id */ - dict_proc_t* procedure_def; /* stored procedure - definition, if a - stored procedure name */ ulint col_no; /* column number if a column */ sel_buf_t* prefetch_buf; /* NULL, or a buffer diff --git a/innobase/include/pars0types.h b/innobase/include/pars0types.h index e7471260501..9fbfd6efaa1 100644 --- a/innobase/include/pars0types.h +++ b/innobase/include/pars0types.h @@ -15,7 +15,6 @@ typedef struct pars_res_word_struct pars_res_word_t; typedef struct func_node_struct func_node_t; typedef struct order_node_struct order_node_t; typedef struct proc_node_struct proc_node_t; -typedef struct call_node_struct call_node_t; typedef struct elsif_node_struct elsif_node_t; typedef struct if_node_struct if_node_t; typedef struct while_node_struct while_node_t; |