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

handler interface cleanups:

more logical table/index_flags
  return  HA_ERR_WRONG_COMMAND instead of abstract methods where appropriate
  max_keys and other limits renamed to max_supported_keys/etc
  max_keys/etc are now wrappers to max_supported_keys/etc 
  ha_index_init/ha_rnd_init/ha_index_end/ha_rnd_end are now wrappers to real {index,rnd}_{init,end} to enforce strict pairing


include/myisam.h:
  increasing myisam_max_temp_file_length
include/my_base.h:
  handler interface cleanup
myisam/mi_static.c:
  warning removed
mysql-test/Makefile.am:
  followup
mysql-test/r/fulltext.result:
  fulltext indexes are not ordered
mysql-test/r/rpl_user_variables.result:
  followup
sql/field.cc:
  index_flags
sql/filesort.cc:
  rnd_init -> ha_rnd_init
  rnd_end -> ha_rnd_end
sql/ha_berkeley.cc:
  cleanup
sql/ha_berkeley.h:
  table/index_flags revamped
sql/ha_heap.cc:
  ensure index is accessed only after index_init (esp. important for temp tables)
sql/ha_heap.h:
  table/index_flags revamped
sql/ha_innodb.cc:
  don't workaround MySQL sloppiness
sql/ha_innodb.h:
  table/index_flags revamped
sql/ha_isam.h:
  table/index_flags revamped
sql/ha_isammrg.h:
  table/index_flags revamped
sql/ha_myisam.cc:
  ensure index is accessed only after index_init (esp. important for temp tables)
sql/ha_myisam.h:
  table/index_flags revamped
sql/ha_myisammrg.h:
  table/index_flags revamped
sql/handler.cc:
  handler interface cleanups
sql/handler.h:
  handler interface cleanups:
    more logical table/index_flags
    return  HA_ERR_WRONG_COMMAND instead of abstract methods
    max_keys and other limits renamed to max_supported_keys/etc
    max_keys/etc are now wrappers to max_supported_keys/etc 
    ha_index_init/ha_rnd_init/ha_index_end/ha_rnd_end are now wrappers to enforce strict pairing
sql/item_subselect.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
sql/lex.h:
  renamed to avoid conflicts
sql/opt_range.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
  table/index_flags cleanup
sql/opt_range.h:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
sql/opt_sum.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
  table/index_flags cleanup
sql/records.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
sql/sql_acl.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
sql/sql_cache.cc:
  cleanup
sql/sql_delete.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
sql/sql_handler.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
sql/sql_help.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
sql/sql_insert.cc:
  table/index_flags cleanup
sql/sql_select.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
  table/index_flags cleanup
sql/sql_table.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
  table/index_flags cleanup
sql/sql_update.cc:
  index_init/index_end/rnd_init/rnd_end strict pairing fixed
sql/sql_yacc.yy:
  INDEX -> INDEX_SYM
sql/table.cc:
  table/index_flags cleanup
This commit is contained in:
unknown
2004-06-23 12:29:05 +02:00
parent 16c5f173e8
commit 9a554b4751
38 changed files with 562 additions and 660 deletions

View File

@@ -529,7 +529,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
break;
case FIELD_TYPE_GEOMETRY:
#ifdef HAVE_SPATIAL
if (!(file->table_flags() & HA_HAS_GEOMETRY))
if (!(file->table_flags() & HA_CAN_GEOMETRY))
{
my_printf_error(ER_CHECK_NOT_IMPLEMENTED, ER(ER_CHECK_NOT_IMPLEMENTED),
MYF(0), "GEOMETRY");
@@ -667,7 +667,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
continue;
}
(*key_count)++;
tmp=max(file->max_key_parts(),MAX_REF_PARTS);
tmp=file->max_key_parts();
if (key->columns.elements > tmp)
{
my_error(ER_TOO_MANY_KEY_PARTS,MYF(0),tmp);
@@ -719,7 +719,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
DBUG_RETURN(-1);
}
}
tmp=min(file->max_keys(), MAX_KEY);
tmp=file->max_keys();
if (*key_count > tmp)
{
my_error(ER_TOO_MANY_KEYS,MYF(0),tmp);
@@ -879,7 +879,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (f_is_blob(sql_field->pack_flag))
{
if (!(file->table_flags() & HA_BLOB_KEY))
if (!(file->table_flags() & HA_CAN_INDEX_BLOBS))
{
my_printf_error(ER_BLOB_USED_AS_KEY,ER(ER_BLOB_USED_AS_KEY),MYF(0),
column->field_name);
@@ -916,7 +916,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
}
else
key_info->flags|= HA_NULL_PART_KEY;
if (!(file->table_flags() & HA_NULL_KEY))
if (!(file->table_flags() & HA_NULL_IN_KEY))
{
my_printf_error(ER_NULL_COLUMN_IN_INDEX,ER(ER_NULL_COLUMN_IN_INDEX),
MYF(0),column->field_name);
@@ -1048,7 +1048,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (!(key_info->flags & HA_NULL_PART_KEY))
unique_key=1;
key_info->key_length=(uint16) key_length;
uint max_key_length= min(file->max_key_length(), MAX_KEY_LENGTH);
uint max_key_length= file->max_key_length();
if (key_length > max_key_length && key->type != Key::FULLTEXT)
{
my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length);
@@ -1140,12 +1140,21 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
alias= table_case_name(create_info, table_name);
file=get_new_handler((TABLE*) 0, create_info->db_type);
#ifdef NOT_USED
/*
if there is a technical reason for a handler not to have support
for temp. tables this code can be re-enabled.
Otherwise, if a handler author has a wish to prohibit usage of
temporary tables for his handler he should implement a check in
::create() method
*/
if ((create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
(file->table_flags() & HA_NO_TEMP_TABLES))
{
my_error(ER_ILLEGAL_HA,MYF(0),table_name);
DBUG_RETURN(-1);
}
#endif
if (mysql_prepare_table(thd, create_info, fields,
keys, tmp_table, db_options, file,
@@ -3398,7 +3407,7 @@ int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt)
current query id */
t->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
if (t->file->rnd_init(1))
if (t->file->ha_rnd_init(1))
protocol->store_null();
else
{
@@ -3426,6 +3435,7 @@ int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt)
crc+= row_crc;
}
protocol->store((ulonglong)crc);
t->file->ha_rnd_end();
}
}
thd->clear_error();