~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:
16
16
 
17
17
/* A lexical scanner on a temporary buffer with a yacc interface */
18
18
 
19
 
#define MYSQL_LEX 1
20
 
#include "mysql_priv.h"
21
 
#include "item_create.h"
22
 
#include <m_ctype.h>
23
 
#include <hash.h>
 
19
#define DRIZZLE_LEX 1
 
20
#include <drizzled/server_includes.h>
24
21
 
25
22
static int lex_one_token(void *arg, void *yythd);
26
23
 
45
42
  used when comparing keywords
46
43
*/
47
44
 
48
 
static uchar to_upper_lex[]=
 
45
static unsigned char to_upper_lex[]=
49
46
{
50
47
    0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
51
48
   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
77
74
  "FORCE INDEX"
78
75
};
79
76
 
80
 
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)
81
78
{
82
79
  while (len-- != 0 &&
83
 
         to_upper_lex[(uchar) *s++] == to_upper_lex[(uchar) *t++]) ;
 
80
         to_upper_lex[(unsigned char) *s++] == to_upper_lex[(unsigned char) *t++]) ;
84
81
  return (int) len+1;
85
82
}
86
83
 
89
86
 
90
87
void lex_init(void)
91
88
{
92
 
  uint i;
 
89
  uint32_t i;
93
90
  for (i=0 ; i < array_elements(symbols) ; i++)
94
 
    symbols[i].length=(uchar) strlen(symbols[i].name);
 
91
    symbols[i].length=(unsigned char) strlen(symbols[i].name);
95
92
  for (i=0 ; i < array_elements(sql_functions) ; i++)
96
 
    sql_functions[i].length=(uchar) strlen(sql_functions[i].name);
 
93
    sql_functions[i].length=(unsigned char) strlen(sql_functions[i].name);
97
94
 
98
95
  return;
99
96
}
166
163
  assert(begin_ptr);
167
164
  assert(m_cpp_buf <= begin_ptr && begin_ptr <= m_cpp_buf + m_buf_length);
168
165
 
169
 
  uint body_utf8_length=
 
166
  uint32_t body_utf8_length=
170
167
    (m_buf_length / thd->variables.character_set_client->mbminlen) *
171
168
    my_charset_utf8_bin.mbmaxlen;
172
169
 
246
243
 
247
244
void Lex_input_stream::body_utf8_append_literal(THD *thd,
248
245
                                                const LEX_STRING *txt,
249
 
                                                CHARSET_INFO *txt_cs,
 
246
                                                const CHARSET_INFO * const txt_cs,
250
247
                                                const char *end_ptr)
251
248
{
252
249
  if (!m_cpp_utf8_processed_ptr)
342
339
  lex->in_sum_func= NULL;
343
340
  /*
344
341
    ok, there must be a better solution for this, long-term
345
 
    I tried "bzero" in the sql_yacc.yy code, but that for
 
342
    I tried "memset" in the sql_yacc.yy code, but that for
346
343
    some reason made the values zero, even if they were set
347
344
  */
348
345
  lex->server_options.server_name= 0;
352
349
  lex->server_options.username= 0;
353
350
  lex->server_options.password= 0;
354
351
  lex->server_options.scheme= 0;
355
 
  lex->server_options.socket= 0;
356
352
  lex->server_options.owner= 0;
357
353
  lex->server_options.port= -1;
358
354
 
364
360
{
365
361
  if (lex->yacc_yyss)
366
362
  {
367
 
    my_free(lex->yacc_yyss, MYF(0));
368
 
    my_free(lex->yacc_yyvs, MYF(0));
 
363
    free(lex->yacc_yyss);
 
364
    free(lex->yacc_yyvs);
369
365
    lex->yacc_yyss= 0;
370
366
    lex->yacc_yyvs= 0;
371
367
  }
375
371
                     lex->plugins.elements);
376
372
  reset_dynamic(&lex->plugins);
377
373
 
 
374
  delete lex->result;
 
375
  lex->result= 0;
 
376
 
378
377
  return;
379
378
}
380
379
 
381
380
 
