~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/rpl_tblmap.cc

  • Committer: Brian Aker
  • Date: 2008-07-10 19:37:55 UTC
  • mfrom: (51.1.67 remove-dbug)
  • Revision ID: brian@tangent.org-20080710193755-f5g761uieqa3wxmt
Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
st_table* table_mapping::get_table(ulong table_id)
50
50
{
51
 
  DBUG_ENTER("table_mapping::get_table(ulong)");
52
 
  DBUG_PRINT("enter", ("table_id: %lu", table_id));
53
51
  entry *e= find_entry(table_id);
54
52
  if (e) 
55
53
  {
56
 
    DBUG_PRINT("info", ("tid %lu -> table 0x%lx (%s)", 
57
 
                        table_id, (long) e->table,
58
 
                        MAYBE_TABLE_NAME(e->table)));
59
 
    DBUG_RETURN(e->table);
 
54
    return(e->table);
60
55
  }
61
56
 
62
 
  DBUG_PRINT("info", ("tid %lu is not mapped!", table_id));
63
 
  DBUG_RETURN(NULL);
 
57
  return(NULL);
64
58
}
65
59
 
66
60
/*
91
85
 
92
86
int table_mapping::set_table(ulong table_id, TABLE* table)
93
87
{
94
 
  DBUG_ENTER("table_mapping::set_table(ulong,TABLE*)");
95
 
  DBUG_PRINT("enter", ("table_id: %lu  table: 0x%lx (%s)", 
96
 
                       table_id, 
97
 
                       (long) table, MAYBE_TABLE_NAME(table)));
98
88
  entry *e= find_entry(table_id);
99
89
  if (e == 0)
100
90
  {
101
91
    if (m_free == 0 && expand())
102
 
      DBUG_RETURN(ERR_MEMORY_ALLOCATION); // Memory allocation failed      
 
92
      return(ERR_MEMORY_ALLOCATION); // Memory allocation failed      
103
93
    e= m_free;
104
94
    m_free= m_free->next;
105
95
  }
110
100
  e->table= table;
111
101
  my_hash_insert(&m_table_ids,(uchar *)e);
112
102
 
113
 
  DBUG_PRINT("info", ("tid %lu -> table 0x%lx (%s)", 
114
 
                      table_id, (long) e->table,
115
 
                      MAYBE_TABLE_NAME(e->table)));
116
 
  DBUG_RETURN(0);               // All OK
 
103
  return(0);            // All OK
117
104
}
118
105
 
119
106
int table_mapping::remove_table(ulong table_id)
136
123
*/
137
124
void table_mapping::clear_tables()
138
125
{
139
 
  DBUG_ENTER("table_mapping::clear_tables()");
140
126
  for (uint i= 0; i < m_table_ids.records; i++)
141
127
  {
142
128
    entry *e= (entry *)hash_element(&m_table_ids, i);
144
130
    m_free= e;
145
131
  }
146
132
  my_hash_reset(&m_table_ids);
147
 
  DBUG_VOID_RETURN;
 
133
  return;
148
134
}
149
135
 
150
136
#endif