~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Brian Aker
  • Date: 2011-02-21 18:33:47 UTC
  • mto: (2187.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2188.
  • Revision ID: brian@tangent.org-20110221183347-37lw0bf0eizv0gxm
getLex() usage and fix for table_name creation during admin commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
      return false;
164
164
  }
165
165
 
166
 
  Item_field *my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "SCHEMA_NAME");
 
166
  Item_field *my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "SCHEMA_NAME");
167
167
  my_field->is_autogenerated_name= false;
168
168
  my_field->set_name(column_name.c_str(), column_name.length(), system_charset_info);
169
169
 
219
219
  if (prepare_new_schema_table(session, session->getLex(), "SHOW_TABLES"))
220
220
    return false;
221
221
 
222
 
  Item_field *my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "TABLE_NAME");
 
222
  Item_field *my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "TABLE_NAME");
223
223
  my_field->is_autogenerated_name= false;
224
224
  my_field->set_name(column_name.c_str(), column_name.length(), system_charset_info);
225
225
 
242
242
  if (prepare_new_schema_table(session, session->getLex(), "SHOW_TEMPORARY_TABLES"))
243
243
    return false;
244
244
 
245
 
  if (session->add_item_to_list( new Item_field(&session->lex->current_select->context, NULL, NULL, "*")))
 
245
  if (session->add_item_to_list( new Item_field(&session->getLex()->current_select->context, NULL, NULL, "*")))
246
246
    return false;
247
247
 
248
 
  (session->lex->current_select->with_wild)++;
 
248
  (session->getLex()->current_select->with_wild)++;
249
249
 
250
250
  return true;
251
251
}
284
284
  if (prepare_new_schema_table(session, session->getLex(), "SHOW_TABLE_STATUS"))
285
285
    return false;
286
286
 
287
 
  if (session->add_item_to_list( new Item_field(&session->lex->current_select->
 
287
  if (session->add_item_to_list( new Item_field(&session->getLex()->current_select->
288
288
                                                  context,
289
289
                                                  NULL, NULL, "*")))
290
290
    return false;
291
291
 
292
 
  (session->lex->current_select->with_wild)++;
 
292
  (session->getLex()->current_select->with_wild)++;
293
293
 
294
294
  return true;
295
295
}
341
341
  if (prepare_new_schema_table(session, session->getLex(), "SHOW_COLUMNS"))
342
342
    return false;
343
343
 
344
 
  if (session->add_item_to_list( new Item_field(&session->lex->current_select->context, NULL, NULL, "*")))
 
344
  if (session->add_item_to_list( new Item_field(&session->getLex()->current_select->context, NULL, NULL, "*")))
345
345
    return false;
346
346
 
347
 
  (session->lex->current_select->with_wild)++;
 
347
  (session->getLex()->current_select->with_wild)++;
348
348
 
349
349
  return true;
350
350
}
407
407
  if (prepare_new_schema_table(session, session->getLex(), "SHOW_INDEXES"))
408
408
    return false;
409
409
 
410
 
  if (session->add_item_to_list( new Item_field(&session->lex->current_select->context, NULL, NULL, "*")))
 
410
  if (session->add_item_to_list( new Item_field(&session->getLex()->current_select->context, NULL, NULL, "*")))
411
411
    return false;
412
412
 
413
 
  (session->lex->current_select->with_wild)++;
 
413
  (session->getLex()->current_select->with_wild)++;
414
414
 
415
415
  return true;
416
416
}
434
434
  std::string key("Variable_name");
435
435
  std::string value("Value");
436
436
 
437
 
  Item_field *my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "VARIABLE_NAME");
 
437
  Item_field *my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "VARIABLE_NAME");
438
438
  my_field->is_autogenerated_name= false;
439
439
  my_field->set_name(key.c_str(), key.length(), system_charset_info);
440
440
 
441
441
  if (session->add_item_to_list(my_field))
442
442
    return false;
443
443
 
444
 
  my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "VARIABLE_VALUE");
 
444
  my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "VARIABLE_VALUE");
445
445
  my_field->is_autogenerated_name= false;
446
446
  my_field->set_name(value.c_str(), value.length(), system_charset_info);
447
447
 
481
481
  std::string key("Table");
482
482
  std::string value("Create Table");
483
483
 
484
 
  Item_field *my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "TABLE_NAME");
 
484
  Item_field *my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "TABLE_NAME");
485
485
  my_field->is_autogenerated_name= false;
486
486
  my_field->set_name(key.c_str(), key.length(), system_charset_info);
487
487
 
488
488
  if (session->add_item_to_list(my_field))
489
489
    return false;
490
490
 
491
 
  my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "TABLE_SQL_DEFINITION");
 
491
  my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "TABLE_SQL_DEFINITION");
492
492
  my_field->is_autogenerated_name= false;
493
493
  my_field->set_name(value.c_str(), value.length(), system_charset_info);
494
494
 
506
506
  if (prepare_new_schema_table(session, session->getLex(), "PROCESSLIST"))
507
507
    return false;
508
508
 
509
 
  if (session->add_item_to_list( new Item_field(&session->lex->current_select->context, NULL, NULL, "*")))
 
509
  if (session->add_item_to_list( new Item_field(&session->getLex()->current_select->context, NULL, NULL, "*")))
510
510
    return false;
511
511
 
512
 
  (session->lex->current_select->with_wild)++;
 
512
  (session->getLex()->current_select->with_wild)++;
513
513
 
514
514
  return true;
515
515
}
533
533
  std::string key("Variable_name");
534
534
  std::string value("Value");
535
535
 
536
 
  Item_field *my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "VARIABLE_NAME");
 
536
  Item_field *my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "VARIABLE_NAME");
537
537
  my_field->is_autogenerated_name= false;
538
538
  my_field->set_name(key.c_str(), key.length(), system_charset_info);
539
539
 
540
540
  if (session->add_item_to_list(my_field))
541
541
    return false;
542
542
 
543
 
  my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "VARIABLE_VALUE");
 
543
  my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "VARIABLE_VALUE");
544
544
  my_field->is_autogenerated_name= false;
545
545
  my_field->set_name(value.c_str(), value.length(), system_charset_info);
546
546
 
577
577
  std::string key("Database");
578
578
  std::string value("Create Database");
579
579
 
580
 
  Item_field *my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "SCHEMA_NAME");
 
580
  Item_field *my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "SCHEMA_NAME");
581
581
  my_field->is_autogenerated_name= false;
582
582
  my_field->set_name(key.c_str(), key.length(), system_charset_info);
583
583
 
584
584
  if (session->add_item_to_list(my_field))
585
585
    return false;
586
586
 
587
 
  my_field= new Item_field(&session->lex->current_select->context, NULL, NULL, "SCHEMA_SQL_DEFINITION");
 
587
  my_field= new Item_field(&session->getLex()->current_select->context, NULL, NULL, "SCHEMA_SQL_DEFINITION");
588
588
  my_field->is_autogenerated_name= false;
589
589
  my_field->set_name(value.c_str(), value.length(), system_charset_info);
590
590
 
632
632
    return false;
633
633
  }
634
634
 
635
 
  if (session->add_item_to_list( new Item_field(&session->lex->current_select->
 
635
  if (session->add_item_to_list( new Item_field(&session->getLex()->current_select->
636
636
                                                  context,
637
637
                                                  NULL, NULL, "*")))
638
638
  {
639
639
    return false;
640
640
  }
641
641
 
642
 
  (session->lex->current_select->with_wild)++;
 
642
  (session->getLex()->current_select->with_wild)++;
643
643
 
644
644
  return true;
645
645
}