~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Monty Taylor
  • Date: 2010-02-05 08:11:15 UTC
  • mfrom: (1283 build)
  • mto: (1273.13.43 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: mordred@inaugust.com-20100205081115-dr82nvrwv4lvw7sd
Merged trunk.

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 "config.h"
 
17
 
16
18
#define DRIZZLE_LEX 1
17
 
#include "config.h"
 
19
 
18
20
#include <drizzled/my_hash.h>
19
21
#include <drizzled/error.h>
20
22
#include <drizzled/nested_join.h>
39
41
#include "drizzled/probes.h"
40
42
#include "drizzled/session_list.h"
41
43
#include "drizzled/global_charset_info.h"
42
 
 
 
44
#include "drizzled/transaction_services.h"
43
45
 
44
46
#include "drizzled/plugin/logging.h"
45
47
#include "drizzled/plugin/info_schema_table.h"
53
55
 
54
56
#include "drizzled/internal/my_sys.h"
55
57
 
56
 
using namespace drizzled;
57
58
using namespace std;
58
59
 
 
60
extern int DRIZZLEparse(void *session); // from sql_yacc.cc
 
61
 
 
62
namespace drizzled
 
63
{
 
64
 
59
65
/* Prototypes */
60
66
bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
61
67
static bool parse_sql(Session *session, Lex_input_stream *lip);
251
257
 
252
258
  /* If commit fails, we should be able to reset the OK status. */
253
259
  session->main_da.can_overwrite_status= true;
254
 
  ha_autocommit_or_rollback(session, session->is_error());
 
260
  TransactionServices &transaction_services= TransactionServices::singleton();
 
261
  transaction_services.ha_autocommit_or_rollback(session, session->is_error());
255
262
  session->main_da.can_overwrite_status= false;
256
263
 
257
264
  session->transaction.stmt.reset();
859
866
{
860
867
  register CreateField *new_field;
861
868
  LEX  *lex= session->lex;
862
 
  drizzled::statement::AlterTable *statement= (drizzled::statement::AlterTable *)lex->statement;
 
869
  statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
863
870
 
864
871
  if (check_identifier_name(field_name, ER_TOO_LONG_IDENT))
865
872
    return true;
1706
1713
    my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", INFORMATION_SCHEMA_NAME.c_str());
1707
1714
    return true;
1708
1715
  }
1709
 
  if (strcmp(identifier.getDBName(), DATA_DICTIONARY) == 0)
 
1716
  if (strcmp(identifier.getDBName(), DRIZZLE_DATA_DICTIONARY) == 0)
1710
1717
  {
1711
 
    my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", DATA_DICTIONARY);
 
1718
    my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", DRIZZLE_DATA_DICTIONARY);
1712
1719
    return true;
1713
1720
  }
1714
1721
 
1824
1831
  return true;
1825
1832
}
1826
1833
 
1827
 
extern int DRIZZLEparse(void *session); // from sql_yacc.cc
1828
 
 
1829
1834
 
1830
1835
/**
1831
1836
  This is a wrapper of DRIZZLEparse(). All the code should call parse_sql()
1871
1876
/**
1872
1877
  @} (end of group Runtime_Environment)
1873
1878
*/
 
1879
 
 
1880
} /* namespace drizzled */