~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.h

  • Committer: Brian Aker
  • Date: 2008-11-13 02:56:15 UTC
  • mfrom: (575.4.10 devel)
  • Revision ID: brian@tangent.org-20081113025615-snhsi52yb2ivmx6f
Merging Monty's code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
#endif
55
55
#endif
56
56
 
57
 
/*
58
 
  When a command is added here, be sure it's also added in mysqld.cc
59
 
  in "struct show_var_st status_vars[]= {" ...
60
 
 
61
 
  If the command returns a result set or is not allowed in stored
62
 
  functions or triggers, please also make sure that
63
 
  sp_get_flags_for_command (sp_head.cc) returns proper flags for the
64
 
  added SQLCOM_.
65
 
*/
66
 
 
67
 
enum enum_sql_command {
68
 
  SQLCOM_SELECT, SQLCOM_CREATE_TABLE, SQLCOM_CREATE_INDEX, SQLCOM_ALTER_TABLE,
69
 
  SQLCOM_UPDATE, SQLCOM_INSERT, SQLCOM_INSERT_SELECT,
70
 
  SQLCOM_DELETE, SQLCOM_TRUNCATE, SQLCOM_DROP_TABLE, SQLCOM_DROP_INDEX,
71
 
  SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
72
 
  SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_STATUS,
73
 
  SQLCOM_SHOW_ENGINE_LOGS, SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_MUTEX,
74
 
  SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
75
 
  SQLCOM_SHOW_CREATE,
76
 
  SQLCOM_SHOW_CREATE_DB,
77
 
  SQLCOM_SHOW_TABLE_STATUS,
78
 
  SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES,
79
 
  SQLCOM_CHANGE_DB, SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB,
80
 
  SQLCOM_REPAIR, SQLCOM_REPLACE, SQLCOM_REPLACE_SELECT,
81
 
  SQLCOM_OPTIMIZE, SQLCOM_CHECK,
82
 
  SQLCOM_ASSIGN_TO_KEYCACHE,
83
 
  SQLCOM_FLUSH, SQLCOM_KILL, SQLCOM_ANALYZE,
84
 
  SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT,
85
 
  SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT,
86
 
  SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP,
87
 
  SQLCOM_BEGIN, SQLCOM_CHANGE_MASTER,
88
 
  SQLCOM_RENAME_TABLE,  
89
 
  SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS,
90
 
  SQLCOM_SHOW_OPEN_TABLES,
91
 
  SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
92
 
  SQLCOM_SHOW_WARNS,
93
 
  SQLCOM_EMPTY_QUERY,
94
 
  SQLCOM_SHOW_ERRORS,
95
 
  SQLCOM_CHECKSUM,
96
 
  SQLCOM_BINLOG_BASE64_EVENT,
97
 
  SQLCOM_SHOW_PLUGINS,
98
 
  /*
99
 
    When a command is added here, be sure it's also added in mysqld.cc
100
 
    in "struct show_var_st status_vars[]= {" ...
101
 
  */
102
 
  /* This should be the last !!! */
103
 
  SQLCOM_END
104
 
};
105
 
 
106
57
// describe/explain types
107
58
#define DESCRIBE_NORMAL         1
108
59
#define DESCRIBE_EXTENDED       2
316
267
    Base class for st_select_lex (SELECT_LEX) & 
317
268
    st_select_lex_unit (SELECT_LEX_UNIT)
318
269
*/
319
 
struct st_lex;
 
270
class LEX;
320
271
class st_select_lex;
321
272
class st_select_lex_unit;
322
273
class st_select_lex_node {
384
335
  {}
385
336
 
386
337
  friend class st_select_lex_unit;
387
 
  friend bool mysql_new_select(struct st_lex *lex, bool move_down);
 
338
  friend bool mysql_new_select(LEX *lex, bool move_down);
388
339
private:
389
340
  void fast_exclude();
390
341
};
502
453
  /* Saved values of the WHERE and HAVING clauses*/
503
454
  Item::cond_result cond_value, having_value;
504
455
  /* point on lex in which it was created, used in view subquery detection */
505
 
  st_lex *parent_lex;
 
456
  LEX *parent_lex;
506
457
  enum olap_type olap;
507
458
  /* FROM clause - points to the beginning of the TableList::next_local list. */
508
459
  SQL_LIST            table_list;
1363
1314
 
1364
1315
/* The state of the lex parsing. This is saved in the Session struct */
1365
1316
 
1366
 
typedef struct st_lex : public Query_tables_list
 
1317
class LEX : public Query_tables_list
1367
1318
{
 
1319
public: 
1368
1320
  SELECT_LEX_UNIT unit;                         /* most upper unit */
1369
1321
  SELECT_LEX select_lex;                        /* first SELECT_LEX */
1370
1322
  /* current SELECT_LEX in parsing */
1521
1473
  bool escape_used;
1522
1474
  bool is_lex_started; /* If lex_start() did run. For debugging. */
1523
1475
 
1524
 
  st_lex();
 
1476
  LEX();
1525
1477
 
1526
 
  virtual ~st_lex()
 
1478
  virtual ~LEX()
1527
1479
  {
1528
1480
    destroy_query_tables_list();
1529
1481
    plugin_unlock_list(NULL, (plugin_ref *)plugins.buffer, plugins.elements);
1589
1541
    }
1590
1542
    return false;
1591
1543
  }
1592
 
} LEX;
 
1544
};
1593
1545
 
1594
 
struct st_lex_local: public st_lex
 
1546
struct st_lex_local: public LEX
1595
1547
{
1596
1548
  static void *operator new(size_t size) throw()
1597
1549
  {