382
 
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)
383
382
{
384
383
  const char *tok= lip->get_tok_start();
385
384
 
408
407
    1         name isn't a keyword
409
408
*/
410
409
 
411
 
bool is_keyword(const char *name, uint len)
 
410
bool is_keyword(const char *name, uint32_t len)
412
411
{
413
412
  assert(len != 0);
414
413
  return get_hash_symbol(name,len,0)!=0;
422
421
 
423
422
/* make a copy of token before ptr and set yytoklen */
424
423
 
425
 
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)
426
425
{
427
426
  LEX_STRING tmp;
428
427
  lip->yyUnget();                       // ptr points now after last token char
443
442
*/
444
443
 
445
444
static LEX_STRING get_quoted_token(Lex_input_stream *lip,
446
 
                                   uint skip,
447
 
                                   uint length, char quote)
 
445
                                   uint32_t skip,
 
446
                                   uint32_t length, char quote)
448
447
{
449
448
  LEX_STRING tmp;
450
449
  const char *from, *end;
479
478
 
480
479
static char *get_text(Lex_input_stream *lip, int pre_skip, int post_skip)
481
480
{
482
 
  register uchar c,sep;
483
 
  uint found_escape=0;
484
 
  CHARSET_INFO *cs= lip->m_thd->charset();
 
481
  register unsigned char c,sep;
 
482
  uint32_t found_escape=0;
 
483
  const CHARSET_INFO * const cs= lip->m_thd->charset();
485
484
 
486
485
  lip->tok_bitmap= 0;
487
486
  sep= lip->yyGetLast();                        // String should end with this
557
556
              continue;
558
557
          }
559
558
#endif
560
 
          if (!(lip->m_thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
561
 
              *str == '\\' && str+1 != end)
 
559
          if (*str == '\\' && str+1 != end)
562
560
          {
563
561
            switch(*++str) {
564
562
            case 'n':
612
610
*/
613
611
 
614
612
static const char *long_str="2147483647";
615
 
static const uint long_len=10;
 
613
static const uint32_t long_len=10;
616
614
static const char *signed_long_str="-2147483648";
617
615
static const char *int64_t_str="9223372036854775807";
618
 
static const uint int64_t_len=19;
 
616
static const uint32_t int64_t_len=19;
619
617
static const char *signed_int64_t_str="-9223372036854775808";
620
 
static const uint signed_int64_t_len=19;
 
618
static const uint32_t signed_int64_t_len=19;
621
619
static const char *unsigned_int64_t_str="18446744073709551615";
622
 
static const uint unsigned_int64_t_len=20;
 
620
static const uint32_t unsigned_int64_t_len=20;
623
621
 
624
 
static inline uint int_token(const char *str,uint length)
 
622
static inline uint32_t int_token(const char *str,uint32_t length)
625
623
{
626
624
  if (length < long_len)                        // quick normal case
627
625
    return NUM;
643
641
  if (length < long_len)
644
642
    return NUM;
645
643
 
646
 
  uint smaller,bigger;
 
644
  uint32_t smaller,bigger;
647
645
  const char *cmp;
648
646
  if (neg)
649
647
  {
690
688
    }
691
689
  }
692
690
  while (*cmp && *cmp++ == *str++) ;
693
 
  return ((uchar) str[-1] <= (uchar) cmp[-1]) ? smaller : bigger;
 
691
  return ((unsigned char) str[-1] <= (unsigned char) cmp[-1]) ? smaller : bigger;
694
692
}
695
693
 
696
694
 
727
725
  switch(token) {
728
726
  case WITH:
729
727
    /*
730
 
      Parsing 'WITH' 'ROLLUP' or 'WITH' 'CUBE' requires 2 look ups,
 
728
      Parsing 'WITH' 'ROLLUP' requires 2 look ups,
731
729
      which makes the grammar LALR(2).
732
730
      Replace by a single 'WITH_ROLLUP' or 'WITH_CUBE' token,
733
731
      to transform the grammar into a LALR(1) grammar,
734
732
      which sql_yacc.yy can process.
735
733
    */
736
734
    token= lex_one_token(arg, yythd);
737
 
    switch(token) {
738
 
    case CUBE_SYM:
739
 
      return WITH_CUBE_SYM;
740
 
    case ROLLUP_SYM:
 
735
    if (token == ROLLUP_SYM)
 
736
    {
741
737
      return WITH_ROLLUP_SYM;
742
 
    default:
 
738
    }
 
739
    else
 
740
    {
743
741
      /*
744
742
        Save the token following 'WITH'
745
743
      */
767
765
  Lex_input_stream *lip= thd->m_lip;
768
766
  LEX *lex= thd->lex;
769
767
  YYSTYPE *yylval=(YYSTYPE*) arg;
770
 
  CHARSET_INFO *cs= thd->charset();
771
 
  uchar *state_map= cs->state_map;
772
 
  uchar *ident_map= cs->ident_map;
 
768
  const CHARSET_INFO * const cs= thd->charset();
 
769
  unsigned char *state_map= cs->state_map;
 
770
  unsigned char *ident_map= cs->ident_map;
773
771
 
774
772
  lip->yylval=yylval;                   // The global state
775
773
 
831
829
 
832
830
      return((int) c);
833
831
 
834
 
    case MY_LEX_IDENT_OR_NCHAR:
835
 
      if (lip->yyPeek() != '\'')
836
 
      {
837
 
        state= MY_LEX_IDENT;
838
 
        break;
839
 
      }
840
 
      /* Found N'string' */
841
 
      lip->yySkip();                         // Skip '
842
 
      if (!(yylval->lex_str.str = get_text(lip, 2, 1)))
843
 
      {
844
 
        state= MY_LEX_CHAR;             // Read char by char
845
 
        break;
846
 
      }
847
 
      yylval->lex_str.length= lip->yytoklen;
848
 
      lex->text_string_is_7bit= (lip->tok_bitmap & 0x80) ? 0 : 1;
849
 
      return(NCHAR_STRING);
850
 
 
851
832
    case MY_LEX_IDENT_OR_HEX:
852
833
      if (lip->yyPeek() == '\'')
853
834
      {                                 // Found x'hex-number'
930
911
 
931
912
      if (yylval->lex_str.str[0] == '_')
932
913
      {
933
 
        CHARSET_INFO *cs= get_charset_by_csname(yylval->lex_str.str + 1,
934
 
                                                MY_CS_PRIMARY, MYF(0));
 
914
        const CHARSET_INFO * const cs= get_charset_by_csname(yylval->lex_str.str + 1,
 
915
                                                             MY_CS_PRIMARY, MYF(0));
935
916
        if (cs)
936
917
        {
937
918
          yylval->charset= cs;
1055
1036
 
1056
1037
    case MY_LEX_USER_VARIABLE_DELIMITER:        // Found quote char
1057
1038
    {
1058
 
      uint double_quotes= 0;
 
1039
      uint32_t double_quotes= 0;
1059
1040
      char quote_char= c;                       // Used char
1060
1041
      while ((c=lip->yyGet()))
1061
1042
      {
1265
1246
          /* Accept 'M' 'm' 'm' 'd' 'd' */
1266
1247
          lip->yySkipn(5);
1267
1248
 
1268
 
          if (version <= MYSQL_VERSION_ID)
 
1249
          if (version <= DRIZZLE_VERSION_ID)
1269
1250
          {
1270
1251
            /* Expand the content of the special comment as real code */
1271
1252
            lip->set_echo(true);
1494
1475
}
1495
1476
 
1496
1477
 
1497
 
void trim_whitespace(CHARSET_INFO *cs, LEX_STRING *str)
 
1478
void trim_whitespace(const CHARSET_INFO * const cs, LEX_STRING *str)
1498
1479
{
1499
1480
  /*
1500
1481
    TODO:
1586
1567
  select_n_having_items= 0;
1587
1568
  subquery_in_having= explicit_limit= 0;
1588
1569
  is_item_list_lookup= 0;
1589
 
  first_execution= 1;
1590
 
  first_cond_optimization= 1;
1591
1570
  parsing_place= NO_MATTER;
1592
1571
  exclude_from_table_unique_test= false;
1593
1572
  nest_level= 0;
1612
1591
  linkage= UNSPECIFIED_TYPE;
1613
1592
  order_list.elements= 0;
1614
1593
  order_list.first= 0;
1615
 
  order_list.next= (uchar**) &order_list.first;
 
1594
  order_list.next= (unsigned char**) &order_list.first;
1616
1595
  /* Set limit and offset to default values */
1617
1596
  select_limit= 0;      /* denotes the default limit = HA_POS_ERROR */
1618
1597
  offset_limit= 0;      /* denotes the default offset = 0 */
1832
1811
  }
1833
1812
}
1834
1813
 
1835
 
bool st_select_lex_node::set_braces(bool value __attribute__((__unused__)))
 
1814
bool st_select_lex_node::set_braces(bool value __attribute__((unused)))
1836
1815
{ return 1; }
1837
1816
bool st_select_lex_node::inc_in_sum_expr()           { return 1; }
1838
 
uint st_select_lex_node::get_in_sum_expr()           { return 0; }
1839
 
TABLE_LIST* st_select_lex_node::get_table_list()     { return 0; }
 
1817
uint32_t st_select_lex_node::get_in_sum_expr()           { return 0; }
 
1818
TableList* st_select_lex_node::get_table_list()     { return 0; }
1840
1819
List<Item>* st_select_lex_node::get_item_list()      { return 0; }
1841
 
TABLE_LIST *st_select_lex_node::add_table_to_list (THD *thd __attribute__((__unused__)),
1842
 
                                                   Table_ident *table __attribute__((__unused__)),
1843
 
                                                  LEX_STRING *alias __attribute__((__unused__)),
1844
 
                                                  ulong table_join_options __attribute__((__unused__)),
1845
 
                                                  thr_lock_type flags __attribute__((__unused__)),
1846
 
                                                  List<Index_hint> *hints __attribute__((__unused__)),
1847
 
                                                  LEX_STRING *option __attribute__((__unused__)))
 
1820
TableList *st_select_lex_node::add_table_to_list (THD *thd __attribute__((unused)),
 
1821
                                                   Table_ident *table __attribute__((unused)),
 
1822
                                                  LEX_STRING *alias __attribute__((unused)),
 
1823
                                                  uint32_t table_join_options __attribute__((unused)),
 
1824
                                                  thr_lock_type flags __attribute__((unused)),
 
1825
                                                  List<Index_hint> *hints __attribute__((unused)),
 
1826
                                                  LEX_STRING *option __attribute__((unused)))
1848
1827
{
1849
1828
  return 0;
1850
1829
}
1851
 
ulong st_select_lex_node::get_table_join_options()
 
1830
uint32_t st_select_lex_node::get_table_join_options()
1852
1831
{
1853
1832
  return 0;
1854
1833
}
1886
1865
}
1887
1866
 
1888
1867
 
1889
 
bool st_select_lex::add_item_to_list(THD *thd __attribute__((__unused__)),
 
1868
bool st_select_lex::add_item_to_list(THD *thd __attribute__((unused)),
1890
1869
                                     Item *item)
1891
1870
{
1892
1871
  return(item_list.push_back(item));
1925
1904
}
1926
1905
 
1927
1906
 
1928
 
uint st_select_lex::get_in_sum_expr()
 
1907
uint32_t st_select_lex::get_in_sum_expr()
1929
1908
{
1930
1909
  return in_sum_expr;
1931
1910
}
1932
1911
 
1933
1912
 
1934
 
TABLE_LIST* st_select_lex::get_table_list()
 
1913
TableList* st_select_lex::get_table_list()
1935
1914
{
1936
 
  return (TABLE_LIST*) table_list.first;
 
1915
  return (TableList*) table_list.first;
1937
1916
}
1938
1917
 
1939
1918
List<Item>* st_select_lex::get_item_list()
1941
1920
  return &item_list;
1942
1921
}
1943
1922
 
1944
 
ulong st_select_lex::get_table_join_options()
 
1923
uint32_t st_select_lex::get_table_join_options()
1945
1924
{
1946
1925
  return table_join_options;
1947
1926
}
1948
1927
 
1949
1928
 
1950
 
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)
1951
1930
{
1952
1931
  if (ref_pointer_array)
1953
1932
    return 0;
1954
1933
 
1955
 
  /*
1956
 
    We have to create array in prepared statement memory if it is
1957
 
    prepared statement
1958
 
  */
1959
 
  Query_arena *arena= thd->stmt_arena;
1960
1934
  return (ref_pointer_array=
1961
 
          (Item **)arena->alloc(sizeof(Item*) * (n_child_sum_items +
 
1935
          (Item **)thd->alloc(sizeof(Item*) * (n_child_sum_items +
1962
1936
                                                 item_list.elements +
1963
1937
                                                 select_n_having_items +
1964
1938
                                                 select_n_where_fields +
1992
1966
      str->append(STRING_WITH_LEN(" order by "));
1993
1967
      fake_select_lex->print_order(
1994
1968
        str,
1995
 
        (ORDER *) fake_select_lex->order_list.first,
 
1969
        (order_st *) fake_select_lex->order_list.first,
1996
1970
        query_type);
1997
1971
    }
1998
1972
    fake_select_lex->print_limit(thd, str, query_type);
2001
1975
 
2002
1976
 
2003
1977
void st_select_lex::print_order(String *str,
2004
 
                                ORDER *order,
 
1978
                                order_st *order,
2005
1979
                                enum_query_type query_type)
2006
1980
{
2007
1981
  for (; order; order= order->next)
2009
1983
    if (order->counter_used)
2010
1984
    {
2011
1985
      char buffer[20];
2012
 
      uint length= snprintf(buffer, 20, "%d", order->counter);
 
1986
      uint32_t length= snprintf(buffer, 20, "%d", order->counter);
2013
1987
      str->append(buffer, length);
2014
1988
    }
2015
1989
    else
2022
1996
}
2023
1997
 
2024
1998
 
2025
 
void st_select_lex::print_limit(THD *thd __attribute__((__unused__)),
 
1999
void st_select_lex::print_limit(THD *thd __attribute__((unused)),
2026
2000
                                String *str,
2027
2001
                                enum_query_type query_type)
2028
2002
{
2045
2019
                    ((Item_in_subselect*)item)->exec_method ==
2046
2020
                    Item_in_subselect::MATERIALIZATION) ?
2047
2021
                   true :
2048
 
                   (select_limit->val_int() == 1LL) &&
 
2022
                   (select_limit->val_int() == 1L) &&
2049
2023
                   offset_limit == 0));
2050
2024
      return;
2051
2025
    }
2074
2048
  to implement the clean up.
2075
2049
*/
2076
2050
 
2077
 
void st_lex::cleanup_lex_after_parse_error(THD *thd __attribute__((__unused__)))
 
2051
void st_lex::cleanup_lex_after_parse_error(THD *thd __attribute__((unused)))
2078
2052
{
2079
2053
}
2080
2054
 
2100
2074
{
2101
2075
  if (!init && query_tables)
2102
2076
  {
2103
 
    TABLE_LIST *table= query_tables;
 
2077
    TableList *table= query_tables;
2104
2078
    for (;;)
2105
2079
    {
2106
2080
      if (query_tables_last == &table->next_global ||
2338
2312
  }
2339
2313
}
2340
2314
 
2341
 
/*
2342
 
  Get effective type of CHECK OPTION for given view
2343
 
 
2344
 
  SYNOPSIS
2345
 
    get_effective_with_check()
2346
 
    view    given view
2347
 
 
2348
 
  NOTE
2349
 
    It have not sense to set CHECK OPTION for SELECT satement or subqueries,
2350
 
    so we do not.
2351
 
 
2352
 
  RETURN
2353
 
    VIEW_CHECK_NONE      no need CHECK OPTION
2354
 
    VIEW_CHECK_LOCAL     CHECK OPTION LOCAL
2355
 
    VIEW_CHECK_CASCADED  CHECK OPTION CASCADED
2356
 
*/
2357
 
 
2358
 
uint8 st_lex::get_effective_with_check(TABLE_LIST *view __attribute__((__unused__)))
2359
 
{
2360
 
  return 0;
2361
 
}
2362
 
 
2363
2315
 
2364
2316
/**
2365
2317
  This method should be called only during parsing.
2410
2362
    select_limit_val= HA_POS_ERROR;
2411
2363
#endif
2412
2364
  offset_limit_cnt= (ha_rows)(sl->offset_limit ? sl->offset_limit->val_uint() :
2413
 
                                                 0ULL);
 
2365
                                                 0UL);
2414
2366
  select_limit_cnt= select_limit_val + offset_limit_cnt;
2415
2367
  if (select_limit_cnt < select_limit_val)
2416
2368
    select_limit_cnt= HA_POS_ERROR;             // no limit
2435
2387
      In this case link_to_local is set.
2436
2388
 
2437
2389
*/
2438
 
TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
 
2390
TableList *st_lex::unlink_first_table(bool *link_to_local)
2439
2391
{
2440
 
  TABLE_LIST *first;
 
2392
  TableList *first;
2441
2393
  if ((first= query_tables))
2442
2394
  {
2443
2395
    /*
2456
2408
    {
2457
2409
      select_lex.context.table_list= 
2458
2410
        select_lex.context.first_name_resolution_table= first->next_local;
2459
 
      select_lex.table_list.first= (uchar*) (first->next_local);
 
2411
      select_lex.table_list.first= (unsigned char*) (first->next_local);
2460
2412
      select_lex.table_list.elements--; //safety
2461
2413
      first->next_local= 0;
2462
2414
      /*
2488
2440
 
2489
2441
void st_lex::first_lists_tables_same()
2490
2442
{
2491
 
  TABLE_LIST *first_table= (TABLE_LIST*) select_lex.table_list.first;
 
2443
  TableList *first_table= (TableList*) select_lex.table_list.first;
2492
2444
  if (query_tables != first_table && first_table != 0)
2493
2445
  {
2494
 
    TABLE_LIST *next;
 
2446
    TableList *next;
2495
2447
    if (query_tables_last == &first_table->next_global)
2496
2448
      query_tables_last= first_table->prev_global;
2497
2449
 
2522
2474
    global list
2523
2475
*/
2524
2476
 
2525
 
void st_lex::link_first_table_back(TABLE_LIST *first,
 
2477
void st_lex::link_first_table_back(TableList *first,
2526
2478
                                   bool link_to_local)
2527
2479
{
2528
2480
  if (first)
2535
2487
 
2536
2488
    if (link_to_local)
2537
2489
    {
2538
 
      first->next_local= (TABLE_LIST*) select_lex.table_list.first;
 
2490
      first->next_local= (TableList*) select_lex.table_list.first;
2539
2491
      select_lex.context.table_list= first;
2540
 
      select_lex.table_list.first= (uchar*) first;
 
2492
      select_lex.table_list.first= (unsigned char*) first;
2541
2493
      select_lex.table_list.elements++; //safety
2542
2494
    }
2543
2495
  }
2592
2544
      backup  Pointer to Query_tables_list instance to be used for backup
2593
2545
*/
2594
2546
 
2595
 
void st_lex::reset_n_backup_query_tables_list(Query_tables_list *backup __attribute__((__unused__)))
 
2547
void st_lex::reset_n_backup_query_tables_list(Query_tables_list *backup __attribute__((unused)))
2596
2548
{
2597
2549
}
2598
2550
 
2605
2557
      backup  Pointer to Query_tables_list instance used for backup
2606
2558
*/
2607
2559
 
2608
 
void st_lex::restore_backup_query_tables_list(Query_tables_list *backup __attribute__((__unused__)))
 
2560
void st_lex::restore_backup_query_tables_list(Query_tables_list *backup __attribute__((unused)))
2609
2561
{
2610
2562
}
2611
2563
 
2645
2597
 
2646
2598
*/
2647
2599
 
2648
 
static void fix_prepare_info_in_table_list(THD *thd, TABLE_LIST *tbl)
 
2600
static void fix_prepare_info_in_table_list(THD *thd, TableList *tbl)
2649
2601
{
2650
2602
  for (; tbl; tbl= tbl->next_local)
2651
2603
  {
2722
2674
  RETURN VALUE
2723
2675
    0 on success, non-zero otherwise
2724
2676
*/
2725
 
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)
2726
2678
{
2727
2679
  return index_hints->push_front (new (thd->mem_root) 
2728
2680
                                 Index_hint(current_index_hint_type,