~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to sql/sql_lex.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
 
1
/*
 
2
   Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
2
3
 
3
4
   This program is free software; you can redistribute it and/or modify
4
5
   it under the terms of the GNU General Public License as published by
11
12
 
12
13
   You should have received a copy of the GNU General Public License
13
14
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
16
*/
15
17
 
16
18
 
17
19
/* A lexical scanner on a temporary buffer with a yacc interface */
111
113
}
112
114
 
113
115
 
114
 
bool Lex_input_stream::init(THD *thd, const char *buff, unsigned int length)
 
116
bool Lex_input_stream::init(THD *thd, char *buff, unsigned int length)
115
117
{
116
118
  DBUG_EXECUTE_IF("bug42064_simulate_oom",
117
119
                  DBUG_SET("+d,simulate_out_of_memory"););
305
307
  lex->select_lex.group_list.empty();
306
308
  lex->describe= 0;
307
309
  lex->subqueries= FALSE;
308
 
  lex->view_prepare_mode= FALSE;
 
310
  lex->context_analysis_only= 0;
309
311
  lex->derived_tables= 0;
310
312
  lex->lock_option= TL_READ;
311
313
  lex->safe_to_cache_query= 1;
358
360
  lex->server_options.port= -1;
359
361
 
360
362
  lex->is_lex_started= TRUE;
 
363
  lex->used_tables= 0;
361
364
  DBUG_VOID_RETURN;
362
365
}
363
366
 
1292
1295
          ulong version;
1293
1296
          version=strtol(version_str, NULL, 10);
1294
1297
 
1295
 
          /* Accept 'M' 'm' 'm' 'd' 'd' */
1296
 
          lip->yySkipn(5);
1297
 
 
1298
1298
          if (version <= MYSQL_VERSION_ID)
1299
1299
          {
 
1300
            /* Accept 'M' 'm' 'm' 'd' 'd' */
 
1301
            lip->yySkipn(5);
1300
1302
            /* Expand the content of the special comment as real code */
1301
1303
            lip->set_echo(TRUE);
1302
1304
            state=MY_LEX_START;
1304
1306
          }
1305
1307
          else
1306
1308
          {
 
1309
            /*
 
1310
              Patch and skip the conditional comment to avoid it
 
1311
              being propagated infinitely (eg. to a slave).
 
1312
            */
 
1313
            char *pcom= lip->yyUnput(' ');
1307
1314
            comment_closed= ! consume_comment(lip, 1);
 
1315
            if (! comment_closed)
 
1316
            {
 
1317
              *pcom= '!';
 
1318
            }
1308
1319
            /* version allowed to have one level of comment inside. */
1309
1320
          }
1310
1321
        }
1613
1624
  nest_level= 0;
1614
1625
  link_next= 0;
1615
1626
  lock_option= TL_READ_DEFAULT;
 
1627
  m_non_agg_field_used= false;
 
1628
  m_agg_func_used= false;
1616
1629
}
1617
1630
 
1618
1631
void st_select_lex::init_select()
1643
1656
  non_agg_fields.empty();
1644
1657
  cond_value= having_value= Item::COND_UNDEF;
1645
1658
  inner_refs_list.empty();
1646
 
  full_group_by_flag= 0;
 
1659
  m_non_agg_field_used= false;
 
1660
  m_agg_func_used= false;
1647
1661
}
1648
1662
 
1649
1663
/*
1974
1988
  if (ref_pointer_array)
1975
1989
    return 0;
1976
1990
 
 
1991
  // find_order_in_list() may need some extra space, so multiply by two.
 
1992
  order_group_num*= 2;
 
1993
 
1977
1994
  /*
1978
1995
    We have to create array in prepared statement memory if it is
1979
1996
    prepared statement