~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2010-12-18 00:43:02 UTC
  • Revision ID: brian@tangent.org-20101218004302-4ivzuuzdkblyqe18
Refactor naming for integers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <drizzled/statement.h>
40
40
#include <drizzled/statement/alter_table.h>
41
41
#include "drizzled/probes.h"
42
 
#include "drizzled/session_list.h"
 
42
#include "drizzled/session/cache.h"
43
43
#include "drizzled/global_charset_info.h"
44
44
 
45
45
#include "drizzled/plugin/logging.h"
222
222
      break;                                    // fatal error is set
223
223
    DRIZZLE_QUERY_START(session->getQueryString()->c_str(),
224
224
                        session->thread_id,
225
 
                        const_cast<const char *>(session->db.empty() ? "" : session->db.c_str()));
 
225
                        const_cast<const char *>(session->schema()->c_str()));
226
226
 
227
 
    plugin::QueryRewriter::rewriteQuery(session->getSchema(), session->getQueryString());
228
227
    mysql_parse(session, session->getQueryString()->c_str(), session->getQueryString()->length());
229
228
 
230
229
    break;
744
743
      {
745
744
        DRIZZLE_QUERY_EXEC_START(session->getQueryString()->c_str(),
746
745
                                 session->thread_id,
747
 
                                 const_cast<const char *>(session->db.empty() ? "" : session->db.c_str()));
 
746
                                 const_cast<const char *>(session->schema()->c_str()));
748
747
        // Implement Views here --Brian
749
748
        /* Actually execute the query */
750
749
        try 
755
754
        {
756
755
          // Just try to catch any random failures that could have come
757
756
          // during execution.
 
757
          unireg_abort(1);
758
758
        }
759
759
        DRIZZLE_QUERY_EXEC_DONE(0);
760
760
      }
1542
1542
 
1543
1543
 
1544
1544
/**
1545
 
  CREATE TABLE query pre-check.
1546
 
 
1547
 
  @param session                        Thread handler
1548
 
  @param tables         Global table list
1549
 
  @param create_table           Table which will be created
1550
 
 
1551
 
  @retval
1552
 
    false   OK
1553
 
  @retval
1554
 
    true   Error
1555
 
*/
1556
 
 
1557
 
bool create_table_precheck(TableIdentifier &identifier)
1558
 
{
1559
 
  if (not plugin::StorageEngine::canCreateTable(identifier))
1560
 
  {
1561
 
    my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", identifier.getSchemaName().c_str());
1562
 
    return true;
1563
 
  }
1564
 
 
1565
 
  if (not plugin::StorageEngine::doesSchemaExist(identifier))
1566
 
  {
1567
 
    my_error(ER_BAD_DB_ERROR, MYF(0), identifier.getSchemaName().c_str());
1568
 
    return true;
1569
 
  }
1570
 
 
1571
 
  return false;
1572
 
}
1573
 
 
1574
 
 
1575
 
/**
1576
1545
  negate given expression.
1577
1546
 
1578
1547
  @param session  thread handler