summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-11-21 22:25:53 +0200
committerunknown <monty@mashka.mysql.fi>2002-11-21 22:25:53 +0200
commitc58d9d9a9dda3037db574bbf97b22e7c1c274e02 (patch)
tree54ccfe80d1405cb4325209020ea3c34d86a60770 /sql
parent33fc0d53b543032accea2476a4eed0522cead2bb (diff)
downloadmariadb-git-c58d9d9a9dda3037db574bbf97b22e7c1c274e02.tar.gz
Fixes after merge with 4.0
mysql-test/r/heap_btree.result: Updated results mysql-test/r/heap_hash.result: Updated results mysql-test/r/merge.result: Updated results mysql-test/r/rpl_log.result: Updated results mysql-test/r/select.result: Updated results mysql-test/r/subselect.result: Updated results sql/item_cmpfunc.h: Fix after merge sql/log_event.cc: Fix after merge sql/mysql_priv.h: Fix after merge sql/sql_acl.cc: Fix after merge sql/sql_class.cc: Fix after merge sql/sql_db.cc: Fix after merge sql/sql_delete.cc: Fix after merge sql/sql_lex.cc: Fix after merge sql/sql_lex.h: Fix after merge sql/sql_parse.cc: Fix after merge sql/sql_update.cc: Fix after merge sql/sql_yacc.yy: Fix after merge
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.h4
-rw-r--r--sql/log_event.cc11
-rw-r--r--sql/mysql_priv.h1
-rw-r--r--sql/sql_acl.cc8
-rw-r--r--sql/sql_class.cc6
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_delete.cc2
-rw-r--r--sql/sql_lex.cc1
-rw-r--r--sql/sql_lex.h3
-rw-r--r--sql/sql_parse.cc8
-rw-r--r--sql/sql_update.cc3
-rw-r--r--sql/sql_yacc.yy23
12 files changed, 38 insertions, 34 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index a9dc6c87f95..f94c520cc15 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -213,10 +213,10 @@ public:
longlong val_int();
String *val_str(String *str);
enum Item_result result_type () const { return cached_result_type; }
- bool fix_fields(THD *thd,struct st_table_list *tlist)
+ bool fix_fields(THD *thd,struct st_table_list *tlist, Item **ref)
{
args[0]->top_level_item();
- return Item_func::fix_fields(thd,tlist);
+ return Item_func::fix_fields(thd, tlist, ref);
}
void fix_length_and_dec();
const char *func_name() const { return "if"; }
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 3747af22922..d9ee832f7d3 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1159,11 +1159,12 @@ int Load_log_event::write_data_body(IO_CACHE* file)
Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex,
const char *db_arg, const char *table_name_arg,
List<Item> &fields_arg,
- enum enum_duplicates handle_dup)
- :Log_event(thd_arg),thread_id(thd_arg->thread_id), num_fields(0),fields(0),
- field_lens(0),field_block_len(0),
- table_name(table_name_arg ? table_name_arg : ""),
- db(db_arg), fname(ex->file_name)
+ enum enum_duplicates handle_dup,
+ bool using_trans)
+ :Log_event(thd_arg, 0, using_trans), thread_id(thd_arg->thread_id),
+ num_fields(0), fields(0), field_lens(0),field_block_len(0),
+ table_name(table_name_arg ? table_name_arg : ""),
+ db(db_arg), fname(ex->file_name)
{
time_t end_time;
time(&end_time);
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 4317ea05041..058e6b4ee95 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -541,7 +541,6 @@ bool add_field_to_list(char *field_name, enum enum_field_types type,
char *change, TYPELIB *interval,CHARSET_INFO *cs);
void store_position_for_column(const char *name);
bool add_to_list(SQL_LIST &list,Item *group,bool asc=0);
-void set_lock_for_tables(thr_lock_type lock_type);
void add_join_on(TABLE_LIST *b,Item *expr);
void add_join_natural(TABLE_LIST *a,TABLE_LIST *b);
bool add_proc_to_list(Item *item);
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 8ccd7dbde68..d741c53d127 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1359,10 +1359,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
case SSL_TYPE_NOT_SPECIFIED:
break;
case SSL_TYPE_NONE:
- table->field[24]->store("",0);
- table->field[25]->store("",0);
- table->field[26]->store("",0);
- table->field[27]->store("",0);
+ table->field[24]->store("", 0, system_charset_info);
+ table->field[25]->store("", 0, system_charset_info);
+ table->field[26]->store("", 0, system_charset_info);
+ table->field[27]->store("", 0, system_charset_info);
break;
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index e3ee0fb9f72..4141211ad92 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -214,11 +214,11 @@ void THD::init(void)
void THD::change_user(void)
{
cleanup();
- cleanup_done=0;
+ cleanup_done= 0;
init();
- hash_init(&user_vars, USER_VARS_HASH_SIZE, 0, 0,
+ hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
(hash_get_key) get_var_key,
- (hash_free_key) free_user_var,0);
+ (hash_free_key) free_user_var, 0);
}
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index cefad6a0805..c3e183de0ac 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -282,7 +282,7 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
mysql_update_log.write(thd,thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query, thd->query_length);
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
}
send_ok(thd, result);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index cc60ebfb58d..c9e10b5b0b5 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -35,7 +35,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
SQL_SELECT *select=0;
READ_RECORD info;
bool using_limit=limit != HA_POS_ERROR;
- bool using_transactions, log_delayed, safe_update, const_cond;
+ bool transactional_table, log_delayed, safe_update, const_cond;
ha_rows deleted;
DBUG_ENTER("mysql_delete");
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 975c3cfcf2b..9ed66aede6f 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1180,7 +1180,6 @@ bool st_select_lex_unit::create_total_list_n_last_return(THD *thd, st_lex *lex,
if (!cursor)
{
/* Add not used table to the total table list */
- aux->lock_type= lex->lock_option;
if (!(cursor= (TABLE_LIST *) thd->memdup((char*) aux,
sizeof(*aux))))
{
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 9f8e3200246..dd41af4b250 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -239,7 +239,7 @@ public:
thr_lock_type flags= TL_UNLOCK,
List<String> *use_index= 0,
List<String> *ignore_index= 0);
-
+ virtual void set_lock_for_tables(thr_lock_type lock_type) {}
void mark_as_dependent(st_select_lex *last);
private:
void fast_exclude();
@@ -364,6 +364,7 @@ public:
thr_lock_type flags= TL_UNLOCK,
List<String> *use_index= 0,
List<String> *ignore_index= 0);
+ void set_lock_for_tables(thr_lock_type lock_type);
inline void init_order()
{
order_list.elements= 0;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4816a0539f3..263ac50120d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3409,7 +3409,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(Table_ident *table,
DBUG_RETURN(0); // End of memory
alias_str= alias ? alias->str : table->table.str;
if (table->table.length > NAME_LEN ||
- (table->table.length && check_table_name(table->table.str,table->table.length)) ||
+ (table->table.length &&
+ check_table_name(table->table.str,table->table.length)) ||
table->db.str && check_db_name(table->db.str))
{
net_printf(thd,ER_WRONG_TABLE_NAME,table->table.str);
@@ -3489,15 +3490,14 @@ TABLE_LIST *st_select_lex::add_table_to_list(Table_ident *table,
query
*/
-void set_lock_for_tables(thr_lock_type lock_type)
+void st_select_lex::set_lock_for_tables(thr_lock_type lock_type)
{
- THD *thd=current_thd;
bool for_update= lock_type >= TL_READ_NO_INSERT;
DBUG_ENTER("set_lock_for_tables");
DBUG_PRINT("enter", ("lock_type: %d for_update: %d", lock_type,
for_update));
- for (TABLE_LIST *tables= (TABLE_LIST*) thd->lex.select->table_list.first ;
+ for (TABLE_LIST *tables= (TABLE_LIST*) table_list.first ;
tables ;
tables=tables->next)
{
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 73343ab1a50..e3e0bca9856 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -52,7 +52,8 @@ int mysql_update(THD *thd,
ha_rows limit,
enum enum_duplicates handle_duplicates)
{
- bool using_limit=limit != HA_POS_ERROR, safe_update= thd->options & OPTION_SAFE_UPDATES;
+ bool using_limit=limit != HA_POS_ERROR;
+ bool safe_update= thd->options & OPTION_SAFE_UPDATES;
bool used_key_is_modified, transactional_table, log_delayed;
int error=0;
uint save_time_stamp, used_index, want_privilege;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a994a2539f7..eaae24d0310 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -646,7 +646,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
table_to_table_list table_to_table opt_table_list opt_as
handler_rkey_function handler_read_or_scan
single_multi table_wild_list table_wild_one opt_wild
- union opt_union union_list union_option
+ union union_list union_option
precision opt_on_delete_item subselect_start opt_and
subselect_end select_var_list select_var_list_init help opt_len
END_OF_INPUT
@@ -2817,7 +2817,7 @@ insert:
INSERT { Lex->sql_command = SQLCOM_INSERT; } insert_lock_option
opt_ignore insert2
{
- set_lock_for_tables($3);
+ Select->set_lock_for_tables($3);
}
insert_field_spec
;
@@ -2831,7 +2831,7 @@ replace:
}
replace_lock_option insert2
{
- set_lock_for_tables($3);
+ Select->set_lock_for_tables($3);
}
insert_field_spec
;
@@ -2891,7 +2891,8 @@ insert_values:
mysql_init_select(lex);
}
select_options select_item_list select_from select_lock_type
- opt_union {};
+ union {}
+ ;
values_list:
values_list ',' no_braces
@@ -2958,7 +2959,7 @@ expr_or_default:
/* Update rows in a table */
update:
- UPDATE_SYM
+ UPDATE_SYM
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_UPDATE;
@@ -2967,7 +2968,7 @@ update:
opt_low_priority opt_ignore join_table_list
SET update_list where_clause opt_order_clause delete_limit_clause
{
- set_lock_for_tables($3);
+ Select->set_lock_for_tables($3);
}
;
@@ -3004,7 +3005,7 @@ delete:
single_multi:
FROM table_ident
{
- if (!add_table_to_list($2, NULL, 1, Lex->lock_option))
+ if (!Select->add_table_to_list($2, NULL, 1, Lex->lock_option))
YYABORT;
}
where_clause opt_order_clause
@@ -4239,9 +4240,10 @@ rollback:
*/
-opt_union:
+union:
/* empty */ {}
- | union_list;
+ | union_list
+ ;
union_list:
UNION_SYM union_option
@@ -4267,7 +4269,8 @@ union_list:
union_opt:
union_list {}
- | optional_order_or_limit {};
+ | optional_order_or_limit {}
+ ;
optional_order_or_limit:
/* empty