~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Monty Taylor
  • Date: 2008-12-10 07:43:50 UTC
  • mto: (670.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 672.
  • Revision ID: monty@inaugust.com-20081210074350-wi2y2piv23ko707h
Removed more stuff from the headers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <drizzled/show.h>
31
31
#include <drizzled/rename.h>
32
32
#include <drizzled/functions/time/unix_timestamp.h>
 
33
#include <drizzled/functions/get_system_var.h>
33
34
#include <drizzled/item/cmpfunc.h>
34
35
#include <drizzled/session.h>
35
36
#include <drizzled/sql_load.h>
36
 
/* API for connecting, logging in to a drizzled server */
37
37
#include <drizzled/connect.h>
 
38
#include <drizzled/lock.h>
38
39
#include <bitset>
39
40
 
40
41
using namespace std;
2386
2387
  return res;
2387
2388
}
2388
2389
 
2389
 
/****************************************************************************
2390
 
        Check stack size; Send error if there isn't enough stack to continue
2391
 
****************************************************************************/
2392
 
#if STACK_DIRECTION < 0
2393
 
#define used_stack(A,B) (long) (A - B)
2394
 
#else
2395
 
#define used_stack(A,B) (long) (B - A)
2396
 
#endif
2397
 
 
2398
 
/**
2399
 
  @note
2400
 
  Note: The 'buf' parameter is necessary, even if it is unused here.
2401
 
  - fix_fields functions has a "dummy" buffer large enough for the
2402
 
    corresponding exec. (Thus we only have to check in fix_fields.)
2403
 
  - Passing to check_stack_overrun() prevents the compiler from removing it.
2404
 
*/
2405
 
bool check_stack_overrun(Session *session, long margin, unsigned char *)
2406
 
{
2407
 
  long stack_used;
2408
 
  assert(session == current_session);
2409
 
  if ((stack_used=used_stack(session->thread_stack,(char*) &stack_used)) >=
2410
 
      (long) (my_thread_stack_size - margin))
2411
 
  {
2412
 
    sprintf(errbuff[0],ER(ER_STACK_OVERRUN_NEED_MORE),
2413
 
            stack_used,my_thread_stack_size,margin);
2414
 
    my_message(ER_STACK_OVERRUN_NEED_MORE,errbuff[0],MYF(ME_FATALERROR));
2415
 
    return 1;
2416
 
  }
2417
 
  return 0;
2418
 
}
2419
2390
 
2420
2391
#define MY_YACC_INIT 1000                       // Start with big alloc
2421
2392
#define MY_YACC_MAX  32000                      // Because of 'short'