mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Proposed fix for #751
Fields in key_expr (mysql_ha_read) wasn't linked to tables. Hmm. How did it work at all?
This commit is contained in:
@ -70,3 +70,4 @@ INSERT INTO t1 VALUES ('40004712','000001','0020',0);
|
|||||||
UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
|
UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
|
||||||
"40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr
|
"40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr
|
||||||
ASC LIMIT 1;
|
ASC LIMIT 1;
|
||||||
|
drop table t1;
|
||||||
|
@ -146,3 +146,9 @@ alter table t1 type=MyISAM;
|
|||||||
handler t2 read first;
|
handler t2 read first;
|
||||||
Unknown table 't2' in HANDLER
|
Unknown table 't2' in HANDLER
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1(a int, index(a));
|
||||||
|
insert into t1 values (1), (2), (3);
|
||||||
|
handler t1 open;
|
||||||
|
handler t1 read a=(W);
|
||||||
|
Unknown column 'W' in 'field list'
|
||||||
|
drop table t1;
|
||||||
|
@ -81,3 +81,5 @@ INSERT INTO t1 VALUES ('40004712','000001','0020',0);
|
|||||||
UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
|
UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
|
||||||
"40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr
|
"40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr
|
||||||
ASC LIMIT 1;
|
ASC LIMIT 1;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
@ -80,3 +80,13 @@ alter table t1 type=MyISAM;
|
|||||||
handler t2 read first;
|
handler t2 read first;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
#test for #751
|
||||||
|
#
|
||||||
|
create table t1(a int, index(a));
|
||||||
|
insert into t1 values (1), (2), (3);
|
||||||
|
handler t1 open;
|
||||||
|
--error 1054
|
||||||
|
handler t1 read a=(W);
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
@ -193,6 +193,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
|
|||||||
Item *item;
|
Item *item;
|
||||||
for (key_len=0 ; (item=it_ke++) ; key_part++)
|
for (key_len=0 ; (item=it_ke++) ; key_part++)
|
||||||
{
|
{
|
||||||
|
if (item->fix_fields(thd, tables))
|
||||||
|
return -1;
|
||||||
item->save_in_field(key_part->field, 1);
|
item->save_in_field(key_part->field, 1);
|
||||||
key_len+=key_part->store_length;
|
key_len+=key_part->store_length;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user