1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

after review & some other fixes

This commit is contained in:
bell@sanja.is.com.ua
2004-03-16 20:19:36 +02:00
parent 446b1bd260
commit 579a94a328
4 changed files with 10 additions and 4 deletions

View File

@@ -1637,4 +1637,3 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1
drop table t1;

View File

@@ -959,7 +959,6 @@ double Item_func_round::val()
return tmp2;
}
void Item_func_rand::fix_length_and_dec()
{
decimals=NOT_FIXED_DEC;
@@ -990,6 +989,12 @@ void Item_func_rand::fix_length_and_dec()
}
}
void Item_func_rand::update_used_tables()
{
Item_real_func::update_used_tables();
used_tables_cache|= RAND_TABLE_BIT;
}
double Item_func_rand::val()
{

View File

@@ -512,6 +512,7 @@ public:
double val();
const char *func_name() const { return "rand"; }
bool const_item() const { return 0; }
void update_used_tables();
void fix_length_and_dec();
};

View File

@@ -585,8 +585,9 @@ JOIN::optimize()
}
if (const_table_map != found_const_table_map &&
!(select_options & SELECT_DESCRIBE) &&
!((conds->used_tables() & RAND_TABLE_BIT) &&
select_lex->master_unit() != &thd->lex->unit))// not upper level SELECT
(!conds ||
!(conds->used_tables() & RAND_TABLE_BIT) ||
select_lex->master_unit() == &thd->lex->unit)) // upper level SELECT
{
zero_result_cause= "no matching row in const table";
DBUG_PRINT("error",("Error: %s", zero_result_cause));