~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_keycache.cc

  • Committer: Monty Taylor
  • Date: 2009-10-13 06:22:10 UTC
  • mfrom: (1182 staging)
  • mto: This revision was merged to the branch mainline in revision 1184.
  • Revision ID: mordred@inaugust.com-20091013062210-iwnwwcdamjdvlx1m
Merged up with build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2003 MySQL AB
2
 
 
3
 
   This program is free software; you can redistribute it and/or modify
4
 
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; version 2 of the License.
6
 
 
7
 
   This program is distributed in the hope that it will be useful,
8
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
   GNU General Public License for more details.
11
 
 
12
 
   You should have received a copy of the GNU General Public License
13
 
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
 
 
16
 
/*
17
 
  Key cache assignments
18
 
*/
19
 
 
20
 
#include "myisam_priv.h"
21
 
 
22
 
using namespace std;
23
 
 
24
 
/*
25
 
  Assign pages of the index file for a table to a key cache
26
 
 
27
 
  SYNOPSIS
28
 
    mi_assign_to_key_cache()
29
 
      info          open table
30
 
      key_cache_ptr pointer to the key cache handle
31
 
      assign_lock   Mutex to lock during assignment
32
 
 
33
 
  PREREQUESTS
34
 
    One must have a READ lock or a WRITE lock on the table when calling
35
 
    the function to ensure that there is no other writers to it.
36
 
 
37
 
    The caller must also ensure that one doesn't call this function from
38
 
    two different threads with the same table.
39
 
 
40
 
  NOTES
41
 
    At present pages for all indexes must be assigned to the same key cache.
42
 
 
43
 
  RETURN VALUE
44
 
    0  If a success
45
 
    #  Error code
46
 
*/
47
 
 
48
 
int mi_assign_to_key_cache(MI_INFO *, KEY_CACHE *) 
49
 
{
50
 
  return 0;
51
 
}
52
 
 
53
 
 
54
 
/*
55
 
  Change all MyISAM entries that uses one key cache to another key cache
56
 
 
57
 
  SYNOPSIS
58
 
    mi_change_key_cache()
59
 
    old_key_cache       Old key cache
60
 
    new_key_cache       New key cache
61
 
 
62
 
  NOTES
63
 
    This is used when we delete one key cache.
64
 
 
65
 
    To handle the case where some other threads tries to open an MyISAM
66
 
    table associated with the to-be-deleted key cache while this operation
67
 
    is running, we have to call 'multi_key_cache_change()' from this
68
 
    function while we have a lock on the MyISAM table list structure.
69
 
 
70
 
    This is safe as long as it's only MyISAM that is using this specific
71
 
    key cache.
72
 
*/
73
 
 
74
 
 
75
 
void mi_change_key_cache(KEY_CACHE *, KEY_CACHE *)
76
 
{
77
 
}