summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/heap_btree.result20
-rw-r--r--mysql-test/r/heap_hash.result12
-rw-r--r--mysql-test/r/merge.result20
-rw-r--r--mysql-test/r/rpl_log.result2
-rw-r--r--mysql-test/r/select.result4
-rw-r--r--mysql-test/r/subselect.result18
-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
18 files changed, 76 insertions, 72 deletions
diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result
index a33f237a312..bf24f78321f 100644
--- a/mysql-test/r/heap_btree.result
+++ b/mysql-test/r/heap_btree.result
@@ -66,14 +66,14 @@ a
alter table t1 type=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 where used; Using index
+1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y))
type=heap;
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
explain select * from t1 where x=1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref x x 4 const 1 where used
+1 SIMPLE t1 ref x x 4 const 1 Using where
select * from t1 where x=1;
x y
1 1
@@ -124,17 +124,17 @@ a b
1 6
explain select * from tx where a=x order by a,b;
id select_type table type possible_keys key key_len ref rows Extra
-x SIMPLE tx ref a a x const x where used
+x SIMPLE tx ref a a x const x Using where
explain select * from tx where a=x order by b;
id select_type table type possible_keys key key_len ref rows Extra
-x SIMPLE tx ref a a x const x where used
+x SIMPLE tx ref a a x const x Using where
select * from t1 where b=1;
a b
1 1
1 1
explain select * from tx where b=x;
id select_type table type possible_keys key key_len ref rows Extra
-x SIMPLE tx ref b b x const x where used
+x SIMPLE tx ref b b x const x Using where
drop table t1;
create table t1 (id int unsigned not null, primary key using BTREE (id)) type=HEAP;
insert into t1 values(1);
@@ -175,17 +175,17 @@ create table t1 (btn char(10) not null, key using BTREE (btn)) type=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
explain select * from t1 where btn like "q%";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL btn NULL NULL NULL 14 where used
+1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where
select * from t1 where btn like "q%";
btn
alter table t1 add column new_col char(1) not null, add key using BTREE (btn,new_col), drop key btn;
update t1 set new_col=btn;
explain select * from t1 where btn="a";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref btn btn 10 const 1 where used
+1 SIMPLE t1 ref btn btn 10 const 1 Using where
explain select * from t1 where btn="a" and new_col="a";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref btn btn 11 const,const 1 where used
+1 SIMPLE t1 ref btn btn 11 const,const 1 Using where
drop table t1;
CREATE TABLE t1 (
a int default NULL,
@@ -198,7 +198,7 @@ SELECT * FROM t1 WHERE a=NULL;
a b
explain SELECT * FROM t1 WHERE a IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a a 5 const 1 where used
+1 SIMPLE t1 ref a a 5 const 1 Using where
SELECT * FROM t1 WHERE a<=>NULL;
a b
NULL 99
@@ -206,7 +206,7 @@ SELECT * FROM t1 WHERE b=NULL;
a b
explain SELECT * FROM t1 WHERE b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref b b 5 const 1 where used
+1 SIMPLE t1 ref b b 5 const 1 Using where
SELECT * FROM t1 WHERE b<=>NULL;
a b
99 NULL
diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result
index 43a86069d3d..3c2baa645f7 100644
--- a/mysql-test/r/heap_hash.result
+++ b/mysql-test/r/heap_hash.result
@@ -66,7 +66,7 @@ a
alter table t1 type=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 where used; Using index
+1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x using HASH (x), unique y using HASH (y))
type=heap;
@@ -159,17 +159,17 @@ create table t1 (btn char(10) not null, key using HASH (btn)) type=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
explain select * from t1 where btn like "q%";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL btn NULL NULL NULL 14 where used
+1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where
select * from t1 where btn like "q%";
btn
alter table t1 add column new_col char(1) not null, add key using HASH (btn,new_col), drop key btn;
update t1 set new_col=btn;
explain select * from t1 where btn="a";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL btn NULL NULL NULL 14 where used
+1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where
explain select * from t1 where btn="a" and new_col="a";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref btn btn 11 const,const 10 where used
+1 SIMPLE t1 ref btn btn 11 const,const 10 Using where
drop table t1;
CREATE TABLE t1 (
a int default NULL,
@@ -182,7 +182,7 @@ SELECT * FROM t1 WHERE a=NULL;
a b
explain SELECT * FROM t1 WHERE a IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a a 5 const 10 where used
+1 SIMPLE t1 ref a a 5 const 10 Using where
SELECT * FROM t1 WHERE a<=>NULL;
a b
NULL 99
@@ -190,7 +190,7 @@ SELECT * FROM t1 WHERE b=NULL;
a b
explain SELECT * FROM t1 WHERE b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref b b 5 const 1 where used
+1 SIMPLE t1 ref b b 5 const 1 Using where
SELECT * FROM t1 WHERE b<=>NULL;
a b
99 NULL
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 45b5bd9ddb7..cd78ac791c4 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -35,10 +35,10 @@ insert into t1 select NULL,message from t2;
create table t3 (a int not null, b char(20), key(a)) type=MERGE UNION=(test.t1,test.t2);
explain select * from t3 where a < 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 range a a 4 NULL 10 Using where
+1 SIMPLE t3 range a a 4 NULL 18 Using where
explain select * from t3 where a > 10 and a < 20;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 range a a 4 NULL 10 Using where
+1 SIMPLE t3 range a a 4 NULL 16 Using where
select * from t3 where a = 10;
a b
10 Testing
@@ -581,18 +581,18 @@ KEY files (fileset_id,fileset_root_id)
) TYPE=MRG_MyISAM UNION=(t1);
EXPLAIN SELECT * FROM t2 IGNORE INDEX (files) WHERE fileset_id = 2
AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1;
-table type possible_keys key key_len ref rows Extra
-t2 range PRIMARY PRIMARY 33 NULL 5 Using where
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range PRIMARY PRIMARY 33 NULL 5 Using where
EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2
AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1;
-table type possible_keys key key_len ref rows Extra
-t2 range PRIMARY,files PRIMARY 33 NULL 5 Using where
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range PRIMARY,files PRIMARY 33 NULL 5 Using where
EXPLAIN SELECT * FROM t1 WHERE fileset_id = 2
AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1;
-table type possible_keys key key_len ref rows Extra
-t1 range PRIMARY,files PRIMARY 33 NULL 5 Using where
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,files PRIMARY 33 NULL 5 Using where
EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2
AND file_code = '0000000115' LIMIT 1;
-table type possible_keys key key_len ref rows Extra
-t2 const PRIMARY,files PRIMARY 33 const,const 1
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 const PRIMARY,files PRIMARY 33 const,const 1
DROP TABLE IF EXISTS t1, t2;
diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result
index a5850cbd181..ed54eb75f4b 100644
--- a/mysql-test/r/rpl_log.result
+++ b/mysql-test/r/rpl_log.result
@@ -72,7 +72,7 @@ show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id Orig_log_pos Info
slave-bin.000001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3
slave-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key)
-slave-bin.000001 172 Intvar 1 200 INSERT_ID=1
+slave-bin.000001 172 Intvar 1 172 INSERT_ID=1
slave-bin.000001 200 Query 1 200 use `test`; insert into t1 values (NULL)
slave-bin.000001 263 Query 1 263 use `test`; drop table t1
slave-bin.000001 311 Query 1 311 use `test`; create table t1 (word char(20) not null)
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 2615ee542e3..94c93dbc3dc 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -1331,10 +1331,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index NULL fld3 30 NULL 1199 Using where; Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index NULL fld3 30 NULL 1199 Using where; Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index e54e1fb0fef..c7862440bf1 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -60,9 +60,9 @@ a b
explain select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)
union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 where used
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 SUBSELECT t3 ALL NULL NULL NULL NULL 3 Using filesort
-3 UNION t4 ALL NULL NULL NULL NULL 3 where used; Using filesort
+3 UNION t4 ALL NULL NULL NULL NULL 3 Using where; Using filesort
4 SUBSELECT t2 ALL NULL NULL NULL NULL 2
select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a
@@ -76,8 +76,8 @@ explain select (select t3.a from t3 where a<8 order by 1 desc limit 1), a from
(select * from t2 where a>1) as tt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived3> system NULL NULL NULL NULL 1
-3 DERIVED t2 ALL NULL NULL NULL NULL 2 where used
-2 SUBSELECT t3 ALL NULL NULL NULL NULL 3 where used; Using filesort
+3 DERIVED t2 ALL NULL NULL NULL NULL 2 Using where
+2 SUBSELECT t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
a
2
@@ -95,7 +95,7 @@ explain select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3
2 DEPENDENT SUBSELECT t2 ALL NULL NULL NULL NULL 2
-3 DEPENDENT SUBSELECT t3 ALL NULL NULL NULL NULL 3 where used
+3 DEPENDENT SUBSELECT t3 ALL NULL NULL NULL NULL 3 Using where
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
7
@@ -129,8 +129,8 @@ NULL 1
explain select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2
-2 DEPENDENT SUBSELECT t1 system NULL NULL NULL NULL 1 where used
-3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 where used
+2 DEPENDENT SUBSELECT t1 system NULL NULL NULL NULL 1 Using where
+3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 Using where
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
Subselect returns more than 1 record
create table attend (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -200,11 +200,11 @@ INSERT INTO searchconthardwarefr3 (topic,date,pseudo) VALUES
('43506','2002-10-02','joce'),('40143','2002-08-03','joce');
EXPLAIN SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE searchconthardwarefr3 index NULL PRIMARY 41 NULL 2 where used; Using index
+1 SIMPLE searchconthardwarefr3 index NULL PRIMARY 41 NULL 2 Using where; Using index
EXPLAIN SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY No tables used
-2 SUBSELECT searchconthardwarefr3 index NULL PRIMARY 41 NULL 2 where used; Using index
+2 SUBSELECT searchconthardwarefr3 index NULL PRIMARY 41 NULL 2 Using where; Using index
SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
date
2002-08-03
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