summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-10-11 22:00:24 +0300
committerunknown <monty@mashka.mysql.fi>2003-10-11 22:00:24 +0300
commit74ea459412f9a479ea1385a72cc27b4245c06435 (patch)
tree50a7bfd87153439907087d4b3529d622cfc75313 /sql/sql_select.cc
parent0323a5c49ff77e5c028da70cfd86c229036f3eb4 (diff)
downloadmariadb-git-74ea459412f9a479ea1385a72cc27b4245c06435.tar.gz
Add new user variables for tuning memory usage:
query_alloc_block_size, query_prealloc_size, range_alloc_block_size,transaction_alloc_block_size and transaction_prealloc_size Add more checks for "out of memory" detection in range optimization configure.in: Added detection of mallinfo mysql-test/r/variables.result: Test of new variables mysql-test/t/variables.test: Test of new variables sql/ha_berkeley.cc: Use init_sql_alloc instead of init_alloc_root for better OOM detection sql/log_event.cc: Add new user variables for tuning memory usage sql/mysql_priv.h: Add new user variables for tuning memory usage sql/mysqld.cc: Add new user variables for tuning memory usage sql/opt_ft.cc: Add new user variables for tuning memory usage sql/opt_ft.h: Add new user variables for tuning memory usage sql/opt_range.cc: Add new user variables for tuning memory usage Add more checks for out of memory conditions sql/opt_range.h: Add new user variables for tuning memory usage sql/set_var.cc: Add new user variables for tuning memory usage sql/sql_acl.cc: Add new user variables for tuning memory usage sql/sql_class.h: Add new user variables for tuning memory usage sql/sql_delete.cc: Add new user variables for tuning memory usage sql/sql_parse.cc: Add new user variables for tuning memory usage sql/sql_select.cc: Add new user variables for tuning memory usage sql/sql_test.cc: Add information about memory useage if system supports mallinfo() sql/sql_udf.cc: Add new user variables for tuning memory usage sql/sql_update.cc: Add new user variables for tuning memory usage sql/table.cc: Add new user variables for tuning memory usage
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index bffe3cd7968..353a4623962 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1000,7 +1000,8 @@ err:
Approximate how many records will be used in each table
*****************************************************************************/
-static ha_rows get_quick_record_count(SQL_SELECT *select,TABLE *table,
+static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select,
+ TABLE *table,
key_map keys,ha_rows limit)
{
int error;
@@ -1009,7 +1010,7 @@ static ha_rows get_quick_record_count(SQL_SELECT *select,TABLE *table,
{
select->head=table;
table->reginfo.impossible_range=0;
- if ((error=select->test_quick_select(keys,(table_map) 0,limit))
+ if ((error=select->test_quick_select(thd, keys,(table_map) 0,limit))
== 1)
DBUG_RETURN(select->quick->records);
if (error == -1)
@@ -1290,8 +1291,8 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
found_const_table_map,
s->on_expr ? s->on_expr : conds,
&error);
- records= get_quick_record_count(select,s->table, s->const_keys,
- join->row_limit);
+ records= get_quick_record_count(join->thd, select, s->table,
+ s->const_keys, join->row_limit);
s->quick=select->quick;
s->needed_reg=select->needed_reg;
select->quick=0;
@@ -2687,7 +2688,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
/* Join with outer join condition */
COND *orig_cond=sel->cond;
sel->cond=and_conds(sel->cond,tab->on_expr);
- if (sel->test_quick_select(tab->keys,
+ if (sel->test_quick_select(join->thd, tab->keys,
used_tables & ~ current_map,
(join->select_options &
OPTION_FOUND_ROWS ?
@@ -2697,7 +2698,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
we have to check isn't it only "impossible ON" instead */
sel->cond=orig_cond;
if (!tab->on_expr ||
- sel->test_quick_select(tab->keys,
+ sel->test_quick_select(join->thd, tab->keys,
used_tables & ~ current_map,
(join->select_options &
OPTION_FOUND_ROWS ?
@@ -5047,7 +5048,8 @@ test_if_quick_select(JOIN_TAB *tab)
{
delete tab->select->quick;
tab->select->quick=0;
- return tab->select->test_quick_select(tab->keys,(table_map) 0,HA_POS_ERROR);
+ return tab->select->test_quick_select(tab->join->thd, tab->keys,
+ (table_map) 0, HA_POS_ERROR);
}
@@ -6014,7 +6016,8 @@ create_sort_index(JOIN_TAB *tab, ORDER *order, ha_rows filesort_limit,
For impossible ranges (like when doing a lookup on NULL on a NOT NULL
field, quick will contain an empty record set.
*/
- if (!(select->quick=get_ft_or_quick_select_for_ref(table, tab)))
+ if (!(select->quick=get_ft_or_quick_select_for_ref(tab->join->thd,
+ table, tab)))
goto err;
}
}