1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

aliases with multi-table updates / deletes

fix for a bug with derived tables and query cache
ix for a charset bug in timestamp
This commit is contained in:
Sinisa@sinisa.nasamreza.org
2002-12-28 21:34:17 +02:00
parent 5a44f2bc26
commit 1e2bec8009
8 changed files with 12 additions and 4 deletions

View File

@ -235,7 +235,7 @@ select * from t2;
n d
1 30
1 30
UPDATE t1 a ,t2 b SET t1.d=t2.d,t2.d=30 WHERE a.n=b.n;
UPDATE t1 a ,t2 b SET a.d=b.d,b.d=30 WHERE a.n=b.n;
select * from t1;
n d
1 30

View File

@ -531,6 +531,7 @@ i
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
update t1 set i=(select distinct 1 from (select * from t2) a);
drop table t1, t2, t3;
use mysql;
select * from db;

View File

@ -213,7 +213,7 @@ insert into t2 values(1,10),(1,20);
UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
select * from t1;
select * from t2;
UPDATE t1 a ,t2 b SET t1.d=t2.d,t2.d=30 WHERE a.n=b.n;
UPDATE t1 a ,t2 b SET a.d=b.d,b.d=30 WHERE a.n=b.n;
select * from t1;
select * from t2;
DELETE t1, t2 FROM t1 a,t2 b where a.n=b.n;

View File

@ -21,3 +21,8 @@
#select * into dumpfile "/tmp/select-test.99" from t1;
#select load_file("/tmp/select-test.not-exist");
#drop table t1;
#drop table if exists t;
#CREATE TABLE t ( t timestamp NOT NULL, c char(200) character set latin1 NOT NULL default '', KEY t (t)) TYPE=MyISAM;
#INSERT INTO t VALUES ('2002-12-20 12:01:20','');
#select * from t into outfile "fdg";
#drop table if exists t;

View File

@ -368,6 +368,7 @@ select * from t2;
show status like "Qcache_queries_in_cache";
select * from t3;
show status like "Qcache_queries_in_cache";
update t1 set i=(select distinct 1 from (select * from t2) a);
drop table t1, t2, t3;
#

View File

@ -2845,6 +2845,7 @@ String *Field_timestamp::val_str(String *val_buffer,
val_buffer->alloc(field_length+1);
char *to=(char*) val_buffer->ptr(),*end=to+field_length;
val_buffer->length(field_length);
val_buffer->set_charset(val_ptr->charset());
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)

View File

@ -3003,7 +3003,7 @@ mysql_init_query(THD *thd)
lex->select_lex.link_prev= (st_select_lex_node**)&(lex->all_selects_list);
lex->olap=lex->describe=0;
lex->derived_tables= false;
lex->lock_option=TL_UNLOCK;
lex->lock_option=TL_READ;
thd->check_loops_counter= thd->select_number=
lex->select_lex.select_number= 1;
thd->free_list= 0;

View File

@ -2522,7 +2522,7 @@ join_table:
lex->current_select= unit->outer_select();
if (!($$= lex->current_select->
add_table_to_list(lex->thd, new Table_ident(unit), $5, 0,
lex->lock_option,(List<String> *)0,
TL_READ,(List<String> *)0,
(List<String> *)0)))
YYABORT;