~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
  "FORCE INDEX"
75
75
};
76
76
 
77
 
inline int lex_casecmp(const char *s, const char *t, uint len)
 
77
inline int lex_casecmp(const char *s, const char *t, uint32_t len)
78
78
{
79
79
  while (len-- != 0 &&
80
80
         to_upper_lex[(unsigned char) *s++] == to_upper_lex[(unsigned char) *t++]) ;
86
86
 
87
87
void lex_init(void)
88
88
{
89
 
  uint i;
 
89
  uint32_t i;
90
90
  for (i=0 ; i < array_elements(symbols) ; i++)
91
91
    symbols[i].length=(unsigned char) strlen(symbols[i].name);
92
92
  for (i=0 ; i < array_elements(sql_functions) ; i++)
163
163
  assert(begin_ptr);
164
164
  assert(m_cpp_buf <= begin_ptr && begin_ptr <= m_cpp_buf + m_buf_length);
165
165
 
166
 
  uint body_utf8_length=
 
166
  uint32_t body_utf8_length=
167
167
    (m_buf_length / thd->variables.character_set_client->mbminlen) *
168
168
    my_charset_utf8_bin.mbmaxlen;
169
169
 
378
378
}
379
379
 
380
380
 
381
 
static int find_keyword(Lex_input_stream *lip, uint len, bool function)
 
381
static int find_keyword(Lex_input_stream *lip, uint32_t len, bool function)
382
382
{
383
383
  const char *tok= lip->get_tok_start();
384
384
 
407
407
    1         name isn't a keyword
408
408
*/
409
409
 
410
 
bool is_keyword(const char *name, uint len)
 
410
bool is_keyword(const char *name, uint32_t len)
411
411
{
412
412
  assert(len != 0);
413
413
  return get_hash_symbol(name,len,0)!=0;
421
421
 
422
422
/* make a copy of token before ptr and set yytoklen */
423
423
 
424
 
static LEX_STRING get_token(Lex_input_stream *lip, uint skip, uint length)
 
424
static LEX_STRING get_token(Lex_input_stream *lip, uint32_t skip, uint32_t length)
425
425
{
426
426
  LEX_STRING tmp;
427
427
  lip->yyUnget();                       // ptr points now after last token char
442
442
*/
443
443
 
444
444
static LEX_STRING get_quoted_token(Lex_input_stream *lip,
445
 
                                   uint skip,
446
 
                                   uint length, char quote)
 
445
                                   uint32_t skip,
 
446
                                   uint32_t length, char quote)
447
447
{
448
448
  LEX_STRING tmp;
449
449
  const char *from, *end;
479
479
static char *get_text(Lex_input_stream *lip, int pre_skip, int post_skip)
480
480
{
481
481
  register unsigned char c,sep;
482
 
  uint found_escape=0;
 
482
  uint32_t found_escape=0;
483
483
  const CHARSET_INFO * const cs= lip->m_thd->charset();
484
484
 
485
485
  lip->tok_bitmap= 0;
610
610
*/
611
611
 
612
612
static const char *long_str="2147483647";
613
 
static const uint long_len=10;
 
613
static const uint32_t long_len=10;
614
614
static const char *signed_long_str="-2147483648";
615
615
static const char *int64_t_str="9223372036854775807";
616
 
static const uint int64_t_len=19;
 
616
static const uint32_t int64_t_len=19;
617
617
static const char *signed_int64_t_str="-9223372036854775808";
618
 
static const uint signed_int64_t_len=19;
 
618
static const uint32_t signed_int64_t_len=19;
619
619
static const char *unsigned_int64_t_str="18446744073709551615";
620
 
static const uint unsigned_int64_t_len=20;
 
620
static const uint32_t unsigned_int64_t_len=20;
621
621
 
622
 
static inline uint int_token(const char *str,uint length)
 
622
static inline uint32_t int_token(const char *str,uint32_t length)
623
623
{
624
624
  if (length < long_len)                        // quick normal case
625
625
    return NUM;
641
641
  if (length < long_len)
642
642
    return NUM;
643
643
 
644
 
  uint smaller,bigger;
 
644
  uint32_t smaller,bigger;
645
645
  const char *cmp;
646
646
  if (neg)
647
647
  {
1036
1036
 
1037
1037
    case MY_LEX_USER_VARIABLE_DELIMITER:        // Found quote char
1038
1038
    {
1039
 
      uint double_quotes= 0;
 
1039
      uint32_t double_quotes= 0;
1040
1040
      char quote_char= c;                       // Used char
1041
1041
      while ((c=lip->yyGet()))
1042
1042
      {
1814
1814
bool st_select_lex_node::set_braces(bool value __attribute__((unused)))
1815
1815
{ return 1; }
1816
1816
bool st_select_lex_node::inc_in_sum_expr()           { return 1; }
1817
 
uint st_select_lex_node::get_in_sum_expr()           { return 0; }
 
1817
uint32_t st_select_lex_node::get_in_sum_expr()           { return 0; }
1818
1818
TableList* st_select_lex_node::get_table_list()     { return 0; }
1819
1819
List<Item>* st_select_lex_node::get_item_list()      { return 0; }
1820
1820
TableList *st_select_lex_node::add_table_to_list (THD *thd __attribute__((unused)),
1904
1904
}
1905
1905
 
1906
1906
 
1907
 
uint st_select_lex::get_in_sum_expr()
 
1907
uint32_t st_select_lex::get_in_sum_expr()
1908
1908
{
1909
1909
  return in_sum_expr;
1910
1910
}
1926
1926
}
1927
1927
 
1928
1928
 
1929
 
bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
 
1929
bool st_select_lex::setup_ref_array(THD *thd, uint32_t order_group_num)
1930
1930
{
1931
1931
  if (ref_pointer_array)
1932
1932
    return 0;
1983
1983
    if (order->counter_used)
1984
1984
    {
1985
1985
      char buffer[20];
1986
 
      uint length= snprintf(buffer, 20, "%d", order->counter);
 
1986
      uint32_t length= snprintf(buffer, 20, "%d", order->counter);
1987
1987
      str->append(buffer, length);
1988
1988
    }
1989
1989
    else
2674
2674
  RETURN VALUE
2675
2675
    0 on success, non-zero otherwise
2676
2676
*/
2677
 
bool st_select_lex::add_index_hint (THD *thd, char *str, uint length)
 
2677
bool st_select_lex::add_index_hint (THD *thd, char *str, uint32_t length)
2678
2678
{
2679
2679
  return index_hints->push_front (new (thd->mem_root) 
2680
2680
                                 Index_hint(current_index_hint_type,