~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/mysql_priv.h

  • Committer: Jay Pipes
  • Date: 2008-08-01 02:41:21 UTC
  • mto: (264.1.6 codestyle)
  • mto: This revision was merged to the branch mainline in revision 247.
  • Revision ID: jay@mysql.com-20080801024121-glz14bu5igeazccb
* Pulled Object_creation_ctx and Default_creation_ctx out of mysql_priv.h
  into drizzled/object_creation_ctx.h

* Pulled qc_* callback out of mysql_priv.h into drizzled/handler.h where it belongs

* Put SQL_LIST into drizzled/sql_list.h where it belongs

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
MY_LOCALE *my_locale_by_name(const char *name);
160
160
MY_LOCALE *my_locale_by_number(uint number);
161
161
 
162
 
/*************************************************************************/
163
 
 
164
 
/**
165
 
 Object_creation_ctx -- interface for creation context of database objects
166
 
 (views, stored routines, events, triggers). Creation context -- is a set
167
 
 of attributes, that should be fixed at the creation time and then be used
168
 
 each time the object is parsed or executed.
169
 
*/
170
 
 
171
 
class Object_creation_ctx
172
 
{
173
 
public:
174
 
  Object_creation_ctx *set_n_backup(THD *thd);
175
 
 
176
 
  void restore_env(THD *thd, Object_creation_ctx *backup_ctx);
177
 
 
178
 
protected:
179
 
  Object_creation_ctx() {}
180
 
  virtual Object_creation_ctx *create_backup_ctx(THD *thd) const = 0;
181
 
 
182
 
  virtual void change_env(THD *thd) const = 0;
183
 
 
184
 
public:
185
 
  virtual ~Object_creation_ctx()
186
 
  { }
187
 
};
188
 
 
189
 
/*************************************************************************/
190
 
 
191
 
/**
192
 
 Default_object_creation_ctx -- default implementation of
193
 
 Object_creation_ctx.
194
 
*/
195
 
 
196
 
class Default_object_creation_ctx : public Object_creation_ctx
197
 
{
198
 
public:
199
 
  CHARSET_INFO *get_client_cs()
200
 
  {
201
 
    return m_client_cs;
202
 
  }
203
 
 
204
 
  CHARSET_INFO *get_connection_cl()
205
 
  {
206
 
    return m_connection_cl;
207
 
  }
208
 
 
209
 
protected:
210
 
  Default_object_creation_ctx(THD *thd);
211
 
 
212
 
  Default_object_creation_ctx(CHARSET_INFO *client_cs,
213
 
                              CHARSET_INFO *connection_cl);
214
 
 
215
 
protected:
216
 
  virtual Object_creation_ctx *create_backup_ctx(THD *thd) const;
217
 
 
218
 
  virtual void change_env(THD *thd) const;
219
 
 
220
 
protected:
221
 
  /**
222
 
    client_cs stores the value of character_set_client session variable.
223
 
    The only character set attribute is used.
224
 
 
225
 
    Client character set is included into query context, because we save
226
 
    query in the original character set, which is client character set. So,
227
 
    in order to parse the query properly we have to switch client character
228
 
    set on parsing.
229
 
  */
230
 
  CHARSET_INFO *m_client_cs;
231
 
 
232
 
  /**
233
 
    connection_cl stores the value of collation_connection session
234
 
    variable. Both character set and collation attributes are used.
235
 
 
236
 
    Connection collation is included into query context, becase it defines
237
 
    the character set and collation of text literals in internal
238
 
    representation of query (item-objects).
239
 
  */
240
 
  CHARSET_INFO *m_connection_cl;
241
 
};
242
 
 
243
 
 
 
162
#include <drizzled/object_creation_ctx.h>
244
163
/**
245
164
  Opening modes for open_temporary_table and open_table_from_share
246
165
*/
494
413
#define MODE_NO_ENGINE_SUBSTITUTION     (MODE_HIGH_NOT_PRECEDENCE*2)
495
414
#define MODE_PAD_CHAR_TO_FULL_LENGTH    (1ULL << 31)
496
415
 
497
 
 
498
416
/* @@optimizer_switch flags */
499
417
#define OPTIMIZER_SWITCH_NO_MATERIALIZATION 1
500
418
#define OPTIMIZER_SWITCH_NO_SEMIJOIN 2
501
419
 
502
 
 
503
420
/*
504
421
  Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
505
422
  use strictly more than 64 bits by adding one more define above, you should
511
428
  in scripts/mysql_system_tables.sql and scripts/mysql_system_tables_fix.sql
512
429
 
513
430
*/
514
 
 
515
431
#define RAID_BLOCK_SIZE 1024
516
432
 
517
433
#define MY_CHARSET_BIN_MB_MAXLEN 1
590
506
  CHECK_FIELD_ERROR_FOR_NULL
591
507
};
592
508
 
593
 
                                  
594
 
/** Struct to handle simple linked lists. */
595
 
typedef struct st_sql_list {
596
 
  uint elements;
597
 
  uchar *first;
598
 
  uchar **next;
599
 
 
600
 
  st_sql_list() {}                              /* Remove gcc warning */
601
 
  inline void empty()
602
 
  {
603
 
    elements=0;
604
 
    first=0;
605
 
    next= &first;
606
 
  }
607
 
  inline void link_in_list(uchar *element,uchar **next_ptr)
608
 
  {
609
 
    elements++;
610
 
    (*next)=element;
611
 
    next= next_ptr;
612
 
    *next=0;
613
 
  }
614
 
  inline void save_and_clear(struct st_sql_list *save)
615
 
  {
616
 
    *save= *this;
617
 
    empty();
618
 
  }
619
 
  inline void push_front(struct st_sql_list *save)
620
 
  {
621
 
    *save->next= first;                         /* link current list last */
622
 
    first= save->first;
623
 
    elements+= save->elements;
624
 
  }
625
 
  inline void push_back(struct st_sql_list *save)
626
 
  {
627
 
    if (save->first)
628
 
    {
629
 
      *next= save->first;
630
 
      next= save->next;
631
 
      elements+= save->elements;
632
 
    }
633
 
  }
634
 
} SQL_LIST;
635
 
 
636
 
 
637
509
extern pthread_key(THD*, THR_THD);
638
510
inline THD *_current_thd(void)
639
511
{
656
528
*/
657
529
extern ulong server_id;
658
530
 
659
 
 
660
 
typedef bool (*qc_engine_callback)(THD *thd, char *table_key,
661
 
                                      uint key_length,
662
 
                                      uint64_t *engine_data);
663
531
#include "sql_string.h"
664
532
#include "sql_list.h"
665
533
#include "sql_map.h"