Commit 40b6d074 authored by serg@serg.mylan's avatar serg@serg.mylan

handler should be used with constant expressions only (or rand)

parent 0abd1539
......@@ -151,4 +151,6 @@ insert into t1 values (1), (2), (3);
handler t1 open;
handler t1 read a=(W);
Unknown column 'W' in 'field list'
handler t1 read a=(a);
Wrong arguments to HANDLER ... READ
drop table t1;
......@@ -88,5 +88,7 @@ insert into t1 values (1), (2), (3);
handler t1 open;
--error 1054
handler t1 read a=(W);
--error 1210
handler t1 read a=(a);
drop table t1;
......@@ -194,7 +194,12 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
for (key_len=0 ; (item=it_ke++) ; key_part++)
{
if (item->fix_fields(thd, tables))
return -1;
goto err;
if (item->used_tables() & ~RAND_TABLE_BIT)
{
my_error(ER_WRONG_ARGUMENTS,MYF(0),"HANDLER ... READ");
goto err;
}
item->save_in_field(key_part->field, 1);
key_len+=key_part->store_length;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment