~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_show.cc

  • Committer: Monty Taylor
  • Date: 2008-10-04 18:42:30 UTC
  • Revision ID: monty@inaugust.com-20081004184230-j2j1uottu2d0yl0m
Removed NullS. bu-bye.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1144
1144
        thd_info->state_info= (char*) (tmp->net.reading_or_writing ?
1145
1145
                                       (tmp->net.reading_or_writing == 2 ?
1146
1146
                                        "Writing to net" :
1147
 
                                        thd_info->command == COM_SLEEP ? NullS :
 
1147
                                        thd_info->command == COM_SLEEP ? NULL :
1148
1148
                                        "Reading from net") :
1149
1149
                                       tmp->get_proc_info() ? tmp->get_proc_info() :
1150
1150
                                       tmp->mysys_var &&
1151
1151
                                       tmp->mysys_var->current_cond ?
1152
 
                                       "Waiting on cond" : NullS);
 
1152
                                       "Waiting on cond" : NULL);
1153
1153
        if (mysys_var)
1154
1154
          pthread_mutex_unlock(&mysys_var->mutex);
1155
1155
 
1205
1205
  char *user;
1206
1206
  time_t now= my_time(0);
1207
1207
 
1208
 
  user= NullS;
 
1208
  user= NULL;
1209
1209
 
1210
1210
  pthread_mutex_lock(&LOCK_thread_count);
1211
1211
 
1254
1254
      val= (char*) (tmp->net.reading_or_writing ?
1255
1255
                    (tmp->net.reading_or_writing == 2 ?
1256
1256
                     "Writing to net" :
1257
 
                     tmp->command == COM_SLEEP ? NullS :
 
1257
                     tmp->command == COM_SLEEP ? NULL :
1258
1258
                     "Reading from net") :
1259
1259
                    tmp->get_proc_info() ? tmp->get_proc_info() :
1260
1260
                    tmp->mysys_var &&
1261
1261
                    tmp->mysys_var->current_cond ?
1262
 
                    "Waiting on cond" : NullS);
 
1262
                    "Waiting on cond" : NULL);
1263
1263
      if (val)
1264
1264
      {
1265
1265
        table->field[6]->store(val, strlen(val), cs);
1950
1950
                             LOOKUP_FIELD_VALUES *lookup_field_values)
1951
1951
{
1952
1952
  LEX *lex= thd->lex;
1953
 
  const char *wild= lex->wild ? lex->wild->ptr() : NullS;
 
1953
  const char *wild= lex->wild ? lex->wild->ptr() : NULL;
1954
1954
  memset(lookup_field_values, 0, sizeof(LOOKUP_FIELD_VALUES));
1955
1955
  switch (lex->sql_command) {
1956
1956
  case SQLCOM_SHOW_DATABASES:
2031
2031
      if (files->push_back(i_s_name_copy))
2032
2032
        return 1;
2033
2033
    }
2034
 
    return (find_files(thd, files, NullS, mysql_data_home,
 
2034
    return (find_files(thd, files, NULL, mysql_data_home,
2035
2035
                       lookup_field_vals->db_value.str, 1) != FIND_FILES_OK);
2036
2036
  }
2037
2037
 
2062
2062
  if (files->push_back(i_s_name_copy))
2063
2063
    return 1;
2064
2064
  *with_i_schema= 1;
2065
 
  return (find_files(thd, files, NullS,
2066
 
                     mysql_data_home, NullS, 1) != FIND_FILES_OK);
 
2065
  return (find_files(thd, files, NULL,
 
2066
                     mysql_data_home, NULL, 1) != FIND_FILES_OK);
2067
2067
}
2068
2068
 
2069
2069
 
2848
2848
      ptr=my_stpcpy(ptr," checksum=1");
2849
2849
    if (share->page_checksum != HA_CHOICE_UNDEF)
2850
2850
      ptr= strxmov(ptr, " page_checksum=",
2851
 
                   ha_choice_values[(uint) share->page_checksum], NullS);
 
2851
                   ha_choice_values[(uint) share->page_checksum], NULL);
2852
2852
    if (share->db_create_options & HA_OPTION_DELAY_KEY_WRITE)
2853
2853
      ptr=my_stpcpy(ptr," delay_key_write=1");
2854
2854
    if (share->row_type != ROW_TYPE_DEFAULT)
2855
2855
      ptr=strxmov(ptr, " row_format=", 
2856
2856
                  ha_row_type[(uint) share->row_type],
2857
 
                  NullS);
 
2857
                  NULL);
2858
2858
    if (share->block_size)
2859
2859
    {
2860
2860
      ptr= my_stpcpy(ptr, " block_size=");
2865
2865
    {
2866
2866
      ptr= strxmov(ptr, " TRANSACTIONAL=",
2867
2867
                   (share->transactional == HA_CHOICE_YES ? "1" : "0"),
2868
 
                   NullS);
 
2868
                   NULL);
2869
2869
    }
2870
2870
    if (share->transactional != HA_CHOICE_UNDEF)
2871
2871
      ptr= strxmov(ptr, " transactional=",
2872
 
                   ha_choice_values[(uint) share->transactional], NullS);
 
2872
                   ha_choice_values[(uint) share->transactional], NULL);
2873
2873
    table->field[19]->store(option_buff+1,
2874
2874
                            (ptr == option_buff ? 0 : 
2875
2875
                             (uint) (ptr-option_buff)-1), cs);
3071
3071
                                    LEX_STRING *table_name)
3072
3072
{
3073
3073
  LEX *lex= thd->lex;
3074
 
  const char *wild= lex->wild ? lex->wild->ptr() : NullS;
 
3074
  const char *wild= lex->wild ? lex->wild->ptr() : NULL;
3075
3075
  const CHARSET_INFO * const cs= system_charset_info;
3076
3076
  Table *show_table;
3077
3077
  TABLE_SHARE *show_table_share;
3201
3201
int fill_schema_charsets(THD *thd, TableList *tables, COND *cond __attribute__((unused)))
3202
3202
{
3203
3203
  CHARSET_INFO **cs;
3204
 
  const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
 
3204
  const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NULL;
3205
3205
  Table *table= tables->table;
3206
3206
  const CHARSET_INFO * const scs= system_charset_info;
3207
3207
 
3232
3232
int fill_schema_collation(THD *thd, TableList *tables, COND *cond __attribute__((unused)))
3233
3233
{
3234
3234
  CHARSET_INFO **cs;
3235
 
  const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
 
3235
  const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NULL;
3236
3236
  Table *table= tables->table;
3237
3237
  const CHARSET_INFO * const scs= system_charset_info;
3238
3238
  for (cs= all_charsets ; cs < all_charsets+255 ; cs++ )
3577
3577
 
3578
3578
int fill_open_tables(THD *thd, TableList *tables, COND *cond __attribute__((unused)))
3579
3579
{
3580
 
  const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
 
3580
  const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NULL;
3581
3581
  Table *table= tables->table;
3582
3582
  const CHARSET_INFO * const cs= system_charset_info;
3583
3583
  OPEN_TableList *open_list;
3603
3603
{
3604
3604
  int res= 0;
3605
3605
  LEX *lex= thd->lex;
3606
 
  const char *wild= lex->wild ? lex->wild->ptr() : NullS;
 
3606
  const char *wild= lex->wild ? lex->wild->ptr() : NULL;
3607
3607
  enum enum_schema_tables schema_table_idx=
3608
3608
    get_schema_table_idx(tables->schema_table);
3609
3609
  enum enum_var_type option_type= OPT_SESSION;
3625
3625
int fill_status(THD *thd, TableList *tables, COND *cond __attribute__((unused)))
3626
3626
{
3627
3627
  LEX *lex= thd->lex;
3628
 
  const char *wild= lex->wild ? lex->wild->ptr() : NullS;
 
3628
  const char *wild= lex->wild ? lex->wild->ptr() : NULL;
3629
3629
  int res= 0;
3630
3630
  STATUS_VAR *tmp1, tmp;
3631
3631
  enum enum_schema_tables schema_table_idx=
3958
3958
    if (field_info->old_name)
3959
3959
    {
3960
3960
      Item_field *field= new Item_field(context,
3961
 
                                        NullS, NullS, field_info->field_name);
 
3961
                                        NULL, NULL, field_info->field_name);
3962
3962
      if (field)
3963
3963
      {
3964
3964
        field->set_name(field_info->old_name,
3985
3985
    ST_FIELD_INFO *field_info= &schema_table->fields_info[1];
3986
3986
    String buffer(tmp,sizeof(tmp), system_charset_info);
3987
3987
    Item_field *field= new Item_field(context,
3988
 
                                      NullS, NullS, field_info->field_name);
 
3988
                                      NULL, NULL, field_info->field_name);
3989
3989
    if (!field || add_item_to_list(thd, field))
3990
3990
      return 1;
3991
3991
    buffer.length(0);
4020
4020
    buffer.append(')');
4021
4021
  }
4022
4022
  Item_field *field= new Item_field(context,
4023
 
                                    NullS, NullS, field_info->field_name);
 
4023
                                    NULL, NULL, field_info->field_name);
4024
4024
  if (add_item_to_list(thd, field))
4025
4025
    return 1;
4026
4026
  field->set_name(buffer.ptr(), buffer.length(), system_charset_info);
4028
4028
  {
4029
4029
    field->set_name(buffer.ptr(), buffer.length(), system_charset_info);
4030
4030
    field_info= &schema_table->fields_info[3];
4031
 
    field= new Item_field(context, NullS, NullS, field_info->field_name);
 
4031
    field= new Item_field(context, NULL, NULL, field_info->field_name);
4032
4032
    if (add_item_to_list(thd, field))
4033
4033
      return 1;
4034
4034
    field->set_name(field_info->old_name, strlen(field_info->old_name),
4053
4053
                               *field_num == 18))
4054
4054
      continue;
4055
4055
    Item_field *field= new Item_field(context,
4056
 
                                      NullS, NullS, field_info->field_name);
 
4056
                                      NULL, NULL, field_info->field_name);
4057
4057
    if (field)
4058
4058
    {
4059
4059
      field->set_name(field_info->old_name,
4078
4078
  {
4079
4079
    field_info= &schema_table->fields_info[*field_num];
4080
4080
    Item_field *field= new Item_field(context,
4081
 
                                      NullS, NullS, field_info->field_name);
 
4081
                                      NULL, NULL, field_info->field_name);
4082
4082
    if (field)
4083
4083
    {
4084
4084
      field->set_name(field_info->old_name,