~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Stewart Smith
  • Date: 2011-03-03 08:29:06 UTC
  • mto: (2216.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2217.
  • Revision ID: stewart@flamingspork.com-20110303082906-5zhmxub1j7au038u
remove enum_query_type which was effectively unused. It was set to one value once, compared to it once (i.e. always true) and passed around everywhere doing nothing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6252
6252
static void print_table_array(Session *session, String *str, TableList **table,
6253
6253
                              TableList **end)
6254
6254
{
6255
 
  (*table)->print(session, str, QT_ORDINARY);
 
6255
  (*table)->print(session, str);
6256
6256
 
6257
6257
  for (TableList **tbl= table + 1; tbl < end; tbl++)
6258
6258
  {
6266
6266
      str->append(STRING_WITH_LEN(" straight_join "));
6267
6267
    else
6268
6268
      str->append(STRING_WITH_LEN(" join "));
6269
 
    curr->print(session, str, QT_ORDINARY);
 
6269
    curr->print(session, str);
6270
6270
    if (curr->on_expr)
6271
6271
    {
6272
6272
      str->append(STRING_WITH_LEN(" on("));
6273
 
      curr->on_expr->print(str, QT_ORDINARY);
 
6273
      curr->on_expr->print(str);
6274
6274
      str->append(')');
6275
6275
    }
6276
6276
  }
6281
6281
  @param session     thread Cursor
6282
6282
  @param str     string where table should be printed
6283
6283
  @param tables  list of tables in join
6284
 
  @query_type    type of the query is being generated
6285
6284
*/
6286
6285
void print_join(Session *session, String *str,
6287
 
                List<TableList> *tables, enum_query_type)
 
6286
                List<TableList> *tables)
6288
6287
{
6289
6288
  /* List is reversed => we should reverse it before using */
6290
6289
  List<TableList>::iterator ti(tables->begin());
6299
6298
  print_table_array(session, str, table, table + tables->size());
6300
6299
}
6301
6300
 
6302
 
void Select_Lex::print(Session *session, String *str, enum_query_type query_type)
 
6301
void Select_Lex::print(Session *session, String *str)
6303
6302
{
6304
6303
  /* QQ: session may not be set for sub queries, but this should be fixed */
6305
6304
  if(not session)
6332
6331
      first= 0;
6333
6332
    else
6334
6333
      str->append(',');
6335
 
    item->print_item_w_name(str, query_type);
 
6334
    item->print_item_w_name(str);
6336
6335
  }
6337
6336
 
6338
6337
  /*
6343
6342
  {
6344
6343
    str->append(STRING_WITH_LEN(" from "));
6345
6344
    /* go through join tree */
6346
 
    print_join(session, str, &top_join_list, query_type);
 
6345
    print_join(session, str, &top_join_list);
6347
6346
  }
6348
6347
  else if (where)
6349
6348
  {
6362
6361
  {
6363
6362
    str->append(STRING_WITH_LEN(" where "));
6364
6363
    if (cur_where)
6365
 
      cur_where->print(str, query_type);
 
6364
      cur_where->print(str);
6366
6365
    else
6367
6366
      str->append(cond_value != Item::COND_FALSE ? "1" : "0");
6368
6367
  }
6371
6370
  if (group_list.size())
6372
6371
  {
6373
6372
    str->append(STRING_WITH_LEN(" group by "));
6374
 
    print_order(str, (Order *) group_list.first, query_type);
 
6373
    print_order(str, (Order *) group_list.first);
6375
6374
    switch (olap)
6376
6375
    {
6377
6376
      case CUBE_TYPE:
6394
6393
  {
6395
6394
    str->append(STRING_WITH_LEN(" having "));
6396
6395
    if (cur_having)
6397
 
      cur_having->print(str, query_type);
 
6396
      cur_having->print(str);
6398
6397
    else
6399
6398
      str->append(having_value != Item::COND_FALSE ? "1" : "0");
6400
6399
  }
6402
6401
  if (order_list.size())
6403
6402
  {
6404
6403
    str->append(STRING_WITH_LEN(" order by "));
6405
 
    print_order(str, (Order *) order_list.first, query_type);
 
6404
    print_order(str, (Order *) order_list.first);
6406
6405
  }
6407
6406
 
6408
6407
  // limit
6409
 
  print_limit(session, str, query_type);
 
6408
  print_limit(session, str);
6410
6409
 
6411
6410
  // PROCEDURE unsupported here
6412
6411
}