~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.cc

  • Committer: Siddharth Prakash Singh
  • Date: 2010-03-26 17:24:57 UTC
  • mto: This revision was merged to the branch mainline in revision 1425.
  • Revision ID: spsneo@spsneo-laptop-20100326172457-vni09y22ktvvefmn
some more sprintf --> snprintf

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
  You should have received a copy of the GNU General Public License
13
13
  along with this program; if not, write to the Free Software
14
 
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "config.h"
17
17
 
34
34
class Item;
35
35
class Item_field;
36
36
 
37
 
bool TableList::set_insert_values(memory::Root *)
 
37
uint32_t TableList::create_table_def_key(char *key)
 
38
{
 
39
  return TableShare::createKey(key, db, table_name);
 
40
}
 
41
 
 
42
bool TableList::set_insert_values(memory::Root *mem_root)
38
43
{
39
44
  if (table)
40
45
  {
41
 
    table->insert_values.resize(table->getShare()->rec_buff_length);
 
46
    if (!table->insert_values &&
 
47
        !(table->insert_values= (unsigned char *)alloc_root(mem_root,
 
48
                                                   table->s->rec_buff_length)))
 
49
      return true;
42
50
  }
43
51
 
44
52
  return false;
58
66
  return NULL;
59
67
}
60
68
 
61
 
bool TableList::isCartesian() const
62
 
{
63
 
  return false;
64
 
}
65
 
 
66
69
bool TableList::placeholder()
67
70
{
68
71
  return derived || (create && !table->getDBStat()) || !table;
153
156
{
154
157
  /* initialize the result variables */
155
158
  tbl->keys_in_use_for_query= tbl->keys_in_use_for_group_by=
156
 
    tbl->keys_in_use_for_order_by= tbl->getShare()->keys_in_use;
 
159
    tbl->keys_in_use_for_order_by= tbl->s->keys_in_use;
157
160
 
158
161
  /* index hint list processing */
159
162
  if (index_hints)
178
181
    /* iterate over the hints list */
179
182
    while ((hint= iter++))
180
183
    {
181
 
      uint32_t pos= 0;
 
184
      uint32_t pos;
182
185
 
183
186
      /* process empty USE INDEX () */
184
187
      if (hint->type == INDEX_HINT_USE && !hint->key_name.str)
205
208
        Check if an index with the given name exists and get his offset in
206
209
        the keys bitmask for the table
207
210
      */
208
 
      if (not tbl->getShare()->doesKeyNameExist(hint->key_name.str, hint->key_name.length, pos))
 
211
      if (tbl->s->keynames.type_names == 0 ||
 
212
          (pos= find_type(&tbl->s->keynames, hint->key_name.str,
 
213
                          hint->key_name.length, 1)) <= 0)
209
214
      {
210
215
        my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), hint->key_name.str, alias);
211
216
        return 1;
212
217
      }
 
218
 
 
219
      pos--;
 
220
 
213
221
      /* add to the appropriate clause mask */
214
222
      if (hint->clause & INDEX_HINT_MASK_JOIN)
215
223
        index_join[hint->type].set(pos);