mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
mysql-test/r/multi_update.result, mysql-test/t/multi_update.test
don't fail w/o bdb (or innodb) sql/sql_base.cc typo fixed. "mysql-test-run --ps-protocol select" fixed (item->cached_item was set to the last table if many matches) mysql-test/r/multi_update.result: don't fail w/o bdb (or innodb) mysql-test/t/multi_update.test: don't fail w/o bdb (or innodb) sql/sql_base.cc: typo fixed. "mysql-test-run --ps-protocol select" fixed (item->cached_item was set to the last table if many matches)
This commit is contained in:
@ -476,9 +476,7 @@ aclid bigint, index idx_acl(aclid)
|
|||||||
insert into t2 values(1,null);
|
insert into t2 values(1,null);
|
||||||
delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
|
delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
set @ttype_save=@@storage_engine;
|
create table t1 ( c char(8) not null ) engine=innodb;
|
||||||
set @@storage_engine=innodb;
|
|
||||||
create table t1 ( c char(8) not null );
|
|
||||||
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
||||||
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
|
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
|
||||||
alter table t1 add b char(8) not null;
|
alter table t1 add b char(8) not null;
|
||||||
@ -489,8 +487,7 @@ create table t2 like t1;
|
|||||||
insert into t2 select * from t1;
|
insert into t2 select * from t1;
|
||||||
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
set @@storage_engine=bdb;
|
create table t1 ( c char(8) not null ) engine=bdb;
|
||||||
create table t1 ( c char(8) not null );
|
|
||||||
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
||||||
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
|
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
|
||||||
alter table t1 add b char(8) not null;
|
alter table t1 add b char(8) not null;
|
||||||
@ -500,7 +497,6 @@ update t1 set a=c, b=c;
|
|||||||
create table t2 like t1;
|
create table t2 like t1;
|
||||||
insert into t2 select * from t1;
|
insert into t2 select * from t1;
|
||||||
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
||||||
set @@storage_engine=@ttype_save;
|
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
create table t1 (a int, b int);
|
create table t1 (a int, b int);
|
||||||
insert into t1 values (1, 2), (2, 3), (3, 4);
|
insert into t1 values (1, 2), (2, 3), (3, 4);
|
||||||
|
@ -452,11 +452,8 @@ drop table t1, t2;
|
|||||||
#
|
#
|
||||||
# Test for bug #1980.
|
# Test for bug #1980.
|
||||||
#
|
#
|
||||||
set @ttype_save=@@storage_engine;
|
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
set @@storage_engine=innodb;
|
create table t1 ( c char(8) not null ) engine=innodb;
|
||||||
create table t1 ( c char(8) not null );
|
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
||||||
@ -475,8 +472,7 @@ delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
|||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
set @@storage_engine=bdb;
|
create table t1 ( c char(8) not null ) engine=bdb;
|
||||||
create table t1 ( c char(8) not null );
|
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
||||||
@ -492,7 +488,6 @@ insert into t2 select * from t1;
|
|||||||
|
|
||||||
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
||||||
|
|
||||||
set @@storage_engine=@ttype_save;
|
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
|
||||||
create table t1 (a int, b int);
|
create table t1 (a int, b int);
|
||||||
|
@ -2247,12 +2247,12 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
|||||||
if (item->cached_table)
|
if (item->cached_table)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
This shortcut is used by prepared statements. We assuming that
|
This shortcut is used by prepared statements. We assuming that
|
||||||
TABLE_LIST *tables is not changed during query execution (which
|
TABLE_LIST *tables is not changed during query execution (which
|
||||||
is true for all queries except RENAME but luckily RENAME doesn't
|
is true for all queries except RENAME but luckily RENAME doesn't
|
||||||
use fields...) so we can rely on reusing pointer to its member.
|
use fields...) so we can rely on reusing pointer to its member.
|
||||||
With this optimization we also miss case when addition of one more
|
With this optimization we also miss case when addition of one more
|
||||||
field makes some prepared query ambiguous and so erroneous, but we
|
field makes some prepared query ambiguous and so erroneous, but we
|
||||||
accept this trade off.
|
accept this trade off.
|
||||||
*/
|
*/
|
||||||
if (item->cached_table->table)
|
if (item->cached_table->table)
|
||||||
@ -2268,7 +2268,7 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TABLE_LIST *table= item->cached_table;
|
TABLE_LIST *table= item->cached_table;
|
||||||
Field *find= find_field_in_table(thd, table, name, item->name, length,
|
found= find_field_in_table(thd, table, name, item->name, length,
|
||||||
ref,
|
ref,
|
||||||
(table->table &&
|
(table->table &&
|
||||||
test(table->table->grant.
|
test(table->table->grant.
|
||||||
@ -2391,9 +2391,7 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
|||||||
{
|
{
|
||||||
if (field == WRONG_GRANT)
|
if (field == WRONG_GRANT)
|
||||||
return (Field*) 0;
|
return (Field*) 0;
|
||||||
item->cached_table= tables;
|
item->cached_table= (!tables->cacheable_table || found) ? 0 : tables;
|
||||||
if (!tables->cacheable_table)
|
|
||||||
item->cached_table= 0;
|
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
if (!thd->where) // Returns first found
|
if (!thd->where) // Returns first found
|
||||||
|
Reference in New Issue
Block a user