mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Fixes for MERGE TABLES and HEAP tables
Docs/manual.texi: Updated MERGE table stuff + more extra/perror.c: Added missing error messages include/myisammrg.h: Fixes for MERGE TABLE include/queues.h: Fixes for MERGE TABLE isam/isamlog.c: Fixed hard bug myisam/mi_log.c: cleanup myisam/mi_open.c: Fixed file name format in myisam log myisam/myisamlog.c: Bug fixes myisammrg/mymrgdef.h: Fixes for MERGE TABLE myisammrg/myrg_create.c: Fixes for MERGE TABLE myisammrg/myrg_open.c: Fixes for MERGE TABLE myisammrg/myrg_queue.c: Fixes for MERGE TABLE myisammrg/myrg_rfirst.c: Fixes for MERGE TABLE myisammrg/myrg_rkey.c: Fixes for MERGE TABLE myisammrg/myrg_rlast.c: Fixes for MERGE TABLE myisammrg/myrg_rnext.c: Fixes for MERGE TABLE myisammrg/myrg_rprev.c: Fixes for MERGE TABLE myisammrg/myrg_rrnd.c: Fixes for MERGE TABLE mysql.proj: update mysys/queues.c: Fixed bug when using reverse queues sql-bench/test-insert.sh: Separated some things to get better timings sql/ha_heap.cc: Fixed heap table bug sql/ha_heap.h: Fixed heap table bug sql/ha_myisam.h: Fixed wrong max_keys sql/ha_myisammrg.cc: Fixed MERGE TABLES sql/ha_myisammrg.h: Fixed MERGE TABLES sql/handler.h: Fix for MERGE TABLES and HEAP tables sql/lex.h: Fixed MERGE TABLES sql/mysql_priv.h: Cleanup of code sql/sql_acl.cc: Fixed that privilege tables are flushed at start sql/sql_lex.h: Fixed MERGE TABLES sql/sql_parse.cc: Fixed MERGE TABLES sql/sql_select.cc: Fixes for HEAP tables sql/sql_table.cc: Cleanup sql/sql_yacc.yy: Fixed MERGE TABLES
This commit is contained in:
parent
9e37676d7c
commit
d5964ba20c
35 changed files with 408 additions and 239 deletions
|
|
@ -16,6 +16,17 @@
|
|||
|
||||
/* Read record based on a key */
|
||||
|
||||
/*
|
||||
* HA_READ_KEY_EXACT => SEARCH_BIGGER
|
||||
* HA_READ_KEY_OR_NEXT => SEARCH_BIGGER
|
||||
* HA_READ_AFTER_KEY => SEARCH_BIGGER
|
||||
* HA_READ_PREFIX => SEARCH_BIGGER
|
||||
* HA_READ_KEY_OR_PREV => SEARCH_SMALLER
|
||||
* HA_READ_BEFORE_KEY => SEARCH_SMALLER
|
||||
* HA_READ_PREFIX_LAST => SEARCH_SMALLER
|
||||
*/
|
||||
|
||||
|
||||
#include "mymrgdef.h"
|
||||
|
||||
/* todo: we could store some additional info to speedup lookups:
|
||||
|
|
@ -33,7 +44,7 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key,
|
|||
MYRG_TABLE *table;
|
||||
MI_INFO *mi;
|
||||
int err;
|
||||
byte *buf=((search_flag == HA_READ_KEY_EXACT)?record:0);
|
||||
byte *buf=((search_flag == HA_READ_KEY_EXACT) ? record: 0);
|
||||
|
||||
if (_myrg_init_queue(info,inx,search_flag))
|
||||
return my_errno;
|
||||
|
|
@ -52,13 +63,14 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key,
|
|||
{
|
||||
err=_mi_rkey(mi,buf,inx,key_buff,pack_key_length,search_flag,FALSE);
|
||||
}
|
||||
info->last_used_table=table;
|
||||
info->last_used_table=table+1;
|
||||
|
||||
if (err == HA_ERR_KEY_NOT_FOUND)
|
||||
continue;
|
||||
if (err)
|
||||
{
|
||||
if (err == HA_ERR_KEY_NOT_FOUND)
|
||||
continue;
|
||||
return err;
|
||||
|
||||
}
|
||||
/* adding to queue */
|
||||
queue_insert(&(info->by_key),(byte *)table);
|
||||
|
||||
|
|
@ -76,14 +88,3 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key,
|
|||
mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table;
|
||||
return mi_rrnd(mi,record,mi->lastpos);
|
||||
}
|
||||
|
||||
/*
|
||||
* HA_READ_KEY_EXACT => SEARCH_BIGGER
|
||||
* HA_READ_KEY_OR_NEXT => SEARCH_BIGGER
|
||||
* HA_READ_AFTER_KEY => SEARCH_BIGGER
|
||||
* HA_READ_PREFIX => SEARCH_BIGGER
|
||||
* HA_READ_KEY_OR_PREV => SEARCH_SMALLER
|
||||
* HA_READ_BEFORE_KEY => SEARCH_SMALLER
|
||||
* HA_READ_PREFIX_LAST => SEARCH_SMALLER
|
||||
*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue