1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Don't count NULL values in cardinalty for MyISAM tables.

Free row buffer cache after each query for MyISAM tables.
Added table join option FORCE INDEX
Fixed core dump bug when connecting with hostname that could not be resolved.


include/my_base.h:
  Don't count NULL values in cardinalty
myisam/mi_check.c:
  Don't count NULL values in cardinalty
myisam/mi_extra.c:
  Free row buffer cache after each query
myisam/mi_open.c:
  Avoid realloc if cache size doesn't change
myisam/mi_search.c:
  Don't count NULL values in cardinalty
myisam/myisamdef.h:
  Change buffer length from uint to uint32 to make it more portable/predictable
mysql-test/r/myisam.result:
  Test case for cardinality with NULL keys and FORCE INDEX
mysql-test/t/myisam.test:
  Test case for cardinality with NULL keys and FORCE INDEX
sql/lex.h:
  Added table join option FORCE INDEX
sql/mysql_priv.h:
  Added table join option FORCE INDEX
sql/opt_range.cc:
  Added table join option FORCE INDEX
sql/sql_base.cc:
  Added table join option FORCE INDEX
sql/sql_lex.h:
  Added table join option FORCE INDEX
sql/sql_parse.cc:
  Added table join option FORCE INDEX
  Don't use strlen() on hostname without first checking if it's not NULL
sql/sql_select.cc:
  Added table join option FORCE INDEX
sql/sql_yacc.yy:
  Added table join option FORCE INDEX
sql/table.h:
  Added table join option FORCE INDEX
This commit is contained in:
unknown
2003-01-09 02:19:14 +02:00
parent a3f4a46bf2
commit b5e37b242e
17 changed files with 207 additions and 52 deletions

View File

@@ -498,7 +498,8 @@ check_connections(THD *thd)
vio_in_addr(net->vio,&thd->remote.sin_addr);
thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors);
/* Cut very long hostnames to avoid possible overflows */
thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0;
if (thd->host)
thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0;
if (connect_errors > max_connect_errors)
return(ER_HOST_IS_BLOCKED);
}
@@ -3158,12 +3159,30 @@ bool add_to_list(SQL_LIST &list,Item *item,bool asc)
}
/*
Add a table to list of used tables
SYNOPSIS
add_table_to_list()
table Table to add
alias alias for table (or null if no alias)
table_options A set of the following bits:
TL_OPTION_UPDATING Table will be updated
TL_OPTION_FORCE_INDEX Force usage of index
lock_type How table should be locked
use_index List of indexed used in USE INDEX
ignore_index List of indexed used in IGNORE INDEX
RETURN
0 Error
# Pointer to TABLE_LIST element added to the total table list
*/
TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
bool updating,
thr_lock_type flags,
ulong table_options,
thr_lock_type lock_type,
List<String> *use_index,
List<String> *ignore_index
)
List<String> *ignore_index)
{
register TABLE_LIST *ptr;
THD *thd=current_thd;
@@ -3211,8 +3230,9 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
}
ptr->real_name=table->table.str;
ptr->real_name_length=table->table.length;
ptr->lock_type=flags;
ptr->updating=updating;
ptr->lock_type= lock_type;
ptr->updating= test(table_options & TL_OPTION_UPDATING);
ptr->force_index= test(table_options & TL_OPTION_FORCE_INDEX);
if (use_index)
ptr->use_index=(List<String> *) thd->memdup((gptr) use_index,
sizeof(*use_index));
@@ -3221,7 +3241,7 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
sizeof(*ignore_index));
/* check that used name is unique */
if (flags != TL_IGNORE)
if (lock_type != TL_IGNORE)
{
for (TABLE_LIST *tables=(TABLE_LIST*) thd->lex.select->table_list.first ;
tables ;