~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2010-11-30 00:29:39 UTC
  • mto: (1965.2.2 build)
  • mto: This revision was merged to the branch mainline in revision 1966.
  • Revision ID: brian@tangent.org-20101130002939-8bzz3xpa0aapbq2w
Fix sleep() so that a kill command will kill it.

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/cache.h"
 
42
#include "drizzled/session_list.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->schema()->c_str()));
 
225
                        const_cast<const char *>(session->db.empty() ? "" : session->db.c_str()));
226
226
 
 
227
    plugin::QueryRewriter::rewriteQuery(session->getSchema(), session->getQueryString());
227
228
    mysql_parse(session, session->getQueryString()->c_str(), session->getQueryString()->length());
228
229
 
229
230
    break;
743
744
      {
744
745
        DRIZZLE_QUERY_EXEC_START(session->getQueryString()->c_str(),
745
746
                                 session->thread_id,
746
 
                                 const_cast<const char *>(session->schema()->c_str()));
 
747
                                 const_cast<const char *>(session->db.empty() ? "" : session->db.c_str()));
747
748
        // Implement Views here --Brian
748
749
        /* Actually execute the query */
749
750
        try 
754
755
        {
755
756
          // Just try to catch any random failures that could have come
756
757
          // 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
/**
1545
1576
  negate given expression.
1546
1577
 
1547
1578
  @param session  thread handler