diff options
author | unknown <konstantin@oak.local> | 2003-12-20 02:16:10 +0300 |
---|---|---|
committer | unknown <konstantin@oak.local> | 2003-12-20 02:16:10 +0300 |
commit | 32c6b0d72a120dcafb1ae084bbc1c57c5fc5701f (patch) | |
tree | c9441e15b696703bb24911352787db69a6784020 /libmysqld | |
parent | 8d987f9e532689545becf521aa6a6aa6b23bf330 (diff) | |
download | mariadb-git-32c6b0d72a120dcafb1ae084bbc1c57c5fc5701f.tar.gz |
Prepared_statement deployed instead of PREP_STMT.
libmysqld/lib_sql.cc:
Prepared_statement now resides entirely in sql_prepare.cc
Embedded versions of setup_params_data moved to sql_prepare.cc
sql/mysql_priv.h:
removed declarations for non-existing functions
sql/slave.cc:
no thd->init_for_queries() any more
sql/sql_class.cc:
added Statement and Statement_map classes.
PREP_STMT replaced with Statement (Prepared_statement) and moved to
sql_prepare.cc
sql/sql_class.h:
added Statement and Statement_map classes.
PREP_STMT replaced with Statement (Prepared_statement) and moved to
sql_prepare.cc
sql/sql_parse.cc:
thd->init_for_queries() doesn't exist any more
comment moved to proper place
sql/sql_prepare.cc:
PREP_STMT replaced with Prepared_statement
minor code cleanups
tests/client_test.c:
Later in the test we rely on order of rows, which normally is not defined.
My patch changes the order.
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/lib_sql.cc | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 89012a84857..365e9bc820a 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -743,90 +743,3 @@ bool Protocol::convert_str(const char *from, uint length) } #endif -bool setup_params_data(st_prep_stmt *stmt) -{ - THD *thd= stmt->thd; - List<Item> ¶ms= thd->lex->param_list; - List_iterator<Item> param_iterator(params); - Item_param *param; - ulong param_no= 0; - MYSQL_BIND *client_param= thd->client_params; - - DBUG_ENTER("setup_params_data"); - - for (;(param= (Item_param *)param_iterator++); client_param++) - { - setup_param_functions(param, client_param->buffer_type); - if (!param->long_data_supplied) - { - if (*client_param->is_null) - param->maybe_null= param->null_value= 1; - else - { - uchar *buff= (uchar*)client_param->buffer; - param->maybe_null= param->null_value= 0; - param->setup_param_func(param,&buff, - client_param->length ? - *client_param->length : - client_param->buffer_length); - } - } - param_no++; - } - DBUG_RETURN(0); -} - -bool setup_params_data_withlog(st_prep_stmt *stmt) -{ - THD *thd= stmt->thd; - List<Item> ¶ms= thd->lex->param_list; - List_iterator<Item> param_iterator(params); - Item_param *param; - MYSQL_BIND *client_param= thd->client_params; - - DBUG_ENTER("setup_params_data"); - - String str, *res, *query= new String(stmt->query->alloced_length()); - query->copy(*stmt->query); - - ulong param_no= 0; - uint32 length= 0; - - for (;(param= (Item_param *)param_iterator++); client_param++) - { - setup_param_functions(param, client_param->buffer_type); - if (param->long_data_supplied) - res= param->query_val_str(&str); - - else - { - if (*client_param->is_null) - { - param->maybe_null= param->null_value= 1; - res= &my_null_string; - } - else - { - uchar *buff= (uchar*)client_param->buffer; - param->maybe_null= param->null_value= 0; - param->setup_param_func(param,&buff, - client_param->length ? - *client_param->length : - client_param->buffer_length); - res= param->query_val_str(&str); - } - } - if (query->replace(param->pos_in_query+length, 1, *res)) - DBUG_RETURN(1); - - length+= res->length()-1; - param_no++; - } - - if (alloc_query(stmt->thd, (char *)query->ptr(), query->length()+1)) - DBUG_RETURN(1); - - query->free(); - DBUG_RETURN(0); -} - |