~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/rpl_tblmap.cc

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "mysql_priv.h"
17
 
 
18
 
#ifdef HAVE_REPLICATION
 
16
#include <drizzled/server_includes.h>
19
17
 
20
18
#include "rpl_tblmap.h"
21
19
 
46
44
  free_root(&m_mem_root, MYF(0));
47
45
}
48
46
 
49
 
st_table* table_mapping::get_table(ulong table_id)
 
47
Table* table_mapping::get_table(ulong table_id)
50
48
{
51
49
  entry *e= find_entry(table_id);
52
50
  if (e) 
83
81
  return 0;
84
82
}
85
83
 
86
 
int table_mapping::set_table(ulong table_id, TABLE* table)
 
84
int table_mapping::set_table(ulong table_id, Table* table)
87
85
{
88
86
  entry *e= find_entry(table_id);
89
87
  if (e == 0)
94
92
    m_free= m_free->next;
95
93
  }
96
94
  else
97
 
    hash_delete(&m_table_ids,(uchar *)e);
 
95
    hash_delete(&m_table_ids,(unsigned char *)e);
98
96
 
99
97
  e->table_id= table_id;
100
98
  e->table= table;
101
 
  my_hash_insert(&m_table_ids,(uchar *)e);
 
99
  my_hash_insert(&m_table_ids,(unsigned char *)e);
102
100
 
103
101
  return(0);            // All OK
104
102
}
108
106
  entry *e= find_entry(table_id);
109
107
  if (e)
110
108
  {
111
 
    hash_delete(&m_table_ids,(uchar *)e);
 
109
    hash_delete(&m_table_ids,(unsigned char *)e);
112
110
    /* we add this entry to the chain of free (free for use) entries */
113
111
    e->next= m_free;
114
112
    m_free= e;
123
121
*/
124
122
void table_mapping::clear_tables()
125
123
{
126
 
  for (uint i= 0; i < m_table_ids.records; i++)
 
124
  for (uint32_t i= 0; i < m_table_ids.records; i++)
127
125
  {
128
126
    entry *e= (entry *)hash_element(&m_table_ids, i);
129
127
    e->next= m_free;
132
130
  my_hash_reset(&m_table_ids);
133
131
  return;
134
132
}
135
 
 
136
 
#endif